Ignore:
File:
1 edited

Legend:

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

    rdf7f5cea r9d58539  
    3636#include <interrupt.h>
    3737#include <arch/interrupt.h>
    38 #include <arch/istate.h>
    3938#include <typedefs.h>
    4039#include <arch.h>
     40#include <time/clock.h>
    4141#include <ipc/sysipc.h>
    4242#include <arch/drivers/pic.h>
     
    4444#include <arch/mm/pht.h>
    4545#include <print.h>
    46 #include <log.h>
    4746
    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)
     47void start_decrementer(void)
    5748{
    5849        asm volatile (
    5950                "mtdec %[dec]\n"
    60                 :: [dec] "r" (decrementer_value)
     51                :: [dec] "r" (1000)
    6152        );
    6253}
     
    6455void istate_decode(istate_t *istate)
    6556{
    66         log_printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t"
     57        printf("r0 =%0#10" PRIx32 "\tr1 =%0#10" PRIx32 "\t"
    6758            "r2 =%0#10" PRIx32 "\n", istate->r0, istate->sp, istate->r2);
    6859       
    69         log_printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t"
     60        printf("r3 =%0#10" PRIx32 "\tr4 =%0#10" PRIx32 "\t"
    7061            "r5 =%0#10" PRIx32 "\n", istate->r3, istate->r4, istate->r5);
    7162       
    72         log_printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t"
     63        printf("r6 =%0#10" PRIx32 "\tr7 =%0#10" PRIx32 "\t"
    7364            "r8 =%0#10" PRIx32 "\n", istate->r6, istate->r7, istate->r8);
    7465       
    75         log_printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t"
     66        printf("r9 =%0#10" PRIx32 "\tr10=%0#10" PRIx32 "\t"
    7667            "r11=%0#10" PRIx32 "\n", istate->r9, istate->r10, istate->r11);
    7768       
    78         log_printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t"
     69        printf("r12=%0#10" PRIx32 "\tr13=%0#10" PRIx32 "\t"
    7970            "r14=%0#10" PRIx32 "\n", istate->r12, istate->r13, istate->r14);
    8071       
    81         log_printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t"
     72        printf("r15=%0#10" PRIx32 "\tr16=%0#10" PRIx32 "\t"
    8273            "r17=%0#10" PRIx32 "\n", istate->r15, istate->r16, istate->r17);
    8374       
    84         log_printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t"
     75        printf("r18=%0#10" PRIx32 "\tr19=%0#10" PRIx32 "\t"
    8576            "r20=%0#10" PRIx32 "\n", istate->r18, istate->r19, istate->r20);
    8677       
    87         log_printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t"
     78        printf("r21=%0#10" PRIx32 "\tr22=%0#10" PRIx32 "\t"
    8879            "r23=%0#10" PRIx32 "\n", istate->r21, istate->r22, istate->r23);
    8980       
    90         log_printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t"
     81        printf("r24=%0#10" PRIx32 "\tr25=%0#10" PRIx32 "\t"
    9182            "r26=%0#10" PRIx32 "\n", istate->r24, istate->r25, istate->r26);
    9283       
    93         log_printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t"
     84        printf("r27=%0#10" PRIx32 "\tr28=%0#10" PRIx32 "\t"
    9485            "r29=%0#10" PRIx32 "\n", istate->r27, istate->r28, istate->r29);
    9586       
    96         log_printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n",
     87        printf("r30=%0#10" PRIx32 "\tr31=%0#10" PRIx32 "\n",
    9788            istate->r30, istate->r31);
    9889       
    99         log_printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t"
     90        printf("cr =%0#10" PRIx32 "\tpc =%0#10" PRIx32 "\t"
    10091            "lr =%0#10" PRIx32 "\n", istate->cr, istate->pc, istate->lr);
    10192       
    102         log_printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t"
     93        printf("ctr=%0#10" PRIx32 "\txer=%0#10" PRIx32 "\t"
    10394            "dar=%0#10" PRIx32 "\n", istate->ctr, istate->xer, istate->dar);
    10495       
    105         log_printf("srr1=%0#10" PRIx32 "\n", istate->srr1);
     96        printf("srr1=%0#10" PRIx32 "\n", istate->srr1);
    10697}
    10798
     
    112103{
    113104        uint8_t inum;
    114 
     105       
    115106        while ((inum = pic_get_pending()) != 255) {
    116107                irq_t *irq = irq_dispatch_and_lock(inum);
     
    139130                         */
    140131#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);
    143134#endif
    144135                }
     
    146137}
    147138
    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 
    163139static void exception_decrementer(unsigned int n, istate_t *istate)
    164140{
    165         decrementer_restart();
     141        start_decrementer();
    166142        clock();
    167143}
     
    176152        exc_register(VECTOR_EXTERNAL, "external", true,
    177153            exception_external);
    178         exc_register(VECTOR_FP_UNAVAILABLE, "fp_unavailable", true,
    179             exception_fp_unavailable);
    180154        exc_register(VECTOR_DECREMENTER, "timer", true,
    181155            exception_decrementer);
Note: See TracChangeset for help on using the changeset viewer.