diff options
Diffstat (limited to 'arch/sh/kernel/sys_sh.c')
-rw-r--r-- | arch/sh/kernel/sys_sh.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c index 8fde95001c34..e18f183e1035 100644 --- a/arch/sh/kernel/sys_sh.c +++ b/arch/sh/kernel/sys_sh.c | |||
@@ -33,14 +33,15 @@ | |||
33 | */ | 33 | */ |
34 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, | 34 | asmlinkage int sys_pipe(unsigned long r4, unsigned long r5, |
35 | unsigned long r6, unsigned long r7, | 35 | unsigned long r6, unsigned long r7, |
36 | struct pt_regs regs) | 36 | struct pt_regs __regs) |
37 | { | 37 | { |
38 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
38 | int fd[2]; | 39 | int fd[2]; |
39 | int error; | 40 | int error; |
40 | 41 | ||
41 | error = do_pipe(fd); | 42 | error = do_pipe(fd); |
42 | if (!error) { | 43 | if (!error) { |
43 | regs.regs[1] = fd[1]; | 44 | regs->regs[1] = fd[1]; |
44 | return fd[0]; | 45 | return fd[0]; |
45 | } | 46 | } |
46 | return error; | 47 | return error; |
@@ -50,6 +51,7 @@ unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ | |||
50 | 51 | ||
51 | EXPORT_SYMBOL(shm_align_mask); | 52 | EXPORT_SYMBOL(shm_align_mask); |
52 | 53 | ||
54 | #ifdef CONFIG_MMU | ||
53 | /* | 55 | /* |
54 | * To avoid cache aliases, we map the shared page with same color. | 56 | * To avoid cache aliases, we map the shared page with same color. |
55 | */ | 57 | */ |
@@ -135,6 +137,7 @@ full_search: | |||
135 | addr = COLOUR_ALIGN(addr, pgoff); | 137 | addr = COLOUR_ALIGN(addr, pgoff); |
136 | } | 138 | } |
137 | } | 139 | } |
140 | #endif /* CONFIG_MMU */ | ||
138 | 141 | ||
139 | static inline long | 142 | static inline long |
140 | do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 143 | do_mmap2(unsigned long addr, unsigned long len, unsigned long prot, |
@@ -311,6 +314,12 @@ asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, | |||
311 | #endif | 314 | #endif |
312 | } | 315 | } |
313 | 316 | ||
317 | #if defined(CONFIG_CPU_SH2) || defined(CONFIG_CPU_SH2A) | ||
318 | #define SYSCALL_ARG3 "trapa #0x23" | ||
319 | #else | ||
320 | #define SYSCALL_ARG3 "trapa #0x13" | ||
321 | #endif | ||
322 | |||
314 | /* | 323 | /* |
315 | * Do a system call from kernel instead of calling sys_execve so we | 324 | * Do a system call from kernel instead of calling sys_execve so we |
316 | * end up with proper pt_regs. | 325 | * end up with proper pt_regs. |
@@ -321,7 +330,7 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | |||
321 | register long __sc4 __asm__ ("r4") = (long) filename; | 330 | register long __sc4 __asm__ ("r4") = (long) filename; |
322 | register long __sc5 __asm__ ("r5") = (long) argv; | 331 | register long __sc5 __asm__ ("r5") = (long) argv; |
323 | register long __sc6 __asm__ ("r6") = (long) envp; | 332 | register long __sc6 __asm__ ("r6") = (long) envp; |
324 | __asm__ __volatile__ ("trapa #0x13" : "=z" (__sc0) | 333 | __asm__ __volatile__ (SYSCALL_ARG3 : "=z" (__sc0) |
325 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) | 334 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) |
326 | : "memory"); | 335 | : "memory"); |
327 | return __sc0; | 336 | return __sc0; |