diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/cpu.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/pcic.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/process.c | 35 | ||||
-rw-r--r-- | arch/sparc/mm/fault.c | 2 |
4 files changed, 20 insertions, 23 deletions
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c index 6a4ebc62193e..d7bfc61d2879 100644 --- a/arch/sparc/kernel/cpu.c +++ b/arch/sparc/kernel/cpu.c | |||
@@ -75,7 +75,7 @@ struct cpu_fp_info linux_sparc_fpu[] = { | |||
75 | { 9, 3, "Fujitsu or Weitek on-chip FPU"}, | 75 | { 9, 3, "Fujitsu or Weitek on-chip FPU"}, |
76 | }; | 76 | }; |
77 | 77 | ||
78 | #define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) | 78 | #define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu) |
79 | 79 | ||
80 | struct cpu_iu_info linux_sparc_chips[] = { | 80 | struct cpu_iu_info linux_sparc_chips[] = { |
81 | /* Sun4/100, 4/200, SLC */ | 81 | /* Sun4/100, 4/200, SLC */ |
@@ -120,7 +120,7 @@ struct cpu_iu_info linux_sparc_chips[] = { | |||
120 | { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, | 120 | { 0xf, 0, "UNKNOWN CPU-VENDOR/TYPE"}, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | #define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) | 123 | #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips) |
124 | 124 | ||
125 | char *sparc_cpu_type; | 125 | char *sparc_cpu_type; |
126 | char *sparc_fpu_type; | 126 | char *sparc_fpu_type; |
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index 25e31d5ec99b..cccfc12802ed 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -143,7 +143,7 @@ static struct pcic_ca2irq pcic_i_jk[] = { | |||
143 | * as several PROMs may be installed on the same physical board. | 143 | * as several PROMs may be installed on the same physical board. |
144 | */ | 144 | */ |
145 | #define SN2L_INIT(name, map) \ | 145 | #define SN2L_INIT(name, map) \ |
146 | { name, map, sizeof(map)/sizeof(struct pcic_ca2irq) } | 146 | { name, map, ARRAY_SIZE(map) } |
147 | 147 | ||
148 | static struct pcic_sn2list pcic_known_sysnames[] = { | 148 | static struct pcic_sn2list pcic_known_sysnames[] = { |
149 | SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ | 149 | SN2L_INIT("SUNW,JavaEngine1", pcic_i_je1a), /* JE1, PROM 2.32 */ |
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 *); | |||
67 | struct task_struct *last_task_used_math = NULL; | 67 | struct task_struct *last_task_used_math = NULL; |
68 | struct thread_info *current_set[NR_CPUS]; | 68 | struct thread_info *current_set[NR_CPUS]; |
69 | 69 | ||
70 | /* | ||
71 | * default_idle is new in 2.5. XXX Review, currently stolen from sparc64. | ||
72 | */ | ||
73 | void 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'. */ |
131 | void cpu_idle(void) | 128 | void 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 | ||
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c index 2bbd53f3cafb..9eeed3347df3 100644 --- a/arch/sparc/mm/fault.c +++ b/arch/sparc/mm/fault.c | |||
@@ -33,8 +33,6 @@ | |||
33 | #include <asm/kdebug.h> | 33 | #include <asm/kdebug.h> |
34 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
35 | 35 | ||
36 | #define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0])) | ||
37 | |||
38 | extern int prom_node_root; | 36 | extern int prom_node_root; |
39 | 37 | ||
40 | /* At boot time we determine these two values necessary for setting | 38 | /* At boot time we determine these two values necessary for setting |