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 definition for _AC().

The correct way to fix this is to use getpagesize() function instead of PAGE_SIZE macro.

Attached is a patch for the same. Please review.

Thanks
-Sachin


Signed-off-by : Sachin Sant <[EMAIL PROTECTED]>
---




* 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 <[EMAIL PROTECTED]>
---

diff -Naurp old/kexec/arch/i386/kexec-multiboot-x86.c new/kexec/arch/i386/kexec-multiboot-x86.c
--- old/kexec/arch/i386/kexec-multiboot-x86.c	2007-02-27 11:00:34.000000000 +0530
+++ new/kexec/arch/i386/kexec-multiboot-x86.c	2007-02-27 11:01:58.000000000 +0530
@@ -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 **
 			/* 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);
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to