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