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