Changes in kernel/arch/ia32/include/interrupt.h [7a0359b:6473d41] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/interrupt.h
r7a0359b r6473d41 38 38 #include <typedefs.h> 39 39 #include <arch/pm.h> 40 #include <trace.h>41 40 42 #define IVT_ITEMS 43 #define IVT_FIRST 41 #define IVT_ITEMS IDT_ITEMS 42 #define IVT_FIRST 0 44 43 45 #define EXC_COUNT 46 #define IRQ_COUNT 44 #define EXC_COUNT 32 45 #define IRQ_COUNT 16 47 46 48 #define IVT_EXCBASE 49 #define IVT_IRQBASE 50 #define IVT_FREEBASE 47 #define IVT_EXCBASE 0 48 #define IVT_IRQBASE (IVT_EXCBASE + EXC_COUNT) 49 #define IVT_FREEBASE (IVT_IRQBASE + IRQ_COUNT) 51 50 52 #define IRQ_CLK 53 #define IRQ_KBD 54 #define IRQ_PIC1 55 #define IRQ_PIC_SPUR 56 #define IRQ_MOUSE 57 #define IRQ_DP8390 51 #define IRQ_CLK 0 52 #define IRQ_KBD 1 53 #define IRQ_PIC1 2 54 #define IRQ_PIC_SPUR 7 55 #define IRQ_MOUSE 12 56 #define IRQ_DP8390 9 58 57 59 /* This one must have four least significant bits set to ones */60 #define VECTOR_APIC_SPUR 58 /* this one must have four least significant bits set to ones */ 59 #define VECTOR_APIC_SPUR (IVT_ITEMS - 1) 61 60 62 61 #if (((VECTOR_APIC_SPUR + 1) % 16) || VECTOR_APIC_SPUR >= IVT_ITEMS) … … 64 63 #endif 65 64 66 #define VECTOR_DEBUG 67 #define VECTOR_CLK 68 #define VECTOR_PIC_SPUR 69 #define VECTOR_SYSCALL 70 #define VECTOR_TLB_SHOOTDOWN_IPI 71 #define VECTOR_DEBUG_IPI 65 #define VECTOR_DEBUG 1 66 #define VECTOR_CLK (IVT_IRQBASE + IRQ_CLK) 67 #define VECTOR_PIC_SPUR (IVT_IRQBASE + IRQ_PIC_SPUR) 68 #define VECTOR_SYSCALL IVT_FREEBASE 69 #define VECTOR_TLB_SHOOTDOWN_IPI (IVT_FREEBASE + 1) 70 #define VECTOR_DEBUG_IPI (IVT_FREEBASE + 2) 72 71 73 72 typedef struct istate { … … 80 79 uint32_t ebp; 81 80 82 uint32_t ebp_frame; 83 uint32_t eip_frame; 84 81 uint32_t ebp_frame; /* imitation of frame pointer linkage */ 82 uint32_t eip_frame; /* imitation of return address linkage */ 83 85 84 uint32_t gs; 86 85 uint32_t fs; 87 86 uint32_t es; 88 87 uint32_t ds; 89 90 uint32_t error_word; 88 89 uint32_t error_word; /* real or fake error word */ 91 90 uint32_t eip; 92 91 uint32_t cs; 93 92 uint32_t eflags; 94 uint32_t esp; 95 uint32_t ss; 93 uint32_t esp; /* only if istate_t is from uspace */ 94 uint32_t ss; /* only if istate_t is from uspace */ 96 95 } istate_t; 97 96 98 97 /** Return true if exception happened while in userspace */ 99 NO_TRACEstatic inline int istate_from_uspace(istate_t *istate)98 static inline int istate_from_uspace(istate_t *istate) 100 99 { 101 100 return !(istate->eip & 0x80000000); 102 101 } 103 102 104 NO_TRACE static inline void istate_set_retaddr(istate_t *istate, 105 uintptr_t retaddr) 103 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 106 104 { 107 105 istate->eip = retaddr; 108 106 } 109 107 110 NO_TRACEstatic inline unative_t istate_get_pc(istate_t *istate)108 static inline unative_t istate_get_pc(istate_t *istate) 111 109 { 112 110 return istate->eip; 113 111 } 114 112 115 NO_TRACEstatic inline unative_t istate_get_fp(istate_t *istate)113 static inline unative_t istate_get_fp(istate_t *istate) 116 114 { 117 115 return istate->ebp; 118 116 } 119 117 120 extern void (* disable_irqs_function)(uint16_t );121 extern void (* enable_irqs_function)(uint16_t );118 extern void (* disable_irqs_function)(uint16_t irqmask); 119 extern void (* enable_irqs_function)(uint16_t irqmask); 122 120 extern void (* eoi_function)(void); 123 121 124 122 extern void interrupt_init(void); 125 extern void trap_virtual_enable_irqs(uint16_t );126 extern void trap_virtual_disable_irqs(uint16_t );123 extern void trap_virtual_enable_irqs(uint16_t irqmask); 124 extern void trap_virtual_disable_irqs(uint16_t irqmask); 127 125 128 126 #endif
Note:
See TracChangeset
for help on using the changeset viewer.