Changeset 49a39c2 in mainline for arch/amd64/src/interrupt.c
- Timestamp:
- 2006-02-06T21:14:29Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a1da55
- Parents:
- 7febdde5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/interrupt.c
r7febdde5 r49a39c2 59 59 } 60 60 */ 61 static void print_info_errcode(int n, void *st) 61 62 static void print_info_errcode(int n, struct interrupt_context *ctx) 62 63 { 63 64 char *symbol; 64 __ native *x = (__native *) st;65 __u64 *x = &ctx->stack[0]; 65 66 66 67 if (!(symbol=get_symtab_entry(x[1]))) … … 68 69 69 70 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); 70 printf("%%rip: %Q (%s)\n",x[1],symbol); 71 printf("ERROR_WORD=%Q\n", x[0]); 72 printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", x[2], x[3],read_cr0()); 73 printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",x[-2],x[-3],x[-4]); 74 printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",x[-5],x[-6],x[-7]); 75 printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",x[-8],x[-9],x[-10]); 76 printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",x[-11],x[-12],x[-13]); 77 printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",x[-14],x[-15],x); 78 printf("%%rbp=%Q\n",x[-1]); 71 printf("%%rip: %Q (%s)\n",ctx->stack[1],symbol); 72 printf("ERROR_WORD=%Q\n", ctx->stack[0]); 73 printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", ctx->stack[2], 74 ctx->stack[3],read_cr0()); 75 printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",ctx->rax,ctx->rbx,ctx->rcx); 76 printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",ctx->rdx,ctx->rsi,ctx->rdi); 77 printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",ctx->r8,ctx->r9,ctx->r10); 78 printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",ctx->r11,ctx->r12,ctx->r13); 79 printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",ctx->r14,ctx->r15,&ctx->stack[0]); 80 printf("%%rbp=%Q\n",ctx->rbp); 79 81 printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]); 80 82 printf(" %Q, %Q, %Q\n", x[8], x[9], x[10]); 81 83 printf(" %Q, %Q, %Q\n", x[11], x[12], x[13]); 82 84 printf(" %Q, %Q, %Q\n", x[14], x[15], x[16]); 83 printf(" %Q, %Q, %Q\n", x[17], x[18], x[19]);84 printf(" %Q, %Q, %Q\n", x[20], x[21], x[22]);85 printf(" %Q, %Q, %Q\n", x[23], x[24], x[25]);86 85 // messy_stack_trace(&x[5]); 87 86 } … … 95 94 void (* eoi_function)(void) = NULL; 96 95 97 void null_interrupt(int n, void *st)96 void null_interrupt(int n, struct interrupt_context *ctx) 98 97 { 99 __native *stack = (__native *) st;100 101 98 printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \ 102 printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]); 99 printf("stack: %X, %X, %X, %X\n", ctx->stack[0], ctx->stack[1], 100 ctx->stack[2], ctx->stack[3]); 103 101 panic("unserviced interrupt\n"); 104 102 } … … 126 124 } 127 125 128 void page_fault(int n, void *stack)126 void page_fault(int n, struct interrupt_context *ctx) 129 127 { 130 128 __address page; … … 132 130 page = read_cr2(); 133 131 if (!as_page_fault(page)) { 134 print_info_errcode(n, stack);132 print_info_errcode(n,ctx); 135 133 printf("Page fault address: %Q\n", page); 136 134 panic("page fault\n"); 137 135 } 138 }139 140 void syscall(int n, void *stack)141 {142 printf("cpu%d: syscall\n", CPU->id);143 thread_usleep(1000);144 136 } 145 137
Note:
See TracChangeset
for help on using the changeset viewer.