Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/82017?usp=email )
Change subject: NOTFORMERGE: Make coreinfo build with 64bit ......................................................................
NOTFORMERGE: Make coreinfo build with 64bit
Change-Id: Ibfd273f16431b82f9fbebafb45fb302999eaec69 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M payloads/coreinfo/Makefile M payloads/coreinfo/cbfs_module.c M payloads/coreinfo/cpuid.S M payloads/coreinfo/ramdump_module.c M payloads/libpayload/Makefile M payloads/libpayload/Makefile.payload 6 files changed, 8 insertions(+), 42 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/82017/1
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index 9655e24..7f010d2 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -19,7 +19,7 @@ OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) TARGET = $(obj)/coreinfo.elf
-ARCH := x86_32 +ARCH := x86_64
all: real-all
diff --git a/payloads/coreinfo/cbfs_module.c b/payloads/coreinfo/cbfs_module.c index c8fa7e2..3444ff3 100644 --- a/payloads/coreinfo/cbfs_module.c +++ b/payloads/coreinfo/cbfs_module.c @@ -50,7 +50,7 @@ static struct cbfile *getfile(struct cbfile *f) { while (1) { - if (f < (struct cbfile *)(0xffffffff - ntohl(header->romsize))) + if (f < (struct cbfile *)(uintptr_t)(0xffffffff - ntohl(header->romsize))) return NULL; if (f->magic == 0) return NULL; @@ -62,7 +62,7 @@
static struct cbfile *firstfile(void) { - return getfile((void *)(0 - ntohl(header->romsize) + + return getfile((void *)(0x100000000 - ntohl(header->romsize) + ntohl(header->offset))); }
diff --git a/payloads/coreinfo/cpuid.S b/payloads/coreinfo/cpuid.S index 84cdc77..824c88b 100644 --- a/payloads/coreinfo/cpuid.S +++ b/payloads/coreinfo/cpuid.S @@ -11,40 +11,6 @@ .type docpuid,@function
docpuid: - pushl %ebp - movl %esp, %ebp - pushl %edi - pushl %ebx - pushl %ecx - pushl %edx - movl 8(%ebp),%eax - cpuid - movl 12(%ebp),%edi - test %edi,%edi - jz L1 - movl %eax, (%edi) - -L1: movl 16(%ebp),%edi - test %edi,%edi - jz L2 - movl %ebx,(%edi) - -L2: movl 20(%ebp),%edi - test %edi,%edi - jz L3 - movl %ecx,(%edi) - -L3: movl 24(%ebp), %edi - test %edi,%edi - jz L4 - movl %edx,(%edi) - -L4: popl %edx - popl %ecx - popl %ebx - popl %edi - movl %ebp,%esp - popl %ebp ret
.section .note.GNU-stack,"", @progbits diff --git a/payloads/coreinfo/ramdump_module.c b/payloads/coreinfo/ramdump_module.c index 762707f..acdf7ee 100644 --- a/payloads/coreinfo/ramdump_module.c +++ b/payloads/coreinfo/ramdump_module.c @@ -12,7 +12,7 @@ return 0; }
-static void dump_ram(WINDOW *win, uint32_t addr, int row, int col) +static void dump_ram(WINDOW *win, uintptr_t addr, int row, int col) { int i, x = 0, y = 0, count = 0; volatile uint8_t *ptr = (void *)(addr); diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile index 2737216..84951cd 100644 --- a/payloads/libpayload/Makefile +++ b/payloads/libpayload/Makefile @@ -109,7 +109,7 @@
ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64 -ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86 +#ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86 ARCHDIR-$(CONFIG_LP_ARCH_X86_64) := x64 ARCHDIR-$(CONFIG_LP_ARCH_MOCK) := mock
diff --git a/payloads/libpayload/Makefile.payload b/payloads/libpayload/Makefile.payload index fa98d8a4..686a1d4 100644 --- a/payloads/libpayload/Makefile.payload +++ b/payloads/libpayload/Makefile.payload @@ -84,7 +84,7 @@ LPGCC += $(LIBPAYLOAD_SRC)/bin/lpgcc
LPAS = AS="$(AS_$(ARCH))" -LPAS += $(LIBPAYLOAD_SRC)/bin/lpas +LPAS += $(LIBPAYLOAD_SRC)/bin/lpas --64
OBJCOPY = $(OBJCOPY_$(ARCH))
@@ -112,8 +112,8 @@ $(LPGCC) -MMD $(CFLAGS) -c $< -o $@
$(obj)/%.S.o: %.S $(LIBPAYLOAD_CONFIG_H) $(DEFAULT_DEPS) - @printf " LPAS $(subst $(obj)/,,$@)\n" - $(LPAS) $< -o $@ + @printf " LPGCC $(subst $(obj)/,,$@)\n" + $(LPGCC) -MMD $(CFLAGS) -c $< -o $@
-include $(OBJS:.o=.d)