Skip to content

Commit

Permalink
um/os-Linux: Use char[] for syscall_stub declarations
Browse files Browse the repository at this point in the history
When declaring __syscall_stub_start, use the same type in UML userspace
code as in arch/um/include/asm/sections.h.

While at it, also declare batch_syscall_stub as char[].

Signed-off-by: Nicolas Iooss <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
fishilico authored and richardweinberger committed May 31, 2015
1 parent 05eacfd commit 5f32943
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions arch/um/os-Linux/skas/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <sysdep/ptrace.h>
#include <sysdep/stub.h>

extern unsigned long batch_syscall_stub, __syscall_stub_start;
extern char batch_syscall_stub[], __syscall_stub_start[];

extern void wait_stub_done(int pid);

Expand All @@ -38,8 +38,8 @@ static int __init init_syscall_regs(void)
{
get_safe_registers(syscall_regs, NULL);
syscall_regs[REGS_IP_INDEX] = STUB_CODE +
((unsigned long) &batch_syscall_stub -
(unsigned long) &__syscall_stub_start);
((unsigned long) batch_syscall_stub -
(unsigned long) __syscall_stub_start);
return 0;
}

Expand Down
8 changes: 4 additions & 4 deletions arch/um/os-Linux/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
handle_syscall(regs);
}

extern int __syscall_stub_start;
extern char __syscall_stub_start[];

static int userspace_tramp(void *stack)
{
Expand All @@ -197,7 +197,7 @@ static int userspace_tramp(void *stack)
* This has a pte, but it can't be mapped in with the usual
* tlb_flush mechanism because this is part of that mechanism
*/
fd = phys_mapping(to_phys(&__syscall_stub_start), &offset);
fd = phys_mapping(to_phys(__syscall_stub_start), &offset);
addr = mmap64((void *) STUB_CODE, UM_KERN_PAGE_SIZE,
PROT_EXEC, MAP_FIXED | MAP_PRIVATE, fd, offset);
if (addr == MAP_FAILED) {
Expand All @@ -223,7 +223,7 @@ static int userspace_tramp(void *stack)

unsigned long v = STUB_CODE +
(unsigned long) stub_segv_handler -
(unsigned long) &__syscall_stub_start;
(unsigned long) __syscall_stub_start;

set_sigstack((void *) STUB_DATA, UM_KERN_PAGE_SIZE);
sigemptyset(&sa.sa_mask);
Expand Down Expand Up @@ -447,7 +447,7 @@ static int __init init_thread_regs(void)
/* Set parent's instruction pointer to start of clone-stub */
thread_regs[REGS_IP_INDEX] = STUB_CODE +
(unsigned long) stub_clone_handler -
(unsigned long) &__syscall_stub_start;
(unsigned long) __syscall_stub_start;
thread_regs[REGS_SP_INDEX] = STUB_DATA + UM_KERN_PAGE_SIZE -
sizeof(void *);
#ifdef __SIGNAL_FRAMESIZE
Expand Down

0 comments on commit 5f32943

Please sign in to comment.