aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/cpu.c4
-rw-r--r--arch/sparc64/kernel/ioctl32.c6
-rw-r--r--arch/sparc64/kernel/process.c24
-rw-r--r--arch/sparc64/kernel/sbus.c2
-rw-r--r--arch/sparc64/kernel/smp.c16
-rw-r--r--arch/sparc64/mm/fault.c4
6 files changed, 27 insertions, 29 deletions
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index 77ef5df4e5a7..00eed88ef2e8 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -43,7 +43,7 @@ struct cpu_fp_info linux_sparc_fpu[] = {
43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, 43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
44}; 44};
45 45
46#define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) 46#define NSPARCFPU ARRAY_SIZE(linux_sparc_fpu)
47 47
48struct cpu_iu_info linux_sparc_chips[] = { 48struct cpu_iu_info linux_sparc_chips[] = {
49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"}, 49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
@@ -59,7 +59,7 @@ struct cpu_iu_info linux_sparc_chips[] = {
59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, 59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
60}; 60};
61 61
62#define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) 62#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
63 63
64char *sparc_cpu_type = "cpu-oops"; 64char *sparc_cpu_type = "cpu-oops";
65char *sparc_fpu_type = "fpu-oops"; 65char *sparc_fpu_type = "fpu-oops";
diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c
index 92e26304de90..e62214354bb5 100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ b/arch/sparc64/kernel/ioctl32.c
@@ -92,10 +92,8 @@ static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
92 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p); 92 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
93} 93}
94 94
95typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
96
97#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl) 95#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
98#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL }, 96#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
99#define IOCTL_TABLE_START \ 97#define IOCTL_TABLE_START \
100 struct ioctl_trans ioctl_start[] = { 98 struct ioctl_trans ioctl_start[] = {
101#define IOCTL_TABLE_END \ 99#define IOCTL_TABLE_END \
@@ -116,8 +114,6 @@ COMPATIBLE_IOCTL(FBIOGCURPOS)
116COMPATIBLE_IOCTL(FBIOGCURMAX) 114COMPATIBLE_IOCTL(FBIOGCURMAX)
117/* Little k */ 115/* Little k */
118/* Little v, the video4linux ioctls */ 116/* Little v, the video4linux ioctls */
119COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
120COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
121/* And these ioctls need translation */ 117/* And these ioctls need translation */
122/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */ 118/* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
123HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap) 119HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7d10b0397091..02f9dec1d459 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -74,7 +74,9 @@ void cpu_idle(void)
74 while (!need_resched()) 74 while (!need_resched())
75 barrier(); 75 barrier();
76 76
77 preempt_enable_no_resched();
77 schedule(); 78 schedule();
79 preempt_disable();
78 check_pgt_cache(); 80 check_pgt_cache();
79 } 81 }
80} 82}
@@ -83,21 +85,31 @@ void cpu_idle(void)
83 85
84/* 86/*
85 * the idle loop on a UltraMultiPenguin... 87 * the idle loop on a UltraMultiPenguin...
88 *
89 * TIF_POLLING_NRFLAG is set because we do not sleep the cpu
90 * inside of the idler task, so an interrupt is not needed
91 * to get a clean fast response.
92 *
93 * XXX Reverify this assumption... -DaveM
94 *
95 * Addendum: We do want it to do something for the signal
96 * delivery case, we detect that by just seeing
97 * if we are trying to send this to an idler or not.
86 */ 98 */
87#define idle_me_harder() (cpu_data(smp_processor_id()).idle_volume += 1)
88#define unidle_me() (cpu_data(smp_processor_id()).idle_volume = 0)
89void cpu_idle(void) 99void cpu_idle(void)
90{ 100{
101 cpuinfo_sparc *cpuinfo = &local_cpu_data();
91 set_thread_flag(TIF_POLLING_NRFLAG); 102 set_thread_flag(TIF_POLLING_NRFLAG);
103
92 while(1) { 104 while(1) {
93 if (need_resched()) { 105 if (need_resched()) {
94 unidle_me(); 106 cpuinfo->idle_volume = 0;
95 clear_thread_flag(TIF_POLLING_NRFLAG); 107 preempt_enable_no_resched();
96 schedule(); 108 schedule();
97 set_thread_flag(TIF_POLLING_NRFLAG); 109 preempt_disable();
98 check_pgt_cache(); 110 check_pgt_cache();
99 } 111 }
100 idle_me_harder(); 112 cpuinfo->idle_volume++;
101 113
102 /* The store ordering is so that IRQ handlers on 114 /* The store ordering is so that IRQ handlers on
103 * other cpus see our increasing idleness for the buddy 115 * other cpus see our increasing idleness for the buddy
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index e09ddf927655..96b825055668 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -790,7 +790,7 @@ static unsigned long sysio_irq_offsets[] = {
790 790
791#undef bogon 791#undef bogon
792 792
793#define NUM_SYSIO_OFFSETS (sizeof(sysio_irq_offsets) / sizeof(sysio_irq_offsets[0])) 793#define NUM_SYSIO_OFFSETS ARRAY_SIZE(sysio_irq_offsets)
794 794
795/* Convert Interrupt Mapping register pointer to associated 795/* Convert Interrupt Mapping register pointer to associated
796 * Interrupt Clear register pointer, SYSIO specific version. 796 * Interrupt Clear register pointer, SYSIO specific version.
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 5d90ee9aebf1..797a65493fb8 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -168,6 +168,9 @@ void __init smp_callin(void)
168 rmb(); 168 rmb();
169 169
170 cpu_set(cpuid, cpu_online_map); 170 cpu_set(cpuid, cpu_online_map);
171
172 /* idle thread is expected to have preempt disabled */
173 preempt_disable();
171} 174}
172 175
173void cpu_panic(void) 176void cpu_panic(void)
@@ -1149,20 +1152,9 @@ void __init smp_cpus_done(unsigned int max_cpus)
1149 (bogosum/(5000/HZ))%100); 1152 (bogosum/(5000/HZ))%100);
1150} 1153}
1151 1154
1152/* This needn't do anything as we do not sleep the cpu
1153 * inside of the idler task, so an interrupt is not needed
1154 * to get a clean fast response.
1155 *
1156 * XXX Reverify this assumption... -DaveM
1157 *
1158 * Addendum: We do want it to do something for the signal
1159 * delivery case, we detect that by just seeing
1160 * if we are trying to send this to an idler or not.
1161 */
1162void smp_send_reschedule(int cpu) 1155void smp_send_reschedule(int cpu)
1163{ 1156{
1164 if (cpu_data(cpu).idle_volume == 0) 1157 smp_receive_signal(cpu);
1165 smp_receive_signal(cpu);
1166} 1158}
1167 1159
1168/* This is a nop because we capture all other cpus 1160/* This is a nop because we capture all other cpus
diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
index 31fbc67719a1..6f0539aa44d0 100644
--- a/arch/sparc64/mm/fault.c
+++ b/arch/sparc64/mm/fault.c
@@ -30,8 +30,6 @@
30#include <asm/sections.h> 30#include <asm/sections.h>
31#include <asm/kdebug.h> 31#include <asm/kdebug.h>
32 32
33#define ELEMENTS(arr) (sizeof (arr)/sizeof (arr[0]))
34
35/* 33/*
36 * To debug kernel to catch accesses to certain virtual/physical addresses. 34 * To debug kernel to catch accesses to certain virtual/physical addresses.
37 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints. 35 * Mode = 0 selects physical watchpoints, mode = 1 selects virtual watchpoints.
@@ -109,7 +107,7 @@ static void bad_kernel_pc(struct pt_regs *regs)
109 * this. Additionally, to prevent kswapd from ripping ptes from 107 * this. Additionally, to prevent kswapd from ripping ptes from
110 * under us, raise interrupts around the time that we look at the 108 * under us, raise interrupts around the time that we look at the
111 * pte, kswapd will have to wait to get his smp ipi response from 109 * pte, kswapd will have to wait to get his smp ipi response from
112 * us. This saves us having to get page_table_lock. 110 * us. vmtruncate likewise. This saves us having to get pte lock.
113 */ 111 */
114static unsigned int get_user_insn(unsigned long tpc) 112static unsigned int get_user_insn(unsigned long tpc)
115{ 113{