diff options
author | Sachin P. Sant <sachinp@in.ibm.com> | 2007-02-27 11:25:07 +0530 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2007-02-27 15:29:43 +0900 |
commit | 05abdb92a5f5c32659620ffdb2c6e48f0b2428ae (patch) | |
tree | dfd4759a412eba42f22f14629f83295b0acdfebb | |
parent | d869eec86724069242679e458a0a24b8274d1cc4 (diff) |
kexec-tools : fix compile time error on x86-64
On x86_64 machines running kernels having relocatale kernel patches
compilation of kexec tools fails with following error.
kexec/arch/i386/kexec-multiboot-x86.c:347: warning: implicit declaration of function ‘_AC’
kexec/arch/i386/kexec-multiboot-x86.c:347: error: ‘UL’ undeclared (first use in this function)
kexec/arch/i386/kexec-multiboot-x86.c:347: error: (Each undeclared identifier is reported only once
kexec/arch/i386/kexec-multiboot-x86.c:347: error: for each function it appears in.)
The error is bacause of the use of PAGE_SIZE macro in the above file. On
x86_64 arch PAGE_SIZE is defined as
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
and hence fails to find definitation for _AC().
The correct way to fix this is to use getpagesize() function instead of
PAGE_SIZE macro.
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
Acked-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by : Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/i386/kexec-multiboot-x86.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c index 8b2c9fd..8ec8bba 100644 --- a/kexec/arch/i386/kexec-multiboot-x86.c +++ b/kexec/arch/i386/kexec-multiboot-x86.c @@ -47,7 +47,6 @@ #include <getopt.h> #include <elf.h> #include <boot/elf_boot.h> -#include <asm/page.h> #include <ip_checksum.h> #include "../../kexec.h" #include "../../kexec-elf.h" @@ -343,7 +342,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len, /* Pick the next aligned spot to load it in */ freespace = add_buffer(info, buf, mod_size, mod_size, - PAGE_SIZE, 0, 0xffffffffUL, 1); + getpagesize(), 0, 0xffffffffUL, 1); /* Add the module command line */ sprintf(mod_clp, "%s", mod_command_line); |