All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: xen-devel@lists.xen.org
Cc: wei.liu2@citrix.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, julien.grall@arm.com,
	jbeulich@suse.com, zhaoshenglong@huawei.com,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	roger.pau@citrix.com
Subject: [PATCH v4 10/21] acpi/hvmloader: Link ACPI object files directly
Date: Mon, 19 Sep 2016 20:19:28 -0400	[thread overview]
Message-ID: <1474330779-10645-11-git-send-email-boris.ostrovsky@oracle.com> (raw)
In-Reply-To: <1474330779-10645-1-git-send-email-boris.ostrovsky@oracle.com>

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>
---
Changes in v4:
* Added a suffix to iasl's -p option to work around a bug in older
  iasl versions where it drops everything after rightmost '.'.

 .gitignore                             |  8 +++---
 tools/firmware/hvmloader/Makefile      | 11 +++++++-
 tools/firmware/hvmloader/acpi/Makefile | 48 ++++++++++++++++------------------
 3 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6dee857..5720e0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,13 +127,13 @@ 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*.c
+tools/firmware/hvmloader/dsdt_*.asl
 tools/firmware/hvmloader/hvmloader
+tools/firmware/hvmloader/mk_dsdt
 tools/firmware/hvmloader/roms.h
 tools/firmware/hvmloader/roms.inc
+tools/firmware/hvmloader/ssdt_*.h
 tools/firmware/rombios/BIOS-bochs-[^/]*
 tools/firmware/rombios/_rombios[^/]*_.c
 tools/firmware/rombios/rombios[^/]*.s
diff --git a/tools/firmware/hvmloader/Makefile b/tools/firmware/hvmloader/Makefile
index 23b0a58..2565832 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -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:
@@ -76,7 +77,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
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index c6382bd..4045ea7 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -15,41 +15,45 @@
 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))
+# Used as a workaround for a bug in some older iasl versions where
+# the tool will ignore everything after last '.' in the path ('-p' argument)
+TMP_SUFFIX	= tmp__
 
-CFLAGS += $(CFLAGS_xeninclude)
+MK_DSDT = $(ACPI_BUILD_DIR)/mk_dsdt
+
+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)
 
 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
