Rev 1196 | Rev 1258 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1196 | Rev 1256 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | #include <arch.h> |
39 | #include <arch.h> |
| 40 | #include <symtab.h> |
40 | #include <symtab.h> |
| 41 | #include <arch/asm.h> |
41 | #include <arch/asm.h> |
| 42 | #include <proc/scheduler.h> |
42 | #include <proc/scheduler.h> |
| 43 | #include <proc/thread.h> |
43 | #include <proc/thread.h> |
| - | 44 | #include <proc/task.h> |
|
| - | 45 | #include <synch/spinlock.h> |
|
| - | 46 | #include <arch/ddi/ddi.h> |
|
| 44 | 47 | ||
| 45 | void print_info_errcode(int n, istate_t *istate) |
48 | void print_info_errcode(int n, istate_t *istate) |
| 46 | { |
49 | { |
| 47 | char *symbol; |
50 | char *symbol; |
| 48 | /* __u64 *x = &istate->stack[0]; */ |
51 | /* __u64 *x = &istate->stack[0]; */ |
| Line 76... | Line 79... | ||
| 76 | { |
79 | { |
| 77 | print_info_errcode(n, istate); |
80 | print_info_errcode(n, istate); |
| 78 | panic("unserviced interrupt\n"); |
81 | panic("unserviced interrupt\n"); |
| 79 | } |
82 | } |
| 80 | 83 | ||
| - | 84 | /** General Protection Fault. */ |
|
| 81 | void gp_fault(int n, istate_t *istate) |
85 | void gp_fault(int n, istate_t *istate) |
| 82 | { |
86 | { |
| - | 87 | if (TASK) { |
|
| - | 88 | count_t ver; |
|
| - | 89 | ||
| - | 90 | spinlock_lock(&TASK->lock); |
|
| - | 91 | ver = TASK->arch.iomapver; |
|
| - | 92 | spinlock_unlock(&TASK->lock); |
|
| - | 93 | ||
| - | 94 | if (CPU->arch.iomapver_copy != ver) { |
|
| - | 95 | /* |
|
| - | 96 | * This fault can be caused by an early access |
|
| - | 97 | * to I/O port because of an out-dated |
|
| - | 98 | * I/O Permission bitmap installed on CPU. |
|
| - | 99 | * Install the fresh copy and restart |
|
| - | 100 | * the instruction. |
|
| - | 101 | */ |
|
| - | 102 | io_perm_bitmap_install(); |
|
| - | 103 | return; |
|
| - | 104 | } |
|
| - | 105 | } |
|
| - | 106 | ||
| 83 | print_info_errcode(n, istate); |
107 | print_info_errcode(n, istate); |
| 84 | panic("general protection fault\n"); |
108 | panic("general protection fault\n"); |
| 85 | } |
109 | } |
| 86 | 110 | ||
| 87 | void ss_fault(int n, istate_t *istate) |
111 | void ss_fault(int n, istate_t *istate) |