| 1 |
|
| 2 |
|
| 3 |
ramstage-y += smm_module_loader.c |
| 4 |
ramstage-$(CONFIG_SMM_PCI_RESOURCE_STORE) += pci_resource_store.c |
| 5 |
|
| 6 |
smm-$(CONFIG_SMM_PCI_RESOURCE_STORE) += pci_resource_store.c |
| 7 |
|
| 8 |
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) |
| 9 |
$(eval $(call create_class_compiler,smm,x86_32)) |
| 10 |
$(eval $(call create_class_compiler,smmstub,x86_32)) |
| 11 |
else |
| 12 |
$(eval $(call create_class_compiler,smm,x86_64)) |
| 13 |
$(eval $(call create_class_compiler,smmstub,x86_64)) |
| 14 |
endif |
| 15 |
|
| 16 |
smmstub-generic-ccopts += -D__SMM__ |
| 17 |
smm-generic-ccopts += -D__SMM__ |
| 18 |
smm-c-deps+=$$(OPTION_TABLE_H) |
| 19 |
|
| 20 |
$(obj)/smm/smm.a: $$(smm-objs) |
| 21 |
$(AR_smm) rcsT [email protected] $(filter-out %.ld, $(smm-objs)) |
| 22 |
mv [email protected] $@ |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
$(call src-to-obj,ramstage,$(obj)/cpu/x86/smm/smm.manual): $(obj)/smm/smm |
| 28 |
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
| 29 |
cd $(dir $<); $(OBJCOPY_smm) -I binary $(notdir $<) $(target-objcopy) $(abspath $@) |
| 30 |
|
| 31 |
ifeq ($(CONFIG_HAVE_SMI_HANDLER),y) |
| 32 |
ramstage-srcs += $(obj)/cpu/x86/smm/smm.manual |
| 33 |
endif |
| 34 |
|
| 35 |
smm-y += save_state.c |
| 36 |
|
| 37 |
ramstage-y += tseg_region.c |
| 38 |
romstage-y += tseg_region.c |
| 39 |
postcar-y += tseg_region.c |
| 40 |
|
| 41 |
ifeq ($(CONFIG_PARALLEL_MP),y) |
| 42 |
|
| 43 |
smmstub-y += smm_stub.S |
| 44 |
|
| 45 |
smm-y += smm_module_handler.c |
| 46 |
|
| 47 |
ramstage-srcs += $(obj)/cpu/x86/smm/smmstub.manual |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
$(obj)/smmstub/smmstub.o: $$(smmstub-objs) $(COMPILER_RT_smmstub) |
| 52 |
$(LD_smmstub) -nostdlib -r -o $@ $(COMPILER_RT_FLAGS_smmstub) --whole-archive --start-group $(smmstub-objs) --no-whole-archive $(COMPILER_RT_smmstub) --end-group |
| 53 |
|
| 54 |
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) |
| 55 |
$(eval $(call rmodule_link,$(obj)/smmstub/smmstub.elf, $(obj)/smmstub/smmstub.o,x86_32)) |
| 56 |
else |
| 57 |
$(eval $(call rmodule_link,$(obj)/smmstub/smmstub.elf, $(obj)/smmstub/smmstub.o,x86_64)) |
| 58 |
endif |
| 59 |
|
| 60 |
$(obj)/smmstub/smmstub: $(obj)/smmstub/smmstub.elf.rmod |
| 61 |
$(OBJCOPY_smmstub) -O binary $< $@ |
| 62 |
|
| 63 |
$(call src-to-obj,ramstage,$(obj)/cpu/x86/smm/smmstub.manual): $(obj)/smmstub/smmstub |
| 64 |
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n" |
| 65 |
cd $(dir $<); $(OBJCOPY_smmstub) -I binary $(notdir $<) $(target-objcopy) $(abspath $@) |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) |
| 70 |
$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.a,x86_32)) |
| 71 |
else |
| 72 |
$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.a,x86_64)) |
| 73 |
endif |
| 74 |
|
| 75 |
$(obj)/smm/smm: $(obj)/smm/smm.elf.rmod |
| 76 |
$(OBJCOPY_smm) -O binary $< $@ |
| 77 |
|
| 78 |
endif |