00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00035 #ifndef __sparc64_TRAP_TABLE_H__
00036 #define __sparc64_TRAP_TABLE_H__
00037
00038 #ifndef __ASM__
00039 #include <arch/types.h>
00040 #endif
00041
00042 #include <arch/stack.h>
00043
00044 #define TRAP_TABLE_ENTRY_COUNT 1024
00045 #define TRAP_TABLE_ENTRY_SIZE 32
00046 #define TRAP_TABLE_SIZE (TRAP_TABLE_ENTRY_COUNT*TRAP_TABLE_ENTRY_SIZE)
00047
00048 #ifndef __ASM__
00049 struct trap_table_entry {
00050 __u8 octets[TRAP_TABLE_ENTRY_SIZE];
00051 } __attribute__ ((packed));
00052
00053 typedef struct trap_table_entry trap_table_entry_t;
00054
00055 extern trap_table_entry_t trap_table[TRAP_TABLE_ENTRY_COUNT];
00056 extern trap_table_entry_t trap_table_save[TRAP_TABLE_ENTRY_COUNT];
00057 #endif
00058
00059 #ifdef __ASM__
00060 .macro SAVE_GLOBALS
00061 mov %g1, %l1
00062 mov %g2, %l2
00063 mov %g3, %l3
00064 mov %g4, %l4
00065 mov %g5, %l5
00066 mov %g6, %l6
00067 mov %g7, %l7
00068 .endm
00069
00070 .macro RESTORE_GLOBALS
00071 mov %l1, %g1
00072 mov %l2, %g2
00073 mov %l3, %g3
00074 mov %l4, %g4
00075 mov %l5, %g5
00076 mov %l6, %g6
00077 mov %l7, %g7
00078 .endm
00079
00080 #define PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE (STACK_WINDOW_SAVE_AREA_SIZE+(4*8))
00081 #define SAVED_TSTATE -(1*8)
00082 #define SAVED_TPC -(2*8)
00083 #define SAVED_TNPC -(3*8)
00084 #define SAVED_PSTATE -(4*8)
00085
00086 .macro PREEMPTIBLE_HANDLER f
00087 set \f, %l0
00088 b preemptible_handler
00089 nop
00090 .endm
00091
00092 .macro SIMPLE_HANDLER f
00093 call \f
00094 nop
00095 .endm
00096 #endif
00097
00098 #endif
00099