1 /* See COPYRIGHT for copyright information. */
4 #include <inc/memlayout.h>
9 ###################################################################
10 # exceptions/interrupts
11 ###################################################################
13 /* The TRAPHANDLER macro defines a globally-visible function for handling
15 * The function can be referenced from C++ after you declare it, for
16 * instance using "asmlinkage FUNCTIONNAME()".
17 * It pushes a trap number onto the stack, then jumps to _alltraps.
18 * Use TRAPHANDLER for traps where the CPU automatically pushes an error code.
20 #define TRAPHANDLER(name, num) \
21 .globl name; /* define global symbol for 'name' */ \
22 .type name, @function; /* symbol type is function */ \
23 .align 2; /* align function definition */ \
24 name: /* function starts here */ \
28 /* Use TRAPHANDLER_NOEC for traps where the CPU doesn't push an error code.
29 * It pushes a 0 in place of the error code, so the trap frame has the same
30 * format in either case.
32 #define TRAPHANDLER_NOEC(name, num) \
34 .type name, @function; \
44 * Lab 2: Your code here for generating entry points for the different traps.
47 * Lab 2: Your code here for _alltraps