aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/process.c2
-rw-r--r--arch/sparc/kernel/signal.c260
-rw-r--r--arch/sparc/kernel/sys_sparc.c14
-rw-r--r--arch/sparc64/Kconfig85
-rw-r--r--arch/sparc64/defconfig23
-rw-r--r--arch/sparc64/kernel/Makefile6
-rw-r--r--arch/sparc64/kernel/audit.c6
-rw-r--r--arch/sparc64/kernel/irq.c3
-rw-r--r--arch/sparc64/kernel/isa.c191
-rw-r--r--arch/sparc64/kernel/of_device.c6
-rw-r--r--arch/sparc64/kernel/pci.c2
-rw-r--r--arch/sparc64/kernel/process.c12
-rw-r--r--arch/sparc64/kernel/signal.c16
-rw-r--r--arch/sparc64/kernel/signal32.c272
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c2
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c11
-rw-r--r--drivers/input/misc/sparcspkr.c262
-rw-r--r--drivers/serial/sunzilog.c4
-rw-r--r--drivers/video/bw2.c5
-rw-r--r--drivers/video/cg14.c6
-rw-r--r--drivers/video/cg3.c2
-rw-r--r--drivers/video/cg6.c2
-rw-r--r--drivers/video/ffb.c7
-rw-r--r--drivers/video/leo.c2
-rw-r--r--drivers/video/p9100.c2
-rw-r--r--drivers/video/tcx.c10
-rw-r--r--include/asm-sparc/processor.h4
-rw-r--r--include/asm-sparc64/floppy.h84
-rw-r--r--include/asm-sparc64/isa.h47
-rw-r--r--include/asm-sparc64/ptrace.h23
-rw-r--r--include/asm-sparc64/thread_info.h6
-rw-r--r--init/Kconfig2
32 files changed, 318 insertions, 1061 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 70c0dd22491d..e7f35198ae34 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -357,8 +357,6 @@ void flush_thread(void)
357{ 357{
358 current_thread_info()->w_saved = 0; 358 current_thread_info()->w_saved = 0;
359 359
360 /* No new signal delivery by default */
361 current->thread.new_signal = 0;
362#ifndef CONFIG_SMP 360#ifndef CONFIG_SMP
363 if(last_task_used_math == current) { 361 if(last_task_used_math == current) {
364#else 362#else
diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index 3e849e8e3480..3c312290c3c2 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -1,5 +1,4 @@
1/* $Id: signal.c,v 1.110 2002/02/08 03:57:14 davem Exp $ 1/* linux/arch/sparc/kernel/signal.c
2 * linux/arch/sparc/kernel/signal.c
3 * 2 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -32,37 +31,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
32 void *fpqueue, unsigned long *fpqdepth); 31 void *fpqueue, unsigned long *fpqdepth);
33extern void fpload(unsigned long *fpregs, unsigned long *fsr); 32extern void fpload(unsigned long *fpregs, unsigned long *fsr);
34 33
35/* Signal frames: the original one (compatible with SunOS): 34struct signal_frame {
36 *
37 * Set up a signal frame... Make the stack look the way SunOS
38 * expects it to look which is basically:
39 *
40 * ---------------------------------- <-- %sp at signal time
41 * Struct sigcontext
42 * Signal address
43 * Ptr to sigcontext area above
44 * Signal code
45 * The signal number itself
46 * One register window
47 * ---------------------------------- <-- New %sp
48 */
49struct signal_sframe {
50 struct reg_window sig_window;
51 int sig_num;
52 int sig_code;
53 struct sigcontext __user *sig_scptr;
54 int sig_address;
55 struct sigcontext sig_context;
56 unsigned int extramask[_NSIG_WORDS - 1];
57};
58
59/*
60 * And the new one, intended to be used for Linux applications only
61 * (we have enough in there to work with clone).
62 * All the interesting bits are in the info field.
63 */
64
65struct new_signal_frame {
66 struct sparc_stackf ss; 35 struct sparc_stackf ss;
67 __siginfo_t info; 36 __siginfo_t info;
68 __siginfo_fpu_t __user *fpu_save; 37 __siginfo_fpu_t __user *fpu_save;
@@ -85,8 +54,7 @@ struct rt_signal_frame {
85}; 54};
86 55
87/* Align macros */ 56/* Align macros */
88#define SF_ALIGNEDSZ (((sizeof(struct signal_sframe) + 7) & (~7))) 57#define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7)))
89#define NF_ALIGNEDSZ (((sizeof(struct new_signal_frame) + 7) & (~7)))
90#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7))) 58#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7)))
91 59
92static int _sigpause_common(old_sigset_t set) 60static int _sigpause_common(old_sigset_t set)
@@ -141,15 +109,20 @@ restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
141 return err; 109 return err;
142} 110}
143 111
144static inline void do_new_sigreturn (struct pt_regs *regs) 112asmlinkage void do_sigreturn(struct pt_regs *regs)
145{ 113{
146 struct new_signal_frame __user *sf; 114 struct signal_frame __user *sf;
147 unsigned long up_psr, pc, npc; 115 unsigned long up_psr, pc, npc;
148 sigset_t set; 116 sigset_t set;
149 __siginfo_fpu_t __user *fpu_save; 117 __siginfo_fpu_t __user *fpu_save;
150 int err; 118 int err;
151 119
152 sf = (struct new_signal_frame __user *) regs->u_regs[UREG_FP]; 120 /* Always make any pending restarted system calls return -EINTR */
121 current_thread_info()->restart_block.fn = do_no_restart_syscall;
122
123 synchronize_user_stack();
124
125 sf = (struct signal_frame __user *) regs->u_regs[UREG_FP];
153 126
154 /* 1. Make sure we are not getting garbage from the user */ 127 /* 1. Make sure we are not getting garbage from the user */
155 if (!access_ok(VERIFY_READ, sf, sizeof(*sf))) 128 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)))
@@ -198,73 +171,6 @@ segv_and_exit:
198 force_sig(SIGSEGV, current); 171 force_sig(SIGSEGV, current);
199} 172}
200 173
201asmlinkage void do_sigreturn(struct pt_regs *regs)
202{
203 struct sigcontext __user *scptr;
204 unsigned long pc, npc, psr;
205 sigset_t set;
206 int err;
207
208 /* Always make any pending restarted system calls return -EINTR */
209 current_thread_info()->restart_block.fn = do_no_restart_syscall;
210
211 synchronize_user_stack();
212
213 if (current->thread.new_signal) {
214 do_new_sigreturn(regs);
215 return;
216 }
217
218 scptr = (struct sigcontext __user *) regs->u_regs[UREG_I0];
219
220 /* Check sanity of the user arg. */
221 if (!access_ok(VERIFY_READ, scptr, sizeof(struct sigcontext)) ||
222 (((unsigned long) scptr) & 3))
223 goto segv_and_exit;
224
225 err = __get_user(pc, &scptr->sigc_pc);
226 err |= __get_user(npc, &scptr->sigc_npc);
227
228 if ((pc | npc) & 3)
229 goto segv_and_exit;
230
231 /* This is pretty much atomic, no amount locking would prevent
232 * the races which exist anyways.
233 */
234 err |= __get_user(set.sig[0], &scptr->sigc_mask);
235 /* Note that scptr + 1 points to extramask */
236 err |= __copy_from_user(&set.sig[1], scptr + 1,
237 (_NSIG_WORDS - 1) * sizeof(unsigned int));
238
239 if (err)
240 goto segv_and_exit;
241
242 sigdelsetmask(&set, ~_BLOCKABLE);
243 spin_lock_irq(&current->sighand->siglock);
244 current->blocked = set;
245 recalc_sigpending();
246 spin_unlock_irq(&current->sighand->siglock);
247
248 regs->pc = pc;
249 regs->npc = npc;
250
251 err = __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp);
252 err |= __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0);
253 err |= __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1);
254
255 /* User can only change condition codes in %psr. */
256 err |= __get_user(psr, &scptr->sigc_psr);
257 if (err)
258 goto segv_and_exit;
259
260 regs->psr &= ~(PSR_ICC);
261 regs->psr |= (psr & PSR_ICC);
262 return;
263
264segv_and_exit:
265 force_sig(SIGSEGV, current);
266}
267
268asmlinkage void do_rt_sigreturn(struct pt_regs *regs) 174asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
269{ 175{
270 struct rt_signal_frame __user *sf; 176 struct rt_signal_frame __user *sf;
@@ -351,128 +257,6 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re
351 return (void __user *)(sp - framesize); 257 return (void __user *)(sp - framesize);
352} 258}
353 259
354static inline void
355setup_frame(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *oldset, siginfo_t *info)
356{
357 struct signal_sframe __user *sframep;
358 struct sigcontext __user *sc;
359 int window = 0, err;
360 unsigned long pc = regs->pc;
361 unsigned long npc = regs->npc;
362 struct thread_info *tp = current_thread_info();
363 void __user *sig_address;
364 int sig_code;
365
366 synchronize_user_stack();
367 sframep = (struct signal_sframe __user *)
368 get_sigframe(sa, regs, SF_ALIGNEDSZ);
369 if (invalid_frame_pointer(sframep, sizeof(*sframep))){
370 /* Don't change signal code and address, so that
371 * post mortem debuggers can have a look.
372 */
373 goto sigill_and_return;
374 }
375
376 sc = &sframep->sig_context;
377
378 /* We've already made sure frame pointer isn't in kernel space... */
379 err = __put_user((sas_ss_flags(regs->u_regs[UREG_FP]) == SS_ONSTACK),
380 &sc->sigc_onstack);
381 err |= __put_user(oldset->sig[0], &sc->sigc_mask);
382 err |= __copy_to_user(sframep->extramask, &oldset->sig[1],
383 (_NSIG_WORDS - 1) * sizeof(unsigned int));
384 err |= __put_user(regs->u_regs[UREG_FP], &sc->sigc_sp);
385 err |= __put_user(pc, &sc->sigc_pc);
386 err |= __put_user(npc, &sc->sigc_npc);
387 err |= __put_user(regs->psr, &sc->sigc_psr);
388 err |= __put_user(regs->u_regs[UREG_G1], &sc->sigc_g1);
389 err |= __put_user(regs->u_regs[UREG_I0], &sc->sigc_o0);
390 err |= __put_user(tp->w_saved, &sc->sigc_oswins);
391 if (tp->w_saved)
392 for (window = 0; window < tp->w_saved; window++) {
393 put_user((char *)tp->rwbuf_stkptrs[window],
394 &sc->sigc_spbuf[window]);
395 err |= __copy_to_user(&sc->sigc_wbuf[window],
396 &tp->reg_window[window],
397 sizeof(struct reg_window));
398 }
399 else
400 err |= __copy_to_user(sframep, (char *) regs->u_regs[UREG_FP],
401 sizeof(struct reg_window));
402
403 tp->w_saved = 0; /* So process is allowed to execute. */
404
405 err |= __put_user(signr, &sframep->sig_num);
406 sig_address = NULL;
407 sig_code = 0;
408 if (SI_FROMKERNEL (info) && (info->si_code & __SI_MASK) == __SI_FAULT) {
409 sig_address = info->si_addr;
410 switch (signr) {
411 case SIGSEGV:
412 switch (info->si_code) {
413 case SEGV_MAPERR: sig_code = SUBSIG_NOMAPPING; break;
414 default: sig_code = SUBSIG_PROTECTION; break;
415 }
416 break;
417 case SIGILL:
418 switch (info->si_code) {
419 case ILL_ILLOPC: sig_code = SUBSIG_ILLINST; break;
420 case ILL_PRVOPC: sig_code = SUBSIG_PRIVINST; break;
421 case ILL_ILLTRP: sig_code = SUBSIG_BADTRAP(info->si_trapno); break;
422 default: sig_code = SUBSIG_STACK; break;
423 }
424 break;
425 case SIGFPE:
426 switch (info->si_code) {
427 case FPE_INTDIV: sig_code = SUBSIG_IDIVZERO; break;
428 case FPE_INTOVF: sig_code = SUBSIG_FPINTOVFL; break;
429 case FPE_FLTDIV: sig_code = SUBSIG_FPDIVZERO; break;
430 case FPE_FLTOVF: sig_code = SUBSIG_FPOVFLOW; break;
431 case FPE_FLTUND: sig_code = SUBSIG_FPUNFLOW; break;
432 case FPE_FLTRES: sig_code = SUBSIG_FPINEXACT; break;
433 case FPE_FLTINV: sig_code = SUBSIG_FPOPERROR; break;
434 default: sig_code = SUBSIG_FPERROR; break;
435 }
436 break;
437 case SIGBUS:
438 switch (info->si_code) {
439 case BUS_ADRALN: sig_code = SUBSIG_ALIGNMENT; break;
440 case BUS_ADRERR: sig_code = SUBSIG_MISCERROR; break;
441 default: sig_code = SUBSIG_BUSTIMEOUT; break;
442 }
443 break;
444 case SIGEMT:
445 switch (info->si_code) {
446 case EMT_TAGOVF: sig_code = SUBSIG_TAG; break;
447 }
448 break;
449 case SIGSYS:
450 if (info->si_code == (__SI_FAULT|0x100)) {
451 sig_code = info->si_trapno;
452 break;
453 }
454 default:
455 sig_address = NULL;
456 }
457 }
458 err |= __put_user((unsigned long)sig_address, &sframep->sig_address);
459 err |= __put_user(sig_code, &sframep->sig_code);
460 err |= __put_user(sc, &sframep->sig_scptr);
461 if (err)
462 goto sigsegv;
463
464 regs->u_regs[UREG_FP] = (unsigned long) sframep;
465 regs->pc = (unsigned long) sa->sa_handler;
466 regs->npc = (regs->pc + 4);
467 return;
468
469sigill_and_return:
470 do_exit(SIGILL);
471sigsegv:
472 force_sigsegv(signr, current);
473}
474
475
476static inline int 260static inline int
477save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) 261save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
478{ 262{
@@ -508,21 +292,20 @@ save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
508 return err; 292 return err;
509} 293}
510 294
511static inline void 295static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs,
512new_setup_frame(struct k_sigaction *ka, struct pt_regs *regs, 296 int signo, sigset_t *oldset)
513 int signo, sigset_t *oldset)
514{ 297{
515 struct new_signal_frame __user *sf; 298 struct signal_frame __user *sf;
516 int sigframe_size, err; 299 int sigframe_size, err;
517 300
518 /* 1. Make sure everything is clean */ 301 /* 1. Make sure everything is clean */
519 synchronize_user_stack(); 302 synchronize_user_stack();
520 303
521 sigframe_size = NF_ALIGNEDSZ; 304 sigframe_size = SF_ALIGNEDSZ;
522 if (!used_math()) 305 if (!used_math())
523 sigframe_size -= sizeof(__siginfo_fpu_t); 306 sigframe_size -= sizeof(__siginfo_fpu_t);
524 307
525 sf = (struct new_signal_frame __user *) 308 sf = (struct signal_frame __user *)
526 get_sigframe(&ka->sa, regs, sigframe_size); 309 get_sigframe(&ka->sa, regs, sigframe_size);
527 310
528 if (invalid_frame_pointer(sf, sigframe_size)) 311 if (invalid_frame_pointer(sf, sigframe_size))
@@ -586,9 +369,8 @@ sigsegv:
586 force_sigsegv(signo, current); 369 force_sigsegv(signo, current);
587} 370}
588 371
589static inline void 372static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
590new_setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, 373 int signo, sigset_t *oldset, siginfo_t *info)
591 int signo, sigset_t *oldset, siginfo_t *info)
592{ 374{
593 struct rt_signal_frame __user *sf; 375 struct rt_signal_frame __user *sf;
594 int sigframe_size; 376 int sigframe_size;
@@ -674,11 +456,9 @@ handle_signal(unsigned long signr, struct k_sigaction *ka,
674 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) 456 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
675{ 457{
676 if (ka->sa.sa_flags & SA_SIGINFO) 458 if (ka->sa.sa_flags & SA_SIGINFO)
677 new_setup_rt_frame(ka, regs, signr, oldset, info); 459 setup_rt_frame(ka, regs, signr, oldset, info);
678 else if (current->thread.new_signal)
679 new_setup_frame(ka, regs, signr, oldset);
680 else 460 else
681 setup_frame(&ka->sa, regs, signr, oldset, info); 461 setup_frame(ka, regs, signr, oldset);
682 462
683 spin_lock_irq(&current->sighand->siglock); 463 spin_lock_irq(&current->sighand->siglock);
684 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 464 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c
index 42bf09db9a81..f188b5dc9fd0 100644
--- a/arch/sparc/kernel/sys_sparc.c
+++ b/arch/sparc/kernel/sys_sparc.c
@@ -1,5 +1,4 @@
1/* $Id: sys_sparc.c,v 1.70 2001/04/14 01:12:02 davem Exp $ 1/* linux/arch/sparc/kernel/sys_sparc.c
2 * linux/arch/sparc/kernel/sys_sparc.c
3 * 2 *
4 * This file contains various random system calls that 3 * This file contains various random system calls that
5 * have a non-standard calling sequence on the Linux/sparc 4 * have a non-standard calling sequence on the Linux/sparc
@@ -395,10 +394,8 @@ sparc_sigaction (int sig, const struct old_sigaction __user *act,
395 struct k_sigaction new_ka, old_ka; 394 struct k_sigaction new_ka, old_ka;
396 int ret; 395 int ret;
397 396
398 if (sig < 0) { 397 WARN_ON_ONCE(sig >= 0);
399 current->thread.new_signal = 1; 398 sig = -sig;
400 sig = -sig;
401 }
402 399
403 if (act) { 400 if (act) {
404 unsigned long mask; 401 unsigned long mask;
@@ -446,11 +443,6 @@ sys_rt_sigaction(int sig,
446 if (sigsetsize != sizeof(sigset_t)) 443 if (sigsetsize != sizeof(sigset_t))
447 return -EINVAL; 444 return -EINVAL;
448 445
449 /* All tasks which use RT signals (effectively) use
450 * new style signals.
451 */
452 current->thread.new_signal = 1;
453
454 if (act) { 446 if (act) {
455 new_ka.ka_restorer = restorer; 447 new_ka.ka_restorer = restorer;
456 if (copy_from_user(&new_ka.sa, act, sizeof(*act))) 448 if (copy_from_user(&new_ka.sa, act, sizeof(*act)))
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 8acc5cc38621..edbe71e3fab9 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -1,9 +1,5 @@
1# $Id: config.in,v 1.158 2002/01/24 22:14:44 davem Exp $ 1# sparc64 configuration
2# For a description of the syntax of this configuration file, 2mainmenu "Linux Kernel Configuration for 64-bit SPARC"
3# see the Configure script.
4#
5
6mainmenu "Linux/UltraSPARC Kernel Configuration"
7 3
8config SPARC 4config SPARC
9 bool 5 bool
@@ -17,12 +13,6 @@ config SPARC64
17 default y 13 default y
18 select HAVE_IDE 14 select HAVE_IDE
19 select HAVE_LMB 15 select HAVE_LMB
20 help
21 SPARC is a family of RISC microprocessors designed and marketed by
22 Sun Microsystems, incorporated. This port covers the newer 64-bit
23 UltraSPARC. The UltraLinux project maintains both the SPARC32 and
24 SPARC64 ports; its web page is available at
25 <http://www.ultralinux.org/>.
26 16
27config GENERIC_TIME 17config GENERIC_TIME
28 bool 18 bool
@@ -97,7 +87,7 @@ config SPARC64_PAGE_SIZE_8KB
97 help 87 help
98 This lets you select the page size of the kernel. 88 This lets you select the page size of the kernel.
99 89
100 8KB and 64KB work quite well, since Sparc ELF sections 90 8KB and 64KB work quite well, since SPARC ELF sections
101 provide for up to 64KB alignment. 91 provide for up to 64KB alignment.
102 92
103 Therefore, 512KB and 4MB are for expert hackers only. 93 Therefore, 512KB and 4MB are for expert hackers only.
@@ -138,7 +128,7 @@ config HOTPLUG_CPU
138 bool "Support for hot-pluggable CPUs" 128 bool "Support for hot-pluggable CPUs"
139 depends on SMP 129 depends on SMP
140 select HOTPLUG 130 select HOTPLUG
141 ---help--- 131 help
142 Say Y here to experiment with turning CPUs off and on. CPUs 132 Say Y here to experiment with turning CPUs off and on. CPUs
143 can be controlled through /sys/devices/system/cpu/cpu#. 133 can be controlled through /sys/devices/system/cpu/cpu#.
144 Say N if you want to disable CPU hotplug. 134 Say N if you want to disable CPU hotplug.
@@ -155,23 +145,16 @@ source "kernel/time/Kconfig"
155 145
156config SMP 146config SMP
157 bool "Symmetric multi-processing support" 147 bool "Symmetric multi-processing support"
158 ---help--- 148 help
159 This enables support for systems with more than one CPU. If you have 149 This enables support for systems with more than one CPU. If you have
160 a system with only one CPU, say N. If you have a system with more than 150 a system with only one CPU, say N. If you have a system with more than
161 one CPU, say Y. 151 one CPU, say Y.
162 152
163 If you say N here, the kernel will run on single and multiprocessor 153 If you say N here, the kernel will run on single and multiprocessor
164 machines, but will use only one CPU of a multiprocessor machine. If 154 machines, but will use only one CPU of a multiprocessor machine. If
165 you say Y here, the kernel will run on many, but not all, 155 you say Y here, the kernel will run on single-processor machines.
166 singleprocessor machines. On a singleprocessor machine, the kernel 156 On a single-processor machine, the kernel will run faster if you say
167 will run faster if you say N here. 157 N here.
168
169 People using multiprocessor machines who say Y here should also say
170 Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
171 Management" code will be disabled if you say Y here.
172
173 See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
174 available at <http://www.tldp.org/docs.html#howto>.
175 158
176 If you don't know what to do here, say N. 159 If you don't know what to do here, say N.
177 160
@@ -284,50 +267,19 @@ source "mm/Kconfig"
284 267
285config ISA 268config ISA
286 bool 269 bool
287 help
288 Find out whether you have ISA slots on your motherboard. ISA is the
289 name of a bus system, i.e. the way the CPU talks to the other stuff
290 inside your box. Other bus systems are PCI, EISA, MicroChannel
291 (MCA) or VESA. ISA is an older system, now being displaced by PCI;
292 newer boards don't support it. If you have ISA, say Y, otherwise N.
293 270
294config ISAPNP 271config ISAPNP
295 bool 272 bool
296 help
297 Say Y here if you would like support for ISA Plug and Play devices.
298 Some information is in <file:Documentation/isapnp.txt>.
299
300 To compile this driver as a module, choose M here: the
301 module will be called isapnp.
302
303 If unsure, say Y.
304 273
305config EISA 274config EISA
306 bool 275 bool
307 ---help---
308 The Extended Industry Standard Architecture (EISA) bus was
309 developed as an open alternative to the IBM MicroChannel bus.
310
311 The EISA bus provided some of the features of the IBM MicroChannel
312 bus while maintaining backward compatibility with cards made for
313 the older ISA bus. The EISA bus saw limited use between 1988 and
314 1995 when it was made obsolete by the PCI bus.
315
316 Say Y here if you are building a kernel for an EISA-based machine.
317
318 Otherwise, say N.
319 276
320config MCA 277config MCA
321 bool 278 bool
322 help
323 MicroChannel Architecture is found in some IBM PS/2 machines and
324 laptops. It is a bus system similar to PCI or ISA. See
325 <file:Documentation/mca.txt> (and especially the web page given
326 there) before attempting to build an MCA bus kernel.
327 279
328config PCMCIA 280config PCMCIA
329 tristate 281 tristate
330 ---help--- 282 help
331 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux 283 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux
332 computer. These are credit-card size devices such as network cards, 284 computer. These are credit-card size devices such as network cards,
333 modems or hard drives often used with laptops computers. There are 285 modems or hard drives often used with laptops computers. There are
@@ -369,10 +321,10 @@ config PCI
369 bool "PCI support" 321 bool "PCI support"
370 select ARCH_SUPPORTS_MSI 322 select ARCH_SUPPORTS_MSI
371 help 323 help
372 Find out whether you have a PCI motherboard. PCI is the name of a 324 Find out whether your system includes a PCI bus. PCI is the name of
373 bus system, i.e. the way the CPU talks to the other stuff inside 325 a bus system, i.e. the way the CPU talks to the other stuff inside
374 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or 326 your box. If you say Y here, the kernel will include drivers and
375 VESA. If you have PCI, say Y, otherwise N. 327 infrastructure code to support PCI bus devices.
376 328
377config PCI_DOMAINS 329config PCI_DOMAINS
378 def_bool PCI 330 def_bool PCI
@@ -396,15 +348,8 @@ menu "Executable file formats"
396 348
397source "fs/Kconfig.binfmt" 349source "fs/Kconfig.binfmt"
398 350
399config SPARC32_COMPAT
400 bool "Kernel support for Linux/Sparc 32bit binary compatibility"
401 help
402 This allows you to run 32-bit binaries on your Ultra.
403 Everybody wants this; say Y.
404
405config COMPAT 351config COMPAT
406 bool 352 bool
407 depends on SPARC32_COMPAT
408 default y 353 default y
409 select COMPAT_BINFMT_ELF 354 select COMPAT_BINFMT_ELF
410 355
@@ -421,8 +366,8 @@ config SCHED_SMT
421 default y 366 default y
422 help 367 help
423 SMT scheduler support improves the CPU scheduler's decision making 368 SMT scheduler support improves the CPU scheduler's decision making
424 when dealing with UltraSPARC cpus at a cost of slightly increased 369 when dealing with SPARC cpus at a cost of slightly increased overhead
425 overhead in some places. If unsure say N here. 370 in some places. If unsure say N here.
426 371
427config SCHED_MC 372config SCHED_MC
428 bool "Multi-core scheduler support" 373 bool "Multi-core scheduler support"
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 92f79680f70d..aff93c9d13f4 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-numa 3# Linux kernel version: 2.6.25
4# Wed Apr 23 04:49:08 2008 4# Sat Apr 26 03:11:06 2008
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
@@ -152,7 +152,9 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
152CONFIG_HUGETLB_PAGE_SIZE_4MB=y 152CONFIG_HUGETLB_PAGE_SIZE_4MB=y
153# CONFIG_HUGETLB_PAGE_SIZE_512K is not set 153# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
154# CONFIG_HUGETLB_PAGE_SIZE_64K is not set 154# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
155# CONFIG_NUMA is not set 155CONFIG_NUMA=y
156CONFIG_NODES_SHIFT=4
157CONFIG_NODES_SPAN_OTHER_NODES=y
156CONFIG_ARCH_POPULATES_NODE_MAP=y 158CONFIG_ARCH_POPULATES_NODE_MAP=y
157CONFIG_ARCH_SELECT_MEMORY_MODEL=y 159CONFIG_ARCH_SELECT_MEMORY_MODEL=y
158CONFIG_ARCH_SPARSEMEM_ENABLE=y 160CONFIG_ARCH_SPARSEMEM_ENABLE=y
@@ -162,12 +164,14 @@ CONFIG_SELECT_MEMORY_MODEL=y
162# CONFIG_DISCONTIGMEM_MANUAL is not set 164# CONFIG_DISCONTIGMEM_MANUAL is not set
163CONFIG_SPARSEMEM_MANUAL=y 165CONFIG_SPARSEMEM_MANUAL=y
164CONFIG_SPARSEMEM=y 166CONFIG_SPARSEMEM=y
167CONFIG_NEED_MULTIPLE_NODES=y
165CONFIG_HAVE_MEMORY_PRESENT=y 168CONFIG_HAVE_MEMORY_PRESENT=y
166# CONFIG_SPARSEMEM_STATIC is not set 169# CONFIG_SPARSEMEM_STATIC is not set
167CONFIG_SPARSEMEM_EXTREME=y 170CONFIG_SPARSEMEM_EXTREME=y
168CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y 171CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
169CONFIG_SPARSEMEM_VMEMMAP=y 172CONFIG_SPARSEMEM_VMEMMAP=y
170CONFIG_SPLIT_PTLOCK_CPUS=4 173CONFIG_SPLIT_PTLOCK_CPUS=4
174CONFIG_MIGRATION=y
171CONFIG_RESOURCES_64BIT=y 175CONFIG_RESOURCES_64BIT=y
172CONFIG_ZONE_DMA_FLAG=0 176CONFIG_ZONE_DMA_FLAG=0
173CONFIG_NR_QUICK=1 177CONFIG_NR_QUICK=1
@@ -191,7 +195,6 @@ CONFIG_SUN_OPENPROMFS=m
191CONFIG_BINFMT_ELF=y 195CONFIG_BINFMT_ELF=y
192CONFIG_COMPAT_BINFMT_ELF=y 196CONFIG_COMPAT_BINFMT_ELF=y
193CONFIG_BINFMT_MISC=m 197CONFIG_BINFMT_MISC=m
194CONFIG_SPARC32_COMPAT=y
195CONFIG_COMPAT=y 198CONFIG_COMPAT=y
196CONFIG_SYSVIPC_COMPAT=y 199CONFIG_SYSVIPC_COMPAT=y
197CONFIG_SCHED_SMT=y 200CONFIG_SCHED_SMT=y
@@ -746,13 +749,7 @@ CONFIG_DEVPORT=y
746CONFIG_I2C=y 749CONFIG_I2C=y
747CONFIG_I2C_BOARDINFO=y 750CONFIG_I2C_BOARDINFO=y
748# CONFIG_I2C_CHARDEV is not set 751# CONFIG_I2C_CHARDEV is not set
749
750#
751# I2C Algorithms
752#
753CONFIG_I2C_ALGOBIT=y 752CONFIG_I2C_ALGOBIT=y
754# CONFIG_I2C_ALGOPCF is not set
755# CONFIG_I2C_ALGOPCA is not set
756 753
757# 754#
758# I2C Hardware Bus support 755# I2C Hardware Bus support
@@ -780,6 +777,7 @@ CONFIG_I2C_ALGOBIT=y
780# CONFIG_I2C_VIA is not set 777# CONFIG_I2C_VIA is not set
781# CONFIG_I2C_VIAPRO is not set 778# CONFIG_I2C_VIAPRO is not set
782# CONFIG_I2C_VOODOO3 is not set 779# CONFIG_I2C_VOODOO3 is not set
780# CONFIG_I2C_PCA_PLATFORM is not set
783 781
784# 782#
785# Miscellaneous I2C Chip support 783# Miscellaneous I2C Chip support
@@ -1026,6 +1024,7 @@ CONFIG_SND_ALI5451=m
1026# CONFIG_SND_AU8810 is not set 1024# CONFIG_SND_AU8810 is not set
1027# CONFIG_SND_AU8820 is not set 1025# CONFIG_SND_AU8820 is not set
1028# CONFIG_SND_AU8830 is not set 1026# CONFIG_SND_AU8830 is not set
1027# CONFIG_SND_AW2 is not set
1029# CONFIG_SND_AZT3328 is not set 1028# CONFIG_SND_AZT3328 is not set
1030# CONFIG_SND_BT87X is not set 1029# CONFIG_SND_BT87X is not set
1031# CONFIG_SND_CA0106 is not set 1030# CONFIG_SND_CA0106 is not set
@@ -1097,10 +1096,6 @@ CONFIG_SND_SUN_CS4231=m
1097# CONFIG_SND_SOC is not set 1096# CONFIG_SND_SOC is not set
1098 1097
1099# 1098#
1100# SoC Audio support for SuperH
1101#
1102
1103#
1104# ALSA SoC audio for Freescale SOCs 1099# ALSA SoC audio for Freescale SOCs
1105# 1100#
1106 1101
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 63c6ae0dd273..2bd0340b743d 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -15,17 +15,17 @@ obj-y := process.o setup.o cpu.o idprom.o \
15 visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o 15 visemul.o prom.o of_device.o hvapi.o sstate.o mdesc.o
16 16
17obj-$(CONFIG_STACKTRACE) += stacktrace.o 17obj-$(CONFIG_STACKTRACE) += stacktrace.o
18obj-$(CONFIG_PCI) += ebus.o isa.o pci_common.o \ 18obj-$(CONFIG_PCI) += ebus.o pci_common.o \
19 pci_psycho.o pci_sabre.o pci_schizo.o \ 19 pci_psycho.o pci_sabre.o pci_schizo.o \
20 pci_sun4v.o pci_sun4v_asm.o pci_fire.o 20 pci_sun4v.o pci_sun4v_asm.o pci_fire.o
21obj-$(CONFIG_PCI_MSI) += pci_msi.o 21obj-$(CONFIG_PCI_MSI) += pci_msi.o
22obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o 22obj-$(CONFIG_SMP) += smp.o trampoline.o hvtramp.o
23obj-$(CONFIG_SPARC32_COMPAT) += sys32.o sys_sparc32.o signal32.o 23obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o
24obj-$(CONFIG_MODULES) += module.o 24obj-$(CONFIG_MODULES) += module.o
25obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o 25obj-$(CONFIG_US3_FREQ) += us3_cpufreq.o
26obj-$(CONFIG_US2E_FREQ) += us2e_cpufreq.o 26obj-$(CONFIG_US2E_FREQ) += us2e_cpufreq.o
27obj-$(CONFIG_KPROBES) += kprobes.o 27obj-$(CONFIG_KPROBES) += kprobes.o
28obj-$(CONFIG_SUN_LDOMS) += ldc.o vio.o viohs.o ds.o 28obj-$(CONFIG_SUN_LDOMS) += ldc.o vio.o viohs.o ds.o
29obj-$(CONFIG_AUDIT) += audit.o 29obj-$(CONFIG_AUDIT) += audit.o
30obj-$(CONFIG_AUDIT)$(CONFIG_SPARC32_COMPAT) += compat_audit.o 30obj-$(CONFIG_AUDIT)$(CONFIG_COMPAT) += compat_audit.o
31obj-y += $(obj-yy) 31obj-y += $(obj-yy)
diff --git a/arch/sparc64/kernel/audit.c b/arch/sparc64/kernel/audit.c
index 24d7f4b4178a..8fff0ac63d56 100644
--- a/arch/sparc64/kernel/audit.c
+++ b/arch/sparc64/kernel/audit.c
@@ -30,7 +30,7 @@ static unsigned signal_class[] = {
30 30
31int audit_classify_arch(int arch) 31int audit_classify_arch(int arch)
32{ 32{
33#ifdef CONFIG_SPARC32_COMPAT 33#ifdef CONFIG_COMPAT
34 if (arch == AUDIT_ARCH_SPARC) 34 if (arch == AUDIT_ARCH_SPARC)
35 return 1; 35 return 1;
36#endif 36#endif
@@ -39,7 +39,7 @@ int audit_classify_arch(int arch)
39 39
40int audit_classify_syscall(int abi, unsigned syscall) 40int audit_classify_syscall(int abi, unsigned syscall)
41{ 41{
42#ifdef CONFIG_SPARC32_COMPAT 42#ifdef CONFIG_COMPAT
43 extern int sparc32_classify_syscall(unsigned); 43 extern int sparc32_classify_syscall(unsigned);
44 if (abi == AUDIT_ARCH_SPARC) 44 if (abi == AUDIT_ARCH_SPARC)
45 return sparc32_classify_syscall(syscall); 45 return sparc32_classify_syscall(syscall);
@@ -60,7 +60,7 @@ int audit_classify_syscall(int abi, unsigned syscall)
60 60
61static int __init audit_classes_init(void) 61static int __init audit_classes_init(void)
62{ 62{
63#ifdef CONFIG_SPARC32_COMPAT 63#ifdef CONFIG_COMPAT
64 extern __u32 sparc32_dir_class[]; 64 extern __u32 sparc32_dir_class[];
65 extern __u32 sparc32_write_class[]; 65 extern __u32 sparc32_write_class[];
66 extern __u32 sparc32_read_class[]; 66 extern __u32 sparc32_read_class[];
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index eb88bd6e674e..b441a26b73b0 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -1,6 +1,6 @@
1/* irq.c: UltraSparc IRQ handling/init/registry. 1/* irq.c: UltraSparc IRQ handling/init/registry.
2 * 2 *
3 * Copyright (C) 1997, 2007 David S. Miller (davem@davemloft.net) 3 * Copyright (C) 1997, 2007, 2008 David S. Miller (davem@davemloft.net)
4 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 5 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
6 */ 6 */
@@ -308,6 +308,7 @@ static void sun4u_irq_enable(unsigned int virt_irq)
308 IMAP_AID_SAFARI | IMAP_NID_SAFARI); 308 IMAP_AID_SAFARI | IMAP_NID_SAFARI);
309 val |= tid | IMAP_VALID; 309 val |= tid | IMAP_VALID;
310 upa_writeq(val, imap); 310 upa_writeq(val, imap);
311 upa_writeq(ICLR_IDLE, data->iclr);
311 } 312 }
312} 313}
313 314
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
deleted file mode 100644
index a2af5ed784c9..000000000000
--- a/arch/sparc64/kernel/isa.c
+++ /dev/null
@@ -1,191 +0,0 @@
1#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/pci.h>
4#include <linux/slab.h>
5#include <asm/oplib.h>
6#include <asm/prom.h>
7#include <asm/of_device.h>
8#include <asm/isa.h>
9
10struct sparc_isa_bridge *isa_chain;
11
12static void __init fatal_err(const char *reason)
13{
14 prom_printf("ISA: fatal error, %s.\n", reason);
15}
16
17static void __init report_dev(struct sparc_isa_device *isa_dev, int child)
18{
19 if (child)
20 printk(" (%s)", isa_dev->prom_node->name);
21 else
22 printk(" [%s", isa_dev->prom_node->name);
23}
24
25static void __init isa_dev_get_resource(struct sparc_isa_device *isa_dev)
26{
27 struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
28
29 memcpy(&isa_dev->resource, &op->resource[0], sizeof(struct resource));
30}
31
32static void __init isa_dev_get_irq(struct sparc_isa_device *isa_dev)
33{
34 struct of_device *op = of_find_device_by_node(isa_dev->prom_node);
35
36 if (!op || !op->num_irqs) {
37 isa_dev->irq = PCI_IRQ_NONE;
38 } else {
39 isa_dev->irq = op->irqs[0];
40 }
41}
42
43static void __init isa_fill_children(struct sparc_isa_device *parent_isa_dev)
44{
45 struct device_node *dp = parent_isa_dev->prom_node->child;
46
47 if (!dp)
48 return;
49
50 printk(" ->");
51 while (dp) {
52 struct sparc_isa_device *isa_dev;
53
54 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
55 if (!isa_dev) {
56 fatal_err("cannot allocate child isa_dev");
57 prom_halt();
58 }
59
60 /* Link it in to parent. */
61 isa_dev->next = parent_isa_dev->child;
62 parent_isa_dev->child = isa_dev;
63
64 isa_dev->bus = parent_isa_dev->bus;
65 isa_dev->prom_node = dp;
66
67 isa_dev_get_resource(isa_dev);
68 isa_dev_get_irq(isa_dev);
69
70 report_dev(isa_dev, 1);
71
72 dp = dp->sibling;
73 }
74}
75
76static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
77{
78 struct device_node *dp = isa_br->prom_node->child;
79
80 while (dp) {
81 struct sparc_isa_device *isa_dev;
82 struct dev_archdata *sd;
83
84 isa_dev = kzalloc(sizeof(*isa_dev), GFP_KERNEL);
85 if (!isa_dev) {
86 printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
87 return;
88 }
89
90 sd = &isa_dev->ofdev.dev.archdata;
91 sd->prom_node = dp;
92 sd->op = &isa_dev->ofdev;
93 sd->iommu = isa_br->ofdev.dev.parent->archdata.iommu;
94 sd->stc = isa_br->ofdev.dev.parent->archdata.stc;
95 sd->numa_node = isa_br->ofdev.dev.parent->archdata.numa_node;
96
97 isa_dev->ofdev.node = dp;
98 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
99 isa_dev->ofdev.dev.bus = &isa_bus_type;
100 sprintf(isa_dev->ofdev.dev.bus_id, "isa[%08x]", dp->node);
101
102 /* Register with core */
103 if (of_device_register(&isa_dev->ofdev) != 0) {
104 printk(KERN_DEBUG "isa: device registration error for %s!\n",
105 dp->path_component_name);
106 kfree(isa_dev);
107 goto next_sibling;
108 }
109
110 /* Link it in. */
111 isa_dev->next = NULL;
112 if (isa_br->devices == NULL) {
113 isa_br->devices = isa_dev;
114 } else {
115 struct sparc_isa_device *tmp = isa_br->devices;
116
117 while (tmp->next)
118 tmp = tmp->next;
119
120 tmp->next = isa_dev;
121 }
122
123 isa_dev->bus = isa_br;
124 isa_dev->prom_node = dp;
125
126 isa_dev_get_resource(isa_dev);
127 isa_dev_get_irq(isa_dev);
128
129 report_dev(isa_dev, 0);
130
131 isa_fill_children(isa_dev);
132
133 printk("]");
134
135 next_sibling:
136 dp = dp->sibling;
137 }
138}
139
140void __init isa_init(void)
141{
142 struct pci_dev *pdev;
143 unsigned short vendor, device;
144 int index = 0;
145
146 vendor = PCI_VENDOR_ID_AL;
147 device = PCI_DEVICE_ID_AL_M1533;
148
149 pdev = NULL;
150 while ((pdev = pci_get_device(vendor, device, pdev)) != NULL) {
151 struct sparc_isa_bridge *isa_br;
152 struct device_node *dp;
153
154 dp = pci_device_to_OF_node(pdev);
155
156 isa_br = kzalloc(sizeof(*isa_br), GFP_KERNEL);
157 if (!isa_br) {
158 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
159 pci_dev_put(pdev);
160 return;
161 }
162
163 isa_br->ofdev.node = dp;
164 isa_br->ofdev.dev.parent = &pdev->dev;
165 isa_br->ofdev.dev.bus = &isa_bus_type;
166 sprintf(isa_br->ofdev.dev.bus_id, "isa%d", index);
167
168 /* Register with core */
169 if (of_device_register(&isa_br->ofdev) != 0) {
170 printk(KERN_DEBUG "isa: device registration error for %s!\n",
171 dp->path_component_name);
172 kfree(isa_br);
173 pci_dev_put(pdev);
174 return;
175 }
176
177 /* Link it in. */
178 isa_br->next = isa_chain;
179 isa_chain = isa_br;
180
181 isa_br->self = pdev;
182 isa_br->index = index++;
183 isa_br->prom_node = dp;
184
185 printk("isa%d:", isa_br->index);
186
187 isa_fill_devices(isa_br);
188
189 printk("\n");
190 }
191}
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 9e58e8cba1c3..d569f60c24b8 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -412,12 +412,6 @@ static int __init build_one_resource(struct device_node *parent,
412 412
413static int __init use_1to1_mapping(struct device_node *pp) 413static int __init use_1to1_mapping(struct device_node *pp)
414{ 414{
415 /* If this is on the PMU bus, don't try to translate it even
416 * if a ranges property exists.
417 */
418 if (!strcmp(pp->name, "pmu"))
419 return 1;
420
421 /* If we have a ranges property in the parent, use it. */ 415 /* If we have a ranges property in the parent, use it. */
422 if (of_find_property(pp, "ranges", NULL) != NULL) 416 if (of_find_property(pp, "ranges", NULL) != NULL)
423 return 0; 417 return 0;
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 49f912766519..dbf2fc2f4d87 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -23,7 +23,6 @@
23#include <asm/pgtable.h> 23#include <asm/pgtable.h>
24#include <asm/irq.h> 24#include <asm/irq.h>
25#include <asm/ebus.h> 25#include <asm/ebus.h>
26#include <asm/isa.h>
27#include <asm/prom.h> 26#include <asm/prom.h>
28#include <asm/apb.h> 27#include <asm/apb.h>
29 28
@@ -885,7 +884,6 @@ static int __init pcibios_init(void)
885 884
886 pci_scan_each_controller_bus(); 885 pci_scan_each_controller_bus();
887 886
888 isa_init();
889 ebus_init(); 887 ebus_init();
890 power_init(); 888 power_init();
891 889
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index acf8c5250aa9..056013749157 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -1,5 +1,4 @@
1/* $Id: process.c,v 1.131 2002/02/09 19:49:30 davem Exp $ 1/* arch/sparc64/kernel/process.c
2 * arch/sparc64/kernel/process.c
3 * 2 *
4 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
@@ -368,9 +367,6 @@ void flush_thread(void)
368 367
369 if (get_thread_current_ds() != ASI_AIUS) 368 if (get_thread_current_ds() != ASI_AIUS)
370 set_fs(USER_DS); 369 set_fs(USER_DS);
371
372 /* Init new signal delivery disposition. */
373 clear_thread_flag(TIF_NEWSIGNALS);
374} 370}
375 371
376/* It's a bit more tricky when 64-bit tasks are involved... */ 372/* It's a bit more tricky when 64-bit tasks are involved... */
@@ -595,6 +591,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
595 if (clone_flags & CLONE_SETTLS) 591 if (clone_flags & CLONE_SETTLS)
596 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3]; 592 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
597 593
594 /* We do not want to accidently trigger system call restart
595 * handling in the new thread. Therefore, clear out the trap
596 * type, which will make pt_regs_regs_is_syscall() return false.
597 */
598 pt_regs_clear_trap_type(t->kregs);
599
598 return 0; 600 return 0;
599} 601}
600 602
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index 77a3e8592cbc..f2d88d8f7a42 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -8,7 +8,7 @@
8 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 8 * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
9 */ 9 */
10 10
11#ifdef CONFIG_SPARC32_COMPAT 11#ifdef CONFIG_COMPAT
12#include <linux/compat.h> /* for compat_old_sigset_t */ 12#include <linux/compat.h> /* for compat_old_sigset_t */
13#endif 13#endif
14#include <linux/sched.h> 14#include <linux/sched.h>
@@ -236,9 +236,6 @@ struct rt_signal_frame {
236 __siginfo_fpu_t fpu_state; 236 __siginfo_fpu_t fpu_state;
237}; 237};
238 238
239/* Align macros */
240#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7)))
241
242static long _sigpause_common(old_sigset_t set) 239static long _sigpause_common(old_sigset_t set)
243{ 240{
244 set &= _BLOCKABLE; 241 set &= _BLOCKABLE;
@@ -400,7 +397,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
400 synchronize_user_stack(); 397 synchronize_user_stack();
401 save_and_clear_fpu(); 398 save_and_clear_fpu();
402 399
403 sigframe_size = RT_ALIGNEDSZ; 400 sigframe_size = sizeof(struct rt_signal_frame);
404 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) 401 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
405 sigframe_size -= sizeof(__siginfo_fpu_t); 402 sigframe_size -= sizeof(__siginfo_fpu_t);
406 403
@@ -516,11 +513,10 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
516 struct k_sigaction ka; 513 struct k_sigaction ka;
517 sigset_t *oldset; 514 sigset_t *oldset;
518 siginfo_t info; 515 siginfo_t info;
519 int signr, tt; 516 int signr;
520 517
521 tt = regs->magic & 0x1ff; 518 if (pt_regs_is_syscall(regs)) {
522 if (tt == 0x110 || tt == 0x111 || tt == 0x16d) { 519 pt_regs_clear_trap_type(regs);
523 regs->magic &= ~0x1ff;
524 cookie.restart_syscall = 1; 520 cookie.restart_syscall = 1;
525 } else 521 } else
526 cookie.restart_syscall = 0; 522 cookie.restart_syscall = 0;
@@ -531,7 +527,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
531 else 527 else
532 oldset = &current->blocked; 528 oldset = &current->blocked;
533 529
534#ifdef CONFIG_SPARC32_COMPAT 530#ifdef CONFIG_COMPAT
535 if (test_thread_flag(TIF_32BIT)) { 531 if (test_thread_flag(TIF_32BIT)) {
536 extern void do_signal32(sigset_t *, struct pt_regs *, 532 extern void do_signal32(sigset_t *, struct pt_regs *,
537 struct signal_deliver_cookie *); 533 struct signal_deliver_cookie *);
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 43cdec64d9c9..91f8d0826db1 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -1,5 +1,4 @@
1/* $Id: signal32.c,v 1.74 2002/02/09 19:49:30 davem Exp $ 1/* arch/sparc64/kernel/signal32.c
2 * arch/sparc64/kernel/signal32.c
3 * 2 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 3 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -31,30 +30,6 @@
31 30
32#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 31#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
33 32
34/* Signal frames: the original one (compatible with SunOS):
35 *
36 * Set up a signal frame... Make the stack look the way SunOS
37 * expects it to look which is basically:
38 *
39 * ---------------------------------- <-- %sp at signal time
40 * Struct sigcontext
41 * Signal address
42 * Ptr to sigcontext area above
43 * Signal code
44 * The signal number itself
45 * One register window
46 * ---------------------------------- <-- New %sp
47 */
48struct signal_sframe32 {
49 struct reg_window32 sig_window;
50 int sig_num;
51 int sig_code;
52 /* struct sigcontext32 * */ u32 sig_scptr;
53 int sig_address;
54 struct sigcontext32 sig_context;
55 unsigned int extramask[_COMPAT_NSIG_WORDS - 1];
56};
57
58/* This magic should be in g_upper[0] for all upper parts 33/* This magic should be in g_upper[0] for all upper parts
59 * to be valid. 34 * to be valid.
60 */ 35 */
@@ -65,12 +40,7 @@ typedef struct {
65 unsigned int asi; 40 unsigned int asi;
66} siginfo_extra_v8plus_t; 41} siginfo_extra_v8plus_t;
67 42
68/* 43struct signal_frame32 {
69 * And the new one, intended to be used for Linux applications only
70 * (we have enough in there to work with clone).
71 * All the interesting bits are in the info field.
72 */
73struct new_signal_frame32 {
74 struct sparc_stackf32 ss; 44 struct sparc_stackf32 ss;
75 __siginfo32_t info; 45 __siginfo32_t info;
76 /* __siginfo_fpu32_t * */ u32 fpu_save; 46 /* __siginfo_fpu32_t * */ u32 fpu_save;
@@ -149,8 +119,7 @@ struct rt_signal_frame32 {
149}; 119};
150 120
151/* Align macros */ 121/* Align macros */
152#define SF_ALIGNEDSZ (((sizeof(struct signal_sframe32) + 7) & (~7))) 122#define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7)))
153#define NF_ALIGNEDSZ (((sizeof(struct new_signal_frame32) + 7) & (~7)))
154#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) 123#define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7)))
155 124
156int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) 125int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
@@ -241,17 +210,22 @@ static int restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu
241 return err; 210 return err;
242} 211}
243 212
244void do_new_sigreturn32(struct pt_regs *regs) 213void do_sigreturn32(struct pt_regs *regs)
245{ 214{
246 struct new_signal_frame32 __user *sf; 215 struct signal_frame32 __user *sf;
247 unsigned int psr; 216 unsigned int psr;
248 unsigned pc, npc, fpu_save; 217 unsigned pc, npc, fpu_save;
249 sigset_t set; 218 sigset_t set;
250 unsigned seta[_COMPAT_NSIG_WORDS]; 219 unsigned seta[_COMPAT_NSIG_WORDS];
251 int err, i; 220 int err, i;
252 221
222 /* Always make any pending restarted system calls return -EINTR */
223 current_thread_info()->restart_block.fn = do_no_restart_syscall;
224
225 synchronize_user_stack();
226
253 regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL; 227 regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;
254 sf = (struct new_signal_frame32 __user *) regs->u_regs[UREG_FP]; 228 sf = (struct signal_frame32 __user *) regs->u_regs[UREG_FP];
255 229
256 /* 1. Make sure we are not getting garbage from the user */ 230 /* 1. Make sure we are not getting garbage from the user */
257 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)) || 231 if (!access_ok(VERIFY_READ, sf, sizeof(*sf)) ||
@@ -319,76 +293,6 @@ segv:
319 force_sig(SIGSEGV, current); 293 force_sig(SIGSEGV, current);
320} 294}
321 295
322asmlinkage void do_sigreturn32(struct pt_regs *regs)
323{
324 struct sigcontext32 __user *scptr;
325 unsigned int pc, npc, psr;
326 sigset_t set;
327 unsigned int seta[_COMPAT_NSIG_WORDS];
328 int err;
329
330 /* Always make any pending restarted system calls return -EINTR */
331 current_thread_info()->restart_block.fn = do_no_restart_syscall;
332
333 synchronize_user_stack();
334 if (test_thread_flag(TIF_NEWSIGNALS)) {
335 do_new_sigreturn32(regs);
336 return;
337 }
338
339 scptr = (struct sigcontext32 __user *)
340 (regs->u_regs[UREG_I0] & 0x00000000ffffffffUL);
341 /* Check sanity of the user arg. */
342 if (!access_ok(VERIFY_READ, scptr, sizeof(struct sigcontext32)) ||
343 (((unsigned long) scptr) & 3))
344 goto segv;
345
346 err = __get_user(pc, &scptr->sigc_pc);
347 err |= __get_user(npc, &scptr->sigc_npc);
348
349 if ((pc | npc) & 3)
350 goto segv; /* Nice try. */
351
352 err |= __get_user(seta[0], &scptr->sigc_mask);
353 /* Note that scptr + 1 points to extramask */
354 err |= copy_from_user(seta+1, scptr + 1,
355 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int));
356 if (err)
357 goto segv;
358 switch (_NSIG_WORDS) {
359 case 4: set.sig[3] = seta[6] + (((long)seta[7]) << 32);
360 case 3: set.sig[2] = seta[4] + (((long)seta[5]) << 32);
361 case 2: set.sig[1] = seta[2] + (((long)seta[3]) << 32);
362 case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32);
363 }
364 sigdelsetmask(&set, ~_BLOCKABLE);
365 spin_lock_irq(&current->sighand->siglock);
366 current->blocked = set;
367 recalc_sigpending();
368 spin_unlock_irq(&current->sighand->siglock);
369
370 if (test_thread_flag(TIF_32BIT)) {
371 pc &= 0xffffffff;
372 npc &= 0xffffffff;
373 }
374 regs->tpc = pc;
375 regs->tnpc = npc;
376 err = __get_user(regs->u_regs[UREG_FP], &scptr->sigc_sp);
377 err |= __get_user(regs->u_regs[UREG_I0], &scptr->sigc_o0);
378 err |= __get_user(regs->u_regs[UREG_G1], &scptr->sigc_g1);
379
380 /* User can only change condition codes in %tstate. */
381 err |= __get_user(psr, &scptr->sigc_psr);
382 if (err)
383 goto segv;
384 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
385 regs->tstate |= psr_to_tstate_icc(psr);
386 return;
387
388segv:
389 force_sig(SIGSEGV, current);
390}
391
392asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) 296asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
393{ 297{
394 struct rt_signal_frame32 __user *sf; 298 struct rt_signal_frame32 __user *sf;
@@ -504,145 +408,6 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns
504 return (void __user *)(sp - framesize); 408 return (void __user *)(sp - framesize);
505} 409}
506 410
507static void
508setup_frame32(struct sigaction *sa, struct pt_regs *regs, int signr, sigset_t *oldset, siginfo_t *info)
509{
510 struct signal_sframe32 __user *sframep;
511 struct sigcontext32 __user *sc;
512 unsigned int seta[_COMPAT_NSIG_WORDS];
513 int err = 0;
514 void __user *sig_address;
515 int sig_code;
516 unsigned long pc = regs->tpc;
517 unsigned long npc = regs->tnpc;
518 unsigned int psr;
519
520 if (test_thread_flag(TIF_32BIT)) {
521 pc &= 0xffffffff;
522 npc &= 0xffffffff;
523 }
524
525 synchronize_user_stack();
526 save_and_clear_fpu();
527
528 sframep = (struct signal_sframe32 __user *)
529 get_sigframe(sa, regs, SF_ALIGNEDSZ);
530 if (invalid_frame_pointer(sframep, sizeof(*sframep))){
531 /* Don't change signal code and address, so that
532 * post mortem debuggers can have a look.
533 */
534 do_exit(SIGILL);
535 }
536
537 sc = &sframep->sig_context;
538
539 /* We've already made sure frame pointer isn't in kernel space... */
540 err = __put_user((sas_ss_flags(regs->u_regs[UREG_FP]) == SS_ONSTACK),
541 &sc->sigc_onstack);
542
543 switch (_NSIG_WORDS) {
544 case 4: seta[7] = (oldset->sig[3] >> 32);
545 seta[6] = oldset->sig[3];
546 case 3: seta[5] = (oldset->sig[2] >> 32);
547 seta[4] = oldset->sig[2];
548 case 2: seta[3] = (oldset->sig[1] >> 32);
549 seta[2] = oldset->sig[1];
550 case 1: seta[1] = (oldset->sig[0] >> 32);
551 seta[0] = oldset->sig[0];
552 }
553 err |= __put_user(seta[0], &sc->sigc_mask);
554 err |= __copy_to_user(sframep->extramask, seta + 1,
555 (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int));
556 err |= __put_user(regs->u_regs[UREG_FP], &sc->sigc_sp);
557 err |= __put_user(pc, &sc->sigc_pc);
558 err |= __put_user(npc, &sc->sigc_npc);
559 psr = tstate_to_psr(regs->tstate);
560 if (current_thread_info()->fpsaved[0] & FPRS_FEF)
561 psr |= PSR_EF;
562 err |= __put_user(psr, &sc->sigc_psr);
563 err |= __put_user(regs->u_regs[UREG_G1], &sc->sigc_g1);
564 err |= __put_user(regs->u_regs[UREG_I0], &sc->sigc_o0);
565 err |= __put_user(get_thread_wsaved(), &sc->sigc_oswins);
566
567 err |= copy_in_user((u32 __user *)sframep,
568 (u32 __user *)(regs->u_regs[UREG_FP]),
569 sizeof(struct reg_window32));
570
571 set_thread_wsaved(0); /* So process is allowed to execute. */
572 err |= __put_user(signr, &sframep->sig_num);
573 sig_address = NULL;
574 sig_code = 0;
575 if (SI_FROMKERNEL (info) && (info->si_code & __SI_MASK) == __SI_FAULT) {
576 sig_address = info->si_addr;
577 switch (signr) {
578 case SIGSEGV:
579 switch (info->si_code) {
580 case SEGV_MAPERR: sig_code = SUBSIG_NOMAPPING; break;
581 default: sig_code = SUBSIG_PROTECTION; break;
582 }
583 break;
584 case SIGILL:
585 switch (info->si_code) {
586 case ILL_ILLOPC: sig_code = SUBSIG_ILLINST; break;
587 case ILL_PRVOPC: sig_code = SUBSIG_PRIVINST; break;
588 case ILL_ILLTRP: sig_code = SUBSIG_BADTRAP(info->si_trapno); break;
589 default: sig_code = SUBSIG_STACK; break;
590 }
591 break;
592 case SIGFPE:
593 switch (info->si_code) {
594 case FPE_INTDIV: sig_code = SUBSIG_IDIVZERO; break;
595 case FPE_INTOVF: sig_code = SUBSIG_FPINTOVFL; break;
596 case FPE_FLTDIV: sig_code = SUBSIG_FPDIVZERO; break;
597 case FPE_FLTOVF: sig_code = SUBSIG_FPOVFLOW; break;
598 case FPE_FLTUND: sig_code = SUBSIG_FPUNFLOW; break;
599 case FPE_FLTRES: sig_code = SUBSIG_FPINEXACT; break;
600 case FPE_FLTINV: sig_code = SUBSIG_FPOPERROR; break;
601 default: sig_code = SUBSIG_FPERROR; break;
602 }
603 break;
604 case SIGBUS:
605 switch (info->si_code) {
606 case BUS_ADRALN: sig_code = SUBSIG_ALIGNMENT; break;
607 case BUS_ADRERR: sig_code = SUBSIG_MISCERROR; break;
608 default: sig_code = SUBSIG_BUSTIMEOUT; break;
609 }
610 break;
611 case SIGEMT:
612 switch (info->si_code) {
613 case EMT_TAGOVF: sig_code = SUBSIG_TAG; break;
614 }
615 break;
616 case SIGSYS:
617 if (info->si_code == (__SI_FAULT|0x100)) {
618 /* See sys_sunos32.c */
619 sig_code = info->si_trapno;
620 break;
621 }
622 default:
623 sig_address = NULL;
624 }
625 }
626 err |= __put_user(ptr_to_compat(sig_address), &sframep->sig_address);
627 err |= __put_user(sig_code, &sframep->sig_code);
628 err |= __put_user(ptr_to_compat(sc), &sframep->sig_scptr);
629 if (err)
630 goto sigsegv;
631
632 regs->u_regs[UREG_FP] = (unsigned long) sframep;
633 regs->tpc = (unsigned long) sa->sa_handler;
634 regs->tnpc = (regs->tpc + 4);
635 if (test_thread_flag(TIF_32BIT)) {
636 regs->tpc &= 0xffffffff;
637 regs->tnpc &= 0xffffffff;
638 }
639 return;
640
641sigsegv:
642 force_sigsegv(signr, current);
643}
644
645
646static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) 411static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
647{ 412{
648 unsigned long *fpregs = current_thread_info()->fpregs; 413 unsigned long *fpregs = current_thread_info()->fpregs;
@@ -663,10 +428,10 @@ static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
663 return err; 428 return err;
664} 429}
665 430
666static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, 431static void setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
667 int signo, sigset_t *oldset) 432 int signo, sigset_t *oldset)
668{ 433{
669 struct new_signal_frame32 __user *sf; 434 struct signal_frame32 __user *sf;
670 int sigframe_size; 435 int sigframe_size;
671 u32 psr; 436 u32 psr;
672 int i, err; 437 int i, err;
@@ -676,11 +441,11 @@ static void new_setup_frame32(struct k_sigaction *ka, struct pt_regs *regs,
676 synchronize_user_stack(); 441 synchronize_user_stack();
677 save_and_clear_fpu(); 442 save_and_clear_fpu();
678 443
679 sigframe_size = NF_ALIGNEDSZ; 444 sigframe_size = SF_ALIGNEDSZ;
680 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) 445 if (!(current_thread_info()->fpsaved[0] & FPRS_FEF))
681 sigframe_size -= sizeof(__siginfo_fpu_t); 446 sigframe_size -= sizeof(__siginfo_fpu_t);
682 447
683 sf = (struct new_signal_frame32 __user *) 448 sf = (struct signal_frame32 __user *)
684 get_sigframe(&ka->sa, regs, sigframe_size); 449 get_sigframe(&ka->sa, regs, sigframe_size);
685 450
686 if (invalid_frame_pointer(sf, sigframe_size)) 451 if (invalid_frame_pointer(sf, sigframe_size))
@@ -944,10 +709,9 @@ static inline void handle_signal32(unsigned long signr, struct k_sigaction *ka,
944{ 709{
945 if (ka->sa.sa_flags & SA_SIGINFO) 710 if (ka->sa.sa_flags & SA_SIGINFO)
946 setup_rt_frame32(ka, regs, signr, oldset, info); 711 setup_rt_frame32(ka, regs, signr, oldset, info);
947 else if (test_thread_flag(TIF_NEWSIGNALS))
948 new_setup_frame32(ka, regs, signr, oldset);
949 else 712 else
950 setup_frame32(&ka->sa, regs, signr, oldset, info); 713 setup_frame32(ka, regs, signr, oldset);
714
951 spin_lock_irq(&current->sighand->siglock); 715 spin_lock_irq(&current->sighand->siglock);
952 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 716 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
953 if (!(ka->sa.sa_flags & SA_NOMASK)) 717 if (!(ka->sa.sa_flags & SA_NOMASK))
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index 66336590e830..8ac0b99f2c55 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -49,7 +49,6 @@
49#endif 49#endif
50#ifdef CONFIG_PCI 50#ifdef CONFIG_PCI
51#include <asm/ebus.h> 51#include <asm/ebus.h>
52#include <asm/isa.h>
53#endif 52#endif
54#include <asm/ns87303.h> 53#include <asm/ns87303.h>
55#include <asm/timer.h> 54#include <asm/timer.h>
@@ -187,7 +186,6 @@ EXPORT_SYMBOL(insw);
187EXPORT_SYMBOL(insl); 186EXPORT_SYMBOL(insl);
188#ifdef CONFIG_PCI 187#ifdef CONFIG_PCI
189EXPORT_SYMBOL(ebus_chain); 188EXPORT_SYMBOL(ebus_chain);
190EXPORT_SYMBOL(isa_chain);
191EXPORT_SYMBOL(pci_alloc_consistent); 189EXPORT_SYMBOL(pci_alloc_consistent);
192EXPORT_SYMBOL(pci_free_consistent); 190EXPORT_SYMBOL(pci_free_consistent);
193EXPORT_SYMBOL(pci_map_single); 191EXPORT_SYMBOL(pci_map_single);
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index c1a61e98899a..161ce4710fe7 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -554,10 +554,8 @@ asmlinkage long compat_sys_sigaction(int sig, struct old_sigaction32 __user *act
554 struct k_sigaction new_ka, old_ka; 554 struct k_sigaction new_ka, old_ka;
555 int ret; 555 int ret;
556 556
557 if (sig < 0) { 557 WARN_ON_ONCE(sig >= 0);
558 set_thread_flag(TIF_NEWSIGNALS); 558 sig = -sig;
559 sig = -sig;
560 }
561 559
562 if (act) { 560 if (act) {
563 compat_old_sigset_t mask; 561 compat_old_sigset_t mask;
@@ -601,11 +599,6 @@ asmlinkage long compat_sys_rt_sigaction(int sig,
601 if (sigsetsize != sizeof(compat_sigset_t)) 599 if (sigsetsize != sizeof(compat_sigset_t))
602 return -EINVAL; 600 return -EINVAL;
603 601
604 /* All tasks which use RT signals (effectively) use
605 * new style signals.
606 */
607 set_thread_flag(TIF_NEWSIGNALS);
608
609 if (act) { 602 if (act) {
610 u32 u_handler, u_restorer; 603 u32 u_handler, u_restorer;
611 604
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index fed3c375ccf3..d8765cc93d27 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -2,33 +2,69 @@
2 * Driver for PC-speaker like devices found on various Sparc systems. 2 * Driver for PC-speaker like devices found on various Sparc systems.
3 * 3 *
4 * Copyright (c) 2002 Vojtech Pavlik 4 * Copyright (c) 2002 Vojtech Pavlik
5 * Copyright (c) 2002, 2006 David S. Miller (davem@davemloft.net) 5 * Copyright (c) 2002, 2006, 2008 David S. Miller (davem@davemloft.net)
6 */ 6 */
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/input.h> 10#include <linux/input.h>
11#include <linux/platform_device.h> 11#include <linux/of_device.h>
12 12
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/ebus.h>
15#include <asm/isa.h>
16 14
17MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 15MODULE_AUTHOR("David S. Miller <davem@davemloft.net>");
18MODULE_DESCRIPTION("Sparc Speaker beeper driver"); 16MODULE_DESCRIPTION("Sparc Speaker beeper driver");
19MODULE_LICENSE("GPL"); 17MODULE_LICENSE("GPL");
20 18
19struct grover_beep_info {
20 void __iomem *freq_regs;
21 void __iomem *enable_reg;
22};
23
24struct bbc_beep_info {
25 u32 clock_freq;
26 void __iomem *regs;
27};
28
21struct sparcspkr_state { 29struct sparcspkr_state {
22 const char *name; 30 const char *name;
23 unsigned long iobase;
24 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); 31 int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value);
25 spinlock_t lock; 32 spinlock_t lock;
26 struct input_dev *input_dev; 33 struct input_dev *input_dev;
34 union {
35 struct grover_beep_info grover;
36 struct bbc_beep_info bbc;
37 } u;
27}; 38};
28 39
29static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 40static u32 bbc_count_to_reg(struct bbc_beep_info *info, unsigned int count)
41{
42 u32 val, clock_freq = info->clock_freq;
43 int i;
44
45 if (!count)
46 return 0;
47
48 if (count <= clock_freq >> 20)
49 return 1 << 18;
50
51 if (count >= clock_freq >> 12)
52 return 1 << 10;
53
54 val = 1 << 18;
55 for (i = 19; i >= 11; i--) {
56 val >>= 1;
57 if (count <= clock_freq >> i)
58 break;
59 }
60
61 return val;
62}
63
64static int bbc_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
30{ 65{
31 struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent); 66 struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent);
67 struct bbc_beep_info *info = &state->u.bbc;
32 unsigned int count = 0; 68 unsigned int count = 0;
33 unsigned long flags; 69 unsigned long flags;
34 70
@@ -44,24 +80,29 @@ static int ebus_spkr_event(struct input_dev *dev, unsigned int type, unsigned in
44 if (value > 20 && value < 32767) 80 if (value > 20 && value < 32767)
45 count = 1193182 / value; 81 count = 1193182 / value;
46 82
83 count = bbc_count_to_reg(info, count);
84
47 spin_lock_irqsave(&state->lock, flags); 85 spin_lock_irqsave(&state->lock, flags);
48 86
49 /* EBUS speaker only has on/off state, the frequency does not 87 if (count) {
50 * appear to be programmable. 88 outb(0x01, info->regs + 0);
51 */ 89 outb(0x00, info->regs + 2);
52 if (state->iobase & 0x2UL) 90 outb((count >> 16) & 0xff, info->regs + 3);
53 outb(!!count, state->iobase); 91 outb((count >> 8) & 0xff, info->regs + 4);
54 else 92 outb(0x00, info->regs + 5);
55 outl(!!count, state->iobase); 93 } else {
94 outb(0x00, info->regs + 0);
95 }
56 96
57 spin_unlock_irqrestore(&state->lock, flags); 97 spin_unlock_irqrestore(&state->lock, flags);
58 98
59 return 0; 99 return 0;
60} 100}
61 101
62static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 102static int grover_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
63{ 103{
64 struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent); 104 struct sparcspkr_state *state = dev_get_drvdata(dev->dev.parent);
105 struct grover_beep_info *info = &state->u.grover;
65 unsigned int count = 0; 106 unsigned int count = 0;
66 unsigned long flags; 107 unsigned long flags;
67 108
@@ -81,15 +122,15 @@ static int isa_spkr_event(struct input_dev *dev, unsigned int type, unsigned int
81 122
82 if (count) { 123 if (count) {
83 /* enable counter 2 */ 124 /* enable counter 2 */
84 outb(inb(state->iobase + 0x61) | 3, state->iobase + 0x61); 125 outb(inb(info->enable_reg) | 3, info->enable_reg);
85 /* set command for counter 2, 2 byte write */ 126 /* set command for counter 2, 2 byte write */
86 outb(0xB6, state->iobase + 0x43); 127 outb(0xB6, info->freq_regs + 1);
87 /* select desired HZ */ 128 /* select desired HZ */
88 outb(count & 0xff, state->iobase + 0x42); 129 outb(count & 0xff, info->freq_regs + 0);
89 outb((count >> 8) & 0xff, state->iobase + 0x42); 130 outb((count >> 8) & 0xff, info->freq_regs + 0);
90 } else { 131 } else {
91 /* disable counter 2 */ 132 /* disable counter 2 */
92 outb(inb_p(state->iobase + 0x61) & 0xFC, state->iobase + 0x61); 133 outb(inb_p(info->enable_reg) & 0xFC, info->enable_reg);
93 } 134 }
94 135
95 spin_unlock_irqrestore(&state->lock, flags); 136 spin_unlock_irqrestore(&state->lock, flags);
@@ -131,7 +172,7 @@ static int __devinit sparcspkr_probe(struct device *dev)
131 return 0; 172 return 0;
132} 173}
133 174
134static int __devexit sparcspkr_remove(struct of_device *dev) 175static int sparcspkr_shutdown(struct of_device *dev)
135{ 176{
136 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev); 177 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev);
137 struct input_dev *input_dev = state->input_dev; 178 struct input_dev *input_dev = state->input_dev;
@@ -139,115 +180,180 @@ static int __devexit sparcspkr_remove(struct of_device *dev)
139 /* turn off the speaker */ 180 /* turn off the speaker */
140 state->event(input_dev, EV_SND, SND_BELL, 0); 181 state->event(input_dev, EV_SND, SND_BELL, 0);
141 182
142 input_unregister_device(input_dev);
143
144 dev_set_drvdata(&dev->dev, NULL);
145 kfree(state);
146
147 return 0; 183 return 0;
148} 184}
149 185
150static int sparcspkr_shutdown(struct of_device *dev) 186static int __devinit bbc_beep_probe(struct of_device *op, const struct of_device_id *match)
151{ 187{
152 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev); 188 struct sparcspkr_state *state;
153 struct input_dev *input_dev = state->input_dev; 189 struct bbc_beep_info *info;
190 struct device_node *dp;
191 int err = -ENOMEM;
154 192
155 /* turn off the speaker */ 193 state = kzalloc(sizeof(*state), GFP_KERNEL);
156 state->event(input_dev, EV_SND, SND_BELL, 0); 194 if (!state)
195 goto out_err;
196
197 state->name = "Sparc BBC Speaker";
198 state->event = bbc_spkr_event;
199 spin_lock_init(&state->lock);
200
201 dp = of_find_node_by_path("/");
202 err = -ENODEV;
203 if (!dp)
204 goto out_free;
205
206 info = &state->u.bbc;
207 info->clock_freq = of_getintprop_default(dp, "clock-frequency", 0);
208 if (!info->clock_freq)
209 goto out_free;
210
211 info->regs = of_ioremap(&op->resource[0], 0, 6, "bbc beep");
212 if (!info->regs)
213 goto out_free;
214
215 dev_set_drvdata(&op->dev, state);
216
217 err = sparcspkr_probe(&op->dev);
218 if (err)
219 goto out_clear_drvdata;
157 220
158 return 0; 221 return 0;
222
223out_clear_drvdata:
224 dev_set_drvdata(&op->dev, NULL);
225 of_iounmap(&op->resource[0], info->regs, 6);
226
227out_free:
228 kfree(state);
229out_err:
230 return err;
159} 231}
160 232
161static int __devinit ebus_beep_probe(struct of_device *dev, const struct of_device_id *match) 233static int bbc_remove(struct of_device *op)
162{ 234{
163 struct linux_ebus_device *edev = to_ebus_device(&dev->dev); 235 struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
164 struct sparcspkr_state *state; 236 struct input_dev *input_dev = state->input_dev;
165 int err; 237 struct bbc_beep_info *info = &state->u.bbc;
166 238
167 state = kzalloc(sizeof(*state), GFP_KERNEL); 239 /* turn off the speaker */
168 if (!state) 240 state->event(input_dev, EV_SND, SND_BELL, 0);
169 return -ENOMEM;
170 241
171 state->name = "Sparc EBUS Speaker"; 242 input_unregister_device(input_dev);
172 state->iobase = edev->resource[0].start;
173 state->event = ebus_spkr_event;
174 spin_lock_init(&state->lock);
175 243
176 dev_set_drvdata(&dev->dev, state); 244 of_iounmap(&op->resource[0], info->regs, 6);
177 245
178 err = sparcspkr_probe(&dev->dev); 246 dev_set_drvdata(&op->dev, NULL);
179 if (err) { 247 kfree(state);
180 dev_set_drvdata(&dev->dev, NULL);
181 kfree(state);
182 }
183 248
184 return 0; 249 return 0;
185} 250}
186 251
187static struct of_device_id ebus_beep_match[] = { 252static struct of_device_id bbc_beep_match[] = {
188 { 253 {
189 .name = "beep", 254 .name = "beep",
255 .compatible = "SUNW,bbc-beep",
190 }, 256 },
191 {}, 257 {},
192}; 258};
193 259
194static struct of_platform_driver ebus_beep_driver = { 260static struct of_platform_driver bbc_beep_driver = {
195 .name = "beep", 261 .name = "bbcbeep",
196 .match_table = ebus_beep_match, 262 .match_table = bbc_beep_match,
197 .probe = ebus_beep_probe, 263 .probe = bbc_beep_probe,
198 .remove = __devexit_p(sparcspkr_remove), 264 .remove = __devexit_p(bbc_remove),
199 .shutdown = sparcspkr_shutdown, 265 .shutdown = sparcspkr_shutdown,
200}; 266};
201 267
202static int __devinit isa_beep_probe(struct of_device *dev, const struct of_device_id *match) 268static int __devinit grover_beep_probe(struct of_device *op, const struct of_device_id *match)
203{ 269{
204 struct sparc_isa_device *idev = to_isa_device(&dev->dev);
205 struct sparcspkr_state *state; 270 struct sparcspkr_state *state;
206 int err; 271 struct grover_beep_info *info;
272 int err = -ENOMEM;
207 273
208 state = kzalloc(sizeof(*state), GFP_KERNEL); 274 state = kzalloc(sizeof(*state), GFP_KERNEL);
209 if (!state) 275 if (!state)
210 return -ENOMEM; 276 goto out_err;
211 277
212 state->name = "Sparc ISA Speaker"; 278 state->name = "Sparc Grover Speaker";
213 state->iobase = idev->resource.start; 279 state->event = grover_spkr_event;
214 state->event = isa_spkr_event;
215 spin_lock_init(&state->lock); 280 spin_lock_init(&state->lock);
216 281
217 dev_set_drvdata(&dev->dev, state); 282 info = &state->u.grover;
283 info->freq_regs = of_ioremap(&op->resource[2], 0, 2, "grover beep freq");
284 if (!info->freq_regs)
285 goto out_free;
218 286
219 err = sparcspkr_probe(&dev->dev); 287 info->enable_reg = of_ioremap(&op->resource[3], 0, 1, "grover beep enable");
220 if (err) { 288 if (!info->enable_reg)
221 dev_set_drvdata(&dev->dev, NULL); 289 goto out_unmap_freq_regs;
222 kfree(state); 290
223 } 291 dev_set_drvdata(&op->dev, state);
292
293 err = sparcspkr_probe(&op->dev);
294 if (err)
295 goto out_clear_drvdata;
296
297 return 0;
298
299out_clear_drvdata:
300 dev_set_drvdata(&op->dev, NULL);
301 of_iounmap(&op->resource[3], info->enable_reg, 1);
302
303out_unmap_freq_regs:
304 of_iounmap(&op->resource[2], info->freq_regs, 2);
305out_free:
306 kfree(state);
307out_err:
308 return err;
309}
310
311static int grover_remove(struct of_device *op)
312{
313 struct sparcspkr_state *state = dev_get_drvdata(&op->dev);
314 struct grover_beep_info *info = &state->u.grover;
315 struct input_dev *input_dev = state->input_dev;
316
317 /* turn off the speaker */
318 state->event(input_dev, EV_SND, SND_BELL, 0);
319
320 input_unregister_device(input_dev);
321
322 of_iounmap(&op->resource[3], info->enable_reg, 1);
323 of_iounmap(&op->resource[2], info->freq_regs, 2);
324
325 dev_set_drvdata(&op->dev, NULL);
326 kfree(state);
224 327
225 return 0; 328 return 0;
226} 329}
227 330
228static struct of_device_id isa_beep_match[] = { 331static struct of_device_id grover_beep_match[] = {
229 { 332 {
230 .name = "dma", 333 .name = "beep",
334 .compatible = "SUNW,smbus-beep",
231 }, 335 },
232 {}, 336 {},
233}; 337};
234 338
235static struct of_platform_driver isa_beep_driver = { 339static struct of_platform_driver grover_beep_driver = {
236 .name = "beep", 340 .name = "groverbeep",
237 .match_table = isa_beep_match, 341 .match_table = grover_beep_match,
238 .probe = isa_beep_probe, 342 .probe = grover_beep_probe,
239 .remove = __devexit_p(sparcspkr_remove), 343 .remove = __devexit_p(grover_remove),
240 .shutdown = sparcspkr_shutdown, 344 .shutdown = sparcspkr_shutdown,
241}; 345};
242 346
243static int __init sparcspkr_init(void) 347static int __init sparcspkr_init(void)
244{ 348{
245 int err = of_register_driver(&ebus_beep_driver, &ebus_bus_type); 349 int err = of_register_driver(&bbc_beep_driver,
350 &of_platform_bus_type);
246 351
247 if (!err) { 352 if (!err) {
248 err = of_register_driver(&isa_beep_driver, &isa_bus_type); 353 err = of_register_driver(&grover_beep_driver,
354 &of_platform_bus_type);
249 if (err) 355 if (err)
250 of_unregister_driver(&ebus_beep_driver); 356 of_unregister_driver(&bbc_beep_driver);
251 } 357 }
252 358
253 return err; 359 return err;
@@ -255,8 +361,8 @@ static int __init sparcspkr_init(void)
255 361
256static void __exit sparcspkr_exit(void) 362static void __exit sparcspkr_exit(void)
257{ 363{
258 of_unregister_driver(&ebus_beep_driver); 364 of_unregister_driver(&bbc_beep_driver);
259 of_unregister_driver(&isa_beep_driver); 365 of_unregister_driver(&grover_beep_driver);
260} 366}
261 367
262module_init(sparcspkr_init); 368module_init(sparcspkr_init);
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 3271379a36db..90a20a152ebf 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1231,7 +1231,7 @@ static inline struct console *SUNZILOG_CONSOLE(void)
1231#define SUNZILOG_CONSOLE() (NULL) 1231#define SUNZILOG_CONSOLE() (NULL)
1232#endif 1232#endif
1233 1233
1234static void __devinit sunzilog_init_kbdms(struct uart_sunzilog_port *up, int channel) 1234static void __devinit sunzilog_init_kbdms(struct uart_sunzilog_port *up)
1235{ 1235{
1236 int baud, brg; 1236 int baud, brg;
1237 1237
@@ -1305,7 +1305,7 @@ static void __devinit sunzilog_init_hw(struct uart_sunzilog_port *up)
1305 up->curregs[R7] = 0x7E; /* SDLC Flag */ 1305 up->curregs[R7] = 0x7E; /* SDLC Flag */
1306 up->curregs[R9] = NV; 1306 up->curregs[R9] = NV;
1307 up->curregs[R7p] = 0x00; 1307 up->curregs[R7p] = 0x00;
1308 sunzilog_init_kbdms(up, up->port.line); 1308 sunzilog_init_kbdms(up);
1309 /* Only enable interrupts if an ISR handler available */ 1309 /* Only enable interrupts if an ISR handler available */
1310 if (up->flags & SUNZILOG_FLAG_ISR_HANDLER) 1310 if (up->flags & SUNZILOG_FLAG_ISR_HANDLER)
1311 up->curregs[R9] |= MIE; 1311 up->curregs[R9] |= MIE;
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c
index 833b10c84064..275d9dab0c61 100644
--- a/drivers/video/bw2.c
+++ b/drivers/video/bw2.c
@@ -339,7 +339,7 @@ static int __devinit bw2_probe(struct of_device *op, const struct of_device_id *
339 339
340 dev_set_drvdata(&op->dev, info); 340 dev_set_drvdata(&op->dev, info);
341 341
342 printk("%s: bwtwo at %lx:%lx\n", 342 printk(KERN_INFO "%s: bwtwo at %lx:%lx\n",
343 dp->full_name, par->which_io, par->physbase); 343 dp->full_name, par->which_io, par->physbase);
344 344
345 return 0; 345 return 0;
@@ -399,10 +399,9 @@ static int __init bw2_init(void)
399 399
400static void __exit bw2_exit(void) 400static void __exit bw2_exit(void)
401{ 401{
402 return of_unregister_driver(&bw2_driver); 402 of_unregister_driver(&bw2_driver);
403} 403}
404 404
405
406module_init(bw2_init); 405module_init(bw2_init);
407module_exit(bw2_exit); 406module_exit(bw2_exit);
408 407
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c
index fdc9f43ec30a..0db0fecba93b 100644
--- a/drivers/video/cg14.c
+++ b/drivers/video/cg14.c
@@ -556,7 +556,7 @@ static int __devinit cg14_probe(struct of_device *op, const struct of_device_id
556 556
557 dev_set_drvdata(&op->dev, info); 557 dev_set_drvdata(&op->dev, info);
558 558
559 printk("%s: cgfourteen at %lx:%lx, %dMB\n", 559 printk(KERN_INFO "%s: cgfourteen at %lx:%lx, %dMB\n",
560 dp->full_name, 560 dp->full_name,
561 par->iospace, par->physbase, 561 par->iospace, par->physbase,
562 par->ramsize >> 20); 562 par->ramsize >> 20);
@@ -605,7 +605,7 @@ static struct of_platform_driver cg14_driver = {
605 .remove = __devexit_p(cg14_remove), 605 .remove = __devexit_p(cg14_remove),
606}; 606};
607 607
608int __init cg14_init(void) 608static int __init cg14_init(void)
609{ 609{
610 if (fb_get_options("cg14fb", NULL)) 610 if (fb_get_options("cg14fb", NULL))
611 return -ENODEV; 611 return -ENODEV;
@@ -613,7 +613,7 @@ int __init cg14_init(void)
613 return of_register_driver(&cg14_driver, &of_bus_type); 613 return of_register_driver(&cg14_driver, &of_bus_type);
614} 614}
615 615
616void __exit cg14_exit(void) 616static void __exit cg14_exit(void)
617{ 617{
618 of_unregister_driver(&cg14_driver); 618 of_unregister_driver(&cg14_driver);
619} 619}
diff --git a/drivers/video/cg3.c b/drivers/video/cg3.c
index a5c7fb331527..010ea53978f8 100644
--- a/drivers/video/cg3.c
+++ b/drivers/video/cg3.c
@@ -419,7 +419,7 @@ static int __devinit cg3_probe(struct of_device *op,
419 419
420 dev_set_drvdata(&op->dev, info); 420 dev_set_drvdata(&op->dev, info);
421 421
422 printk("%s: cg3 at %lx:%lx\n", 422 printk(KERN_INFO "%s: cg3 at %lx:%lx\n",
423 dp->full_name, par->which_io, par->physbase); 423 dp->full_name, par->which_io, par->physbase);
424 424
425 return 0; 425 return 0;
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 549891d76ef5..fc90db6da65a 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -781,7 +781,7 @@ static int __devinit cg6_probe(struct of_device *op,
781 781
782 dev_set_drvdata(&op->dev, info); 782 dev_set_drvdata(&op->dev, info);
783 783
784 printk("%s: CGsix [%s] at %lx:%lx\n", 784 printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n",
785 dp->full_name, info->fix.id, 785 dp->full_name, info->fix.id,
786 par->which_io, par->physbase); 786 par->which_io, par->physbase);
787 787
diff --git a/drivers/video/ffb.c b/drivers/video/ffb.c
index d7e24889650e..93dca3e2aa50 100644
--- a/drivers/video/ffb.c
+++ b/drivers/video/ffb.c
@@ -32,7 +32,6 @@
32static int ffb_setcolreg(unsigned, unsigned, unsigned, unsigned, 32static int ffb_setcolreg(unsigned, unsigned, unsigned, unsigned,
33 unsigned, struct fb_info *); 33 unsigned, struct fb_info *);
34static int ffb_blank(int, struct fb_info *); 34static int ffb_blank(int, struct fb_info *);
35static void ffb_init_fix(struct fb_info *);
36 35
37static void ffb_imageblit(struct fb_info *, const struct fb_image *); 36static void ffb_imageblit(struct fb_info *, const struct fb_image *);
38static void ffb_fillrect(struct fb_info *, const struct fb_fillrect *); 37static void ffb_fillrect(struct fb_info *, const struct fb_fillrect *);
@@ -1001,7 +1000,7 @@ static int __devinit ffb_probe(struct of_device *op,
1001 1000
1002 dev_set_drvdata(&op->dev, info); 1001 dev_set_drvdata(&op->dev, info);
1003 1002
1004 printk("%s: %s at %016lx, type %d, " 1003 printk(KERN_INFO "%s: %s at %016lx, type %d, "
1005 "DAC pnum[%x] rev[%d] manuf_rev[%d]\n", 1004 "DAC pnum[%x] rev[%d] manuf_rev[%d]\n",
1006 dp->full_name, 1005 dp->full_name,
1007 ((par->flags & FFB_FLAG_AFB) ? "AFB" : "FFB"), 1006 ((par->flags & FFB_FLAG_AFB) ? "AFB" : "FFB"),
@@ -1062,7 +1061,7 @@ static struct of_platform_driver ffb_driver = {
1062 .remove = __devexit_p(ffb_remove), 1061 .remove = __devexit_p(ffb_remove),
1063}; 1062};
1064 1063
1065int __init ffb_init(void) 1064static int __init ffb_init(void)
1066{ 1065{
1067 if (fb_get_options("ffb", NULL)) 1066 if (fb_get_options("ffb", NULL))
1068 return -ENODEV; 1067 return -ENODEV;
@@ -1070,7 +1069,7 @@ int __init ffb_init(void)
1070 return of_register_driver(&ffb_driver, &of_bus_type); 1069 return of_register_driver(&ffb_driver, &of_bus_type);
1071} 1070}
1072 1071
1073void __exit ffb_exit(void) 1072static void __exit ffb_exit(void)
1074{ 1073{
1075 of_unregister_driver(&ffb_driver); 1074 of_unregister_driver(&ffb_driver);
1076} 1075}
diff --git a/drivers/video/leo.c b/drivers/video/leo.c
index 45b9a5d55dec..f3160fc29795 100644
--- a/drivers/video/leo.c
+++ b/drivers/video/leo.c
@@ -614,7 +614,7 @@ static int __devinit leo_probe(struct of_device *op, const struct of_device_id *
614 614
615 dev_set_drvdata(&op->dev, info); 615 dev_set_drvdata(&op->dev, info);
616 616
617 printk("%s: leo at %lx:%lx\n", 617 printk(KERN_INFO "%s: leo at %lx:%lx\n",
618 dp->full_name, 618 dp->full_name,
619 par->which_io, par->physbase); 619 par->which_io, par->physbase);
620 620
diff --git a/drivers/video/p9100.c b/drivers/video/p9100.c
index 58496061142d..c95874fe9076 100644
--- a/drivers/video/p9100.c
+++ b/drivers/video/p9100.c
@@ -310,7 +310,7 @@ static int __devinit p9100_probe(struct of_device *op, const struct of_device_id
310 310
311 dev_set_drvdata(&op->dev, info); 311 dev_set_drvdata(&op->dev, info);
312 312
313 printk("%s: p9100 at %lx:%lx\n", 313 printk(KERN_INFO "%s: p9100 at %lx:%lx\n",
314 dp->full_name, 314 dp->full_name,
315 par->which_io, par->physbase); 315 par->which_io, par->physbase);
316 316
diff --git a/drivers/video/tcx.c b/drivers/video/tcx.c
index e5a9ddb3c8be..a71774305772 100644
--- a/drivers/video/tcx.c
+++ b/drivers/video/tcx.c
@@ -419,7 +419,7 @@ static int __devinit tcx_init_one(struct of_device *op)
419 par->mmap_map[6].size = SBUS_MMAP_EMPTY; 419 par->mmap_map[6].size = SBUS_MMAP_EMPTY;
420 } 420 }
421 421
422 par->physbase = 0; 422 par->physbase = op->resource[0].start;
423 par->which_io = op->resource[0].flags & IORESOURCE_BITS; 423 par->which_io = op->resource[0].flags & IORESOURCE_BITS;
424 424
425 for (i = 0; i < TCX_MMAP_ENTRIES; i++) { 425 for (i = 0; i < TCX_MMAP_ENTRIES; i++) {
@@ -470,10 +470,10 @@ static int __devinit tcx_init_one(struct of_device *op)
470 470
471 dev_set_drvdata(&op->dev, info); 471 dev_set_drvdata(&op->dev, info);
472 472
473 printk("%s: TCX at %lx:%lx, %s\n", 473 printk(KERN_INFO "%s: TCX at %lx:%lx, %s\n",
474 dp->full_name, 474 dp->full_name,
475 par->which_io, 475 par->which_io,
476 op->resource[0].start, 476 par->physbase,
477 par->lowdepth ? "8-bit only" : "24-bit depth"); 477 par->lowdepth ? "8-bit only" : "24-bit depth");
478 478
479 return 0; 479 return 0;
@@ -527,7 +527,7 @@ static struct of_platform_driver tcx_driver = {
527 .remove = __devexit_p(tcx_remove), 527 .remove = __devexit_p(tcx_remove),
528}; 528};
529 529
530int __init tcx_init(void) 530static int __init tcx_init(void)
531{ 531{
532 if (fb_get_options("tcxfb", NULL)) 532 if (fb_get_options("tcxfb", NULL))
533 return -ENODEV; 533 return -ENODEV;
@@ -535,7 +535,7 @@ int __init tcx_init(void)
535 return of_register_driver(&tcx_driver, &of_bus_type); 535 return of_register_driver(&tcx_driver, &of_bus_type);
536} 536}
537 537
538void __exit tcx_exit(void) 538static void __exit tcx_exit(void)
539{ 539{
540 of_unregister_driver(&tcx_driver); 540 of_unregister_driver(&tcx_driver);
541} 541}
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index e3006979709b..8898efbbbe07 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -1,5 +1,4 @@
1/* $Id: processor.h,v 1.83 2001/10/08 09:32:13 davem Exp $ 1/* include/asm-sparc/processor.h
2 * include/asm-sparc/processor.h
3 * 2 *
4 * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
5 */ 4 */
@@ -65,7 +64,6 @@ struct thread_struct {
65 struct fpq fpqueue[16]; 64 struct fpq fpqueue[16];
66 unsigned long flags; 65 unsigned long flags;
67 mm_segment_t current_ds; 66 mm_segment_t current_ds;
68 int new_signal;
69}; 67};
70 68
71#define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ 69#define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index c47f58d6c15c..ca19f80a9b7d 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -293,7 +293,6 @@ static int sun_fd_eject(int drive)
293 293
294#ifdef CONFIG_PCI 294#ifdef CONFIG_PCI
295#include <asm/ebus.h> 295#include <asm/ebus.h>
296#include <asm/isa.h>
297#include <asm/ns87303.h> 296#include <asm/ns87303.h>
298 297
299static struct ebus_dma_info sun_pci_fd_ebus_dma; 298static struct ebus_dma_info sun_pci_fd_ebus_dma;
@@ -558,82 +557,6 @@ static int __init ebus_fdthree_p(struct linux_ebus_device *edev)
558} 557}
559#endif 558#endif
560 559
561#ifdef CONFIG_PCI
562#undef ISA_FLOPPY_WORKS
563
564#ifdef ISA_FLOPPY_WORKS
565static unsigned long __init isa_floppy_init(void)
566{
567 struct sparc_isa_bridge *isa_br;
568 struct sparc_isa_device *isa_dev = NULL;
569
570 for_each_isa(isa_br) {
571 for_each_isadev(isa_dev, isa_br) {
572 if (!strcmp(isa_dev->prom_node->name, "dma")) {
573 struct sparc_isa_device *child =
574 isa_dev->child;
575
576 while (child) {
577 if (!strcmp(child->prom_node->name,
578 "floppy")) {
579 isa_dev = child;
580 goto isa_done;
581 }
582 child = child->next;
583 }
584 }
585 }
586 }
587isa_done:
588 if (!isa_dev)
589 return 0;
590
591 /* We could use DMA on devices behind the ISA bridge, but...
592 *
593 * There is a slight problem. Normally on x86 kit the x86 processor
594 * delays I/O port instructions when the ISA bus "dma in progress"
595 * signal is active. Well, sparc64 systems do not monitor this
596 * signal thus we would need to block all I/O port accesses in software
597 * when a dma transfer is active for some device.
598 */
599
600 sun_fdc = (struct sun_flpy_controller *)isa_dev->resource.start;
601 FLOPPY_IRQ = isa_dev->irq;
602
603 sun_fdops.fd_inb = sun_pci_fd_inb;
604 sun_fdops.fd_outb = sun_pci_fd_outb;
605
606 can_use_virtual_dma = use_virtual_dma = 1;
607 sun_fdops.fd_enable_dma = sun_fd_enable_dma;
608 sun_fdops.fd_disable_dma = sun_fd_disable_dma;
609 sun_fdops.fd_set_dma_mode = sun_fd_set_dma_mode;
610 sun_fdops.fd_set_dma_addr = sun_fd_set_dma_addr;
611 sun_fdops.fd_set_dma_count = sun_fd_set_dma_count;
612 sun_fdops.get_dma_residue = sun_get_dma_residue;
613
614 sun_fdops.fd_request_irq = sun_fd_request_irq;
615 sun_fdops.fd_free_irq = sun_fd_free_irq;
616
617 /* Floppy eject is manual. Actually, could determine this
618 * via presence of 'manual' property in OBP node.
619 */
620 sun_fdops.fd_eject = sun_pci_fd_eject;
621
622 fdc_status = (unsigned long) &sun_fdc->status_82077;
623
624 allowed_drive_mask = 0;
625 sun_floppy_types[0] = 0;
626 sun_floppy_types[1] = 4;
627
628 sun_pci_broken_drive = 1;
629 sun_fdops.fd_outb = sun_pci_fd_broken_outb;
630
631 return sun_floppy_types[0];
632}
633#endif /* ISA_FLOPPY_WORKS */
634
635#endif
636
637static unsigned long __init sun_floppy_init(void) 560static unsigned long __init sun_floppy_init(void)
638{ 561{
639 char state[128]; 562 char state[128];
@@ -667,13 +590,8 @@ static unsigned long __init sun_floppy_init(void)
667 } 590 }
668 } 591 }
669 ebus_done: 592 ebus_done:
670 if (!edev) { 593 if (!edev)
671#ifdef ISA_FLOPPY_WORKS
672 return isa_floppy_init();
673#else
674 return 0; 594 return 0;
675#endif
676 }
677 595
678 state_prop = of_get_property(edev->prom_node, "status", NULL); 596 state_prop = of_get_property(edev->prom_node, "status", NULL);
679 if (state_prop && !strncmp(state_prop, "disabled", 8)) 597 if (state_prop && !strncmp(state_prop, "disabled", 8))
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h
deleted file mode 100644
index ecd9290f78d4..000000000000
--- a/include/asm-sparc64/isa.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/* $Id: isa.h,v 1.1 2001/05/11 04:31:55 davem Exp $
2 * isa.h: Sparc64 layer for PCI to ISA bridge devices.
3 *
4 * Copyright (C) 2001 David S. Miller (davem@redhat.com)
5 */
6
7#ifndef __SPARC64_ISA_H
8#define __SPARC64_ISA_H
9
10#include <asm/oplib.h>
11#include <asm/prom.h>
12#include <asm/of_device.h>
13
14struct sparc_isa_bridge;
15
16struct sparc_isa_device {
17 struct of_device ofdev;
18 struct sparc_isa_device *next;
19 struct sparc_isa_device *child;
20 struct sparc_isa_bridge *bus;
21 struct device_node *prom_node;
22 struct resource resource;
23 unsigned int irq;
24};
25#define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev)
26
27struct sparc_isa_bridge {
28 struct of_device ofdev;
29 struct sparc_isa_bridge *next;
30 struct sparc_isa_device *devices;
31 struct pci_dev *self;
32 int index;
33 struct device_node *prom_node;
34};
35#define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev)
36
37extern struct sparc_isa_bridge *isa_chain;
38
39extern void isa_init(void);
40
41#define for_each_isa(bus) \
42 for((bus) = isa_chain; (bus); (bus) = (bus)->next)
43
44#define for_each_isadev(dev, bus) \
45 for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
46
47#endif /* !(__SPARC64_ISA_H) */
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index b4b951d570bb..714b81956f32 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -1,4 +1,3 @@
1/* $Id: ptrace.h,v 1.14 2002/02/09 19:49:32 davem Exp $ */
2#ifndef _SPARC64_PTRACE_H 1#ifndef _SPARC64_PTRACE_H
3#define _SPARC64_PTRACE_H 2#define _SPARC64_PTRACE_H
4 3
@@ -8,10 +7,15 @@
8 * stack during a system call and basically all traps. 7 * stack during a system call and basically all traps.
9 */ 8 */
10 9
10/* This magic value must have the low 9 bits clear,
11 * as that is where we encode the %tt value, see below.
12 */
11#define PT_REGS_MAGIC 0x57ac6c00 13#define PT_REGS_MAGIC 0x57ac6c00
12 14
13#ifndef __ASSEMBLY__ 15#ifndef __ASSEMBLY__
14 16
17#include <linux/types.h>
18
15struct pt_regs { 19struct pt_regs {
16 unsigned long u_regs[16]; /* globals and ins */ 20 unsigned long u_regs[16]; /* globals and ins */
17 unsigned long tstate; 21 unsigned long tstate;
@@ -33,6 +37,23 @@ struct pt_regs {
33 unsigned int magic; 37 unsigned int magic;
34}; 38};
35 39
40static inline int pt_regs_trap_type(struct pt_regs *regs)
41{
42 return regs->magic & 0x1ff;
43}
44
45static inline int pt_regs_clear_trap_type(struct pt_regs *regs)
46{
47 return regs->magic &= ~0x1ff;
48}
49
50static inline bool pt_regs_is_syscall(struct pt_regs *regs)
51{
52 int tt = pt_regs_trap_type(regs);
53
54 return (tt == 0x110 || tt == 0x111 || tt == 0x16d);
55}
56
36struct pt_regs32 { 57struct pt_regs32 {
37 unsigned int psr; 58 unsigned int psr;
38 unsigned int pc; 59 unsigned int pc;
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index 98252cd44dd6..71e42d1a80d9 100644
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -1,5 +1,4 @@
1/* $Id: thread_info.h,v 1.1 2002/02/10 00:00:58 davem Exp $ 1/* thread_info.h: sparc64 low-level thread information
2 * thread_info.h: sparc64 low-level thread information
3 * 2 *
4 * Copyright (C) 2002 David S. Miller (davem@redhat.com) 3 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
5 */ 4 */
@@ -223,7 +222,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
223#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ 222#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
224#define TIF_PERFCTR 4 /* performance counters active */ 223#define TIF_PERFCTR 4 /* performance counters active */
225#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ 224#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */
226#define TIF_NEWSIGNALS 6 /* wants new-style signals */ 225/* flag bit 6 is available */
227#define TIF_32BIT 7 /* 32-bit binary */ 226#define TIF_32BIT 7 /* 32-bit binary */
228/* flag bit 8 is available */ 227/* flag bit 8 is available */
229#define TIF_SECCOMP 9 /* secure computing */ 228#define TIF_SECCOMP 9 /* secure computing */
@@ -242,7 +241,6 @@ register struct thread_info *current_thread_info_reg asm("g6");
242#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 241#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
243#define _TIF_PERFCTR (1<<TIF_PERFCTR) 242#define _TIF_PERFCTR (1<<TIF_PERFCTR)
244#define _TIF_UNALIGNED (1<<TIF_UNALIGNED) 243#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)
245#define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS)
246#define _TIF_32BIT (1<<TIF_32BIT) 244#define _TIF_32BIT (1<<TIF_32BIT)
247#define _TIF_SECCOMP (1<<TIF_SECCOMP) 245#define _TIF_SECCOMP (1<<TIF_SECCOMP)
248#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 246#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
diff --git a/init/Kconfig b/init/Kconfig
index 183c9973be72..da071c4bbfb7 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -517,7 +517,7 @@ menuconfig EMBEDDED
517 517
518config UID16 518config UID16
519 bool "Enable 16-bit UID system calls" if EMBEDDED 519 bool "Enable 16-bit UID system calls" if EMBEDDED
520 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && SPARC32_COMPAT) || UML || (X86_64 && IA32_EMULATION) 520 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)
521 default y 521 default y
522 help 522 help
523 This enables the legacy 16-bit UID syscall wrappers. 523 This enables the legacy 16-bit UID syscall wrappers.