Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/src/interrupt.c

    rd99c1d2 r22a28a69  
    5757#include <putchar.h>
    5858
    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
     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
    6566
    6667static const char *vector_names_64_bundle[VECTORS_64_BUNDLE] = {
     
    132133}
    133134
    134 static void dump_interrupted_context(istate_t *istate)
    135 {
    136         const char *ifa = symtab_fmt_name_lookup(istate->cr_ifa);
    137         const char *iipa = symtab_fmt_name_lookup(istate->cr_iipa);
    138         const char *iip = symtab_fmt_name_lookup(istate->cr_iip);
    139        
    140         putchar('\n');
    141         printf("Interrupted context dump:\n");
     135void istate_decode(istate_t *istate)
     136{
    142137        printf("ar.bsp=%p\tar.bspstore=%p\n", istate->ar_bsp,
    143138            istate->ar_bspstore);
     
    149144            istate->cr_ipsr);
    150145       
    151         printf("cr.iip=%#018llx, #%d\t(%s)\n", istate->cr_iip,
    152             istate->cr_isr.ei, iip);
    153         printf("cr.iipa=%#018llx\t(%s)\n", istate->cr_iipa, iipa);
    154         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));
    155152}
    156153
     
    184181       
    185182        fault_if_from_uspace(istate, "General Exception (%s).", desc);
    186        
    187         dump_interrupted_context(istate);
    188         panic("General Exception (%s).", desc);
     183        panic_badtrap(istate, vector, "General Exception (%s).", desc);
    189184}
    190185
     
    196191        fault_if_from_uspace(istate, "Interruption: %#hx (%s).",
    197192            (uint16_t) vector, vector_to_string(vector));
    198         dump_interrupted_context(istate);
    199         panic("Interruption: %#hx (%s).", (uint16_t) vector,
    200             vector_to_string(vector));
     193        panic_badtrap(istate, vector, "Interruption: %#hx (%s).",
     194            (uint16_t) vector, vector_to_string(vector));
    201195#endif
    202196}
     
    218212                istate->cr_ipsr.ri++;
    219213        }
    220 
     214       
    221215        return syscall_handler(istate->in0, istate->in1, istate->in2,
    222216            istate->in3, istate->in4, istate->in5, istate->in6);
     
    227221        fault_if_from_uspace(istate, "Interruption: %#hx (%s).",
    228222            (uint16_t) vector, vector_to_string(vector));
    229         dump_interrupted_context(istate);
    230         panic("Interruption: %#hx (%s).", (uint16_t) vector,
    231             vector_to_string(vector));
     223        panic_badtrap(istate, vector, "Interruption: %#hx (%s).",
     224            (uint16_t) vector, vector_to_string(vector));
    232225}
    233226
    234227static void end_of_local_irq(void)
    235228{
    236         asm volatile ("mov cr.eoi=r0;;");
    237 }
    238 
     229        asm volatile (
     230                "mov cr.eoi=r0;;"
     231        );
     232}
    239233
    240234void external_interrupt(uint64_t vector, istate_t *istate)
    241235{
    242236        cr_ivr_t ivr;
    243         irq_t *irq;
    244237       
    245238        ivr.value = ivr_read();
    246239        srlz_d();
    247 
     240       
     241        irq_t *irq;
     242       
    248243        switch (ivr.vector) {
    249244        case INTERRUPT_SPURIOUS:
     
    252247#endif
    253248                break;
    254 
     249       
    255250#ifdef CONFIG_SMP
    256251        case VECTOR_TLB_SHOOTDOWN_IPI:
     
    259254                break;
    260255#endif
    261 
     256       
    262257        case INTERRUPT_TIMER:
    263258                irq = irq_dispatch_and_lock(ivr.vector);
    264259                if (irq) {
    265260                        irq->handler(irq);
    266                         spinlock_unlock(&irq->lock);
     261                        irq_spinlock_unlock(&irq->lock, false);
    267262                } else {
    268263                        panic("Unhandled Internal Timer Interrupt (%d).",
     
    283278                        if (!irq->preack)
    284279                                end_of_local_irq();
    285                         spinlock_unlock(&irq->lock);
     280                        irq_spinlock_unlock(&irq->lock, false);
    286281                } else {
    287282                        /*
Note: See TracChangeset for help on using the changeset viewer.