mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
acpi/hvmloader: Link ACPI object files directly
ACPI sources will be available to various component which will build them according to their own rules. ACPI's Makefile will only generate necessary source files. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
999fb168a8
commit
09de18fc88
3 files changed
+40
-27
No files matched your search
+3
-4
@@ -127,13 +127,12 @@ tools/firmware/*bios/*bios*.txt
|
||||
tools/firmware/etherboot/gpxe/*
|
||||
tools/firmware/extboot/extboot.img
|
||||
tools/firmware/extboot/signrom
|
||||
tools/firmware/hvmloader/acpi/mk_dsdt
|
||||
tools/firmware/hvmloader/acpi/dsdt*.c
|
||||
tools/firmware/hvmloader/acpi/dsdt_*cpu*.asl
|
||||
tools/firmware/hvmloader/acpi/ssdt_*.h
|
||||
tools/firmware/hvmloader/dsdt*
|
||||
tools/firmware/hvmloader/hvmloader
|
||||
tools/firmware/hvmloader/mk_dsdt
|
||||
tools/firmware/hvmloader/roms.h
|
||||
tools/firmware/hvmloader/roms.inc
|
||||
tools/firmware/hvmloader/ssdt*
|
||||
tools/firmware/rombios/BIOS-bochs-[^/]*
|
||||
tools/firmware/rombios/_rombios[^/]*_.c
|
||||
tools/firmware/rombios/rombios[^/]*.s
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
XEN_ROOT = $(CURDIR)/../../..
|
||||
include $(XEN_ROOT)/tools/firmware/Rules.mk
|
||||
|
||||
export ACPI_BUILD_DIR=$(CURDIR)
|
||||
SUBDIRS := acpi
|
||||
|
||||
# The HVM loader is started in 32-bit mode at the address below:
|
||||
@@ -75,7 +76,15 @@ all: subdirs-all
|
||||
rombios.o: roms.inc
|
||||
smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(SMBIOS_REL_DATE)\""
|
||||
|
||||
hvmloader: $(OBJS) acpi/acpi.a
|
||||
ACPI_PATH = acpi
|
||||
ACPI_FILES = dsdt_anycpu.c dsdt_15cpu.c dsdt_anycpu_qemu_xen.c
|
||||
ACPI_OBJS = $(patsubst %.c,%.o,$(ACPI_FILES)) build.o static_tables.o
|
||||
$(ACPI_OBJS): CFLAGS += -I$(ACPI_PATH) -I.
|
||||
vpath build.c $(ACPI_PATH)
|
||||
vpath static_tables.c $(ACPI_PATH)
|
||||
OBJS += $(ACPI_OBJS)
|
||||
|
||||
hvmloader: $(OBJS)
|
||||
$(LD) $(LDFLAGS_DIRECT) -N -Ttext $(LOADADDR) -o hvmloader.tmp $^
|
||||
$(OBJCOPY) hvmloader.tmp hvmloader
|
||||
rm -f hvmloader.tmp
|
||||
|
||||
@@ -15,52 +15,57 @@
|
||||
XEN_ROOT = $(CURDIR)/../../../..
|
||||
include $(XEN_ROOT)/tools/firmware/Rules.mk
|
||||
|
||||
C_SRC-$(GPL) = build.c dsdt_anycpu.c dsdt_15cpu.c dsdt_anycpu_qemu_xen.c
|
||||
C_SRC = build.c static_tables.c $(C_SRC-y)
|
||||
OBJS = $(patsubst %.c,%.o,$(C_SRC))
|
||||
MK_DSDT = $(ACPI_BUILD_DIR)/mk_dsdt
|
||||
|
||||
CFLAGS += $(CFLAGS_xeninclude)
|
||||
C_SRC-$(GPL) = dsdt_anycpu.c dsdt_15cpu.c dsdt_anycpu_qemu_xen.c
|
||||
C_SRC = $(addprefix $(ACPI_BUILD_DIR)/, $(C_SRC-y))
|
||||
H_SRC = $(addprefix $(ACPI_BUILD_DIR)/, ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h)
|
||||
|
||||
# Suffix for temporary files.
|
||||
#
|
||||
# We will also use this suffix to workaround a bug in older iasl
|
||||
# versions where the tool will ignore everything after last '.' in the
|
||||
# path ('-p' argument). By adding ".<suffix>" we force iasl to use
|
||||
# complete $(ACPI_BUILD_DIR) as path, even if it has '.' symbols.
|
||||
TMP_SUFFIX = tmp
|
||||
|
||||
vpath iasl $(PATH)
|
||||
all: acpi.a
|
||||
all: $(C_SRC) $(H_SRC)
|
||||
|
||||
ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
|
||||
iasl -vs -p $* -tc $<
|
||||
sed -e 's/AmlCode/$*/g' $*.hex >$@
|
||||
rm -f $*.hex $*.aml
|
||||
|
||||
mk_dsdt: mk_dsdt.c
|
||||
$(H_SRC): $(ACPI_BUILD_DIR)/%.h: %.asl iasl
|
||||
iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $<
|
||||
sed -e 's/AmlCode/$*/g' $(ACPI_BUILD_DIR)/$*.hex >$@
|
||||
rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
|
||||
|
||||
$(MK_DSDT): mk_dsdt.c
|
||||
$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -o $@ mk_dsdt.c
|
||||
|
||||
ifeq ($(GPL),y)
|
||||
dsdt_anycpu_qemu_xen.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh mk_dsdt
|
||||
$(ACPI_BUILD_DIR)/dsdt_anycpu_qemu_xen.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh $(MK_DSDT)
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
|
||||
# Strip license comment
|
||||
sed -i '1,/\*\//{/\/\*/,/\*\//d}' $@.$(TMP_SUFFIX)
|
||||
$(SHELL) gpl/mk_dsdt_gpl.sh >> $@.$(TMP_SUFFIX)
|
||||
cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
|
||||
./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
|
||||
$(MK_DSDT) --debug=$(debug) --dm-version qemu-xen >> $@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
|
||||
# NB. awk invocation is a portable alternative to 'head -n -1'
|
||||
dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh mk_dsdt
|
||||
$(ACPI_BUILD_DIR)/dsdt_%cpu.asl: dsdt.asl dsdt_acpi_info.asl gpl/mk_dsdt_gpl.sh $(MK_DSDT)
|
||||
awk 'NR > 1 {print s} {s=$$0}' $< > $@.$(TMP_SUFFIX)
|
||||
sed -i '1,/\*\//{/\/\*/,/\*\//d}' $@.$(TMP_SUFFIX)
|
||||
$(SHELL) gpl/mk_dsdt_gpl.sh >> $@.$(TMP_SUFFIX)
|
||||
cat dsdt_acpi_info.asl >> $@.$(TMP_SUFFIX)
|
||||
./mk_dsdt --debug=$(debug) --maxcpu $* >> $@.$(TMP_SUFFIX)
|
||||
$(MK_DSDT) --debug=$(debug) --maxcpu $* >> $@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
endif
|
||||
|
||||
$(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl
|
||||
iasl -vs -p $* -tc $*.asl
|
||||
sed -e 's/AmlCode/$*/g' $*.hex >$@.$(TMP_SUFFIX)
|
||||
echo "int $*_len=sizeof($*);" >>$@.$(TMP_SUFFIX)
|
||||
$(C_SRC): $(ACPI_BUILD_DIR)/%.c: iasl $(ACPI_BUILD_DIR)/%.asl
|
||||
iasl -vs -p $(ACPI_BUILD_DIR)/$*.$(TMP_SUFFIX) -tc $(ACPI_BUILD_DIR)/$*.asl
|
||||
sed -e 's/AmlCode/$*/g' $(ACPI_BUILD_DIR)/$*.hex > $@.$(TMP_SUFFIX)
|
||||
echo "int $*_len=sizeof($*);" >> $@.$(TMP_SUFFIX)
|
||||
mv -f $@.$(TMP_SUFFIX) $@
|
||||
rm -f $*.aml $*.hex
|
||||
rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
|
||||
|
||||
iasl:
|
||||
@echo
|
||||
@@ -76,8 +81,8 @@ acpi.a: $(OBJS)
|
||||
$(AR) rc $@ $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -rf *.a *.o $(IASL_VER) $(IASL_VER).tar.gz $(DEPS)
|
||||
rm -rf ssdt_*.h dsdt*.c *~ *.aml *.hex mk_dsdt dsdt_*cpu*.asl *.$(TMP_SUFFIX)
|
||||
rm -f $(C_SRC) $(H_SRC) $(MK_DSDT) $(C_SRC:=.$(TMP_SUFFIX))
|
||||
rm -f $(patsubst %.c,%.hex,$(C_SRC)) $(patsubst %.c,%.aml,$(C_SRC)) $(patsubst %.c,%.asl,$(C_SRC))
|
||||
|
||||
distclean: clean
|
||||
|
||||
|
||||