Ignore:
File:
1 edited

Legend:

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

    rd99c1d2 r22a28a69  
    4444#include <print.h>
    4545
    46 
    4746void start_decrementer(void)
    4847{
    4948        asm volatile (
    50                 "mtdec %0\n"
    51                 :
    52                 : "r" (1000)
     49                "mtdec %[dec]\n"
     50                :: [dec] "r" (1000)
    5351        );
    5452}
    5553
     54void istate_decode(istate_t *istate)
     55{
     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}
    5679
    57 /** Handler of external interrupts */
    58 static void exception_external(int n, istate_t *istate)
     80/** External interrupts handler
     81 *
     82 */
     83static void exception_external(unsigned int n, istate_t *istate)
    5984{
    60         int inum;
     85        uint8_t inum;
    6186       
    62         while ((inum = pic_get_pending()) != -1) {
     87        while ((inum = pic_get_pending()) != 255) {
    6388                irq_t *irq = irq_dispatch_and_lock(inum);
    6489                if (irq) {
     
    80105                        }
    81106                       
    82                         spinlock_unlock(&irq->lock);
     107                        irq_spinlock_unlock(&irq->lock, false);
    83108                } else {
    84109                        /*
     
    86111                         */
    87112#ifdef CONFIG_DEBUG
    88                         printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum);
     113                        printf("cpu%" PRIs ": spurious interrupt (inum=%" PRIu8 ")\n",
     114                            CPU->id, inum);
    89115#endif
    90116                }
     
    92118}
    93119
    94 
    95 static void exception_decrementer(int n, istate_t *istate)
     120static void exception_decrementer(unsigned int n, istate_t *istate)
    96121{
    97122        start_decrementer();
     
    99124}
    100125
    101 
    102126/* Initialize basic tables for exception dispatching */
    103127void interrupt_init(void)
    104128{
    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);
     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);
    109137}
    110138
Note: See TracChangeset for help on using the changeset viewer.