Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] powerpc: Merge signal.h

Having already merged the ppc and ppc64 versions of signal.c, this
patch finishes the job by merging signal.h. The two versions were
almost identical already. Notable changes:
- We use BITS_PER_LONG to correctly size sigset_t
- Remove some uneeded #includes and struct forward
declarations. This does mean adding an include to signal_32.c which
relied on the indirect inclusion of sigcontext.h
- As the ppc64 version, the merged signal.h has prototypes for
do_signal() and do_signal32(). Thus remove extra prototypes from
ppc_ksyms.c which had them directly.

Built and booted on POWER5 LPAR (ARCH=ppc64 and ARCH=powerpc). Built
for 32-bit powermac (ARCH=ppc and ARCH=powerpc) and Walnut (ARCH=ppc).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

David Gibson and committed by
Paul Mackerras
c5ff7001 31e7f1ff

+40 -174
+1 -1
arch/powerpc/kernel/ppc_ksyms.c
··· 44 44 #include <asm/cputable.h> 45 45 #include <asm/btext.h> 46 46 #include <asm/div64.h> 47 + #include <asm/signal.h> 47 48 48 49 #ifdef CONFIG_8xx 49 50 #include <asm/commproc.h> ··· 57 56 extern void alignment_exception(struct pt_regs *regs); 58 57 extern void program_check_exception(struct pt_regs *regs); 59 58 extern void single_step_exception(struct pt_regs *regs); 60 - extern int do_signal(sigset_t *, struct pt_regs *); 61 59 extern int pmac_newworld; 62 60 extern int sys_sigreturn(struct pt_regs *regs); 63 61
+1
arch/powerpc/kernel/signal_32.c
··· 42 42 43 43 #include <asm/uaccess.h> 44 44 #include <asm/cacheflush.h> 45 + #include <asm/sigcontext.h> 45 46 #ifdef CONFIG_PPC64 46 47 #include "ppc32.h" 47 48 #include <asm/unistd.h>
+1 -1
arch/ppc/kernel/ppc_ksyms.c
··· 46 46 #include <asm/btext.h> 47 47 #include <asm/div64.h> 48 48 #include <asm/xmon.h> 49 + #include <asm/signal.h> 49 50 50 51 #ifdef CONFIG_8xx 51 52 #include <asm/commproc.h> ··· 58 57 extern void alignment_exception(struct pt_regs *regs); 59 58 extern void program_check_exception(struct pt_regs *regs); 60 59 extern void single_step_exception(struct pt_regs *regs); 61 - extern int do_signal(sigset_t *, struct pt_regs *); 62 60 extern int pmac_newworld; 63 61 extern int sys_sigreturn(struct pt_regs *regs); 64 62
-153
include/asm-ppc/signal.h
··· 1 - #ifndef _ASMPPC_SIGNAL_H 2 - #define _ASMPPC_SIGNAL_H 3 - 4 - #ifdef __KERNEL__ 5 - #include <linux/types.h> 6 - #endif /* __KERNEL__ */ 7 - 8 - /* Avoid too many header ordering problems. */ 9 - struct siginfo; 10 - 11 - /* Most things should be clean enough to redefine this at will, if care 12 - is taken to make libc match. */ 13 - 14 - #define _NSIG 64 15 - #define _NSIG_BPW 32 16 - #define _NSIG_WORDS (_NSIG / _NSIG_BPW) 17 - 18 - typedef unsigned long old_sigset_t; /* at least 32 bits */ 19 - 20 - typedef struct { 21 - unsigned long sig[_NSIG_WORDS]; 22 - } sigset_t; 23 - 24 - #define SIGHUP 1 25 - #define SIGINT 2 26 - #define SIGQUIT 3 27 - #define SIGILL 4 28 - #define SIGTRAP 5 29 - #define SIGABRT 6 30 - #define SIGIOT 6 31 - #define SIGBUS 7 32 - #define SIGFPE 8 33 - #define SIGKILL 9 34 - #define SIGUSR1 10 35 - #define SIGSEGV 11 36 - #define SIGUSR2 12 37 - #define SIGPIPE 13 38 - #define SIGALRM 14 39 - #define SIGTERM 15 40 - #define SIGSTKFLT 16 41 - #define SIGCHLD 17 42 - #define SIGCONT 18 43 - #define SIGSTOP 19 44 - #define SIGTSTP 20 45 - #define SIGTTIN 21 46 - #define SIGTTOU 22 47 - #define SIGURG 23 48 - #define SIGXCPU 24 49 - #define SIGXFSZ 25 50 - #define SIGVTALRM 26 51 - #define SIGPROF 27 52 - #define SIGWINCH 28 53 - #define SIGIO 29 54 - #define SIGPOLL SIGIO 55 - /* 56 - #define SIGLOST 29 57 - */ 58 - #define SIGPWR 30 59 - #define SIGSYS 31 60 - #define SIGUNUSED 31 61 - 62 - /* These should not be considered constants from userland. */ 63 - #define SIGRTMIN 32 64 - #define SIGRTMAX _NSIG 65 - 66 - /* 67 - * SA_FLAGS values: 68 - * 69 - * SA_ONSTACK is not currently supported, but will allow sigaltstack(2). 70 - * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the 71 - * SA_RESTART flag to get restarting signals (which were the default long ago) 72 - * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. 73 - * SA_RESETHAND clears the handler when the signal is delivered. 74 - * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. 75 - * SA_NODEFER prevents the current signal from being masked in the handler. 76 - * 77 - * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single 78 - * Unix names RESETHAND and NODEFER respectively. 79 - */ 80 - #define SA_NOCLDSTOP 0x00000001 81 - #define SA_NOCLDWAIT 0x00000002 82 - #define SA_SIGINFO 0x00000004 83 - #define SA_ONSTACK 0x08000000 84 - #define SA_RESTART 0x10000000 85 - #define SA_NODEFER 0x40000000 86 - #define SA_RESETHAND 0x80000000 87 - 88 - #define SA_NOMASK SA_NODEFER 89 - #define SA_ONESHOT SA_RESETHAND 90 - #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ 91 - 92 - #define SA_RESTORER 0x04000000 93 - 94 - /* 95 - * sigaltstack controls 96 - */ 97 - #define SS_ONSTACK 1 98 - #define SS_DISABLE 2 99 - 100 - #define MINSIGSTKSZ 2048 101 - #define SIGSTKSZ 8192 102 - 103 - #include <asm-generic/signal.h> 104 - 105 - struct old_sigaction { 106 - __sighandler_t sa_handler; 107 - old_sigset_t sa_mask; 108 - unsigned long sa_flags; 109 - __sigrestore_t sa_restorer; 110 - }; 111 - 112 - struct sigaction { 113 - __sighandler_t sa_handler; 114 - unsigned long sa_flags; 115 - __sigrestore_t sa_restorer; 116 - sigset_t sa_mask; /* mask last for extensibility */ 117 - }; 118 - 119 - struct k_sigaction { 120 - struct sigaction sa; 121 - }; 122 - 123 - typedef struct sigaltstack { 124 - void __user *ss_sp; 125 - int ss_flags; 126 - size_t ss_size; 127 - } stack_t; 128 - 129 - #ifdef __KERNEL__ 130 - #include <asm/sigcontext.h> 131 - #define ptrace_signal_deliver(regs, cookie) do { } while (0) 132 - #endif /* __KERNEL__ */ 133 - 134 - /* 135 - * These are parameters to dbg_sigreturn syscall. They enable or 136 - * disable certain debugging things that can be done from signal 137 - * handlers. The dbg_sigreturn syscall *must* be called from a 138 - * SA_SIGINFO signal so the ucontext can be passed to it. It takes an 139 - * array of struct sig_dbg_op, which has the debug operations to 140 - * perform before returning from the signal. 141 - */ 142 - struct sig_dbg_op { 143 - int dbg_type; 144 - unsigned long dbg_value; 145 - }; 146 - 147 - /* Enable or disable single-stepping. The value sets the state. */ 148 - #define SIG_DBG_SINGLE_STEPPING 1 149 - 150 - /* Enable or disable branch tracing. The value sets the state. */ 151 - #define SIG_DBG_BRANCH_TRACING 2 152 - 153 - #endif
+37 -19
include/asm-ppc64/signal.h include/asm-powerpc/signal.h
··· 1 - #ifndef _ASMPPC64_SIGNAL_H 2 - #define _ASMPPC64_SIGNAL_H 1 + #ifndef _ASM_POWERPC_SIGNAL_H 2 + #define _ASM_POWERPC_SIGNAL_H 3 3 4 4 #include <linux/types.h> 5 - #include <linux/compiler.h> 6 - #include <asm/siginfo.h> 7 - 8 - /* Avoid too many header ordering problems. */ 9 - struct siginfo; 5 + #include <linux/config.h> 10 6 11 7 #define _NSIG 64 12 - #define _NSIG_BPW 64 8 + #define _NSIG_BPW BITS_PER_LONG 13 9 #define _NSIG_WORDS (_NSIG / _NSIG_BPW) 14 10 15 11 typedef unsigned long old_sigset_t; /* at least 32 bits */ ··· 70 74 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single 71 75 * Unix names RESETHAND and NODEFER respectively. 72 76 */ 73 - #define SA_NOCLDSTOP 0x00000001u 74 - #define SA_NOCLDWAIT 0x00000002u 75 - #define SA_SIGINFO 0x00000004u 76 - #define SA_ONSTACK 0x08000000u 77 - #define SA_RESTART 0x10000000u 78 - #define SA_NODEFER 0x40000000u 79 - #define SA_RESETHAND 0x80000000u 77 + #define SA_NOCLDSTOP 0x00000001U 78 + #define SA_NOCLDWAIT 0x00000002U 79 + #define SA_SIGINFO 0x00000004U 80 + #define SA_ONSTACK 0x08000000U 81 + #define SA_RESTART 0x10000000U 82 + #define SA_NODEFER 0x40000000U 83 + #define SA_RESETHAND 0x80000000U 80 84 81 85 #define SA_NOMASK SA_NODEFER 82 86 #define SA_ONESHOT SA_RESETHAND 83 87 #define SA_INTERRUPT 0x20000000u /* dummy -- ignored */ 84 88 85 - #define SA_RESTORER 0x04000000u 89 + #define SA_RESTORER 0x04000000U 86 90 87 - /* 91 + /* 88 92 * sigaltstack controls 89 93 */ 90 94 #define SS_ONSTACK 1 ··· 119 123 size_t ss_size; 120 124 } stack_t; 121 125 126 + #ifdef __KERNEL__ 122 127 struct pt_regs; 123 - struct timespec; 124 128 extern int do_signal(sigset_t *oldset, struct pt_regs *regs); 125 129 extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); 126 130 #define ptrace_signal_deliver(regs, cookie) do { } while (0) 131 + #endif /* __KERNEL__ */ 127 132 128 - #endif /* _ASMPPC64_SIGNAL_H */ 133 + #ifndef __powerpc64__ 134 + /* 135 + * These are parameters to dbg_sigreturn syscall. They enable or 136 + * disable certain debugging things that can be done from signal 137 + * handlers. The dbg_sigreturn syscall *must* be called from a 138 + * SA_SIGINFO signal so the ucontext can be passed to it. It takes an 139 + * array of struct sig_dbg_op, which has the debug operations to 140 + * perform before returning from the signal. 141 + */ 142 + struct sig_dbg_op { 143 + int dbg_type; 144 + unsigned long dbg_value; 145 + }; 146 + 147 + /* Enable or disable single-stepping. The value sets the state. */ 148 + #define SIG_DBG_SINGLE_STEPPING 1 149 + 150 + /* Enable or disable branch tracing. The value sets the state. */ 151 + #define SIG_DBG_BRANCH_TRACING 2 152 + #endif /* ! __powerpc64__ */ 153 + 154 + #endif /* _ASM_POWERPC_SIGNAL_H */