summaryrefslogtreecommitdiff
path: root/src/cpu/x86
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2015-03-15 19:23:50 +0100
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-06-16 02:47:41 +0200
commit181b77324f9b15e66479ac150a644c3b6cb72c12 (patch)
tree168549fb599ae05cf31db3e64e8feb4303bf9ce9 /src/cpu/x86
parent6867120a8018d93df99dae6fb69e3789f112bb1b (diff)
x86: Make x86 architecture makefiles x64 aware
Almost all of the code between x86 and x64 can be shared, so select it for either architecture. Change-Id: I681149ed7698c08b702bb19f074f369699cef1bf Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Signed-off-by: Scott Duplichan <scott@notabs.org> Reviewed-on: http://review.coreboot.org/8693 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/cpu/x86')
-rw-r--r--src/cpu/x86/Makefile.inc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cpu/x86/Makefile.inc b/src/cpu/x86/Makefile.inc
index 34d97ce08d..9ec07689fd 100644
--- a/src/cpu/x86/Makefile.inc
+++ b/src/cpu/x86/Makefile.inc
@@ -1,4 +1,4 @@
-ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y)
+ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
romstage-$(CONFIG_CACHE_AS_RAM) += car.c
endif
@@ -19,11 +19,19 @@ rmodules_$(ARCH-ramstage-y)-$(CONFIG_PARALLEL_MP) += sipi_vector.S
$(SIPI_DOTO): $(dir $(SIPI_ELF))sipi_vector.rmodules_$(ARCH-ramstage-y).o
$(CC_rmodules_$(ARCH-ramstage-y)) $(CFLAGS_rmodules_$(ARCH-ramstage-y)) -nostdlib -r -o $@ $^
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
$(eval $(call rmodule_link,$(SIPI_ELF), $(SIPI_ELF:.elf=.o), 0,x86_32))
+else
+$(eval $(call rmodule_link,$(SIPI_ELF), $(SIPI_ELF:.elf=.o), 0,x86_64))
+endif
$(SIPI_BIN): $(SIPI_RMOD)
$(OBJCOPY_ramstage) -O binary $< $@
$(SIPI_BIN).ramstage.manual: $(SIPI_BIN)
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
cd $(dir $@); $(OBJCOPY_rmodules_$(ARCH-ramstage-y)) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
+else
+ cd $(dir $@); $(OBJCOPY_rmodules_$(ARCH-ramstage-y)) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
+endif