[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] hvmloader: Fix parallel build of ACPI tables.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1265966170 0
# Node ID 27f5ff8c0aa09695285fd9846aa67ccfda238f8b
# Parent  29797e6d5809360af7a7d676ca16cfc3c62973ce
hvmloader: Fix parallel build of ACPI tables.

Make build.c dependency on ssdt_{pm,tpm}.h explicit, else they can be
built in the wrong order.

Also, improve naming of target DSDT structures, and specify -p option
to iasl so that all generated files for a given target have
target-unique names, hence build can proceed safely in parallel.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/firmware/hvmloader/acpi/Makefile |   27 ++++++++++++++-------------
 tools/firmware/hvmloader/acpi/build.c  |   12 ++++++------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff -r 29797e6d5809 -r 27f5ff8c0aa0 tools/firmware/hvmloader/acpi/Makefile
--- a/tools/firmware/hvmloader/acpi/Makefile    Fri Feb 12 09:14:16 2010 +0000
+++ b/tools/firmware/hvmloader/acpi/Makefile    Fri Feb 12 09:16:10 2010 +0000
@@ -18,7 +18,7 @@ XEN_ROOT = ../../../..
 XEN_ROOT = ../../../..
 include $(XEN_ROOT)/tools/firmware/Rules.mk
 
-C_SRC = build.c dsdt.c dsdt15.c static_tables.c
+C_SRC = build.c dsdt_anycpu.c dsdt_15cpu.c static_tables.c
 OBJS  = $(patsubst %.c,%.o,$(C_SRC))
 
 CFLAGS += -I. -I.. $(CFLAGS_include)
@@ -26,21 +26,19 @@ vpath iasl $(PATH)
 vpath iasl $(PATH)
 all: acpi.a
 
-ssdt_pm.h ssdt_tpm.h: %.h: %.asl
-       $(MAKE) iasl
-       iasl -tc $<
+ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+       iasl -p $* -tc $<
        sed -e 's/AmlCode/$*/g' $*.hex >$@
-       rm -f *.aml $*.hex
+       rm -f $*.hex $*.aml
 
-dsdt.c dsdt15.c: %.c: dsdt.asl mk_dsdt.c
-       $(MAKE) iasl
+dsdt_15cpu.c dsdt_anycpu.c: %.c: dsdt.asl mk_dsdt.c iasl
        $(HOSTCC) $(HOSTCFLAGS) $(CFLAGS_include) -o mk_$* mk_dsdt.c
-       head -n -1 $< >_$*.asl
-       ./mk_$* >>_$*.asl
-       iasl -tc _$*.asl
-       sed -e 's/AmlCode/_$*/g' _$*.hex >$@
-       echo "int _$*_len=sizeof(_$*);" >>$@
-       rm -f *.aml _dsdt* mk_$*
+       head -n -1 $< >$*.asl
+       ./mk_$* >>$*.asl
+       iasl -p $* -tc $*.asl
+       sed -e 's/AmlCode/$*/g' $*.hex >$@
+       echo "int $*_len=sizeof($*);" >>$@
+       rm -f $*.hex $*.aml $*.asl mk_$*
 
 iasl:
        @echo
@@ -50,11 +48,14 @@ iasl:
        @echo 
        @exit 1
 
+build.o: 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 mk_dsdt15 dsdt_*cpu.asl
 
 install: all
 
diff -r 29797e6d5809 -r 27f5ff8c0aa0 tools/firmware/hvmloader/acpi/build.c
--- a/tools/firmware/hvmloader/acpi/build.c     Fri Feb 12 09:14:16 2010 +0000
+++ b/tools/firmware/hvmloader/acpi/build.c     Fri Feb 12 09:16:10 2010 +0000
@@ -42,8 +42,8 @@ extern struct acpi_20_facs Facs;
  * The latter is required for Windows 2000, which experiences a BSOD of
  * KMODE_EXCEPTION_NOT_HANDLED if it sees more than 15 processor objects.
  */
-extern unsigned char _dsdt[], _dsdt15;
-extern int _dsdt_len, _dsdt15_len;
+extern unsigned char dsdt_anycpu[], dsdt_15cpu;
+extern int dsdt_anycpu_len, dsdt_15cpu_len;
 
 /* Number of processor objects in the chosen DSDT. */
 static unsigned int nr_processor_objects;
@@ -265,14 +265,14 @@ static void __acpi_build_tables(uint8_t 
     dsdt = (unsigned char *)&buf[offset];
     if ( hvm_info->nr_vcpus <= 15 )
     {
-        memcpy(dsdt, &_dsdt15, _dsdt15_len);
-        offset += align16(_dsdt15_len);
+        memcpy(dsdt, &dsdt_15cpu, dsdt_15cpu_len);
+        offset += align16(dsdt_15cpu_len);
         nr_processor_objects = 15;
     }
     else
     {
-        memcpy(dsdt, &_dsdt, _dsdt_len);
-        offset += align16(_dsdt_len);
+        memcpy(dsdt, &dsdt_anycpu, dsdt_anycpu_len);
+        offset += align16(dsdt_anycpu_len);
         nr_processor_objects = HVM_MAX_VCPUS;
     }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.