Changeset 25d7709 in mainline for arch/ia32/src
- Timestamp:
- 2006-03-13T20:08:16Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 631ca4d
- Parents:
- 45d6add
- Location:
- arch/ia32/src
- Files:
-
- 8 edited
-
asm.S (modified) (4 diffs)
-
drivers/i8254.c (modified) (3 diffs)
-
drivers/i8259.c (modified) (3 diffs)
-
ia32.c (modified) (1 diff)
-
interrupt.c (modified) (4 diffs)
-
mm/page.c (modified) (1 diff)
-
pm.c (modified) (1 diff)
-
smp/apic.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/asm.S
r45d6add r25d7709 79 79 # 80 80 .macro handler i n 81 push %ebp 82 movl %esp,%ebp 81 push %eax 82 83 # Test if this is interrupt with error word or not 84 movl $(1<<\i), %eax 85 andl $ERROR_WORD_INTERRUPT_LIST,%eax 86 87 /* 88 * If this interrupt/exception stores error word, 89 * we need to pop EAX. 90 * If this interrupt doesn't store error word, we emulate it 91 * for the sake of consistent pstate structure. In that case 92 * we merely leave the EAX on the stack. 93 */ 94 jz 0f 95 96 /* 97 * This exception stores error word. 98 */ 99 pop %eax 100 jmp 1f 101 102 0: 103 /* 104 * This interrupt doesn't store error word. 105 * Just restore EAX without doing POP. 106 */ 107 movl (%esp), %eax 108 109 1: 83 110 pusha 84 111 movl %esp, %ebp 85 112 push %ds 86 113 push %es … … 93 120 movl $(\i),%edi 94 121 pushl %ebp 95 addl $4,(%esp)96 122 pushl %edi 97 123 call exc_dispatch … … 101 127 pop %ds 102 128 103 104 # CLNT 129 # Clear Nested Task flag. 105 130 pushfl 106 131 pop %eax … … 109 134 popfl 110 135 111 112 113 # Test if this is interrupt with error word or not114 mov $\i,%cl115 movl $1,%eax116 test $0xe0,%cl117 jnz 0f118 and $0x1f,%cl119 shl %cl,%eax120 and $ERROR_WORD_INTERRUPT_LIST,%eax121 jz 0f122 123 124 # Return with error word125 136 popa 126 pop %ebp 127 add $4,%esp # Skip error word 128 iret 129 130 0: 131 # Return with no error word 132 popa 133 pop %ebp 137 add $4,%esp # Skip error word, whether real or fake. 134 138 iret 135 139 -
arch/ia32/src/drivers/i8254.c
r45d6add r25d7709 54 54 #define MAGIC_NUMBER 1194 55 55 56 static void i8254_interrupt(int n, void *stack);56 static void i8254_interrupt(int n, istate_t *istate); 57 57 58 58 void i8254_init(void) … … 68 68 outb(CLK_PORT1, (CLK_CONST/HZ) >> 8); 69 69 pic_enable_irqs(1<<IRQ_CLK); 70 exc_register(VECTOR_CLK, "i8254_clock", i8254_interrupt);70 exc_register(VECTOR_CLK, "i8254_clock", (iroutine) i8254_interrupt); 71 71 } 72 72 … … 126 126 } 127 127 128 void i8254_interrupt(int n, void *stack)128 void i8254_interrupt(int n, istate_t *istate) 129 129 { 130 130 trap_virtual_eoi(); -
arch/ia32/src/drivers/i8259.c
r45d6add r25d7709 40 40 */ 41 41 42 static void pic_spurious(int n, void *stack);42 static void pic_spurious(int n, istate_t *istate); 43 43 44 44 void i8259_init(void) … … 71 71 * Register interrupt handler for the PIC spurious interrupt. 72 72 */ 73 exc_register(VECTOR_PIC_SPUR, "pic_spurious", pic_spurious);73 exc_register(VECTOR_PIC_SPUR, "pic_spurious", (iroutine) pic_spurious); 74 74 75 75 /* … … 119 119 } 120 120 121 void pic_spurious(int n, void *stack)121 void pic_spurious(int n, istate_t *istate) 122 122 { 123 123 printf("cpu%d: PIC spurious interrupt\n", CPU->id); -
arch/ia32/src/ia32.c
r45d6add r25d7709 61 61 i8254_init(); /* hard clock */ 62 62 63 exc_register(VECTOR_SYSCALL, "syscall", syscall);63 exc_register(VECTOR_SYSCALL, "syscall", (iroutine) syscall); 64 64 65 65 #ifdef CONFIG_SMP 66 66 exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", 67 tlb_shootdown_ipi);67 (iroutine) tlb_shootdown_ipi); 68 68 #endif /* CONFIG_SMP */ 69 69 } -
arch/ia32/src/interrupt.c
r45d6add r25d7709 50 50 void (* eoi_function)(void) = NULL; 51 51 52 #define PRINT_INFO_ERRCODE(st) { \ 53 __native *x = (__native *) st; \ 54 char *symbol = get_symtab_entry(x[1]); \ 52 #define PRINT_INFO_ERRCODE(istate) do { \ 53 char *symbol = get_symtab_entry(istate->eip); \ 55 54 if (!symbol) \ 56 55 symbol = ""; \ 57 56 printf("----------------EXCEPTION OCCURED----------------\n"); \ 58 printf("%%eip: %X (%s)\n", x[1],symbol); \59 printf("ERROR_WORD=%X\n", x[0]); \60 printf("%%cs=%X,flags=%X\n", x[2], x[3]); \57 printf("%%eip: %X (%s)\n",istate->eip,symbol); \ 58 printf("ERROR_WORD=%X\n", istate->error_word); \ 59 printf("%%cs=%X,flags=%X\n", istate->cs, istate->eflags); \ 61 60 printf("%%eax=%X, %%ebx=%X, %%ecx=%X, %%edx=%X\n",\ 62 x[-2],x[-5],x[-3],x[-4]); \61 istate->eax,istate->ebx,istate->ecx,istate->edx); \ 63 62 printf("%%esi=%X, %%edi=%X, %%ebp=%X, %%esp=%X\n",\ 64 x[-8],x[-9],x[-1],x); \65 printf("stack: %X, %X, %X, %X\n", x[4], x[5], x[6], x[7]); \66 printf(" %X, %X, %X, %X\n", x[8], x[9], x[10], x[11]); \67 } 63 istate->esi,istate->edi,istate->ebp,istate->esp); \ 64 printf("stack: %X, %X, %X, %X\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]); \ 65 printf(" %X, %X, %X, %X\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]); \ 66 } while(0) 68 67 69 void null_interrupt(int n, void *st)68 void null_interrupt(int n, istate_t *istate) 70 69 { 71 __native *stack = (__native *) st; 72 73 printf("int %d: null_interrupt\n", n); 74 printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]); 75 panic("unserviced interrupt\n"); 70 PRINT_INFO_ERRCODE(istate); 71 panic("unserviced interrupt: %d\n", n); 76 72 } 77 73 78 void gp_fault(int n, void *stack)74 void gp_fault(int n, istate_t *istate) 79 75 { 80 PRINT_INFO_ERRCODE( stack);76 PRINT_INFO_ERRCODE(istate); 81 77 panic("general protection fault\n"); 82 78 } 83 79 84 void ss_fault(int n, void *stack)80 void ss_fault(int n, istate_t *istate) 85 81 { 86 PRINT_INFO_ERRCODE( stack);82 PRINT_INFO_ERRCODE(istate); 87 83 panic("stack fault\n"); 88 84 } 89 85 90 91 void nm_fault(int n, void *stack) 86 void nm_fault(int n, istate_t *istate) 92 87 { 93 88 #ifdef CONFIG_FPU_LAZY … … 98 93 } 99 94 100 101 102 void page_fault(int n, void *stack) 95 void page_fault(int n, istate_t *istate) 103 96 { 104 97 __address page; … … 106 99 page = read_cr2(); 107 100 if (!as_page_fault(page)) { 108 PRINT_INFO_ERRCODE( stack);101 PRINT_INFO_ERRCODE(istate); 109 102 printf("page fault address: %X\n", page); 110 103 panic("page fault\n"); … … 112 105 } 113 106 114 void syscall(int n, void *st)107 void syscall(int n, istate_t *istate) 115 108 { 116 __native *stack = (__native *) st;117 118 109 interrupts_enable(); 119 if ( stack[-2]< SYSCALL_END)120 stack[-2] = syscall_table[stack[-2]](stack[-5], stack[-3], stack[-4]);110 if (istate->edx < SYSCALL_END) 111 istate->eax = syscall_table[istate->edx](istate->eax, istate->ebx, istate->ecx); 121 112 else 122 panic("Undefined syscall %d", stack[-2]);113 panic("Undefined syscall %d", istate->edx); 123 114 interrupts_disable(); 124 115 } 125 116 126 void tlb_shootdown_ipi(int n, void *stack)117 void tlb_shootdown_ipi(int n, istate_t *istate) 127 118 { 128 119 trap_virtual_eoi(); -
arch/ia32/src/mm/page.c
r45d6add r25d7709 61 61 } 62 62 63 exc_register(14, "page_fault", page_fault);63 exc_register(14, "page_fault", (iroutine) page_fault); 64 64 write_cr3((__address) AS_KERNEL->page_table); 65 65 } -
arch/ia32/src/pm.c
r45d6add r25d7709 126 126 127 127 idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size); 128 exc_register(i, "undef", null_interrupt);128 exc_register(i, "undef", (iroutine) null_interrupt); 129 129 } 130 exc_register(13, "gp_fault", gp_fault);131 exc_register( 7, "nm_fault", nm_fault);132 exc_register(12, "ss_fault", ss_fault);130 exc_register(13, "gp_fault", (iroutine) gp_fault); 131 exc_register( 7, "nm_fault", (iroutine) nm_fault); 132 exc_register(12, "ss_fault", (iroutine) ss_fault); 133 133 } 134 134 -
arch/ia32/src/smp/apic.c
r45d6add r25d7709 113 113 114 114 115 static void apic_spurious(int n, void *stack);116 static void l_apic_timer_interrupt(int n, void *stack);115 static void apic_spurious(int n, istate_t *istate); 116 static void l_apic_timer_interrupt(int n, istate_t *istate); 117 117 118 118 /** Initialize APIC on BSP. */ … … 122 122 int i; 123 123 124 exc_register(VECTOR_APIC_SPUR, "apic_spurious", apic_spurious);124 exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious); 125 125 126 126 enable_irqs_function = io_apic_enable_irqs; … … 134 134 */ 135 135 io_apic_disable_irqs(0xffff); 136 exc_register(VECTOR_CLK, "l_apic_timer", l_apic_timer_interrupt);136 exc_register(VECTOR_CLK, "l_apic_timer", (iroutine) l_apic_timer_interrupt); 137 137 for (i = 0; i < IRQ_COUNT; i++) { 138 138 int pin; … … 170 170 * @param stack Interrupted stack. 171 171 */ 172 void apic_spurious(int n, void *stack)172 void apic_spurious(int n, istate_t *istate) 173 173 { 174 174 printf("cpu%d: APIC spurious interrupt\n", CPU->id); … … 428 428 * @param stack Interrupted stack. 429 429 */ 430 void l_apic_timer_interrupt(int n, void *stack)430 void l_apic_timer_interrupt(int n, istate_t *istate) 431 431 { 432 432 l_apic_eoi();
Note:
See TracChangeset
for help on using the changeset viewer.
