diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-06-16 13:16:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 16:16:16 -0400 |
commit | c539ab73070b381f0452dae791f891ec2515098e (patch) | |
tree | 68e4e706fe31b88b26bd4b29eadb32440148eb3e /arch/um/os-Linux/main.c | |
parent | f5a9c77df45b113d21b64cbc2bf6c72a0da48998 (diff) |
uml: remove PAGE_SIZE from libc code
Distros seem to be removing PAGE_SIZE from asm/page.h. So, the libc side of
UML should stop using it.
I replace it with UM_KERN_PAGE_SIZE, which is defined to be the same as
PAGE_SIZE on the kernel side of the house. I could also use getpagesize(),
but it's more important that UML have the same value of PAGE_SIZE everywhere.
It's conceivable that it could be built with a larger PAGE_SIZE, and use of
getpagesize() would break that badly.
PAGE_MASK got the same treatment, as it is closely tied to PAGE_SIZE.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/main.c')
-rw-r--r-- | arch/um/os-Linux/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index ea9a23696f36..fb510d40480c 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "uml-config.h" | 24 | #include "uml-config.h" |
25 | #include "os.h" | 25 | #include "os.h" |
26 | #include "um_malloc.h" | 26 | #include "um_malloc.h" |
27 | #include "kern_constants.h" | ||
27 | 28 | ||
28 | /* Set in main, unchanged thereafter */ | 29 | /* Set in main, unchanged thereafter */ |
29 | char *linux_prog; | 30 | char *linux_prog; |
@@ -232,7 +233,8 @@ void *__wrap_malloc(int size) | |||
232 | 233 | ||
233 | if(!CAN_KMALLOC()) | 234 | if(!CAN_KMALLOC()) |
234 | return __real_malloc(size); | 235 | return __real_malloc(size); |
235 | else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/ | 236 | else if(size <= UM_KERN_PAGE_SIZE) |
237 | /* finding contiguous pages can be hard*/ | ||
236 | ret = um_kmalloc(size); | 238 | ret = um_kmalloc(size); |
237 | else ret = um_vmalloc(size); | 239 | else ret = um_vmalloc(size); |
238 | 240 | ||