Minor fixes to comments.
[AROS.git] / rom / kernel / kernel_intr.h
blob994c969829bf528094aaa6588395f65a5e734400
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_INTC3(iv->iv_Code, iv->iv_Data, mask, _CUSTOM);
26 /* Call exec trap handler, if possible */
27 static inline int core_Trap(ULONG code, void *regs)
29 /* exec.library Alert() is inoperative without KernelBase,
30 * but SysBase should not be valid if KernelBase is
31 * not set up.
33 if (SysBase)
35 void (*trapHandler)(ULONG, void *) = SysBase->TaskTrapCode;
36 struct Task *t = SysBase->ThisTask;
38 if (t)
40 if (t->tc_TrapCode)
41 trapHandler = t->tc_TrapCode;
44 if (trapHandler)
46 trapHandler(code, regs);
47 return 1;
50 return 0;