aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro2012-10-10 12:29:28 -0500
committerAl Viro2012-10-14 18:37:44 -0500
commit5fae1b664595adc621fb9294b7d19145918073de (patch)
tree77cef337e95202f12e6483fd33d0a6fde5c9f834 /arch/h8300
parent557e1995a92d318206910d8b5c62075fe02b37e0 (diff)
downloadam43-linux-kernel-5fae1b664595adc621fb9294b7d19145918073de.tar.gz
am43-linux-kernel-5fae1b664595adc621fb9294b7d19145918073de.tar.xz
am43-linux-kernel-5fae1b664595adc621fb9294b7d19145918073de.zip
h8300: generic kernel_execve()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/h8300')
-rw-r--r--arch/h8300/Kconfig1
-rw-r--r--arch/h8300/kernel/entry.S3
-rw-r--r--arch/h8300/kernel/sys_h8300.c26
3 files changed, 2 insertions, 28 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 4cef8a91c2a..04bef4d25b4 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -9,6 +9,7 @@ config H8300
9 select GENERIC_CPU_DEVICES 9 select GENERIC_CPU_DEVICES
10 select MODULES_USE_ELF_RELA 10 select MODULES_USE_ELF_RELA
11 select GENERIC_KERNEL_THREAD 11 select GENERIC_KERNEL_THREAD
12 select GENERIC_KERNEL_EXECVE
12 13
13config SYMBOL_PREFIX 14config SYMBOL_PREFIX
14 string 15 string
diff --git a/arch/h8300/kernel/entry.S b/arch/h8300/kernel/entry.S
index 2cdb49a5609..617a6878787 100644
--- a/arch/h8300/kernel/entry.S
+++ b/arch/h8300/kernel/entry.S
@@ -337,8 +337,7 @@ SYMBOL_NAME_LABEL(ret_from_kernel_thread)
337 mov.l @(LER4:16,sp),er0 337 mov.l @(LER4:16,sp),er0
338 mov.l @(LER5:16,sp),er1 338 mov.l @(LER5:16,sp),er1
339 jsr @er1 339 jsr @er1
340 sub.l @er0,@er0 340 jmp @SYMBOL_NAME(ret_from_exception)
341 jsr @SYMBOL_NAME(sys_exit)
342 341
343SYMBOL_NAME_LABEL(resume) 342SYMBOL_NAME_LABEL(resume)
344 /* 343 /*
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c
index 4bdc7311784..bf350cb7f59 100644
--- a/arch/h8300/kernel/sys_h8300.c
+++ b/arch/h8300/kernel/sys_h8300.c
@@ -46,29 +46,3 @@ asmlinkage void syscall_print(void *dummy,...)
46 ((regs->pc)&0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0); 46 ((regs->pc)&0xffffff)-2,regs->orig_er0,regs->er1,regs->er2,regs->er3,regs->er0);
47} 47}
48#endif 48#endif
49
50/*
51 * Do a system call from kernel instead of calling sys_execve so we
52 * end up with proper pt_regs.
53 */
54asmlinkage
55int kernel_execve(const char *filename,
56 const char *const argv[],
57 const char *const envp[])
58{
59 register long res __asm__("er0");
60 register const char *const *_c __asm__("er3") = envp;
61 register const char *const *_b __asm__("er2") = argv;
62 register const char * _a __asm__("er1") = filename;
63 __asm__ __volatile__ ("mov.l %1,er0\n\t"
64 "trapa #0\n\t"
65 : "=r" (res)
66 : "g" (__NR_execve),
67 "g" (_a),
68 "g" (_b),
69 "g" (_c)
70 : "cc", "memory");
71 return res;
72}
73
74