]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/interrupt.c
xnu-344.32.tar.gz
[apple/xnu.git] / osfmk / ppc / interrupt.c
index 5e72b712a662d5dc9076c5f207823ffa7305252e..47e447e8179303e7576100e52943757ea3158fd0 100644 (file)
 #endif /* NCPUS > 1 */
 #include <sys/kdebug.h>
 
-struct ppc_saved_state * interrupt(
+struct savearea * interrupt(
         int type,
-        struct ppc_saved_state *ssp,
+        struct savearea *ssp,
        unsigned int dsisr,
        unsigned int dar)
 {
        int     current_cpu, tmpr, targtemp;
        unsigned int    throttle;
-       AbsoluteTime    now;
+       uint64_t                now;
        thread_act_t    act;
 
        disable_preemption();
        
+#if 0
+       {
+               extern void fctx_text(void);
+               fctx_test();
+       }
+#endif
+       
+       
        current_cpu = cpu_number();
 
        switch (type) {
@@ -100,7 +108,7 @@ struct ppc_saved_state * interrupt(
                        
                case T_DECREMENTER:
                        KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_DECI, 0) | DBG_FUNC_NONE,
-                                 isync_mfdec(), ((savearea *)ssp)->save_srr0, 0, 0, 0);
+                                 isync_mfdec(), ssp->save_srr0, 0, 0, 0);
        
 #if 0
                        if (pcsample_enable) {
@@ -110,11 +118,10 @@ struct ppc_saved_state * interrupt(
 #endif
 
                        act = current_act();                                    /* Find ourselves */
-                       if(act->mact.qactTimer.hi | act->mact.qactTimer.lo) {   /* Is the timer set? */
+                       if(act->mact.qactTimer != 0) {  /* Is the timer set? */
                                clock_get_uptime(&now);                         /* Find out what time it is */
-                               if (CMP_ABSOLUTETIME(&act->mact.qactTimer, &now) <= 0) {        /* It is set, has it popped? */
-                                       act->mact.qactTimer.hi = 0;             /* Clear single shot timer */
-                                       act->mact.qactTimer.lo = 0;             /* and the other half */
+                               if (act->mact.qactTimer <= now) {       /* It is set, has it popped? */
+                                       act->mact.qactTimer = 0;                /* Clear single shot timer */
                                        if((unsigned int)act->mact.vmmControl & 0xFFFFFFFE) {   /* Are there any virtual machines? */
                                                vmm_timer_pop(act);                     /* Yes, check out them out... */
                                        }
@@ -129,7 +136,7 @@ struct ppc_saved_state * interrupt(
                        counter_always(c_incoming_interrupts++);
        
                        KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_EXCP_INTR, 0) | DBG_FUNC_START,
-                          current_cpu, ((savearea *)ssp)->save_srr0, 0, 0, 0);
+                          current_cpu, ssp->save_srr0, 0, 0, 0);
        
                        per_proc_info[current_cpu].interrupt_handler(
                                per_proc_info[current_cpu].interrupt_target,