summaryrefslogtreecommitdiff
path: root/src/cpu/x86/smm/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/x86/smm/Makefile.inc')
-rw-r--r--src/cpu/x86/smm/Makefile.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc
index 7b4ad593c6..1970911a76 100644
--- a/src/cpu/x86/smm/Makefile.inc
+++ b/src/cpu/x86/smm/Makefile.inc
@@ -61,14 +61,22 @@ $(obj)/cpu/x86/smm/smmstub.o: $$(smmstub-objs)
$(CC_smmstub) $(CFLAGS_smmstub) -nostdlib -r -o $@ $^
# Link the SMM stub module with a 0-byte heap.
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
$(eval $(call rmodule_link,$(obj)/cpu/x86/smm/smmstub.elf, $(obj)/cpu/x86/smm/smmstub.o, 0,x86_32))
+else
+$(eval $(call rmodule_link,$(obj)/cpu/x86/smm/smmstub.elf, $(obj)/cpu/x86/smm/smmstub.o, 0,x86_64))
+endif
$(obj)/cpu/x86/smm/smmstub: $(obj)/cpu/x86/smm/smmstub.elf.rmod
$(OBJCOPY_smmstub) -O binary $< $@
$(obj)/cpu/x86/smm/smmstub.ramstage.manual: $(obj)/cpu/x86/smm/smmstub
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
+ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y)
cd $(dir $@); $(OBJCOPY_smmstub) -I binary $(notdir $<) -O elf32-i386 -B i386 $(notdir $@)
+else
+ cd $(dir $@); $(OBJCOPY_smmstub) -I binary $(notdir $<) -O elf64-x86_64 -B x86_64 $(notdir $@)
+endif
# C-based SMM handler.