Changeset fcfac420 in mainline for arch/amd64/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/amd64/src
- Files:
-
- 5 edited
-
amd64.c (modified) (2 diffs)
-
asm_utils.S (modified) (2 diffs)
-
interrupt.c (modified) (9 diffs)
-
mm/page.c (modified) (2 diffs)
-
pm.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.
