Ignore:
File:
1 edited

Legend:

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

    r22a28a69 rd99c1d2  
    4444#include <print.h>
    4545
     46
    4647void start_decrementer(void)
    4748{
    4849        asm volatile (
    49                 "mtdec %[dec]\n"
    50                 :: [dec] "r" (1000)
     50                "mtdec %0\n"
     51                :
     52                : "r" (1000)
    5153        );
    5254}
    5355
    54 void istate_decode(istate_t *istate)
     56
     57/** Handler of external interrupts */
     58static void exception_external(int n, istate_t *istate)
    5559{
    56         printf("r0 =%p\tr1 =%p\tr2 =%p\n", istate->r0, istate->sp, istate->r2);
    57         printf("r3 =%p\tr4 =%p\tr5 =%p\n", istate->r3, istate->r4, istate->r5);
    58         printf("r6 =%p\tr7 =%p\tr8 =%p\n", istate->r6, istate->r7, istate->r8);
    59         printf("r9 =%p\tr10=%p\tr11=%p\n",
    60             istate->r9, istate->r10, istate->r11);
    61         printf("r12=%p\tr13=%p\tr14=%p\n",
    62             istate->r12, istate->r13, istate->r14);
    63         printf("r15=%p\tr16=%p\tr17=%p\n",
    64             istate->r15, istate->r16, istate->r17);
    65         printf("r18=%p\tr19=%p\tr20=%p\n",
    66             istate->r18, istate->r19, istate->r20);
    67         printf("r21=%p\tr22=%p\tr23=%p\n",
    68             istate->r21, istate->r22, istate->r23);
    69         printf("r24=%p\tr25=%p\tr26=%p\n",
    70             istate->r24, istate->r25, istate->r26);
    71         printf("r27=%p\tr28=%p\tr29=%p\n",
    72             istate->r27, istate->r28, istate->r29);
    73         printf("r30=%p\tr31=%p\n", istate->r30, istate->r31);
    74         printf("cr =%p\tpc =%p\tlr =%p\n", istate->cr, istate->pc, istate->lr);
    75         printf("ctr=%p\txer=%p\tdar=%p\n",
    76             istate->ctr, istate->xer, istate->dar);
    77         printf("srr1=%p\n", istate->srr1);
    78 }
    79 
    80 /** External interrupts handler
    81  *
    82  */
    83 static void exception_external(unsigned int n, istate_t *istate)
    84 {
    85         uint8_t inum;
     60        int inum;
    8661       
    87         while ((inum = pic_get_pending()) != 255) {
     62        while ((inum = pic_get_pending()) != -1) {
    8863                irq_t *irq = irq_dispatch_and_lock(inum);
    8964                if (irq) {
     
    10580                        }
    10681                       
    107                         irq_spinlock_unlock(&irq->lock, false);
     82                        spinlock_unlock(&irq->lock);
    10883                } else {
    10984                        /*
     
    11186                         */
    11287#ifdef CONFIG_DEBUG
    113                         printf("cpu%" PRIs ": spurious interrupt (inum=%" PRIu8 ")\n",
    114                             CPU->id, inum);
     88                        printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum);
    11589#endif
    11690                }
     
    11892}
    11993
    120 static void exception_decrementer(unsigned int n, istate_t *istate)
     94
     95static void exception_decrementer(int n, istate_t *istate)
    12196{
    12297        start_decrementer();
     
    12499}
    125100
     101
    126102/* Initialize basic tables for exception dispatching */
    127103void interrupt_init(void)
    128104{
    129         exc_register(VECTOR_DATA_STORAGE, "data_storage", true,
    130             pht_refill);
    131         exc_register(VECTOR_INSTRUCTION_STORAGE, "instruction_storage", true,
    132             pht_refill);
    133         exc_register(VECTOR_EXTERNAL, "external", true,
    134             exception_external);
    135         exc_register(VECTOR_DECREMENTER, "timer", true,
    136             exception_decrementer);
     105        exc_register(VECTOR_DATA_STORAGE, "data_storage", pht_refill);
     106        exc_register(VECTOR_INSTRUCTION_STORAGE, "instruction_storage", pht_refill);
     107        exc_register(VECTOR_EXTERNAL, "external", exception_external);
     108        exc_register(VECTOR_DECREMENTER, "timer", exception_decrementer);
    137109}
    138110
Note: See TracChangeset for help on using the changeset viewer.