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

[POWERPC] Consolidate sys_sigaltstack

sys_sigaltstack is the same on 32bit and 64 and we can consolidate it
to signal.c. The only difference is that the 32bit code uses ints
for the unused register paramaters and 64bit unsigned long. I've
changed it to unsigned long because it's the same width on 32bit.

(I also wonder who came up with this awkward calling convention.. :))

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Christoph Hellwig and committed by
Paul Mackerras
69d15f6b 22e38f29

+7 -23
+7
arch/powerpc/kernel/signal.c
··· 63 63 regs->ccr |= 0x10000000; 64 64 } 65 65 } 66 + 67 + long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, 68 + unsigned long r5, unsigned long r6, unsigned long r7, 69 + unsigned long r8, struct pt_regs *regs) 70 + { 71 + return do_sigaltstack(uss, uoss, regs->gpr[1]); 72 + }
-8
arch/powerpc/kernel/signal_32.c
··· 253 253 return -ERESTARTNOHAND; 254 254 } 255 255 256 - #ifdef CONFIG_PPC32 257 - long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, int r5, 258 - int r6, int r7, int r8, struct pt_regs *regs) 259 - { 260 - return do_sigaltstack(uss, uoss, regs->gpr[1]); 261 - } 262 - #endif 263 - 264 256 long sys_sigaction(int sig, struct old_sigaction __user *act, 265 257 struct old_sigaction __user *oact) 266 258 {
-8
arch/powerpc/kernel/signal_64.c
··· 66 66 char abigap[288]; 67 67 } __attribute__ ((aligned (16))); 68 68 69 - long sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, unsigned long r5, 70 - unsigned long r6, unsigned long r7, unsigned long r8, 71 - struct pt_regs *regs) 72 - { 73 - return do_sigaltstack(uss, uoss, regs->gpr[1]); 74 - } 75 - 76 - 77 69 /* 78 70 * Set up the sigcontext for the signal frame. 79 71 */
-7
include/asm-powerpc/syscalls.h
··· 43 43 44 44 asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, 45 45 size_t sigsetsize); 46 - 47 - #ifndef __powerpc64__ 48 - asmlinkage long sys_sigaltstack(const stack_t __user *uss, 49 - stack_t __user *uoss, int r5, int r6, int r7, int r8, 50 - struct pt_regs *regs); 51 - #else /* __powerpc64__ */ 52 46 asmlinkage long sys_sigaltstack(const stack_t __user *uss, 53 47 stack_t __user *uoss, unsigned long r5, unsigned long r6, 54 48 unsigned long r7, unsigned long r8, struct pt_regs *regs); 55 - #endif /* __powerpc64__ */ 56 49 57 50 #endif /* __KERNEL__ */ 58 51 #endif /* __ASM_POWERPC_SYSCALLS_H */