diff options
Diffstat (limited to 'arch/um/sys-i386')
-rw-r--r-- | arch/um/sys-i386/Makefile | 2 | ||||
-rw-r--r-- | arch/um/sys-i386/signal.c | 2 | ||||
-rw-r--r-- | arch/um/sys-i386/syscalls.c | 23 | ||||
-rw-r--r-- | arch/um/sys-i386/unmap.c | 25 |
4 files changed, 32 insertions, 20 deletions
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 4351e5605506..095bcdb0b9cc 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -17,3 +17,5 @@ highmem.c-dir = mm | |||
17 | module.c-dir = kernel | 17 | module.c-dir = kernel |
18 | 18 | ||
19 | subdir- := util | 19 | subdir- := util |
20 | |||
21 | include arch/um/scripts/Makefile.unmap | ||
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 03913ca5d256..4efc69a039d7 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -312,7 +312,7 @@ long sys_sigreturn(struct pt_regs regs) | |||
312 | unsigned long __user *extramask = frame->extramask; | 312 | unsigned long __user *extramask = frame->extramask; |
313 | int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); | 313 | int sig_size = (_NSIG_WORDS - 1) * sizeof(unsigned long); |
314 | 314 | ||
315 | if(copy_from_user(&set.sig[0], oldmask, sizeof(&set.sig[0])) || | 315 | if(copy_from_user(&set.sig[0], oldmask, sizeof(set.sig[0])) || |
316 | copy_from_user(&set.sig[1], extramask, sig_size)) | 316 | copy_from_user(&set.sig[1], extramask, sig_size)) |
317 | goto segfault; | 317 | goto segfault; |
318 | 318 | ||
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c index 335e2d89504d..83e9be820a86 100644 --- a/arch/um/sys-i386/syscalls.c +++ b/arch/um/sys-i386/syscalls.c | |||
@@ -69,15 +69,11 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
69 | { | 69 | { |
70 | long ret; | 70 | long ret; |
71 | 71 | ||
72 | /* XXX: normal arch do here this pass, and also pass the regs to | 72 | if (!newsp) |
73 | * do_fork, instead of NULL. Currently the arch-independent code | 73 | newsp = UPT_SP(¤t->thread.regs.regs); |
74 | * ignores these values, while the UML code (actually it's | ||
75 | * copy_thread) does the right thing. But this should change, | ||
76 | probably. */ | ||
77 | /*if (!newsp) | ||
78 | newsp = UPT_SP(current->thread.regs);*/ | ||
79 | current->thread.forking = 1; | 74 | current->thread.forking = 1; |
80 | ret = do_fork(clone_flags, newsp, NULL, 0, parent_tid, child_tid); | 75 | ret = do_fork(clone_flags, newsp, ¤t->thread.regs, 0, parent_tid, |
76 | child_tid); | ||
81 | current->thread.forking = 0; | 77 | current->thread.forking = 0; |
82 | return(ret); | 78 | return(ret); |
83 | } | 79 | } |
@@ -197,14 +193,3 @@ long sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
197 | 193 | ||
198 | return ret; | 194 | return ret; |
199 | } | 195 | } |
200 | |||
201 | /* | ||
202 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
203 | * Emacs will notice this stuff at the end of the file and automatically | ||
204 | * adjust the settings for this buffer only. This must remain at the end | ||
205 | * of the file. | ||
206 | * --------------------------------------------------------------------------- | ||
207 | * Local variables: | ||
208 | * c-file-style: "linux" | ||
209 | * End: | ||
210 | */ | ||
diff --git a/arch/um/sys-i386/unmap.c b/arch/um/sys-i386/unmap.c new file mode 100644 index 000000000000..136875263d27 --- /dev/null +++ b/arch/um/sys-i386/unmap.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <linux/mman.h> | ||
7 | #include <asm/unistd.h> | ||
8 | |||
9 | static int errno; | ||
10 | |||
11 | static inline _syscall2(int,munmap,void *,start,size_t,len) | ||
12 | static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset) | ||
13 | int switcheroo(int fd, int prot, void *from, void *to, int size) | ||
14 | { | ||
15 | if(munmap(to, size) < 0){ | ||
16 | return(-1); | ||
17 | } | ||
18 | if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ | ||
19 | return(-1); | ||
20 | } | ||
21 | if(munmap(from, size) < 0){ | ||
22 | return(-1); | ||
23 | } | ||
24 | return(0); | ||
25 | } | ||