aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/idle.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-07-07 20:56:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:40 -0400
commitd200903e11f6867b91dffa81b2038e55be599f49 (patch)
treee741dfb082e94685c6cb0d1ccc3616c216af7c7a /arch/ppc64/kernel/idle.c
parentfd899c0cc725387992ccfc83fb6f70505c36cbeb (diff)
[PATCH] ppc64: Move iSeries_idle() into iSeries_setup.c
Move iSeries_idle() into iSeries_setup.c, no one else needs to know about it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64/kernel/idle.c')
-rw-r--r--arch/ppc64/kernel/idle.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index e270055e73e2..226152467791 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -39,90 +39,6 @@ extern void power4_idle(void);
39 39
40static int (*idle_loop)(void); 40static int (*idle_loop)(void);
41 41
42#ifdef CONFIG_PPC_ISERIES
43static unsigned long maxYieldTime = 0;
44static unsigned long minYieldTime = 0xffffffffffffffffUL;
45
46static inline void process_iSeries_events(void)
47{
48 asm volatile ("li 0,0x5555; sc" : : : "r0", "r3");
49}
50
51static void yield_shared_processor(void)
52{
53 unsigned long tb;
54 unsigned long yieldTime;
55
56 HvCall_setEnabledInterrupts(HvCall_MaskIPI |
57 HvCall_MaskLpEvent |
58 HvCall_MaskLpProd |
59 HvCall_MaskTimeout);
60
61 tb = get_tb();
62 /* Compute future tb value when yield should expire */
63 HvCall_yieldProcessor(HvCall_YieldTimed, tb+tb_ticks_per_jiffy);
64
65 yieldTime = get_tb() - tb;
66 if (yieldTime > maxYieldTime)
67 maxYieldTime = yieldTime;
68
69 if (yieldTime < minYieldTime)
70 minYieldTime = yieldTime;
71
72 /*
73 * The decrementer stops during the yield. Force a fake decrementer
74 * here and let the timer_interrupt code sort out the actual time.
75 */
76 get_paca()->lppaca.int_dword.fields.decr_int = 1;
77 process_iSeries_events();
78}
79
80static int iSeries_idle(void)
81{
82 struct paca_struct *lpaca;
83 long oldval;
84
85 /* ensure iSeries run light will be out when idle */
86 ppc64_runlatch_off();
87
88 lpaca = get_paca();
89
90 while (1) {
91 if (lpaca->lppaca.shared_proc) {
92 if (hvlpevent_is_pending())
93 process_iSeries_events();
94 if (!need_resched())
95 yield_shared_processor();
96 } else {
97 oldval = test_and_clear_thread_flag(TIF_NEED_RESCHED);
98
99 if (!oldval) {
100 set_thread_flag(TIF_POLLING_NRFLAG);
101
102 while (!need_resched()) {
103 HMT_medium();
104 if (hvlpevent_is_pending())
105 process_iSeries_events();
106 HMT_low();
107 }
108
109 HMT_medium();
110 clear_thread_flag(TIF_POLLING_NRFLAG);
111 } else {
112 set_need_resched();
113 }
114 }
115
116 ppc64_runlatch_on();
117 schedule();
118 ppc64_runlatch_off();
119 }
120
121 return 0;
122}
123
124#else
125
126int default_idle(void) 42int default_idle(void)
127{ 43{
128 long oldval; 44 long oldval;
@@ -305,8 +221,6 @@ int native_idle(void)
305 return 0; 221 return 0;
306} 222}
307 223
308#endif /* CONFIG_PPC_ISERIES */
309
310void cpu_idle(void) 224void cpu_idle(void)
311{ 225{
312 BUG_ON(NULL == ppc_md.idle_loop); 226 BUG_ON(NULL == ppc_md.idle_loop);