-
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.
- Loading branch information
Paolo 'Blaisorblade' Giarrusso
authored and
Linus Torvalds
committed
Jun 22, 2005
1 parent
6510436
commit 837ebc7
Showing
11 changed files
with
87 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: b77d6adc922b8bbf8b16b67f567958c42962cf88 | ||
refs/heads/master: 60b2737de1b1ddfdb90f3ba622634eb49d6f3603 |
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); | ||
} |