diff options
-rw-r--r-- | arch/mips/kernel/signal.c | 14 | ||||
-rw-r--r-- | arch/mips/kernel/syscall.c | 7 | ||||
-rw-r--r-- | include/asm-mips/stackframe.h | 35 |
3 files changed, 34 insertions, 22 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index ad66fcb6c..ac4706dcd 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c @@ -76,12 +76,12 @@ int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) /* * Atomically swap in the new signal mask, and wait for a signal. */ -asmlinkage inline int -sys_sigsuspend(struct pt_regs regs) +save_static_function(sys_sigsuspend); +static unused int +_sys_sigsuspend(struct pt_regs regs) { sigset_t *uset, saveset, newset; - save_static(®s); uset = (sigset_t *) regs.regs[4]; if (copy_from_user(&newset, uset, sizeof(sigset_t))) return -EFAULT; @@ -103,14 +103,14 @@ sys_sigsuspend(struct pt_regs regs) } } -asmlinkage int -sys_rt_sigsuspend(struct pt_regs regs) + +save_static_function(sys_rt_sigsuspend); +static unused int +_sys_rt_sigsuspend(struct pt_regs regs) { sigset_t *unewset, saveset, newset; size_t sigsetsize; - save_static(®s); - /* XXX Don't preclude handling different sized sigset_t's. */ sigsetsize = regs.regs[5]; if (sigsetsize != sizeof(sigset_t)) diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index a7887b6d0..1c47e1be5 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -92,7 +92,8 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, return do_mmap2(addr, len, prot, flags, fd, pgoff); } -asmlinkage int sys_fork(struct pt_regs regs) +save_static_function(sys_fork); +static unused int _sys_fork(struct pt_regs regs) { int res; @@ -101,7 +102,9 @@ asmlinkage int sys_fork(struct pt_regs regs) return res; } -asmlinkage int sys_clone(struct pt_regs regs) + +save_static_function(sys_clone); +static unused int _sys_clone(struct pt_regs regs) { unsigned long clone_flags; unsigned long newsp; diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index 490724b21..d563b5a67 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h @@ -47,19 +47,28 @@ #define __str2(x) #x #define __str(x) __str2(x) -#define save_static(frame) \ - __asm__ __volatile__( \ - "sw\t$16,"__str(PT_R16)"(%0)\n\t" \ - "sw\t$17,"__str(PT_R17)"(%0)\n\t" \ - "sw\t$18,"__str(PT_R18)"(%0)\n\t" \ - "sw\t$19,"__str(PT_R19)"(%0)\n\t" \ - "sw\t$20,"__str(PT_R20)"(%0)\n\t" \ - "sw\t$21,"__str(PT_R21)"(%0)\n\t" \ - "sw\t$22,"__str(PT_R22)"(%0)\n\t" \ - "sw\t$23,"__str(PT_R23)"(%0)\n\t" \ - "sw\t$30,"__str(PT_R30)"(%0)\n\t" \ - : /* No outputs */ \ - : "r" (frame)) +#define save_static_function(symbol) \ +__asm__ ( \ + ".globl\t" #symbol "\n\t" \ + ".align\t2\n\t" \ + ".type\t" #symbol ", @function\n\t" \ + ".ent\t" #symbol ", 0\n" \ + #symbol":\n\t" \ + ".frame\t$29, 0, $31\n\t" \ + "sw\t$16,"__str(PT_R16)"($29)\t\t\t# save_static_function\n\t" \ + "sw\t$17,"__str(PT_R17)"($29)\n\t" \ + "sw\t$18,"__str(PT_R18)"($29)\n\t" \ + "sw\t$19,"__str(PT_R19)"($29)\n\t" \ + "sw\t$20,"__str(PT_R20)"($29)\n\t" \ + "sw\t$21,"__str(PT_R21)"($29)\n\t" \ + "sw\t$22,"__str(PT_R22)"($29)\n\t" \ + "sw\t$23,"__str(PT_R23)"($29)\n\t" \ + "sw\t$30,"__str(PT_R30)"($29)\n\t" \ + ".end\t" #symbol "\n\t" \ + ".size\t" #symbol",. - " #symbol) + +/* Used in declaration of save_static functions. */ +#define unused __attribute__((unused)) #define SAVE_SOME \ .set push; \ |