2 * CPU-specific definitions.
4 * Architectures with the same CPU will likely share single kernel_cpu.h
5 * in arch/$(CPU)-all/kernel/kernel_cpu.h
7 * As you can see, this file is just a sample.
13 #include <aros/m68k/cpucontext.h>
14 #include <aros/m68k/fpucontext.h>
16 /* Number of exceptions supported by the CPU. Needed by kernel_base.h */
17 #define EXCEPTIONS_COUNT 256
19 /* CPU context stored in task's et_RegFrame. */
22 struct ExceptionContext cpu
;
23 struct FpuContext fpu
;
26 typedef struct ExceptionContext regs_t
;
29 * Only Exec/PrepareContext needs this.
31 #define PREPARE_INITIAL_FRAME(cc, sp, startpc) \
33 memset(cc, 0, sizeof(*cc)); \
34 cc->cpu.pc = (IPTR)startpc; \
35 cc->cpu.a[7] = (IPTR)sp; \
36 cc->cpu.sr = 0x0000; \
40 * Only used by Exec/Debug()
42 #define PRINT_CPU_CONTEXT(ctx) \
45 UWORD sr = (ctx)->cpu.sr; \
46 for (i = 0; i < 8; i++) { \
47 bug("D%d: %08x%s", i, (ctx)->cpu.d[i], ((i%4) == 3) ? "\n" : " "); \
49 for (i = 0; i < 8; i++) { \
50 bug("A%d: %08x%s", i, (ctx)->cpu.a[i], ((i%4) == 3) ? "\n" : " "); \
52 bug("SR: T=%02d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d\n", \
53 (sr >> 14) & 3, (sr >> 13) & 1, (sr >> 5) & 1, \
54 (sr >> 4) & 1, (sr >> 3) & 1, (sr >> 2) & 1, \
55 (sr >> 1) & 1, (sr >> 0) & 1, (sr >> 8) & 7); \
56 bug("PC: %08x\n", (ctx)->cpu.pc); \
60 #endif /* _CPU_M68K_H */