Changes in kernel/arch/ppc32/src/interrupt.c [9d58539:df7f5cea] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/src/interrupt.c
r9d58539 rdf7f5cea 36 36 #include <interrupt.h> 37 37 #include <arch/interrupt.h> 38 #include <arch/istate.h> 38 39 #include <typedefs.h> 39 40 #include <arch.h> 40 #include <time/clock.h>41 41 #include <ipc/sysipc.h> 42 42 #include <arch/drivers/pic.h> … … 44 44 #include <arch/mm/pht.h> 45 45 #include <print.h> 46 #include <log.h> 46 47 47 void start_decrementer(void) 48 static uint32_t decrementer_value; 49 50 void decrementer_start(uint32_t val) 51 { 52 decrementer_value = val; 53 decrementer_restart(); 54 } 55 56 void decrementer_restart(void) 48 57 { 49 58 asm volatile ( 50 59 "mtdec %[dec]\n" 51 :: [dec] "r" ( 1000)60 :: [dec] "r" (decrementer_value) 52 61 ); 53 62 } … … 55 64 void istate_decode(istate_t *istate) 56 65 { 57 printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t"66 log_printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t" 58 67 "r2 =%0#10" PRIx32 "\n", istate->r0, istate->sp, istate->r2); 59 68 60 printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t"69 log_printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t" 61 70 "r5 =%0#10" PRIx32 "\n", istate->r3, istate->r4, istate->r5); 62 71 63 printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t"72 log_printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t" 64 73 "r8 =%0#10" PRIx32 "\n", istate->r6, istate->r7, istate->r8); 65 74 66 printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t"75 log_printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t" 67 76 "r11=%0#10" PRIx32 "\n", istate->r9, istate->r10, istate->r11); 68 77 69 printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t"78 log_printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t" 70 79 "r14=%0#10" PRIx32 "\n", istate->r12, istate->r13, istate->r14); 71 80 72 printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t"81 log_printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t" 73 82 "r17=%0#10" PRIx32 "\n", istate->r15, istate->r16, istate->r17); 74 83 75 printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t"84 log_printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t" 76 85 "r20=%0#10" PRIx32 "\n", istate->r18, istate->r19, istate->r20); 77 86 78 printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t"87 log_printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t" 79 88 "r23=%0#10" PRIx32 "\n", istate->r21, istate->r22, istate->r23); 80 89 81 printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t"90 log_printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t" 82 91 "r26=%0#10" PRIx32 "\n", istate->r24, istate->r25, istate->r26); 83 92 84 printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t"93 log_printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t" 85 94 "r29=%0#10" PRIx32 "\n", istate->r27, istate->r28, istate->r29); 86 95 87 printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n",96 log_printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n", 88 97 istate->r30, istate->r31); 89 98 90 printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t"99 log_printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t" 91 100 "lr =%0#10" PRIx32 "\n", istate->cr, istate->pc, istate->lr); 92 101 93 printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t"102 log_printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t" 94 103 "dar=%0#10" PRIx32 "\n", istate->ctr, istate->xer, istate->dar); 95 104 96 printf("srr1=%0#10" PRIx32 "\n", istate->srr1);105 log_printf("srr1=%0#10" PRIx32 "\n", istate->srr1); 97 106 } 98 107 … … 103 112 { 104 113 uint8_t inum; 105 114 106 115 while ((inum = pic_get_pending()) != 255) { 107 116 irq_t *irq = irq_dispatch_and_lock(inum); … … 130 139 */ 131 140 #ifdef CONFIG_DEBUG 132 printf("cpu%u: spurious interrupt (inum=%" PRIu8 ")\n",133 CPU->id, inum);141 log(LF_ARCH, LVL_DEBUG, "cpu%u: spurious interrupt" 142 " (inum=%" PRIu8 ")", CPU->id, inum); 134 143 #endif 135 144 } … … 137 146 } 138 147 148 static void exception_fp_unavailable(unsigned int n, istate_t *istate) 149 { 150 #ifdef CONFIG_FPU_LAZY 151 scheduler_fpu_lazy_request(); 152 /* 153 * Propagate MSR_FP from MSR back to istate's SRR1, which will become 154 * the next MSR. 155 */ 156 istate->srr1 |= msr_read() & MSR_FP; 157 #else 158 fault_if_from_uspace(istate, "FPU fault."); 159 panic_badtrap(istate, n, "FPU fault."); 160 #endif 161 } 162 139 163 static void exception_decrementer(unsigned int n, istate_t *istate) 140 164 { 141 start_decrementer();165 decrementer_restart(); 142 166 clock(); 143 167 } … … 152 176 exc_register(VECTOR_EXTERNAL, "external", true, 153 177 exception_external); 178 exc_register(VECTOR_FP_UNAVAILABLE, "fp_unavailable", true, 179 exception_fp_unavailable); 154 180 exc_register(VECTOR_DECREMENTER, "timer", true, 155 181 exception_decrementer);
Note:
See TracChangeset
for help on using the changeset viewer.