#include <asm/iSeries/HvCall.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/plpar_wrappers.h>
+#include <asm/systemcfg.h>
extern void power4_idle(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();
}
{
struct paca_struct *lpaca;
long oldval;
- unsigned long CTRL;
/* ensure iSeries run light will be out when idle */
- clear_thread_flag(TIF_RUN_LIGHT);
- CTRL = mfspr(CTRLF);
- CTRL &= ~RUNLATCH;
- mtspr(CTRLT, CTRL);
+ ppc64_runlatch_off();
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())
}
}
+ ppc64_runlatch_on();
schedule();
+ ppc64_runlatch_off();
}
return 0;
* 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) {
HMT_medium();
- if (!(ppaca->lppaca.xIdle)) {
+ if (!(ppaca->lppaca.idle)) {
local_irq_disable();
/*
}
HMT_medium();
- lpaca->lppaca.xIdle = 0;
+ lpaca->lppaca.idle = 0;
schedule();
if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
cpu_die();
* 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();
}
HMT_medium();
- lpaca->lppaca.xIdle = 0;
+ lpaca->lppaca.idle = 0;
schedule();
if (cpu_is_offline(smp_processor_id()) &&
system_state == SYSTEM_RUNNING)
power4_idle();
if (need_resched())
schedule();
+
+ if (cpu_is_offline(_smp_processor_id()) &&
+ system_state == SYSTEM_RUNNING)
+ cpu_die();
}
return 0;
}
#endif /* CONFIG_PPC_ISERIES */
-int cpu_idle(void)
+void cpu_idle(void)
{
idle_loop();
- return 0;
}
int powersave_nap;
#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 {