Fix x86_64-efi compilation.
This commit is contained in:
parent
1c7a1bab8c
commit
88ba41253e
3 changed files with 10 additions and 21 deletions
|
@ -16,8 +16,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in
|
||||||
|
|
||||||
# Modules.
|
# Modules.
|
||||||
pkglib_PROGRAMS = kernel.img
|
pkglib_PROGRAMS = kernel.img
|
||||||
pkglib_MODULES = chain.mod appleldr.mod \
|
pkglib_MODULES = chain.mod appleldr.mod halt.mod \
|
||||||
linux.mod halt.mod \
|
|
||||||
datetime.mod loadbios.mod \
|
datetime.mod loadbios.mod \
|
||||||
fixvideo.mod mmap.mod acpi.mod
|
fixvideo.mod mmap.mod acpi.mod
|
||||||
|
|
||||||
|
@ -63,15 +62,6 @@ appleldr_mod_SOURCES = loader/efi/appleloader.c
|
||||||
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
|
appleldr_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
# For linux.mod.
|
|
||||||
linux_mod_SOURCES = loader/i386/efi/linux.c
|
|
||||||
ifeq ($(target_cpu), x86_64)
|
|
||||||
linux_mod_SOURCES += loader/i386/linux_trampoline.S
|
|
||||||
endif
|
|
||||||
linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
||||||
linux_mod_ASFLAGS = $(COMMON_ASFLAGS)
|
|
||||||
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
|
||||||
|
|
||||||
# For halt.mod.
|
# For halt.mod.
|
||||||
halt_mod_SOURCES = commands/halt.c
|
halt_mod_SOURCES = commands/halt.c
|
||||||
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
halt_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
|
@ -103,7 +93,7 @@ efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
pkglib_MODULES += xnu.mod
|
pkglib_MODULES += xnu.mod
|
||||||
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \
|
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c \
|
||||||
loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
|
loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c
|
||||||
xnu_mod_CFLAGS = $(COMMON_CFLAGS)
|
xnu_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
xnu_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
|
@ -253,7 +253,6 @@ grub_relocator64_boot (struct grub_relocator *rel,
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
asm volatile ("cli");
|
asm volatile ("cli");
|
||||||
grub_printf ("%x\n", relst);
|
|
||||||
((void (*) (void)) relst) ();
|
((void (*) (void)) relst) ();
|
||||||
|
|
||||||
/* Not reached. */
|
/* Not reached. */
|
||||||
|
|
|
@ -219,14 +219,12 @@ malloc_in_range (struct grub_relocator *rel,
|
||||||
grub_addr_t target = 0;
|
grub_addr_t target = 0;
|
||||||
|
|
||||||
grub_dprintf ("relocator",
|
grub_dprintf ("relocator",
|
||||||
"trying to allocate in %x-%x aligned %x size %x\n",
|
"trying to allocate in 0x%lx-0x%lx aligned 0x%lx size 0x%lx\n",
|
||||||
start, end, align, size);
|
(unsigned long) start, (unsigned long) end,
|
||||||
|
(unsigned long) align, (unsigned long) size);
|
||||||
|
|
||||||
start = ALIGN_UP (start, align);
|
start = ALIGN_UP (start, align);
|
||||||
end = ALIGN_DOWN (end - size, align) + size;
|
end = ALIGN_DOWN (end - size, align) + size;
|
||||||
grub_dprintf ("relocator",
|
|
||||||
"trying to allocate in %x-%x aligned %x size %x\n",
|
|
||||||
start, end, align, size);
|
|
||||||
|
|
||||||
if (end < start + size)
|
if (end < start + size)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -643,8 +641,9 @@ malloc_in_range (struct grub_relocator *rel,
|
||||||
alloc_end = min (events[j].pos, target + size);
|
alloc_end = min (events[j].pos, target + size);
|
||||||
if (alloc_end > alloc_start)
|
if (alloc_end > alloc_start)
|
||||||
{
|
{
|
||||||
grub_dprintf ("relocator", "subchunk 0x%x-0x%x, %d\n",
|
grub_dprintf ("relocator", "subchunk 0x%lx-0x%lx, %d\n",
|
||||||
alloc_start, alloc_end, typepre);
|
(unsigned long) alloc_start,
|
||||||
|
(unsigned long) alloc_end, typepre);
|
||||||
res->subchunks[cural].type = typepre;
|
res->subchunks[cural].type = typepre;
|
||||||
if (typepre == CHUNK_TYPE_REGION_START)
|
if (typepre == CHUNK_TYPE_REGION_START)
|
||||||
{
|
{
|
||||||
|
@ -715,7 +714,8 @@ malloc_in_range (struct grub_relocator *rel,
|
||||||
|
|
||||||
res->src = target;
|
res->src = target;
|
||||||
res->size = size;
|
res->size = size;
|
||||||
grub_dprintf ("relocator", "allocated: %x %x\n", target, size);
|
grub_dprintf ("relocator", "allocated: 0x%lx+0x%lx\n", (unsigned long) target,
|
||||||
|
(unsigned long) size);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue