aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/Kconfig12
-rw-r--r--arch/sparc/configs/sparc64_defconfig2
-rw-r--r--arch/sparc/include/asm/gpio.h40
-rw-r--r--arch/sparc/include/asm/processor_32.h3
-rw-r--r--arch/sparc/include/asm/processor_64.h3
-rw-r--r--arch/sparc/include/asm/topology_64.h19
-rw-r--r--arch/sparc/kernel/perf_event.c4
-rw-r--r--arch/sparc/kernel/signal32.c10
-rw-r--r--arch/sparc/kernel/signal_32.c12
-rw-r--r--arch/sparc/kernel/signal_64.c13
-rw-r--r--arch/sparc/kernel/sys_sparc32.c4
-rw-r--r--arch/sparc/kernel/sys_sparc_32.c17
12 files changed, 25 insertions, 114 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 22474233205b..15e9e05740da 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -32,12 +32,15 @@ config SPARC
32 select HAVE_NMI_WATCHDOG if SPARC64 32 select HAVE_NMI_WATCHDOG if SPARC64
33 select HAVE_BPF_JIT 33 select HAVE_BPF_JIT
34 select GENERIC_SMP_IDLE_THREAD 34 select GENERIC_SMP_IDLE_THREAD
35 select GENERIC_CMOS_UPDATE
36 select GENERIC_CLOCKEVENTS
35 select GENERIC_STRNCPY_FROM_USER 37 select GENERIC_STRNCPY_FROM_USER
36 38
37config SPARC32 39config SPARC32
38 def_bool !64BIT 40 def_bool !64BIT
39 select GENERIC_ATOMIC64 41 select GENERIC_ATOMIC64
40 select CLZ_TAB 42 select CLZ_TAB
43 select ARCH_USES_GETTIMEOFFSET
41 44
42config SPARC64 45config SPARC64
43 def_bool 64BIT 46 def_bool 64BIT
@@ -77,13 +80,6 @@ config BITS
77 default 32 if SPARC32 80 default 32 if SPARC32
78 default 64 if SPARC64 81 default 64 if SPARC64
79 82
80config GENERIC_CMOS_UPDATE
81 bool
82 default y
83
84config GENERIC_CLOCKEVENTS
85 def_bool y
86
87config IOMMU_HELPER 83config IOMMU_HELPER
88 bool 84 bool
89 default y if SPARC64 85 default y if SPARC64
@@ -274,8 +270,6 @@ config HOTPLUG_CPU
274 can be controlled through /sys/devices/system/cpu/cpu#. 270 can be controlled through /sys/devices/system/cpu/cpu#.
275 Say N if you want to disable CPU hotplug. 271 Say N if you want to disable CPU hotplug.
276 272
277source "kernel/time/Kconfig"
278
279if SPARC64 273if SPARC64
280source "drivers/cpufreq/Kconfig" 274source "drivers/cpufreq/Kconfig"
281 275
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index 3c1e85807403..9d8521b8c854 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -5,7 +5,7 @@ CONFIG_SYSVIPC=y
5CONFIG_POSIX_MQUEUE=y 5CONFIG_POSIX_MQUEUE=y
6CONFIG_LOG_BUF_SHIFT=18 6CONFIG_LOG_BUF_SHIFT=18
7CONFIG_BLK_DEV_INITRD=y 7CONFIG_BLK_DEV_INITRD=y
8CONFIG_PERF_COUNTERS=y 8CONFIG_PERF_EVENTS=y
9# CONFIG_COMPAT_BRK is not set 9# CONFIG_COMPAT_BRK is not set
10CONFIG_SLAB=y 10CONFIG_SLAB=y
11CONFIG_PROFILING=y 11CONFIG_PROFILING=y
diff --git a/arch/sparc/include/asm/gpio.h b/arch/sparc/include/asm/gpio.h
index a0e3ac0af599..b3799d88ffcf 100644
--- a/arch/sparc/include/asm/gpio.h
+++ b/arch/sparc/include/asm/gpio.h
@@ -1,36 +1,4 @@
1#ifndef __ASM_SPARC_GPIO_H 1#ifndef __LINUX_GPIO_H
2#define __ASM_SPARC_GPIO_H 2#warning Include linux/gpio.h instead of asm/gpio.h
3 3#include <linux/gpio.h>
4#include <linux/errno.h> 4#endif
5#include <asm-generic/gpio.h>
6
7#ifdef CONFIG_GPIOLIB
8
9static inline int gpio_get_value(unsigned int gpio)
10{
11 return __gpio_get_value(gpio);
12}
13
14static inline void gpio_set_value(unsigned int gpio, int value)
15{
16 __gpio_set_value(gpio, value);
17}
18
19static inline int gpio_cansleep(unsigned int gpio)
20{
21 return __gpio_cansleep(gpio);
22}
23
24static inline int gpio_to_irq(unsigned int gpio)
25{
26 return -ENOSYS;
27}
28
29static inline int irq_to_gpio(unsigned int irq)
30{
31 return -EINVAL;
32}
33
34#endif /* CONFIG_GPIOLIB */
35
36#endif /* __ASM_SPARC_GPIO_H */
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
index 9cbd854fdfdd..f74ac9ee33a8 100644
--- a/arch/sparc/include/asm/processor_32.h
+++ b/arch/sparc/include/asm/processor_32.h
@@ -108,9 +108,6 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,
108#define release_thread(tsk) do { } while(0) 108#define release_thread(tsk) do { } while(0)
109extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 109extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
110 110
111/* Prepare to copy thread state - unlazy all lazy status */
112#define prepare_to_copy(tsk) do { } while (0)
113
114extern unsigned long get_wchan(struct task_struct *); 111extern unsigned long get_wchan(struct task_struct *);
115 112
116#define task_pt_regs(tsk) ((tsk)->thread.kregs) 113#define task_pt_regs(tsk) ((tsk)->thread.kregs)
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
index 6ca7709971d2..4e5a483122a0 100644
--- a/arch/sparc/include/asm/processor_64.h
+++ b/arch/sparc/include/asm/processor_64.h
@@ -188,9 +188,6 @@ do { \
188/* Free all resources held by a thread. */ 188/* Free all resources held by a thread. */
189#define release_thread(tsk) do { } while (0) 189#define release_thread(tsk) do { } while (0)
190 190
191/* Prepare to copy thread state - unlazy all lazy status */
192#define prepare_to_copy(tsk) do { } while (0)
193
194extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); 191extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
195 192
196extern unsigned long get_wchan(struct task_struct *task); 193extern unsigned long get_wchan(struct task_struct *task);
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h
index 8b9c556d630b..1754390a426f 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -31,25 +31,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
31 cpu_all_mask : \ 31 cpu_all_mask : \
32 cpumask_of_node(pcibus_to_node(bus))) 32 cpumask_of_node(pcibus_to_node(bus)))
33 33
34#define SD_NODE_INIT (struct sched_domain) { \
35 .min_interval = 8, \
36 .max_interval = 32, \
37 .busy_factor = 32, \
38 .imbalance_pct = 125, \
39 .cache_nice_tries = 2, \
40 .busy_idx = 3, \
41 .idle_idx = 2, \
42 .newidle_idx = 0, \
43 .wake_idx = 0, \
44 .forkexec_idx = 0, \
45 .flags = SD_LOAD_BALANCE \
46 | SD_BALANCE_FORK \
47 | SD_BALANCE_EXEC \
48 | SD_SERIALIZE, \
49 .last_balance = jiffies, \
50 .balance_interval = 1, \
51}
52
53#else /* CONFIG_NUMA */ 34#else /* CONFIG_NUMA */
54 35
55#include <asm-generic/topology.h> 36#include <asm-generic/topology.h>
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 28559ce5eeb5..5713957dcb8a 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -1296,8 +1296,6 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,
1296 1296
1297 regs = args->regs; 1297 regs = args->regs;
1298 1298
1299 perf_sample_data_init(&data, 0);
1300
1301 cpuc = &__get_cpu_var(cpu_hw_events); 1299 cpuc = &__get_cpu_var(cpu_hw_events);
1302 1300
1303 /* If the PMU has the TOE IRQ enable bits, we need to do a 1301 /* If the PMU has the TOE IRQ enable bits, we need to do a
@@ -1321,7 +1319,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,
1321 if (val & (1ULL << 31)) 1319 if (val & (1ULL << 31))
1322 continue; 1320 continue;
1323 1321
1324 data.period = event->hw.last_period; 1322 perf_sample_data_init(&data, 0, hwc->last_period);
1325 if (!sparc_perf_event_set_period(event, hwc, idx)) 1323 if (!sparc_perf_event_set_period(event, hwc, idx))
1326 continue; 1324 continue;
1327 1325
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c
index 948700fb9036..bb1513e45f1a 100644
--- a/arch/sparc/kernel/signal32.c
+++ b/arch/sparc/kernel/signal32.c
@@ -215,8 +215,9 @@ void do_sigreturn32(struct pt_regs *regs)
215 (((unsigned long) sf) & 3)) 215 (((unsigned long) sf) & 3))
216 goto segv; 216 goto segv;
217 217
218 get_user(pc, &sf->info.si_regs.pc); 218 if (get_user(pc, &sf->info.si_regs.pc) ||
219 __get_user(npc, &sf->info.si_regs.npc); 219 __get_user(npc, &sf->info.si_regs.npc))
220 goto segv;
220 221
221 if ((pc | npc) & 3) 222 if ((pc | npc) & 3)
222 goto segv; 223 goto segv;
@@ -305,8 +306,9 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
305 (((unsigned long) sf) & 3)) 306 (((unsigned long) sf) & 3))
306 goto segv; 307 goto segv;
307 308
308 get_user(pc, &sf->regs.pc); 309 if (get_user(pc, &sf->regs.pc) ||
309 __get_user(npc, &sf->regs.npc); 310 __get_user(npc, &sf->regs.npc))
311 goto segv;
310 312
311 if ((pc | npc) & 3) 313 if ((pc | npc) & 3)
312 goto segv; 314 goto segv;
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
index ac8e66b50f07..2b7e849f7c65 100644
--- a/arch/sparc/kernel/signal_32.c
+++ b/arch/sparc/kernel/signal_32.c
@@ -64,18 +64,8 @@ struct rt_signal_frame {
64static int _sigpause_common(old_sigset_t set) 64static int _sigpause_common(old_sigset_t set)
65{ 65{
66 sigset_t blocked; 66 sigset_t blocked;
67
68 current->saved_sigmask = current->blocked;
69
70 set &= _BLOCKABLE;
71 siginitset(&blocked, set); 67 siginitset(&blocked, set);
72 set_current_blocked(&blocked); 68 return sigsuspend(&blocked);
73
74 current->state = TASK_INTERRUPTIBLE;
75 schedule();
76 set_thread_flag(TIF_RESTORE_SIGMASK);
77
78 return -ERESTARTNOHAND;
79} 69}
80 70
81asmlinkage int sys_sigsuspend(old_sigset_t set) 71asmlinkage int sys_sigsuspend(old_sigset_t set)
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
index 48b0f57b65f7..eafaab486b2d 100644
--- a/arch/sparc/kernel/signal_64.c
+++ b/arch/sparc/kernel/signal_64.c
@@ -242,19 +242,8 @@ struct rt_signal_frame {
242static long _sigpause_common(old_sigset_t set) 242static long _sigpause_common(old_sigset_t set)
243{ 243{
244 sigset_t blocked; 244 sigset_t blocked;
245
246 current->saved_sigmask = current->blocked;
247
248 set &= _BLOCKABLE;
249 siginitset(&blocked, set); 245 siginitset(&blocked, set);
250 set_current_blocked(&blocked); 246 return sigsuspend(&blocked);
251
252 current->state = TASK_INTERRUPTIBLE;
253 schedule();
254
255 set_restore_sigmask();
256
257 return -ERESTARTNOHAND;
258} 247}
259 248
260asmlinkage long sys_sigpause(unsigned int set) 249asmlinkage long sys_sigpause(unsigned int set)
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index 29c478ffed91..f7392336961f 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -139,8 +139,8 @@ static int cp_compat_stat64(struct kstat *stat,
139 err |= put_user(stat->ino, &statbuf->st_ino); 139 err |= put_user(stat->ino, &statbuf->st_ino);
140 err |= put_user(stat->mode, &statbuf->st_mode); 140 err |= put_user(stat->mode, &statbuf->st_mode);
141 err |= put_user(stat->nlink, &statbuf->st_nlink); 141 err |= put_user(stat->nlink, &statbuf->st_nlink);
142 err |= put_user(stat->uid, &statbuf->st_uid); 142 err |= put_user(from_kuid_munged(current_user_ns(), stat->uid), &statbuf->st_uid);
143 err |= put_user(stat->gid, &statbuf->st_gid); 143 err |= put_user(from_kgid_munged(current_user_ns(), stat->gid), &statbuf->st_gid);
144 err |= put_user(huge_encode_dev(stat->rdev), &statbuf->st_rdev); 144 err |= put_user(huge_encode_dev(stat->rdev), &statbuf->st_rdev);
145 err |= put_user(0, (unsigned long __user *) &statbuf->__pad3[0]); 145 err |= put_user(0, (unsigned long __user *) &statbuf->__pad3[0]);
146 err |= put_user(stat->size, &statbuf->st_size); 146 err |= put_user(stat->size, &statbuf->st_size);
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
index 627e89af1d71..0c9b31b22e07 100644
--- a/arch/sparc/kernel/sys_sparc_32.c
+++ b/arch/sparc/kernel/sys_sparc_32.c
@@ -184,10 +184,10 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act,
184 184
185 if (!access_ok(VERIFY_READ, act, sizeof(*act)) || 185 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
186 __get_user(new_ka.sa.sa_handler, &act->sa_handler) || 186 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
187 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) 187 __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
188 __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
189 __get_user(mask, &act->sa_mask))
188 return -EFAULT; 190 return -EFAULT;
189 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
190 __get_user(mask, &act->sa_mask);
191 siginitset(&new_ka.sa.sa_mask, mask); 191 siginitset(&new_ka.sa.sa_mask, mask);
192 new_ka.ka_restorer = NULL; 192 new_ka.ka_restorer = NULL;
193 } 193 }
@@ -195,17 +195,12 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act,
195 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); 195 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
196 196
197 if (!ret && oact) { 197 if (!ret && oact) {
198 /* In the clone() case we could copy half consistent
199 * state to the user, however this could sleep and
200 * deadlock us if we held the signal lock on SMP. So for
201 * now I take the easy way out and do no locking.
202 */
203 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || 198 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
204 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || 199 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
205 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) 200 __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
201 __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
202 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
206 return -EFAULT; 203 return -EFAULT;
207 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
208 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
209 } 204 }
210 205
211 return ret; 206 return ret;