Changeset 3396f59 in mainline for arch/amd64/src/interrupt.c
- Timestamp:
- 2005-09-04T08:28:55Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8ff2f3f
- Parents:
- 005384ad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/interrupt.c
r005384ad r3396f59 38 38 #include <arch.h> 39 39 #include <symtab.h> 40 #include <arch/asm.h> 40 41 41 #define PRINT_INFO_ERRCODE( x) { \42 #define PRINT_INFO_ERRCODE(n,x) { \ 42 43 char *symbol = get_symtab_entry(stack[1]); \ 43 44 if (!symbol) \ 44 45 symbol = ""; \ 45 printf("----- -----------EXCEPTION OCCURED----------------\n"); \46 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \ 46 47 printf("%%rip: %Q (%s)\n",x[1],symbol); \ 47 48 printf("ERROR_WORD=%Q\n", x[0]); \ 48 printf("%%rcs=%Q,flags=%Q\n", x[2], x[3]); \ 49 printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",x[-1],x[-2],x[-3]); \ 50 printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",x[-4],x[-5],x[-6]); \ 51 printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",x[-7],x[-8],x[-9]); \ 52 printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",x[-10],x[-11],x[-12]); \ 53 printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",x[-13],x[-14],x); \ 49 printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", x[2], x[3],read_cr0()); \ 50 printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",x[-2],x[-3],x[-4]); \ 51 printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",x[-5],x[-6],x[-7]); \ 52 printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",x[-8],x[-9],x[-10]); \ 53 printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",x[-11],x[-12],x[-13]); \ 54 printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",x[-14],x[-15],x); \ 55 printf("%%rbp=%Q\n",x[-1]); \ 54 56 printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]); \ 55 57 printf(" %Q, %Q, %Q\n", x[8], x[9], x[10]); \ 58 printf(" %Q, %Q, %Q\n", x[11], x[12], x[13]); \ 59 printf(" %Q, %Q, %Q\n", x[14], x[15], x[16]); \ 60 printf(" %Q, %Q, %Q\n", x[17], x[18], x[19]); \ 61 printf(" %Q, %Q, %Q\n", x[20], x[21], x[22]); \ 62 printf(" %Q, %Q, %Q\n", x[23], x[24], x[25]); \ 56 63 } 57 64 … … 91 98 void null_interrupt(__u8 n, __native stack[]) 92 99 { 93 printf("----------------EXCEPTION OCCURED----------------\n"); 94 printf("int %d: null_interrupt\n", n); 100 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \ 95 101 printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]); 96 102 panic("unserviced interrupt\n"); … … 99 105 void gp_fault(__u8 n, __native stack[]) 100 106 { 101 PRINT_INFO_ERRCODE( stack);107 PRINT_INFO_ERRCODE(n,stack); 102 108 panic("general protection fault\n"); 103 109 } … … 105 111 void ss_fault(__u8 n, __native stack[]) 106 112 { 107 PRINT_INFO_ERRCODE( stack);113 PRINT_INFO_ERRCODE(n,stack); 108 114 panic("stack fault\n"); 109 115 } … … 113 119 { 114 120 reset_TS_flag(); 115 if ((CPU->fpu_owner)!=NULL) { 116 fpu_lazy_context_save(&((CPU->fpu_owner)->saved_fpu_context)); 117 (CPU->fpu_owner)->fpu_context_engaged=0; /* don't prevent migration */ 121 if (CPU->fpu_owner != NULL) { 122 fpu_lazy_context_save(&CPU->fpu_owner->saved_fpu_context); 123 /* don't prevent migration */ 124 CPU->fpu_owner->fpu_context_engaged=0; 118 125 } 119 if(THREAD->fpu_context_exists) fpu_lazy_context_restore(&(THREAD->saved_fpu_context)); 120 else {fpu_init();THREAD->fpu_context_exists=1;} 126 if (THREAD->fpu_context_exists) 127 fpu_lazy_context_restore(&THREAD->saved_fpu_context); 128 else { 129 fpu_init(); 130 THREAD->fpu_context_exists=1; 131 } 121 132 CPU->fpu_owner=THREAD; 122 133 } … … 126 137 void page_fault(__u8 n, __native stack[]) 127 138 { 128 PRINT_INFO_ERRCODE( stack);139 PRINT_INFO_ERRCODE(n,stack); 129 140 printf("Page fault address: %Q\n", read_cr2()); 130 141 panic("page fault\n");
Note:
See TracChangeset
for help on using the changeset viewer.