Changeset fcfac420 in mainline
- Timestamp:
- 2005-12-10T01:02:31Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6095342
- Parents:
- 973be64e
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r973be64e rfcfac420 164 164 165 165 clean: 166 -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld166 -rm -f kernel.bin kernel.raw kernel.map kernel.map.pre kernel.objdump kernel.disasm generic/src/debug/real_map.bin Makefile.depend* generic/include/arch generic/include/genarch arch/$(ARCH)/_link.ld 167 167 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \; 168 168 for arch in arch/*; do \ … … 175 175 ln -sfn ../../genarch/include/ generic/include/genarch 176 176 177 depend: archlinks 178 $(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 177 depend: archlinks Makefile.depend 178 179 Makefile.depend: 180 -makedepend $(DEFS) $(CFLAGS) -f - $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) >Makefile.depend 2>/dev/null 181 #$(CC) $(DEFS) $(CFLAGS) -M $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 179 182 180 183 arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in -
arch/amd64/src/amd64.c
r973be64e rfcfac420 45 45 #include <genarch/acpi/acpi.h> 46 46 #include <panic.h> 47 #include <interrupt.h> 47 48 48 49 void arch_pre_mm_init(void) … … 73 74 i8254_init(); /* hard clock */ 74 75 75 trap_register(VECTOR_SYSCALL, syscall);76 exc_register(VECTOR_SYSCALL, "syscall", syscall); 76 77 77 78 #ifdef CONFIG_SMP 78 trap_register(VECTOR_TLB_SHOOTDOWN_IPI, tlb_shootdown_ipi); 79 trap_register(VECTOR_WAKEUP_IPI, wakeup_ipi); 79 exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", 80 tlb_shootdown_ipi); 81 exc_register(VECTOR_WAKEUP_IPI, "wakeup_ipi", wakeup_ipi); 80 82 #endif /* CONFIG_SMP */ 81 83 } -
arch/amd64/src/asm_utils.S
r973be64e rfcfac420 160 160 # 161 161 # The handlers setup data segment registers 162 # and call trap_dispatcher().162 # and call exc_dispatch(). 163 163 # 164 164 .macro handler i n … … 171 171 movq %rbp, %rsi 172 172 addq $8, %rsi # %rsi - second parameter - original stack 173 call trap_dispatcher # trap_dispatcher(i, stack)173 call exc_dispatch # exc_dispatch(i, stack) 174 174 175 175 # Test if this is interrupt with error word or not -
arch/amd64/src/interrupt.c
r973be64e rfcfac420 58 58 } 59 59 60 static void print_info_errcode( __u8 n, __native x[])60 static void print_info_errcode(int n, void *st) 61 61 { 62 62 char *symbol; 63 __native *x = (__native *) st; 63 64 64 65 if (!(symbol=get_symtab_entry(x[1]))) … … 89 90 */ 90 91 91 static iroutine ivt[IVT_ITEMS];92 93 92 void (* disable_irqs_function)(__u16 irqmask) = NULL; 94 93 void (* enable_irqs_function)(__u16 irqmask) = NULL; 95 94 void (* eoi_function)(void) = NULL; 96 95 97 iroutine trap_register(__u8 n, iroutine f)96 void null_interrupt(int n, void *st) 98 97 { 99 ASSERT(n < IVT_ITEMS); 100 101 iroutine old; 102 103 old = ivt[n]; 104 ivt[n] = f; 105 106 return old; 107 } 98 __native *stack = (__native *) st; 108 99 109 /*110 * Called directly from the assembler code.111 * CPU is interrupts_disable()'d.112 */113 void trap_dispatcher(__u8 n, __native stack[])114 {115 ASSERT(n < IVT_ITEMS);116 117 ivt[n](n, stack);118 }119 120 void null_interrupt(__u8 n, __native stack[])121 {122 100 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \ 123 101 printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]); … … 125 103 } 126 104 127 void gp_fault( __u8 n, __native stack[])105 void gp_fault(int n, void *stack) 128 106 { 129 107 print_info_errcode(n,stack); … … 131 109 } 132 110 133 void ss_fault( __u8 n, __native stack[])111 void ss_fault(int n, void *stack) 134 112 { 135 113 print_info_errcode(n,stack); … … 138 116 139 117 140 void nm_fault( __u8 n, __native stack[])118 void nm_fault(int n, void *stack) 141 119 { 142 120 #ifdef CONFIG_FPU_LAZY … … 149 127 150 128 151 void page_fault( __u8 n, __native stack[])129 void page_fault(int n, void *stack) 152 130 { 153 131 print_info_errcode(n,stack); … … 156 134 } 157 135 158 void syscall( __u8 n, __native stack[])136 void syscall(int n, void *stack) 159 137 { 160 138 printf("cpu%d: syscall\n", CPU->id); … … 162 140 } 163 141 164 void tlb_shootdown_ipi( __u8 n, __native stack[])142 void tlb_shootdown_ipi(int n, void *stack) 165 143 { 166 144 trap_virtual_eoi(); … … 168 146 } 169 147 170 void wakeup_ipi( __u8 n, __native stack[])148 void wakeup_ipi(int n, void *stack) 171 149 { 172 150 trap_virtual_eoi(); -
arch/amd64/src/mm/page.c
r973be64e rfcfac420 35 35 #include <config.h> 36 36 #include <memstr.h> 37 #include <interrupt.h> 37 38 38 39 static __address bootstrap_dba; … … 56 57 } 57 58 58 trap_register(14, page_fault);59 exc_register(14, "page_fault", page_fault); 59 60 write_cr3(KA2PA(dba)); 60 61 } -
arch/amd64/src/pm.c
r973be64e rfcfac420 32 32 #include <arch/interrupt.h> 33 33 #include <arch/asm.h> 34 #include <interrupt.h> 34 35 35 36 #include <config.h> … … 175 176 176 177 idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size); 177 trap_register(i, null_interrupt);178 exc_register(i, "undef", null_interrupt); 178 179 } 179 trap_register(13, gp_fault);180 trap_register( 7, nm_fault);181 trap_register(12, ss_fault);180 exc_register(13, "gp_fault", gp_fault); 181 exc_register( 7, "nm_fault", nm_fault); 182 exc_register(12, "ss_fault", ss_fault); 182 183 } 183 184 -
arch/ia32/include/i8042.h
r973be64e rfcfac420 40 40 41 41 extern void i8042_init(void); 42 extern void i8042_interrupt(__u8 n, __native stack[]);43 42 44 43 #endif -
arch/ia32/include/i8254.h
r973be64e rfcfac420 33 33 34 34 extern void i8254_init(void); 35 extern void i8254_interrupt(__u8 n, __native stack[]);36 35 extern void i8254_calibrate_delay_loop(void); 37 36 extern void i8254_normal_operation(void); -
arch/ia32/include/i8259.h
r973be64e rfcfac420 45 45 extern void pic_disable_irqs(__u16 irqmask); 46 46 extern void pic_eoi(void); 47 extern void pic_spurious(__u8 n, __native stack[]);48 47 49 48 #endif -
arch/ia32/include/interrupt.h
r973be64e rfcfac420 27 27 */ 28 28 29 #ifndef __ INTERRUPT_H__30 #define __ INTERRUPT_H__29 #ifndef __ia32_INTERRUPT_H__ 30 #define __ia32_INTERRUPT_H__ 31 31 32 32 #include <arch/types.h> … … 62 62 #define VECTOR_WAKEUP_IPI (IVT_FREEBASE+2) 63 63 64 typedef void (* iroutine)(__u8 n, __native stack[]);65 66 64 extern void (* disable_irqs_function)(__u16 irqmask); 67 65 extern void (* enable_irqs_function)(__u16 irqmask); 68 66 extern void (* eoi_function)(void); 69 67 70 extern iroutine trap_register(__u8 n, iroutine f); 71 72 extern void trap_dispatcher(__u8 n, __native stack[]); 73 74 extern void null_interrupt(__u8 n, __native stack[]); 75 extern void gp_fault(__u8 n, __native stack[]); 76 extern void nm_fault(__u8 n, __native stack[]); 77 extern void ss_fault(__u8 n, __native stack[]); 78 extern void page_fault(__u8 n, __native stack[]); 79 extern void syscall(__u8 n, __native stack[]); 80 extern void tlb_shootdown_ipi(__u8 n, __native stack[]); 81 extern void wakeup_ipi(__u8 n, __native stack[]); 68 extern void null_interrupt(int n, void *stack); 69 extern void gp_fault(int n, void *stack); 70 extern void nm_fault(int n, void *stack); 71 extern void ss_fault(int n, void *stack); 72 extern void page_fault(int n, void *stack); 73 extern void syscall(int n, void *stack); 74 extern void tlb_shootdown_ipi(int n, void *stack); 75 extern void wakeup_ipi(int n, void *stack); 82 76 83 77 extern void trap_virtual_enable_irqs(__u16 irqmask); -
arch/ia32/include/smp/apic.h
r973be64e rfcfac420 312 312 313 313 extern void apic_init(void); 314 extern void apic_spurious(__u8 n, __native stack[]);315 314 316 315 extern void l_apic_init(void); … … 319 318 extern int l_apic_send_init_ipi(__u8 apicid); 320 319 extern void l_apic_debug(void); 321 extern void l_apic_timer_interrupt(__u8 n, __native stack[]);322 320 extern __u8 l_apic_id(void); 323 321 -
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.