aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/process.c')
-rw-r--r--arch/sparc/kernel/process.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 29e72b57d4fd..ea8647411462 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -67,13 +67,6 @@ extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
67struct task_struct *last_task_used_math = NULL; 67struct task_struct *last_task_used_math = NULL;
68struct thread_info *current_set[NR_CPUS]; 68struct thread_info *current_set[NR_CPUS];
69 69
70/*
71 * default_idle is new in 2.5. XXX Review, currently stolen from sparc64.
72 */
73void default_idle(void)
74{
75}
76
77#ifndef CONFIG_SMP 70#ifndef CONFIG_SMP
78 71
79#define SUN4C_FAULT_HIGH 100 72#define SUN4C_FAULT_HIGH 100
@@ -92,12 +85,11 @@ void cpu_idle(void)
92 static unsigned long fps; 85 static unsigned long fps;
93 unsigned long now; 86 unsigned long now;
94 unsigned long faults; 87 unsigned long faults;
95 unsigned long flags;
96 88
97 extern unsigned long sun4c_kernel_faults; 89 extern unsigned long sun4c_kernel_faults;
98 extern void sun4c_grow_kernel_ring(void); 90 extern void sun4c_grow_kernel_ring(void);
99 91
100 local_irq_save(flags); 92 local_irq_disable();
101 now = jiffies; 93 now = jiffies;
102 count -= (now - last_jiffies); 94 count -= (now - last_jiffies);
103 last_jiffies = now; 95 last_jiffies = now;
@@ -113,14 +105,19 @@ void cpu_idle(void)
113 sun4c_grow_kernel_ring(); 105 sun4c_grow_kernel_ring();
114 } 106 }
115 } 107 }
116 local_irq_restore(flags); 108 local_irq_enable();
117 } 109 }
118 110
119 while((!need_resched()) && pm_idle) { 111 if (pm_idle) {
120 (*pm_idle)(); 112 while (!need_resched())
113 (*pm_idle)();
114 } else {
115 while (!need_resched())
116 cpu_relax();
121 } 117 }
122 118 preempt_enable_no_resched();
123 schedule(); 119 schedule();
120 preempt_disable();
124 check_pgt_cache(); 121 check_pgt_cache();
125 } 122 }
126} 123}
@@ -130,13 +127,15 @@ void cpu_idle(void)
130/* This is being executed in task 0 'user space'. */ 127/* This is being executed in task 0 'user space'. */
131void cpu_idle(void) 128void cpu_idle(void)
132{ 129{
130 set_thread_flag(TIF_POLLING_NRFLAG);
133 /* endless idle loop with no priority at all */ 131 /* endless idle loop with no priority at all */
134 while(1) { 132 while(1) {
135 if(need_resched()) { 133 while (!need_resched())
136 schedule(); 134 cpu_relax();
137 check_pgt_cache(); 135 preempt_enable_no_resched();
138 } 136 schedule();
139 barrier(); /* or else gcc optimizes... */ 137 preempt_disable();
138 check_pgt_cache();
140 } 139 }
141} 140}
142 141