Der Code macht übrigens das hier:
#include <mint/osbind.h>
#include <setjmp.h>
jmp_buf env;
void access_fault_exception(void) __attribute__((interrupt));
void access_fault_exception(void)
{
Cconws("access fault\r\n");
longjmp(env, 0);
}
void illegal_exception(void) __attribute__((interrupt));
void illegal_exception(void)
{
Cconws("illegal instruction\r\n");
longjmp(env, 0);
}
void linef_exception(void) __attribute__((interrupt));
void linef_exception(void)
{
Cconws("linef exception\r\n");
longjmp(env, 0);
}
void coprocessor_protocol_exception(void) __attribute__((interrupt));
void coprocessor_protocol_exception(void)
{
Cconws("coprocessor protocol violation\r\n");
longjmp(env, 0);
}
void check_pmmu(void)
{
void *old_access, *old_illegal, *old_linef, *old_coproc;
old_access = Setexc(2, access_fault_exception);
old_illegal = Setexc(4, illegal_exception);
old_linef = Setexc(11, linef_exception);
old_coproc = Setexc(13, coprocessor_protocol_exception);
if (!setjmp(env))
{
__asm__ volatile(
" moveq #0,d0 \n\t"
" .long 0xf0390800 \n\t" // pmove 0,tt0
" .long 0x00000000 \n\t"
:
:
: "d0"
);
Cconws("no error\r\n");
}
Setexc(2, old_access);
Setexc(4, old_illegal);
Setexc(11, old_linef);
Setexc(13, old_coproc);
}
int main(int argc, char *argv[])
{
while (Cconis()) Cconin();
Supexec(check_pmmu);
Cconws("\r\nPress key.\r\n");
while (!Cconis());
}