Rev 1735 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1735 | Rev 1780 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | #include <ipc/irq.h> |
54 | #include <ipc/irq.h> |
55 | 55 | ||
56 | void print_info_errcode(int n, istate_t *istate) |
56 | void print_info_errcode(int n, istate_t *istate) |
57 | { |
57 | { |
58 | char *symbol; |
58 | char *symbol; |
59 | /* __u64 *x = &istate->stack[0]; */ |
59 | /* uint64_t *x = &istate->stack[0]; */ |
60 | 60 | ||
61 | if (!(symbol=get_symtab_entry(istate->rip))) |
61 | if (!(symbol=get_symtab_entry(istate->rip))) |
62 | symbol = ""; |
62 | symbol = ""; |
63 | 63 | ||
64 | printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n, __FUNCTION__); |
64 | printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n, __FUNCTION__); |
Line 77... | Line 77... | ||
77 | 77 | ||
78 | /* |
78 | /* |
79 | * Interrupt and exception dispatching. |
79 | * Interrupt and exception dispatching. |
80 | */ |
80 | */ |
81 | 81 | ||
82 | void (* disable_irqs_function)(__u16 irqmask) = NULL; |
82 | void (* disable_irqs_function)(uint16_t irqmask) = NULL; |
83 | void (* enable_irqs_function)(__u16 irqmask) = NULL; |
83 | void (* enable_irqs_function)(uint16_t irqmask) = NULL; |
84 | void (* eoi_function)(void) = NULL; |
84 | void (* eoi_function)(void) = NULL; |
85 | 85 | ||
86 | void null_interrupt(int n, istate_t *istate) |
86 | void null_interrupt(int n, istate_t *istate) |
87 | { |
87 | { |
88 | fault_if_from_uspace(istate, "unserviced interrupt: %d", n); |
88 | fault_if_from_uspace(istate, "unserviced interrupt: %d", n); |
Line 139... | Line 139... | ||
139 | { |
139 | { |
140 | trap_virtual_eoi(); |
140 | trap_virtual_eoi(); |
141 | tlb_shootdown_ipi_recv(); |
141 | tlb_shootdown_ipi_recv(); |
142 | } |
142 | } |
143 | 143 | ||
144 | void trap_virtual_enable_irqs(__u16 irqmask) |
144 | void trap_virtual_enable_irqs(uint16_t irqmask) |
145 | { |
145 | { |
146 | if (enable_irqs_function) |
146 | if (enable_irqs_function) |
147 | enable_irqs_function(irqmask); |
147 | enable_irqs_function(irqmask); |
148 | else |
148 | else |
149 | panic("no enable_irqs_function\n"); |
149 | panic("no enable_irqs_function\n"); |
150 | } |
150 | } |
151 | 151 | ||
152 | void trap_virtual_disable_irqs(__u16 irqmask) |
152 | void trap_virtual_disable_irqs(uint16_t irqmask) |
153 | { |
153 | { |
154 | if (disable_irqs_function) |
154 | if (disable_irqs_function) |
155 | disable_irqs_function(irqmask); |
155 | disable_irqs_function(irqmask); |
156 | else |
156 | else |
157 | panic("no disable_irqs_function\n"); |
157 | panic("no disable_irqs_function\n"); |
Line 172... | Line 172... | ||
172 | trap_virtual_eoi(); |
172 | trap_virtual_eoi(); |
173 | } |
173 | } |
174 | 174 | ||
175 | 175 | ||
176 | /* Reregister irq to be IPC-ready */ |
176 | /* Reregister irq to be IPC-ready */ |
177 | void irq_ipc_bind_arch(__native irq) |
177 | void irq_ipc_bind_arch(unative_t irq) |
178 | { |
178 | { |
179 | if (irq == IRQ_CLK) |
179 | if (irq == IRQ_CLK) |
180 | return; |
180 | return; |
181 | exc_register(IVT_IRQBASE+irq, "ipc_int", ipc_int); |
181 | exc_register(IVT_IRQBASE+irq, "ipc_int", ipc_int); |
182 | trap_virtual_enable_irqs(1 << irq); |
182 | trap_virtual_enable_irqs(1 << irq); |