Changes in kernel/arch/ia64/src/interrupt.c [22a28a69:b60c582] in mainline
- File:
-
- 1 edited
-
kernel/arch/ia64/src/interrupt.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/interrupt.c
r22a28a69 rb60c582 41 41 #include <debug.h> 42 42 #include <console/console.h> 43 #include < typedefs.h>43 #include <arch/types.h> 44 44 #include <arch/asm.h> 45 45 #include <arch/barrier.h> … … 57 57 #include <putchar.h> 58 58 59 #define VECTORS_64_BUNDLE 20 60 #define VECTORS_16_BUNDLE 48 61 #define VECTORS_16_BUNDLE_START 0x5000 62 63 #define VECTOR_MAX 0x7f00 64 65 #define BUNDLE_SIZE 16 66 67 static const char *vector_names_64_bundle[VECTORS_64_BUNDLE] = { 59 #define VECTORS_64_BUNDLE 20 60 #define VECTORS_16_BUNDLE 48 61 #define VECTORS_16_BUNDLE_START 0x5000 62 #define VECTOR_MAX 0x7f00 63 64 #define BUNDLE_SIZE 16 65 66 char *vector_names_64_bundle[VECTORS_64_BUNDLE] = { 68 67 "VHPT Translation vector", 69 68 "Instruction TLB vector", … … 88 87 }; 89 88 90 static constchar *vector_names_16_bundle[VECTORS_16_BUNDLE] = {89 char *vector_names_16_bundle[VECTORS_16_BUNDLE] = { 91 90 "Page Not Present vector", 92 91 "Key Permission vector", … … 122 121 }; 123 122 124 static const char *vector_to_string(uint16_t vector) 123 static char *vector_to_string(uint16_t vector); 124 static void dump_interrupted_context(istate_t *istate); 125 126 char *vector_to_string(uint16_t vector) 125 127 { 126 128 ASSERT(vector <= VECTOR_MAX); … … 133 135 } 134 136 135 void istate_decode(istate_t *istate) 136 { 137 void dump_interrupted_context(istate_t *istate) 138 { 139 char *ifa, *iipa, *iip; 140 141 ifa = symtab_fmt_name_lookup(istate->cr_ifa); 142 iipa = symtab_fmt_name_lookup(istate->cr_iipa); 143 iip = symtab_fmt_name_lookup(istate->cr_iip); 144 145 putchar('\n'); 146 printf("Interrupted context dump:\n"); 137 147 printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp, 138 148 istate->ar_bspstore); … … 144 154 istate->cr_ipsr); 145 155 146 printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei, 147 symtab_fmt_name_lookup(istate->cr_iip)); 148 printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa, 149 symtab_fmt_name_lookup(istate->cr_iipa)); 150 printf("cr.ifa=%#018llx\t(%s)\n", istate->cr_ifa, 151 symtab_fmt_name_lookup(istate->cr_ifa)); 156 printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip, 157 istate->cr_isr.ei, iip); 158 printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa, iipa); 159 printf("cr.ifa=%#018llx\t(%s)\n", istate->cr_ifa, ifa); 152 160 } 153 161 154 162 void general_exception(uint64_t vector, istate_t *istate) 155 163 { 156 c onst char *desc;157 164 char *desc = ""; 165 158 166 switch (istate->cr_isr.ge_code) { 159 167 case GE_ILLEGALOP: … … 179 187 break; 180 188 } 181 189 182 190 fault_if_from_uspace(istate, "General Exception (%s).", desc); 183 panic_badtrap(istate, vector, "General Exception (%s).", desc); 191 192 dump_interrupted_context(istate); 193 panic("General Exception (%s).", desc); 184 194 } 185 195 … … 191 201 fault_if_from_uspace(istate, "Interruption: %#hx (%s).", 192 202 (uint16_t) vector, vector_to_string(vector)); 193 panic_badtrap(istate, vector, "Interruption: %#hx (%s).", 194 (uint16_t) vector, vector_to_string(vector)); 203 dump_interrupted_context(istate); 204 panic("Interruption: %#hx (%s).", (uint16_t) vector, 205 vector_to_string(vector)); 195 206 #endif 196 207 } … … 212 223 istate->cr_ipsr.ri++; 213 224 } 214 225 215 226 return syscall_handler(istate->in0, istate->in1, istate->in2, 216 227 istate->in3, istate->in4, istate->in5, istate->in6); … … 221 232 fault_if_from_uspace(istate, "Interruption: %#hx (%s).", 222 233 (uint16_t) vector, vector_to_string(vector)); 223 panic_badtrap(istate, vector, "Interruption: %#hx (%s).", 224 (uint16_t) vector, vector_to_string(vector)); 234 dump_interrupted_context(istate); 235 panic("Interruption: %#hx (%s).", (uint16_t) vector, 236 vector_to_string(vector)); 225 237 } 226 238 227 239 static void end_of_local_irq(void) 228 240 { 229 asm volatile ( 230 "mov cr.eoi=r0;;" 231 ); 232 } 241 asm volatile ("mov cr.eoi=r0;;"); 242 } 243 233 244 234 245 void external_interrupt(uint64_t vector, istate_t *istate) 235 246 { 236 247 cr_ivr_t ivr; 248 irq_t *irq; 237 249 238 250 ivr.value = ivr_read(); 239 251 srlz_d(); 240 241 irq_t *irq; 242 252 243 253 switch (ivr.vector) { 244 254 case INTERRUPT_SPURIOUS: … … 247 257 #endif 248 258 break; 249 259 250 260 #ifdef CONFIG_SMP 251 261 case VECTOR_TLB_SHOOTDOWN_IPI: … … 254 264 break; 255 265 #endif 256 266 257 267 case INTERRUPT_TIMER: 258 268 irq = irq_dispatch_and_lock(ivr.vector); 259 269 if (irq) { 260 270 irq->handler(irq); 261 irq_spinlock_unlock(&irq->lock, false);271 spinlock_unlock(&irq->lock); 262 272 } else { 263 273 panic("Unhandled Internal Timer Interrupt (%d).", … … 278 288 if (!irq->preack) 279 289 end_of_local_irq(); 280 irq_spinlock_unlock(&irq->lock, false);290 spinlock_unlock(&irq->lock); 281 291 } else { 282 292 /*
Note:
See TracChangeset
for help on using the changeset viewer.
