Changes in kernel/arch/ia64/src/interrupt.c [7e752b2:b60c582] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/interrupt.c
r7e752b2 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 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); 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); 145 155 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)); 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); 153 160 } 154 161 155 162 void general_exception(uint64_t vector, istate_t *istate) 156 163 { 157 c onst char *desc;158 164 char *desc = ""; 165 159 166 switch (istate->cr_isr.ge_code) { 160 167 case GE_ILLEGALOP: … … 180 187 break; 181 188 } 182 189 183 190 fault_if_from_uspace(istate, "General Exception (%s).", desc); 184 panic_badtrap(istate, vector, "General Exception (%s).", desc); 191 192 dump_interrupted_context(istate); 193 panic("General Exception (%s).", desc); 185 194 } 186 195 … … 192 201 fault_if_from_uspace(istate, "Interruption: %#hx (%s).", 193 202 (uint16_t) vector, vector_to_string(vector)); 194 panic_badtrap(istate, vector, "Interruption: %#hx (%s).", 195 (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)); 196 206 #endif 197 207 } … … 213 223 istate->cr_ipsr.ri++; 214 224 } 215 225 216 226 return syscall_handler(istate->in0, istate->in1, istate->in2, 217 227 istate->in3, istate->in4, istate->in5, istate->in6); … … 222 232 fault_if_from_uspace(istate, "Interruption: %#hx (%s).", 223 233 (uint16_t) vector, vector_to_string(vector)); 224 panic_badtrap(istate, vector, "Interruption: %#hx (%s).", 225 (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)); 226 237 } 227 238 228 239 static void end_of_local_irq(void) 229 240 { 230 asm volatile ( 231 "mov cr.eoi=r0;;" 232 ); 233 } 241 asm volatile ("mov cr.eoi=r0;;"); 242 } 243 234 244 235 245 void external_interrupt(uint64_t vector, istate_t *istate) 236 246 { 237 247 cr_ivr_t ivr; 248 irq_t *irq; 238 249 239 250 ivr.value = ivr_read(); 240 251 srlz_d(); 241 242 irq_t *irq; 243 252 244 253 switch (ivr.vector) { 245 254 case INTERRUPT_SPURIOUS: … … 248 257 #endif 249 258 break; 250 259 251 260 #ifdef CONFIG_SMP 252 261 case VECTOR_TLB_SHOOTDOWN_IPI: … … 255 264 break; 256 265 #endif 257 266 258 267 case INTERRUPT_TIMER: 259 268 irq = irq_dispatch_and_lock(ivr.vector); 260 269 if (irq) { 261 270 irq->handler(irq); 262 irq_spinlock_unlock(&irq->lock, false);271 spinlock_unlock(&irq->lock); 263 272 } else { 264 273 panic("Unhandled Internal Timer Interrupt (%d).", … … 279 288 if (!irq->preack) 280 289 end_of_local_irq(); 281 irq_spinlock_unlock(&irq->lock, false);290 spinlock_unlock(&irq->lock); 282 291 } else { 283 292 /*
Note:
See TracChangeset
for help on using the changeset viewer.