5 #include <asm/linkage.h>
7 /* Here are some macros used to build trap table in core file. */
9 #define TRAP_NAME2(nr) nr##_trap(void)
10 #define TRAP_NAME(nr) TRAP_NAME2(TRAP##nr)
12 # define _stringify(x) #x
13 # define stringify(x) _stringify(x)
15 #define BUILD_COMMON_TRAP() \
20 "call "SYMBOL_NAME_STR(printException)"\n\t" \
23 "movl 12(%esp),%esp\n\t" /* Get and use user stack */ \
24 "pushl %eax\n\t" /* Exception number */ \
25 "pushl $0\n\t" /* "Return address" */ \
26 "movl %esp,%ebx\n\t" /* Hold the esp value before pushing! */ \
27 "pushl $" stringify(USER_DS) "\n\t" /* User SS */ \
28 "pushl %ebx\n\t" /* Stack frame */ \
29 "pushl $0x3002\n\t" /* IOPL:3 */ \
30 "pushl $" stringify(USER_CS) "\n\t" \
31 "pushl $" SYMBOL_NAME_STR(handleException) "\n\t" \
34 #define BUILD_TRAP(nr) \
35 asmlinkage void TRAP_NAME(nr); \
38 SYMBOL_NAME_STR(TRAP) #nr "_trap:\n\t" \
42 void set_intr_gate(unsigned int n
, void *addr
);
43 void set_system_gate(unsigned int n
, void *addr
);
45 void Init_Traps(struct PlatformData
*data
);