1 #include <proto/exec.h>
3 /* Main scheduler entry point */
4 void core_ExitInterrupt(regs_t
*regs
);
5 /* CPU-specific wrappers. Need to be implemented in CPU-specific parts */
6 void cpu_Switch(regs_t
*regs
);
7 void cpu_Dispatch(regs_t
*regs
);
9 /* This constant can be redefined this in arch-specific includes */
14 /* Call exec interrupt vector, if present */
15 static inline void core_Cause(unsigned char n
, unsigned int mask
)
17 struct IntVector
*iv
= &SysBase
->IntVects
[n
];
19 /* If the SoftInt vector in SysBase is set, call it. It will do the rest for us */
21 AROS_UFC5(void, iv
->iv_Code
,
22 AROS_UFCA(ULONG
, mask
, D1
),
23 AROS_UFCA(APTR
, _CUSTOM
, A0
),
24 AROS_UFCA(APTR
, iv
->iv_Data
, A1
),
25 AROS_UFCA(APTR
, iv
->iv_Code
, A5
),
26 AROS_UFCA(struct ExecBase
*, SysBase
, A6
));
29 /* Call exec trap handler, if possible */
30 static inline int core_Trap(ULONG code
, void *regs
)
32 /* exec.library Alert() is inoperative without KernelBase */
33 if (SysBase
&& KernelBase
)
35 void (*trapHandler
)(ULONG
, void *) = SysBase
->TaskTrapCode
;
36 struct Task
*t
= SysBase
->ThisTask
;
41 trapHandler
= t
->tc_TrapCode
;
46 trapHandler(code
, regs
);