Changes in kernel/arch/ppc32/src/interrupt.c [7e752b2:c2417bc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/interrupt.c
r7e752b2 rc2417bc 36 36 #include <interrupt.h> 37 37 #include <arch/interrupt.h> 38 #include < typedefs.h>38 #include <arch/types.h> 39 39 #include <arch.h> 40 40 #include <time/clock.h> … … 44 44 #include <print.h> 45 45 46 46 47 void start_decrementer(void) 47 48 { 48 49 asm volatile ( 49 "mtdec %[dec]\n" 50 :: [dec] "r" (1000) 50 "mtdec %0\n" 51 : 52 : "r" (1000) 51 53 ); 52 54 } 53 55 54 void istate_decode(istate_t *istate) 56 57 /** Handler of external interrupts */ 58 static void exception_external(int n, istate_t *istate) 55 59 { 56 printf("r0 =%#0" PRIx32 "\tr1 =%p\tr2 =%#0" PRIx32 "\n", 57 istate->r0, (void *) istate->sp, istate->r2); 60 int inum; 58 61 59 printf("r3 =%#0" PRIx32 "\tr4 =%#0" PRIx32 "\tr5 =%#0" PRIx32 "\n", 60 istate->r3, istate->r4, istate->r5); 61 62 printf("r6 =%#0" PRIx32 "\tr7 =%#0" PRIx32 "\tr8 =%#0" PRIx32 "\n", 63 istate->r6, istate->r7, istate->r8); 64 65 printf("r9 =%#0" PRIx32 "\tr10=%#0" PRIx32 "\tr11=%#0" PRIx32 "\n", 66 istate->r9, istate->r10, istate->r11); 67 68 printf("r12=%#0" PRIx32 "\tr13=%#0" PRIx32 "\tr14=%#0" PRIx32 "\n", 69 istate->r12, istate->r13, istate->r14); 70 71 printf("r15=%#0" PRIx32 "\tr16=%#0" PRIx32 "\tr17=%#0" PRIx32 "\n", 72 istate->r15, istate->r16, istate->r17); 73 74 printf("r18=%#0" PRIx32 "\tr19=%#0" PRIx32 "\tr20=%#0" PRIx32 "\n", 75 istate->r18, istate->r19, istate->r20); 76 77 printf("r21=%#0" PRIx32 "\tr22=%#0" PRIx32 "\tr23=%#0" PRIx32 "\n", 78 istate->r21, istate->r22, istate->r23); 79 80 printf("r24=%#0" PRIx32 "\tr25=%#0" PRIx32 "\tr26=%#0" PRIx32 "\n", 81 istate->r24, istate->r25, istate->r26); 82 83 printf("r27=%#0" PRIx32 "\tr28=%#0" PRIx32 "\tr29=%#0" PRIx32 "\n", 84 istate->r27, istate->r28, istate->r29); 85 86 printf("r30=%#0" PRIx32 "\tr31=%#0" PRIx32 "\n", 87 istate->r30, istate->r31); 88 89 printf("cr =%#0" PRIx32 "\tpc =%p\tlr =%p\n", 90 istate->cr, (void *) istate->pc, (void *) istate->lr); 91 92 printf("ctr=%#0" PRIx32 "\txer=%#0" PRIx32 "\tdar=%#0" PRIx32 "\n", 93 istate->ctr, istate->xer, istate->dar); 94 95 printf("srr1=%p\n", (void *) istate->srr1); 96 } 97 98 /** External interrupts handler 99 * 100 */ 101 static void exception_external(unsigned int n, istate_t *istate) 102 { 103 uint8_t inum; 104 105 while ((inum = pic_get_pending()) != 255) { 62 while ((inum = pic_get_pending()) != -1) { 106 63 irq_t *irq = irq_dispatch_and_lock(inum); 107 64 if (irq) { … … 123 80 } 124 81 125 irq_spinlock_unlock(&irq->lock, false);82 spinlock_unlock(&irq->lock); 126 83 } else { 127 84 /* … … 129 86 */ 130 87 #ifdef CONFIG_DEBUG 131 printf("cpu%u: spurious interrupt (inum=%" PRIu8 ")\n", 132 CPU->id, inum); 88 printf("cpu%u: spurious interrupt (inum=%d)\n", CPU->id, inum); 133 89 #endif 134 90 } … … 136 92 } 137 93 138 static void exception_decrementer(unsigned int n, istate_t *istate) 94 95 static void exception_decrementer(int n, istate_t *istate) 139 96 { 140 97 start_decrementer(); … … 142 99 } 143 100 101 144 102 /* Initialize basic tables for exception dispatching */ 145 103 void interrupt_init(void) 146 104 { 147 exc_register(VECTOR_DATA_STORAGE, "data_storage", true, 148 pht_refill); 149 exc_register(VECTOR_INSTRUCTION_STORAGE, "instruction_storage", true, 150 pht_refill); 151 exc_register(VECTOR_EXTERNAL, "external", true, 152 exception_external); 153 exc_register(VECTOR_DECREMENTER, "timer", true, 154 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); 155 109 } 156 110
Note:
See TracChangeset
for help on using the changeset viewer.