2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
6 #ifndef __AROS_EXEC_LIBRARY__
10 typedef struct sigcontext regs_t
;
11 #define SIGHANDLER bsd_sighandler
12 #define SIGHANDLER_T void *
14 #define SC_DISABLE(sc) (sc->sc_mask = KernelBase->kb_PlatformData->sig_int_mask)
15 #define SC_ENABLE(sc) (pd->iface->SigEmptySet(&sc->sc_mask))
17 #define SP(sc) (sc->sc_esp)
18 #define FP(sc) (sc->sc_ebp)
19 #define PC(sc) (sc->sc_eip)
21 #define R0(sc) (sc->sc_eax)
22 #define R1(sc) (sc->sc_ebx)
23 #define R2(sc) (sc->sc_ecx)
24 #define R3(sc) (sc->sc_edx)
25 #define R4(sc) (sc->sc_edi)
26 #define R5(sc) (sc->sc_esi)
27 #define R6(sc) (sc->sc_eflags)
29 #define GLOBAL_SIGNAL_INIT(sighandler) \
30 static void sighandler ## _gate (int sig, int code, struct sigcontext *sc) \
32 sighandler( sig, (regs_t*)sc); \
35 #define SAVE_CPU(cc, sc) \
48 * Restore CPU registers.
49 * Note that we do not restore segment registers because they
50 * are of own use by the host OS.
52 #define RESTORE_CPU(cc, sc) \
64 /* TODO: FPU/SSE support */
66 #define SAVEREGS(ctx, sc) \
67 SAVE_CPU((ctx)->regs, sc);
69 #define RESTOREREGS(ctx, sc) \
70 RESTORE_CPU((ctx)->regs, sc);
72 #define PRINT_SC(sc) \
73 bug(" SP=%08lx FP=%08lx PC=%08lx\n" \
74 " R0=%08lx R1=%08lx R2=%08lx R3=%08lx\n" \
75 " R4=%08lx R5=%08lx R6=%08lx\n" \
76 , SP(sc), FP(sc), PC(sc) \
77 , R0(sc), R1(sc), R2(sc), R3(sc) \
78 , R4(sc), R5(sc), R6(sc) \
81 #endif /* __AROS_EXEC_LIBRARY__ */
83 #define EXCEPTIONS_COUNT 17
87 struct ExceptionContext regs
;