From 3d1933fb20a033fcbdf2d90ad26a232a5bd46132 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 27 Nov 2009 10:57:52 +0100 Subject: [PATCH] Fix compilation on x86_64-efi --- conf/x86_64-efi.rmk | 6 ++++++ include/grub/x86_64/relocator.h | 1 + lib/relocator.c | 14 ++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 include/grub/x86_64/relocator.h diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 726bf23fa..25c379c98 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -166,4 +166,10 @@ xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) +pkglib_MODULES += relocator.mod +relocator_mod_SOURCES = lib/i386/relocator.c lib/i386/relocator_asm.S lib/i386/relocator_backward.S +relocator_mod_CFLAGS = $(COMMON_CFLAGS) +relocator_mod_ASFLAGS = $(COMMON_ASFLAGS) +relocator_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/x86_64/relocator.h b/include/grub/x86_64/relocator.h new file mode 100644 index 000000000..247e7a18b --- /dev/null +++ b/include/grub/x86_64/relocator.h @@ -0,0 +1 @@ +#include diff --git a/lib/relocator.c b/lib/relocator.c index d4bfebc8e..557fd4f63 100644 --- a/lib/relocator.c +++ b/lib/relocator.c @@ -73,8 +73,8 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest, size = *(grub_size_t *) playground; grub_dprintf ("relocator", - "Relocator: source: %p, destination: 0x%x, size: 0x%x\n", - relocator, dest, size); + "Relocator: source: %p, destination: 0x%x, size: 0x%lx\n", + relocator, (unsigned) dest, (unsigned long) size); /* Very unlikely condition: Relocator may risk overwrite itself. Just move it a bit up. */ @@ -103,10 +103,11 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest, RELOCATOR_ALIGN); grub_dprintf ("relocator", "Backward relocator: code %p, source: %p, " - "destination: 0x%x, size: 0x%x\n", + "destination: 0x%x, size: 0x%lx\n", (char *) relocator - overhead, (char *) relocator - overhead, - dest - overhead, size + overhead); + (unsigned) dest - overhead, + (unsigned long) size + overhead); write_call_relocator_bw ((char *) relocator - overhead, (char *) relocator - overhead, @@ -120,10 +121,11 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest, + RELOCATOR_SIZEOF (forward) - (dest + size); grub_dprintf ("relocator", "Forward relocator: code %p, source: %p, " - "destination: 0x%x, size: 0x%x\n", + "destination: 0x%x, size: 0x%lx\n", (char *) relocator + size + overhead - RELOCATOR_SIZEOF (forward), - relocator, dest, size + overhead); + relocator, (unsigned) dest, + (unsigned long) size + overhead); write_call_relocator_fw ((char *) relocator + size + overhead - RELOCATOR_SIZEOF (forward),