vserver 1.9.5.x5
[linux-2.6.git] / arch / ppc64 / kernel / idle.c
index 62e509d..398b468 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/cpu.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
+#include <linux/smp.h>
 
 #include <asm/system.h>
 #include <asm/processor.h>
@@ -31,6 +32,7 @@
 #include <asm/iSeries/HvCall.h>
 #include <asm/iSeries/ItLpQueue.h>
 #include <asm/plpar_wrappers.h>
+#include <asm/systemcfg.h>
 
 extern void power4_idle(void);
 
@@ -65,7 +67,7 @@ static void yield_shared_processor(void)
         * The decrementer stops during the yield.  Force a fake decrementer
         * here and let the timer_interrupt code sort out the actual time.
         */
-       get_paca()->lppaca.xIntDword.xFields.xDecrInt = 1;
+       get_paca()->lppaca.int_dword.fields.decr_int = 1;
        process_iSeries_events();
 }
 
@@ -84,7 +86,7 @@ static int iSeries_idle(void)
        lpaca = get_paca();
 
        while (1) {
-               if (lpaca->lppaca.xSharedProc) {
+               if (lpaca->lppaca.shared_proc) {
                        if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr))
                                process_iSeries_events();
                        if (!need_resched())
@@ -171,7 +173,7 @@ int dedicated_idle(void)
                 * Indicate to the HV that we are idle. Now would be
                 * a good time to find other work to dispatch.
                 */
-               lpaca->lppaca.xIdle = 1;
+               lpaca->lppaca.idle = 1;
 
                oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
                if (!oldval) {
@@ -192,7 +194,7 @@ int dedicated_idle(void)
 
                                HMT_medium();
 
-                               if (!(ppaca->lppaca.xIdle)) {
+                               if (!(ppaca->lppaca.idle)) {
                                        local_irq_disable();
 
                                        /*
@@ -231,7 +233,7 @@ int dedicated_idle(void)
                }
 
                HMT_medium();
-               lpaca->lppaca.xIdle = 0;
+               lpaca->lppaca.idle = 0;
                schedule();
                if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
                        cpu_die();
@@ -249,7 +251,7 @@ static int shared_idle(void)
                 * Indicate to the HV that we are idle. Now would be
                 * a good time to find other work to dispatch.
                 */
-               lpaca->lppaca.xIdle = 1;
+               lpaca->lppaca.idle = 1;
 
                while (!need_resched() && !cpu_is_offline(cpu)) {
                        local_irq_disable();
@@ -271,7 +273,7 @@ static int shared_idle(void)
                }
 
                HMT_medium();
-               lpaca->lppaca.xIdle = 0;
+               lpaca->lppaca.idle = 0;
                schedule();
                if (cpu_is_offline(smp_processor_id()) &&
                    system_state == SYSTEM_RUNNING)
@@ -297,10 +299,9 @@ static int native_idle(void)
 
 #endif /* CONFIG_PPC_ISERIES */
 
-int cpu_idle(void)
+void cpu_idle(void)
 {
        idle_loop();
-       return 0;
 }
 
 int powersave_nap;
@@ -350,7 +351,7 @@ int idle_setup(void)
 #ifdef CONFIG_PPC_PSERIES
        if (systemcfg->platform & PLATFORM_PSERIES) {
                if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
-                       if (get_paca()->lppaca.xSharedProc) {
+                       if (get_paca()->lppaca.shared_proc) {
                                printk(KERN_INFO "Using shared processor idle loop\n");
                                idle_loop = shared_idle;
                        } else {
@@ -363,12 +364,13 @@ int idle_setup(void)
                }
        }
 #endif /* CONFIG_PPC_PSERIES */
-#ifdef CONFIG_PPC_PMAC
-       if (systemcfg->platform == PLATFORM_POWERMAC) {
+#ifndef CONFIG_PPC_ISERIES
+       if (systemcfg->platform == PLATFORM_POWERMAC ||
+           systemcfg->platform == PLATFORM_MAPLE) {
                printk(KERN_INFO "Using native/NAP idle loop\n");
                idle_loop = native_idle;
        }
-#endif /* CONFIG_PPC_PMAC */
+#endif /* CONFIG_PPC_ISERIES */
 
        return 1;
 }