ia64/xen-unstable

changeset 12658:c630278d4193

[HVMLOADER] Clean up makefile, change TPM detection.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Nov 29 12:41:30 2006 +0000 (2006-11-29)
parents 53795f0a41b1
children 463bda167715
files tools/firmware/hvmloader/Makefile tools/firmware/hvmloader/acpi/build.c
line diff
     1.1 --- a/tools/firmware/hvmloader/Makefile	Wed Nov 29 12:16:59 2006 +0000
     1.2 +++ b/tools/firmware/hvmloader/Makefile	Wed Nov 29 12:41:30 2006 +0000
     1.3 @@ -18,12 +18,10 @@
     1.4  # Place - Suite 330, Boston, MA 02111-1307 USA.
     1.5  #
     1.6  
     1.7 -# External CFLAGS can do more harm than good.
     1.8 -CFLAGS :=
     1.9 -
    1.10  override XEN_TARGET_ARCH = x86_32
    1.11  XEN_ROOT = ../../..
    1.12 -include $(XEN_ROOT)/Config.mk
    1.13 +CFLAGS := -I$(XEN_ROOT)/tools/libxc -I.
    1.14 +include $(XEN_ROOT)/tools/Rules.mk
    1.15  
    1.16  # The HVM loader is started in 32-bit mode at the address below:
    1.17  LOADADDR = 0x100000
    1.18 @@ -34,7 +32,7 @@ CFLAGS  += $(call cc-option,$(CC),-fno-s
    1.19  CFLAGS  += $(call cc-option,$(CC),-fno-stack-protector-all,)
    1.20  
    1.21  OBJCOPY  = objcopy
    1.22 -CFLAGS  += -I$(XEN_ROOT)/tools/libxc -I. -fno-builtin -O2 -msoft-float
    1.23 +CFLAGS  += -fno-builtin -O2 -msoft-float
    1.24  LDFLAGS  = -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
    1.25  
    1.26  SRCS = hvmloader.c mp_tables.c util.c smbios.c
     2.1 --- a/tools/firmware/hvmloader/acpi/build.c	Wed Nov 29 12:16:59 2006 +0000
     2.2 +++ b/tools/firmware/hvmloader/acpi/build.c	Wed Nov 29 12:41:30 2006 +0000
     2.3 @@ -115,7 +115,8 @@ int construct_secondary_tables(uint8_t *
     2.4      int offset = 0, nr_tables = 0;
     2.5      struct acpi_20_madt *madt;
     2.6      struct acpi_20_tcpa *tcpa;
     2.7 -    static const uint16_t tis_did_vid_rid[] = {0x0001, 0x0001, 0x0001};
     2.8 +    static const uint16_t tis_signature[] = {0x0001, 0x0001, 0x0001};
     2.9 +    uint16_t *tis_hdr;
    2.10  
    2.11      /* MADT. */
    2.12      if ( (get_vcpu_nr() > 1) || get_apic_mode() )
    2.13 @@ -126,8 +127,10 @@ int construct_secondary_tables(uint8_t *
    2.14      }
    2.15  
    2.16      /* TPM TCPA and SSDT. */
    2.17 -    if ( memcmp((char *)0xFED40F00, tis_did_vid_rid,
    2.18 -                sizeof(tis_did_vid_rid)) == 0 ) /* Probe for TIS interface. */
    2.19 +    tis_hdr = (uint16_t *)0xFED40F00;
    2.20 +    if ( (tis_hdr[0] == tis_signature[0]) &&
    2.21 +         (tis_hdr[1] == tis_signature[1]) &&
    2.22 +         (tis_hdr[2] == tis_signature[2]) )
    2.23      {
    2.24          memcpy(&buf[offset], AmlCode_TPM, sizeof(AmlCode_TPM));
    2.25          table_ptrs[nr_tables++] = (unsigned long)&buf[offset];