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