White space fixes, detab.
[AROS.git] / rom / kernel / kernel_intr.h
blobd7ef3521799b77329349511215cb5c80ca82a50b
1 #include <proto/exec.h>
3 /* Main scheduler entry points */
4 void core_ExitInterrupt(regs_t *regs);
5 void core_SysCall(int sc, regs_t *regs);
7 /* CPU-specific wrappers. Need to be implemented in CPU-specific parts */
8 void cpu_Switch(regs_t *regs);
9 void cpu_Dispatch(regs_t *regs);
11 /* This constant can be redefined this in arch-specific includes */
12 #ifndef _CUSTOM
13 #define _CUSTOM NULL
14 #endif
16 /* Call exec interrupt vector, if present */
17 static inline void core_Cause(unsigned char n, unsigned int mask)
19 struct IntVector *iv = &SysBase->IntVects[n];
21 /* If the SoftInt vector in SysBase is set, call it. It will do the rest for us */
22 if (iv->iv_Code)
23 AROS_UFC5(void, iv->iv_Code,
24 AROS_UFCA(ULONG, mask, D1),
25 AROS_UFCA(APTR, _CUSTOM, A0),
26 AROS_UFCA(APTR, iv->iv_Data, A1),
27 AROS_UFCA(APTR, iv->iv_Code, A5),
28 AROS_UFCA(struct ExecBase *, SysBase, A6));
31 /* Call exec trap handler, if possible */
32 static inline int core_Trap(ULONG code, void *regs)
34 /* exec.library Alert() is inoperative without KernelBase */
35 if (SysBase && KernelBase)
37 void (*trapHandler)(ULONG, void *) = SysBase->TaskTrapCode;
38 struct Task *t = SysBase->ThisTask;
40 if (t)
42 if (t->tc_TrapCode)
43 trapHandler = t->tc_TrapCode;
46 if (trapHandler)
48 trapHandler(code, regs);
49 return 1;
52 return 0;