Rev 68 | Rev 75 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 68 | Rev 73 | ||
---|---|---|---|
Line 83... | Line 83... | ||
83 | printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack); |
83 | printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack); |
84 | printf("stack: %X, %X, %X, %X\n", stack[4], stack[5], stack[6], stack[7]); |
84 | printf("stack: %X, %X, %X, %X\n", stack[4], stack[5], stack[6], stack[7]); |
85 | panic("general protection fault\n"); |
85 | panic("general protection fault\n"); |
86 | } |
86 | } |
87 | 87 | ||
- | 88 | void nm_fault(__u8 n, __u32 stack[]) |
|
- | 89 | { |
|
- | 90 | ||
- | 91 | if (((CPU->arch).fpu_owner)!=NULL) |
|
- | 92 | { |
|
- | 93 | fpu_lazy_context_save(&(((CPU->arch).fpu_owner)->saved_fpu_context)); |
|
- | 94 | ((CPU->arch).fpu_owner)->fpu_context_engaged=0; /* Enables migration */ |
|
- | 95 | } |
|
- | 96 | ||
- | 97 | if(THREAD->fpu_context_exists) fpu_lazy_context_restore(&(THREAD->saved_fpu_context)); |
|
- | 98 | else {fpu_init();THREAD->fpu_context_exists=1;} |
|
- | 99 | ||
- | 100 | (CPU->arch).fpu_owner=THREAD; |
|
- | 101 | ||
- | 102 | reset_TS_flag(); |
|
- | 103 | ||
- | 104 | // panic("#NM fault\n"); |
|
- | 105 | } |
|
- | 106 | ||
- | 107 | ||
- | 108 | ||
88 | void page_fault(__u8 n, __u32 stack[]) |
109 | void page_fault(__u8 n, __u32 stack[]) |
89 | { |
110 | { |
90 | printf("page fault address: %X\n", cpu_read_cr2()); |
111 | printf("page fault address: %X\n", cpu_read_cr2()); |
91 | printf("stack[0]=%X, %%eip=%X, %%cs=%X, flags=%X\n", stack[0], stack[1], stack[2], stack[3]); |
112 | printf("stack[0]=%X, %%eip=%X, %%cs=%X, flags=%X\n", stack[0], stack[1], stack[2], stack[3]); |
92 | printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack); |
113 | printf("%%eax=%L, %%ebx=%L, %%ecx=%L, %%edx=%L,\n%%edi=%L, %%esi=%L, %%ebp=%L, %%esp=%L\n", stack[-2], stack[-5], stack[-3], stack[-4], stack[-9], stack[-8], stack[-1], stack); |