Fix compilation on x86_64-efi

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2009-11-27 10:57:52 +01:00
parent 48a57559c5
commit 3d1933fb20
3 changed files with 15 additions and 6 deletions

View file

@ -166,4 +166,10 @@ xnu_mod_CFLAGS = $(COMMON_CFLAGS)
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) 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 include $(srcdir)/conf/common.mk

View file

@ -0,0 +1 @@
#include <grub/i386/relocator.h>

View file

@ -73,8 +73,8 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest,
size = *(grub_size_t *) playground; size = *(grub_size_t *) playground;
grub_dprintf ("relocator", grub_dprintf ("relocator",
"Relocator: source: %p, destination: 0x%x, size: 0x%x\n", "Relocator: source: %p, destination: 0x%x, size: 0x%lx\n",
relocator, dest, size); relocator, (unsigned) dest, (unsigned long) size);
/* Very unlikely condition: Relocator may risk overwrite itself. /* Very unlikely condition: Relocator may risk overwrite itself.
Just move it a bit up. */ Just move it a bit up. */
@ -103,10 +103,11 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest,
RELOCATOR_ALIGN); RELOCATOR_ALIGN);
grub_dprintf ("relocator", grub_dprintf ("relocator",
"Backward relocator: code %p, source: %p, " "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,
(char *) relocator - overhead, (char *) relocator - overhead,
dest - overhead, size + overhead); (unsigned) dest - overhead,
(unsigned long) size + overhead);
write_call_relocator_bw ((char *) relocator - overhead, write_call_relocator_bw ((char *) relocator - overhead,
(char *) relocator - overhead, (char *) relocator - overhead,
@ -120,10 +121,11 @@ PREFIX (boot) (void *relocator, grub_uint32_t dest,
+ RELOCATOR_SIZEOF (forward) - (dest + size); + RELOCATOR_SIZEOF (forward) - (dest + size);
grub_dprintf ("relocator", grub_dprintf ("relocator",
"Forward relocator: code %p, source: %p, " "Forward relocator: code %p, source: %p, "
"destination: 0x%x, size: 0x%x\n", "destination: 0x%x, size: 0x%lx\n",
(char *) relocator + size + overhead (char *) relocator + size + overhead
- RELOCATOR_SIZEOF (forward), - RELOCATOR_SIZEOF (forward),
relocator, dest, size + overhead); relocator, (unsigned) dest,
(unsigned long) size + overhead);
write_call_relocator_fw ((char *) relocator + size + overhead write_call_relocator_fw ((char *) relocator + size + overhead
- RELOCATOR_SIZEOF (forward), - RELOCATOR_SIZEOF (forward),