1 #include <asm/amcc440.h>
2 #include "kernel_intern.h"
5 extern char * __text_start
;
6 extern char * __text_end
;
8 void __attribute__((noreturn
)) syscall_handler(regs_t
*ctx
, uint8_t exception
, void *self
)
10 struct KernelBase
*KernelBase
= getKernelBase();
12 // D(bug("[KRN] SysCall handler. context @ %p SC=%d\n", ctx, ctx->gpr[3]));
14 if ((char*)ctx
->srr0
< &__text_start
|| (char*)ctx
->srr0
>= &__text_end
)
16 D(bug("[KRN] ERROR ERROR! SysCall issued directly outside kernel.resource!!!!!\n"));
17 core_LeaveInterrupt(ctx
);
35 if (ctx
->srr1
& MSR_PR
)
43 struct ExecBase
*SysBase
= getSysBase();
63 char *start
= (char*)((IPTR
)ctx
->gpr
[4] & 0xffffffe0);
64 char *end
= (char*)(((IPTR
)ctx
->gpr
[4] + ctx
->gpr
[5] + 31) & 0xffffffe0);
67 for (ptr
= start
; ptr
< end
; ptr
+=32)
69 asm volatile("dcbi 0,%0"::"r"(ptr
));
75 core_LeaveInterrupt(ctx
);