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>
This commit is contained in:
committed by
Linus Torvalds
parent
f5a9c77df4
commit
c539ab7307
@ -24,6 +24,7 @@
|
||||
#include "uml-config.h"
|
||||
#include "os.h"
|
||||
#include "um_malloc.h"
|
||||
#include "kern_constants.h"
|
||||
|
||||
/* Set in main, unchanged thereafter */
|
||||
char *linux_prog;
|
||||
@ -232,7 +233,8 @@ void *__wrap_malloc(int size)
|
||||
|
||||
if(!CAN_KMALLOC())
|
||||
return __real_malloc(size);
|
||||
else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/
|
||||
else if(size <= UM_KERN_PAGE_SIZE)
|
||||
/* finding contiguous pages can be hard*/
|
||||
ret = um_kmalloc(size);
|
||||
else ret = um_vmalloc(size);
|
||||
|
||||
|
Reference in New Issue
Block a user