diff options
Diffstat (limited to 'arch/v850')
-rw-r--r-- | arch/v850/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/v850/kernel/memcons.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/simcons.c | 2 | ||||
-rw-r--r-- | arch/v850/kernel/syscalls.c | 20 |
4 files changed, 23 insertions, 3 deletions
diff --git a/arch/v850/kernel/entry.S b/arch/v850/kernel/entry.S index d991e4547dbb6a..8bc521ca081f9a 100644 --- a/arch/v850/kernel/entry.S +++ b/arch/v850/kernel/entry.S @@ -195,7 +195,7 @@ sst.w lp, PTO+PT_GPR(GPR_LP)[ep]; \ type ## _STATE_SAVER /* Pop a register state pushed by PUSH_STATE, except for the stack pointer, - from the the stack. */ + from the stack. */ #define POP_STATE(type) \ mov sp, ep; \ type ## _STATE_RESTORER; \ diff --git a/arch/v850/kernel/memcons.c b/arch/v850/kernel/memcons.c index 815f8a43926fab..92f514fdcc79fa 100644 --- a/arch/v850/kernel/memcons.c +++ b/arch/v850/kernel/memcons.c @@ -104,7 +104,7 @@ int memcons_tty_chars_in_buffer (struct tty_struct *tty) return 0; } -static struct tty_operations ops = { +static const struct tty_operations ops = { .open = memcons_tty_open, .write = memcons_tty_write, .write_room = memcons_tty_write_room, diff --git a/arch/v850/kernel/simcons.c b/arch/v850/kernel/simcons.c index 3975aa02cef83d..9973596ae3044e 100644 --- a/arch/v850/kernel/simcons.c +++ b/arch/v850/kernel/simcons.c @@ -77,7 +77,7 @@ int simcons_tty_chars_in_buffer (struct tty_struct *tty) return 0; } -static struct tty_operations ops = { +static const struct tty_operations ops = { .open = simcons_tty_open, .write = simcons_tty_write, .write_room = simcons_tty_write_room, diff --git a/arch/v850/kernel/syscalls.c b/arch/v850/kernel/syscalls.c index 2ec0700fc46bc7..d2b1fb19d24313 100644 --- a/arch/v850/kernel/syscalls.c +++ b/arch/v850/kernel/syscalls.c @@ -33,6 +33,7 @@ #include <asm/uaccess.h> #include <asm/ipc.h> #include <asm/semaphore.h> +#include <asm/unistd.h> /* * sys_ipc() is the de-multiplexer for the SysV IPC calls.. @@ -194,3 +195,22 @@ unsigned long sys_mmap (unsigned long addr, size_t len, out: return err; } + +/* + * Do a system call from kernel instead of calling sys_execve so we + * end up with proper pt_regs. + */ +int kernel_execve(const char *filename, char *const argv[], char *const envp[]) +{ + register char *__a __asm__ ("r6") = filename; + register void *__b __asm__ ("r7") = argv; + register void *__c __asm__ ("r8") = envp; + register unsigned long __syscall __asm__ ("r12") = __NR_execve; + register unsigned long __ret __asm__ ("r10"); + __asm__ __volatile__ ("trap 0" + : "=r" (__ret), "=r" (__syscall) + : "1" (__syscall), "r" (__a), "r" (__b), "r" (__c) + : "r1", "r5", "r11", "r13", "r14", + "r15", "r16", "r17", "r18", "r19"); + return __ret; +} |