Rev 1787 | Rev 1888 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1882 | ||
---|---|---|---|
Line 155... | Line 155... | ||
155 | void general_exception(uint64_t vector, istate_t *istate) |
155 | void general_exception(uint64_t vector, istate_t *istate) |
156 | { |
156 | { |
157 | char *desc = ""; |
157 | char *desc = ""; |
158 | 158 | ||
159 | switch (istate->cr_isr.ge_code) { |
159 | switch (istate->cr_isr.ge_code) { |
160 | case GE_ILLEGALOP: |
160 | case GE_ILLEGALOP: |
161 | desc = "Illegal Operation fault"; |
161 | desc = "Illegal Operation fault"; |
162 | break; |
162 | break; |
163 | case GE_PRIVOP: |
163 | case GE_PRIVOP: |
164 | desc = "Privileged Operation fault"; |
164 | desc = "Privileged Operation fault"; |
165 | break; |
165 | break; |
166 | case GE_PRIVREG: |
166 | case GE_PRIVREG: |
167 | desc = "Privileged Register fault"; |
167 | desc = "Privileged Register fault"; |
168 | break; |
168 | break; |
169 | case GE_RESREGFLD: |
169 | case GE_RESREGFLD: |
170 | desc = "Reserved Register/Field fault"; |
170 | desc = "Reserved Register/Field fault"; |
171 | break; |
171 | break; |
172 | case GE_DISBLDISTRAN: |
172 | case GE_DISBLDISTRAN: |
173 | desc = "Disabled Instruction Set Transition fault"; |
173 | desc = "Disabled Instruction Set Transition fault"; |
174 | break; |
174 | break; |
175 | case GE_ILLEGALDEP: |
175 | case GE_ILLEGALDEP: |
176 | desc = "Illegal Dependency fault"; |
176 | desc = "Illegal Dependency fault"; |
177 | break; |
177 | break; |
178 | default: |
178 | default: |
179 | desc = "unknown"; |
179 | desc = "unknown"; |
180 | break; |
180 | break; |
181 | } |
181 | } |
182 | 182 | ||
183 | fault_if_from_uspace(istate, "General Exception (%s)", desc); |
183 | fault_if_from_uspace(istate, "General Exception (%s)", desc); |
184 | 184 | ||
185 | dump_interrupted_context(istate); |
185 | dump_interrupted_context(istate); |
186 | panic("General Exception (%s)\n", desc); |
186 | panic("General Exception (%s)\n", desc); |
187 | } |
187 | } |
188 | 188 | ||
189 | void fpu_enable(void); |
- | |
190 | - | ||
191 | void disabled_fp_register(uint64_t vector, istate_t *istate) |
189 | void disabled_fp_register(uint64_t vector, istate_t *istate) |
192 | { |
190 | { |
193 | #ifdef CONFIG_FPU_LAZY |
191 | #ifdef CONFIG_FPU_LAZY |
194 | scheduler_fpu_lazy_request(); |
192 | scheduler_fpu_lazy_request(); |
195 | #else |
193 | #else |
Line 203... | Line 201... | ||
203 | void nop_handler(uint64_t vector, istate_t *istate) |
201 | void nop_handler(uint64_t vector, istate_t *istate) |
204 | { |
202 | { |
205 | } |
203 | } |
206 | 204 | ||
207 | 205 | ||
208 | - | ||
209 | /** Handle syscall. */ |
206 | /** Handle syscall. */ |
210 | int break_instruction(uint64_t vector, istate_t *istate) |
207 | int break_instruction(uint64_t vector, istate_t *istate) |
211 | { |
208 | { |
212 | /* |
209 | /* |
213 | * Move to next instruction after BREAK. |
210 | * Move to next instruction after BREAK. |
Line 240... | Line 237... | ||
240 | 237 | ||
241 | ivr.value = ivr_read(); |
238 | ivr.value = ivr_read(); |
242 | srlz_d(); |
239 | srlz_d(); |
243 | 240 | ||
244 | switch(ivr.vector) { |
241 | switch(ivr.vector) { |
245 | case INTERRUPT_TIMER: |
242 | case INTERRUPT_TIMER: |
246 | it_interrupt(); |
243 | it_interrupt(); |
247 | break; |
244 | break; |
248 | case INTERRUPT_SPURIOUS: |
245 | case INTERRUPT_SPURIOUS: |
249 | printf("cpu%d: spurious interrupt\n", CPU->id); |
246 | printf("cpu%d: spurious interrupt\n", CPU->id); |
250 | break; |
247 | break; |
251 | default: |
248 | default: |
252 | panic("\nUnhandled External Interrupt Vector %d\n", ivr.vector); |
249 | panic("\nUnhandled External Interrupt Vector %d\n", ivr.vector); |
253 | break; |
250 | break; |
254 | } |
251 | } |
255 | } |
252 | } |
256 | 253 | ||
257 | void virtual_interrupt(uint64_t irq,void *param) |
254 | void virtual_interrupt(uint64_t irq, void *param) |
258 | { |
255 | { |
259 | switch(irq) { |
256 | switch(irq) { |
260 | case IRQ_KBD: |
257 | case IRQ_KBD: |
- | 258 | if (kbd_uspace) |
|
261 | if(kbd_uspace) ipc_irq_send_notif(irq); |
259 | ipc_irq_send_notif(irq); |
262 | break; |
260 | break; |
263 | default: |
261 | default: |
264 | panic("\nUnhandled Virtual Interrupt request %d\n", irq); |
262 | panic("\nUnhandled Virtual Interrupt request %d\n", irq); |
265 | break; |
263 | break; |
266 | } |
264 | } |
267 | } |
265 | } |
268 | 266 | ||
269 | /* Reregister irq to be IPC-ready */ |
267 | /* Reregister irq to be IPC-ready */ |
270 | void irq_ipc_bind_arch(unative_t irq) |
268 | void irq_ipc_bind_arch(unative_t irq) |
271 | { |
269 | { |
272 | if(irq==IRQ_KBD) { |
270 | if(irq == IRQ_KBD) { |
273 | kbd_uspace=1; |
271 | kbd_uspace = 1; |
274 | return; |
272 | return; |
275 | } |
273 | } |
276 | return; |
274 | return; |
277 | panic("not implemented\n"); |
275 | panic("not implemented\n"); |
278 | /* TODO */ |
276 | /* TODO */ |
279 | } |
277 | } |
280 | 278 | ||
281 | /** @} |
279 | /** @} |
282 | */ |
280 | */ |
283 | - |