Changes in kernel/arch/ppc32/src/interrupt.c [22a28a69:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/interrupt.c
r22a28a69 rd99c1d2 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 =%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; 86 61 87 while ((inum = pic_get_pending()) != 255) {62 while ((inum = pic_get_pending()) != -1) { 88 63 irq_t *irq = irq_dispatch_and_lock(inum); 89 64 if (irq) { … … 105 80 } 106 81 107 irq_spinlock_unlock(&irq->lock, false);82 spinlock_unlock(&irq->lock); 108 83 } else { 109 84 /* … … 111 86 */ 112 87 #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); 115 89 #endif 116 90 } … … 118 92 } 119 93 120 static void exception_decrementer(unsigned int n, istate_t *istate) 94 95 static void exception_decrementer(int n, istate_t *istate) 121 96 { 122 97 start_decrementer(); … … 124 99 } 125 100 101 126 102 /* Initialize basic tables for exception dispatching */ 127 103 void interrupt_init(void) 128 104 { 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); 137 109 } 138 110
Note:
See TracChangeset
for help on using the changeset viewer.