-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PATCH] uml: fix linkage of tt mode against NPTL
With Al Viro <viro@parcelfarce.linux.theplanet.co.uk> To make sure switcheroo() can execute when we remap all the executable image, we used a trick to make it use a local copy of errno... this trick does not work with NPTL glibc, only with LinuxThreads, so use another (simpler) one to make it work anyway. Hopefully, a lot improved thanks to merging with the version of Al Viro (which had his part of problems, though, i.e. removing a fix to another bug and not fixing the problem on i386). Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- Loading branch information
Paolo 'Blaisorblade' Giarrusso
authored and
Linus Torvalds
committed
Jun 22, 2005
1 parent
b77d6ad
commit 60b2737
Showing
10 changed files
with
86 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
clean-files += unmap_tmp.o unmap_fin.o unmap.o | ||
|
||
ifdef CONFIG_MODE_TT | ||
|
||
#Always build unmap_fin.o | ||
extra-y += unmap_fin.o | ||
#Do dependency tracking for unmap.o (it will be always built, but won't get the tracking unless we use this). | ||
targets += unmap.o | ||
|
||
#XXX: partially copied from arch/um/scripts/Makefile.rules | ||
$(obj)/unmap.o: _c_flags = $(call unprofile,$(CFLAGS)) | ||
|
||
quiet_cmd_wrapld = LD $@ | ||
define cmd_wrapld | ||
$(LD) -r -o $(obj)/unmap_tmp.o $< $(shell $(CC) -print-file-name=libc.a); \ | ||
$(OBJCOPY) $(obj)/unmap_tmp.o $@ -G switcheroo | ||
endef | ||
|
||
$(obj)/unmap_fin.o : $(obj)/unmap.o FORCE | ||
$(call if_changed,wrapld) | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ highmem.c-dir = mm | |
module.c-dir = kernel | ||
|
||
subdir- := util | ||
|
||
include arch/um/scripts/Makefile.unmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#include <linux/mman.h> | ||
#include <asm/unistd.h> | ||
|
||
static int errno; | ||
|
||
static inline _syscall2(int,munmap,void *,start,size_t,len) | ||
static inline _syscall6(void *,mmap2,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset) | ||
int switcheroo(int fd, int prot, void *from, void *to, int size) | ||
{ | ||
if(munmap(to, size) < 0){ | ||
return(-1); | ||
} | ||
if(mmap2(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ | ||
return(-1); | ||
} | ||
if(munmap(from, size) < 0){ | ||
return(-1); | ||
} | ||
return(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,5 @@ thunk.S-dir = lib | |
module.c-dir = kernel | ||
|
||
subdir- := util | ||
|
||
include arch/um/scripts/Makefile.unmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
* Licensed under the GPL | ||
*/ | ||
|
||
#include <linux/mman.h> | ||
#include <asm/unistd.h> | ||
|
||
static int errno; | ||
|
||
static inline _syscall2(int,munmap,void *,start,size_t,len) | ||
static inline _syscall6(void *,mmap,void *,addr,size_t,len,int,prot,int,flags,int,fd,off_t,offset) | ||
int switcheroo(int fd, int prot, void *from, void *to, int size) | ||
{ | ||
if(munmap(to, size) < 0){ | ||
return(-1); | ||
} | ||
if(mmap(to, size, prot, MAP_SHARED | MAP_FIXED, fd, 0) != to){ | ||
return(-1); | ||
} | ||
if(munmap(from, size) < 0){ | ||
return(-1); | ||
} | ||
return(0); | ||
} |