+$(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
+$(MK_DSDT): mk_dsdt.c
 	$(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_xeninclude) -o $@ mk_dsdt.c
 
 ifeq ($(GPL),y)
-dsdt_anycpu_qemu_xen.asl: gpl/dsdt.asl dsdt_acpi_info.asl mk_dsdt
+$(ACPI_BUILD_DIR)/dsdt_anycpu_qemu_xen.asl: gpl/dsdt.asl $(MK_DSDT)
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@
 	cat dsdt_acpi_info.asl >> $@
-	./mk_dsdt --debug=$(debug) --dm-version qemu-xen >> $@
+	$(MK_DSDT) --debug=$(debug) --dm-version qemu-xen >> $@
 
 # NB. awk invocation is a portable alternative to 'head -n -1'
-dsdt_%cpu.asl: gpl/dsdt.asl dsdt_acpi_info.asl mk_dsdt
+$(ACPI_BUILD_DIR)/dsdt_%cpu.asl: gpl/dsdt.asl $(MK_DSDT)
 	awk 'NR > 1 {print s} {s=$$0}' $< > $@
 	cat dsdt_acpi_info.asl >> $@
-	./mk_dsdt --debug=$(debug) --maxcpu $*  >> $@
+	$(MK_DSDT) --debug=$(debug) --maxcpu $*  >> $@
 endif
 
-$(filter dsdt_%.c,$(C_SRC)): %.c: iasl %.asl
-	iasl -vs -p $* -tc $*.asl
-	sed -e 's/AmlCode/$*/g' $*.hex >$@
+$(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 >$@
 	echo "int $*_len=sizeof($*);" >>$@
-	rm -f $*.aml $*.hex
+	rm -f $(addprefix $(ACPI_BUILD_DIR)/, $*.aml $*.hex)
 
 iasl:
 	@echo
@@ -59,14 +63,8 @@ iasl:
 	@echo 
 	@exit 1
 
-build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
-
-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
+	rm -fr $(C_SRC) $(H_SRC) $(MK_DSDT) $(patsubst %.c,%.asl,$(C_SRC))
 
 distclean: clean
 
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-09-20  0:19 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20  0:19 [PATCH v4 00/21] Make ACPI builder available to components other than hvmloader Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 01/21] acpi: Extract acpi info description into a separate ASL file Boris Ostrovsky
2016-09-21 10:29   ` Jan Beulich
2016-09-21 13:21     ` Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 02/21] acpi: Prevent GPL-only code from seeping into non-GPL binaries Boris Ostrovsky
2016-09-20 10:14   ` Ian Jackson
2016-09-20 10:41     ` Lars Kurth
2016-09-20 14:07     ` Boris Ostrovsky
2016-09-20 14:19       ` Ian Jackson
2016-09-20 14:58         ` Boris Ostrovsky
2016-09-20 10:32   ` Lars Kurth
2016-09-21 10:39   ` Jan Beulich
2016-09-21 13:34     ` Boris Ostrovsky
2016-09-21 13:47       ` Jan Beulich
2016-09-20  0:19 ` [PATCH v4 03/21] acpi: Re-license ACPI builder files from GPLv2 to LGPLv2.1 Boris Ostrovsky
2016-09-20 10:17   ` Lars Kurth
2016-09-20  0:19 ` [PATCH v4 04/21] acpi/hvmloader: Collect processor and NUMA info in hvmloader Boris Ostrovsky
2016-09-21 10:42   ` Jan Beulich
2016-09-20  0:19 ` [PATCH v4 05/21] acpi/hvmloader: Set TIS header address " Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 06/21] acpi/hvmloader: Make providing IOAPIC in MADT optional Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 07/21] acpi/hvmloader: Build WAET optionally Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 08/21] acpi/hvmloader: Replace mem_alloc() and virt_to_phys() with memory ops Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 09/21] acpi/hvmloader: Translate all addresses when assigning addresses in ACPI tables Boris Ostrovsky
2016-09-20  0:19 ` Boris Ostrovsky [this message]
2016-09-21 10:52   ` [PATCH v4 10/21] acpi/hvmloader: Link ACPI object files directly Jan Beulich
2016-09-21 11:29     ` Ian Jackson
2016-09-21 11:36       ` Jan Beulich
2016-09-21 11:38         ` Ian Jackson
2016-09-21 11:40           ` Jan Beulich
2016-09-21 13:45             ` Boris Ostrovsky
2016-09-21 15:05               ` Ian Jackson
2016-09-21 15:21                 ` Boris Ostrovsky
2016-09-21 15:25                   ` Ian Jackson
2016-09-21 21:03     ` Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 11/21] acpi/hvmloader: Include file/paths adjustments Boris Ostrovsky
2016-09-21 11:27   ` Jan Beulich
2016-09-20  0:19 ` [PATCH v4 12/21] acpi: Move ACPI code to tools/libacpi Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 13/21] x86: Allow LAPIC-only emulation_flags for HVM guests Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 14/21] libacpi: Build DSDT for PVH guests Boris Ostrovsky
2016-09-21 11:27   ` Jan Beulich
2016-09-20  0:19 ` [PATCH v4 15/21] acpi: Makefile should better tolerate interrupts Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 16/21] libxc/libxl: Allow multiple ACPI modules Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 17/21] libxl/acpi: Add ACPI e820 entry Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 18/21] libxl/pvhv2: Include APIC page in MMIO hole for PVHv2 guests Boris Ostrovsky
2016-09-20  0:19 ` [PATCH v4 19/21] ilibxl: Initialize domain build info before calling libxl__domain_make Boris Ostrovsky
2016-09-21 11:29   ` Jan Beulich
2016-09-20  0:19 ` [PATCH v4 20/21] libxl/acpi: Build ACPI tables for HVMlite guests Boris Ostrovsky
2016-09-21 11:33   ` Jan Beulich
2016-09-21 15:09     ` Boris Ostrovsky
2016-09-21 15:16       ` Jan Beulich
2016-09-21 15:34         ` Boris Ostrovsky
2016-09-21 16:02           ` Jan Beulich
2016-09-21 16:38             ` Boris Ostrovsky
2016-09-22  8:39               ` Jan Beulich
2016-09-22 10:53   ` Wei Liu
2016-09-22 15:57     ` Boris Ostrovsky
2016-09-22 15:57       ` Wei Liu
2016-09-20  0:19 ` [PATCH v4 21/21] libxc/xc_dom_core: Copy ACPI tables to guest space Boris Ostrovsky
2016-09-22 10:53   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1474330779-10645-11-git-send-email-boris.ostrovsky@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=zhaoshenglong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.