Changeset fcfac420 in mainline for arch/ia32/src
- Timestamp:
- 2005-12-10T01:02:31Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6095342
- Parents:
- 973be64e
- Location:
- arch/ia32/src
- Files:
-
- 9 edited
-
asm.S (modified) (2 diffs)
-
drivers/i8042.c (modified) (3 diffs)
-
drivers/i8254.c (modified) (4 diffs)
-
drivers/i8259.c (modified) (4 diffs)
-
ia32.c (modified) (2 diffs)
-
interrupt.c (modified) (9 diffs)
-
mm/page.c (modified) (2 diffs)
-
pm.c (modified) (2 diffs)
-
smp/apic.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/asm.S
r973be64e rfcfac420 76 76 # 77 77 # The handlers setup data segment registers 78 # and call trap_dispatcher().78 # and call exc_dispatch(). 79 79 # 80 80 .macro handler i n … … 95 95 addl $4,(%esp) 96 96 pushl %edi 97 call trap_dispatcher97 call exc_dispatch 98 98 addl $8,%esp 99 99 -
arch/ia32/src/drivers/i8042.c
r973be64e rfcfac420 39 39 #include <console/console.h> 40 40 #include <macros.h> 41 #include <interrupt.h> 41 42 42 43 /** … … 236 237 }; 237 238 239 static void i8042_interrupt(int n, void *stack); 240 238 241 /** Initialize i8042. */ 239 242 void i8042_init(void) 240 243 { 241 trap_register(VECTOR_KBD, i8042_interrupt);244 exc_register(VECTOR_KBD, "i8042_interrupt", i8042_interrupt); 242 245 trap_virtual_enable_irqs(1<<IRQ_KBD); 243 246 spinlock_initialize(&keylock, "i8042_lock"); … … 251 254 * @param stack Interrupted stack. 252 255 */ 253 void i8042_interrupt( __u8 n, __native stack[])256 void i8042_interrupt(int n, void *stack) 254 257 { 255 258 __u8 x; -
arch/ia32/src/drivers/i8254.c
r973be64e rfcfac420 40 40 #include <arch.h> 41 41 #include <time/delay.h> 42 #include <interrupt.h> 42 43 43 44 /* … … 53 54 #define MAGIC_NUMBER 1194 54 55 56 static void i8254_interrupt(int n, void *stack); 57 55 58 void i8254_init(void) 56 59 { … … 65 68 outb(CLK_PORT1, (CLK_CONST/HZ) >> 8); 66 69 pic_enable_irqs(1<<IRQ_CLK); 67 trap_register(VECTOR_CLK, i8254_interrupt);70 exc_register(VECTOR_CLK, "i8254_clock", i8254_interrupt); 68 71 } 69 72 … … 123 126 } 124 127 125 void i8254_interrupt( __u8 n, __native stack[])128 void i8254_interrupt(int n, void *stack) 126 129 { 127 130 trap_virtual_eoi(); -
arch/ia32/src/drivers/i8259.c
r973be64e rfcfac420 33 33 #include <arch.h> 34 34 #include <print.h> 35 #include <interrupt.h> 35 36 36 37 /* … … 38 39 * Programmable Interrupt Controller for UP systems. 39 40 */ 41 42 static void pic_spurious(int n, void *stack); 40 43 41 44 void i8259_init(void) … … 68 71 * Register interrupt handler for the PIC spurious interrupt. 69 72 */ 70 trap_register(VECTOR_PIC_SPUR, pic_spurious);73 exc_register(VECTOR_PIC_SPUR, "pic_spurious", pic_spurious); 71 74 72 75 /* … … 116 119 } 117 120 118 void pic_spurious( __u8 n, __native stack[])121 void pic_spurious(int n, void *stack) 119 122 { 120 123 printf("cpu%d: PIC spurious interrupt\n", CPU->id); -
arch/ia32/src/ia32.c
r973be64e rfcfac420 50 50 51 51 #include <arch/mm/memory_init.h> 52 #include <interrupt.h> 52 53 53 54 void arch_pre_mm_init(void) … … 60 61 i8254_init(); /* hard clock */ 61 62 62 trap_register(VECTOR_SYSCALL, syscall);63 exc_register(VECTOR_SYSCALL, "syscall", syscall); 63 64 64 65 #ifdef CONFIG_SMP 65 trap_register(VECTOR_TLB_SHOOTDOWN_IPI, tlb_shootdown_ipi); 66 trap_register(VECTOR_WAKEUP_IPI, wakeup_ipi); 66 exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", 67 tlb_shootdown_ipi); 68 exc_register(VECTOR_WAKEUP_IPI, "wakeup_ipi", wakeup_ipi); 67 69 #endif /* CONFIG_SMP */ 68 70 } -
arch/ia32/src/interrupt.c
r973be64e rfcfac420 44 44 */ 45 45 46 static iroutine ivt[IVT_ITEMS];47 48 46 void (* disable_irqs_function)(__u16 irqmask) = NULL; 49 47 void (* enable_irqs_function)(__u16 irqmask) = NULL; 50 48 void (* eoi_function)(void) = NULL; 51 49 52 #define PRINT_INFO_ERRCODE(x) { \ 53 char *symbol = get_symtab_entry(stack[1]); \ 50 #define PRINT_INFO_ERRCODE(st) { \ 51 __native *x = (__native *) st; \ 52 char *symbol = get_symtab_entry(x[1]); \ 54 53 if (!symbol) \ 55 54 symbol = ""; \ … … 66 65 } 67 66 68 iroutine trap_register(__u8 n, iroutine f)67 void null_interrupt(int n, void *st) 69 68 { 70 ASSERT(n < IVT_ITEMS); 71 72 iroutine old; 73 74 old = ivt[n]; 75 ivt[n] = f; 76 77 return old; 78 } 69 __native *stack = (__native *) st; 79 70 80 /*81 * Called directly from the assembler code.82 * CPU is interrupts_disable()'d.83 */84 void trap_dispatcher(__u8 n, __native stack[])85 {86 ASSERT(n < IVT_ITEMS);87 88 ivt[n](n, stack);89 }90 91 void null_interrupt(__u8 n, __native stack[])92 {93 71 printf("int %d: null_interrupt\n", n); 94 72 printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]); … … 96 74 } 97 75 98 void gp_fault( __u8 n, __native stack[])76 void gp_fault(int n, void *stack) 99 77 { 100 78 PRINT_INFO_ERRCODE(stack); … … 102 80 } 103 81 104 void ss_fault( __u8 n, __native stack[])82 void ss_fault(int n, void *stack) 105 83 { 106 84 PRINT_INFO_ERRCODE(stack); … … 109 87 110 88 111 void nm_fault( __u8 n, __native stack[])89 void nm_fault(int n, void *stack) 112 90 { 113 91 #ifdef CONFIG_FPU_LAZY … … 120 98 121 99 122 void page_fault( __u8 n, __native stack[])100 void page_fault(int n, void *stack) 123 101 { 124 102 PRINT_INFO_ERRCODE(stack); … … 127 105 } 128 106 129 void syscall( __u8 n, __native stack[])107 void syscall(int n, void *stack) 130 108 { 131 109 printf("cpu%d: syscall\n", CPU->id); … … 133 111 } 134 112 135 void tlb_shootdown_ipi( __u8 n, __native stack[])113 void tlb_shootdown_ipi(int n, void *stack) 136 114 { 137 115 trap_virtual_eoi(); … … 139 117 } 140 118 141 void wakeup_ipi( __u8 n, __native stack[])119 void wakeup_ipi(int n, void *stack) 142 120 { 143 121 trap_virtual_eoi(); -
arch/ia32/src/mm/page.c
r973be64e rfcfac420 40 40 #include <memstr.h> 41 41 #include <print.h> 42 #include <interrupt.h> 42 43 43 44 static __address bootstrap_dba; … … 60 61 page_mapping_insert(PA2KA(cur), cur, PAGE_CACHEABLE, KA2PA(dba)); 61 62 62 trap_register(14, page_fault);63 exc_register(14, "page_fault", page_fault); 63 64 write_cr3(KA2PA(dba)); 64 65 } -
arch/ia32/src/pm.c
r973be64e rfcfac420 39 39 #include <memstr.h> 40 40 #include <arch/boot/boot.h> 41 #include <interrupt.h> 41 42 42 43 /* … … 125 126 126 127 idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size); 127 trap_register(i, null_interrupt);128 exc_register(i, "undef", null_interrupt); 128 129 } 129 trap_register(13, gp_fault);130 trap_register( 7, nm_fault);131 trap_register(12, ss_fault);130 exc_register(13, "gp_fault", gp_fault); 131 exc_register( 7, "nm_fault", nm_fault); 132 exc_register(12, "ss_fault", ss_fault); 132 133 } 133 134 -
arch/ia32/src/smp/apic.c
r973be64e rfcfac420 33 33 #include <mm/page.h> 34 34 #include <time/delay.h> 35 #include <interrupt.h> 35 36 #include <arch/interrupt.h> 36 37 #include <print.h> … … 109 110 #endif /* LAPIC_VERBOSE */ 110 111 112 113 static void apic_spurious(int n, void *stack); 114 static void l_apic_timer_interrupt(int n, void *stack); 115 111 116 /** Initialize APIC on BSP. */ 112 117 void apic_init(void) … … 115 120 int i; 116 121 117 trap_register(VECTOR_APIC_SPUR, apic_spurious);122 exc_register(VECTOR_APIC_SPUR, "apic_spurious", apic_spurious); 118 123 119 124 enable_irqs_function = io_apic_enable_irqs; … … 127 132 */ 128 133 io_apic_disable_irqs(0xffff); 129 trap_register(VECTOR_CLK, l_apic_timer_interrupt);134 exc_register(VECTOR_CLK, "l_apic_timer", l_apic_timer_interrupt); 130 135 for (i = 0; i < IRQ_COUNT; i++) { 131 136 int pin; … … 163 168 * @param stack Interrupted stack. 164 169 */ 165 void apic_spurious( __u8 n, __native stack[])170 void apic_spurious(int n, void *stack) 166 171 { 167 172 printf("cpu%d: APIC spurious interrupt\n", CPU->id); … … 402 407 * @param stack Interrupted stack. 403 408 */ 404 void l_apic_timer_interrupt( __u8 n, __native stack[])409 void l_apic_timer_interrupt(int n, void *stack) 405 410 { 406 411 l_apic_eoi();
Note:
See TracChangeset
for help on using the changeset viewer.
