ia64/xen-unstable

changeset 19079:f3240cd3cd2b

rombios: Indirect through 32-bit jump table from within the 32-bit bios.

This gets rid of shenanigans with relocating the jump table around the
place.

Also clean up bios_info table while we are updating it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 23 14:32:41 2009 +0000 (2009-01-23)
parents 8de0aae803e0
children 175a425e9b55
files tools/firmware/hvmloader/32bitbios_support.c tools/firmware/hvmloader/acpi/build.c tools/firmware/hvmloader/acpi/dsdt.asl tools/firmware/hvmloader/acpi/dsdt.c tools/firmware/hvmloader/config.h tools/firmware/hvmloader/hvmloader.c tools/firmware/hvmloader/util.c tools/firmware/hvmloader/util.h tools/firmware/rombios/32bit/32bitbios.c tools/firmware/rombios/32bit/Makefile tools/firmware/rombios/32bit/tcgbios/Makefile tools/firmware/rombios/32bitgateway.c tools/firmware/rombios/rombios.c
line diff
     1.1 --- a/tools/firmware/hvmloader/32bitbios_support.c	Fri Jan 23 12:50:14 2009 +0000
     1.2 +++ b/tools/firmware/hvmloader/32bitbios_support.c	Fri Jan 23 14:32:41 2009 +0000
     1.3 @@ -32,15 +32,13 @@
     1.4  
     1.5  #include "../rombios/32bit/32bitbios_flat.h"
     1.6  
     1.7 -static void relocate_32bitbios(char *elfarray, uint32_t elfarraysize)
     1.8 +static uint32_t relocate_32bitbios(char *elfarray, uint32_t elfarraysize)
     1.9  {
    1.10      Elf32_Ehdr *ehdr = (Elf32_Ehdr *)elfarray;
    1.11      Elf32_Shdr *shdr = (Elf32_Shdr *)&elfarray[ehdr->e_shoff];
    1.12 -    char *secstrings = &elfarray[shdr[ehdr->e_shstrndx].sh_offset];
    1.13 -    char *jump_table;
    1.14      uint32_t reloc_off, reloc_size;
    1.15      char *highbiosarea;
    1.16 -    int i, jump_sec_idx = 0;
    1.17 +    int i;
    1.18  
    1.19      /*
    1.20       * Step 1. General elf cleanup, and compute total relocation size.
    1.21 @@ -51,13 +49,6 @@ static void relocate_32bitbios(char *elf
    1.22          /* By default all section data points into elf image data array. */
    1.23          shdr[i].sh_addr = (Elf32_Addr)&elfarray[shdr[i].sh_offset];
    1.24  
    1.25 -        if ( !strcmp(".biosjumptable", secstrings + shdr[i].sh_name) )
    1.26 -        {
    1.27 -            /* We do not relocate the BIOS jump table to high memory. */
    1.28 -            shdr[i].sh_flags &= ~SHF_ALLOC;
    1.29 -            jump_sec_idx = i;
    1.30 -        }
    1.31 -
    1.32          /* Fix up a corner case of address alignment. */
    1.33          if ( shdr[i].sh_addralign == 0 )
    1.34              shdr[i].sh_addralign = 1;
    1.35 @@ -148,21 +139,12 @@ static void relocate_32bitbios(char *elf
    1.36          }
    1.37      }
    1.38  
    1.39 -    /* Step 5. Find the ROMBIOS jump-table stub and copy in the real table. */
    1.40 -    for ( jump_table = (char *)ROMBIOS_BEGIN;
    1.41 -          jump_table != (char *)ROMBIOS_END;
    1.42 -          jump_table++ )
    1.43 -        if ( !strncmp(jump_table, "___JMPT", 7) )
    1.44 -            break;
    1.45 -    BUG_ON(jump_table == NULL);
    1.46 -    BUG_ON(jump_sec_idx == 0);
    1.47 -    memcpy(jump_table, (char *)shdr[jump_sec_idx].sh_addr,
    1.48 -           shdr[jump_sec_idx].sh_size);
    1.49 +    printf("done\n");
    1.50  
    1.51 -    printf("done\n");
    1.52 +    return (uint32_t)highbiosarea;
    1.53  }
    1.54  
    1.55 -void highbios_setup(void)
    1.56 +uint32_t highbios_setup(void)
    1.57  {
    1.58 -    relocate_32bitbios((char *)highbios_array, sizeof(highbios_array));
    1.59 +    return relocate_32bitbios((char *)highbios_array, sizeof(highbios_array));
    1.60  }
     2.1 --- a/tools/firmware/hvmloader/acpi/build.c	Fri Jan 23 12:50:14 2009 +0000
     2.2 +++ b/tools/firmware/hvmloader/acpi/build.c	Fri Jan 23 14:32:41 2009 +0000
     2.3 @@ -48,50 +48,11 @@ static void set_checksum(
     2.4      p[checksum_offset] = -sum;
     2.5  }
     2.6  
     2.7 -static int uart_exists(uint16_t uart_base)
     2.8 -{
     2.9 -    uint16_t ier = uart_base + 1;
    2.10 -    uint8_t a, b, c;
    2.11 -
    2.12 -    a = inb(ier);
    2.13 -    outb(ier, 0);
    2.14 -    b = inb(ier);
    2.15 -    outb(ier, 0xf);
    2.16 -    c = inb(ier);
    2.17 -    outb(ier, a);
    2.18 -
    2.19 -    return ((b == 0) && (c == 0xf));
    2.20 -}
    2.21 -
    2.22 -static int hpet_exists(unsigned long hpet_base)
    2.23 -{
    2.24 -    uint32_t hpet_id = *(uint32_t *)hpet_base;
    2.25 -    return ((hpet_id >> 16) == 0x8086);
    2.26 -}
    2.27 -
    2.28  static uint8_t battery_port_exists(void)
    2.29  {
    2.30      return (inb(0x88) == 0x1F);
    2.31  }
    2.32  
    2.33 -static int construct_bios_info_table(uint8_t *buf)
    2.34 -{
    2.35 -    struct bios_info *bios_info = (struct bios_info *)buf;
    2.36 -
    2.37 -    memset(bios_info, 0, sizeof(*bios_info));
    2.38 -
    2.39 -    bios_info->com1_present = uart_exists(0x3f8);
    2.40 -    bios_info->com2_present = uart_exists(0x2f8);
    2.41 -
    2.42 -    bios_info->hpet_present = hpet_exists(ACPI_HPET_ADDRESS);
    2.43 -
    2.44 -    bios_info->pci_min = pci_mem_start;
    2.45 -    bios_info->pci_len = pci_mem_end - pci_mem_start;
    2.46 -    bios_info->xen_pfiob = 0xdead;
    2.47 -
    2.48 -    return align16(sizeof(*bios_info));
    2.49 -}
    2.50 -
    2.51  static int construct_madt(struct acpi_20_madt *madt)
    2.52  {
    2.53      struct acpi_20_madt_intsrcovr *intsrcovr;
    2.54 @@ -349,9 +310,7 @@ static void __acpi_build_tables(uint8_t 
    2.55      buf = (uint8_t *)ACPI_PHYSICAL_ADDRESS;
    2.56      offset = 0;
    2.57  
    2.58 -    offset += construct_bios_info_table(&buf[offset]);
    2.59      rsdp = (struct acpi_20_rsdp *)&buf[offset];
    2.60 -
    2.61      memcpy(rsdp, &Rsdp, sizeof(struct acpi_20_rsdp));
    2.62      offset += align16(sizeof(struct acpi_20_rsdp));
    2.63      rsdp->rsdt_address = (unsigned long)rsdt;
     3.1 --- a/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Jan 23 12:50:14 2009 +0000
     3.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Fri Jan 23 14:32:41 2009 +0000
     3.3 @@ -86,7 +86,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
     3.4  
     3.5      Scope (\_SB)
     3.6      {
     3.7 -       /* ACPI_PHYSICAL_ADDRESS == 0xEA000 */
     3.8 +       /* BIOS_INFO_PHYSICAL_ADDRESS == 0xEA000 */
     3.9         OperationRegion(BIOS, SystemMemory, 0xEA000, 16)
    3.10         Field(BIOS, ByteAcc, NoLock, Preserve) {
    3.11             UAR1, 1,
     4.1 --- a/tools/firmware/hvmloader/acpi/dsdt.c	Fri Jan 23 12:50:14 2009 +0000
     4.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.c	Fri Jan 23 14:32:41 2009 +0000
     4.3 @@ -1,11 +1,11 @@
     4.4  /*
     4.5   * 
     4.6   * Intel ACPI Component Architecture
     4.7 - * ASL Optimizing Compiler version 20080729 [Dec 25 2008]
     4.8 + * ASL Optimizing Compiler version 20081204 [Jan 23 2009]
     4.9   * Copyright (C) 2000 - 2008 Intel Corporation
    4.10   * Supports ACPI Specification Revision 3.0a
    4.11   * 
    4.12 - * Compilation of "dsdt.asl" - Thu Dec 25 17:00:32 2008
    4.13 + * Compilation of "dsdt.asl" - Fri Jan 23 14:30:29 2009
    4.14   * 
    4.15   * C source code output
    4.16   *
    4.17 @@ -13,10 +13,10 @@
    4.18  unsigned char AmlCode[] =
    4.19  {
    4.20      0x44,0x53,0x44,0x54,0x5E,0x11,0x00,0x00,  /* 00000000    "DSDT^..." */
    4.21 -    0x02,0xD1,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
    4.22 +    0x02,0xEB,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
    4.23      0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
    4.24      0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    4.25 -    0x29,0x07,0x08,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    ").. .PMB" */
    4.26 +    0x04,0x12,0x08,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
    4.27      0x53,0x0B,0x00,0x0C,0x08,0x50,0x4D,0x4C,  /* 00000028    "S....PML" */
    4.28      0x4E,0x0A,0x08,0x08,0x49,0x4F,0x42,0x31,  /* 00000030    "N...IOB1" */
    4.29      0x00,0x08,0x49,0x4F,0x4C,0x31,0x00,0x08,  /* 00000038    "..IOL1.." */
     5.1 --- a/tools/firmware/hvmloader/config.h	Fri Jan 23 12:50:14 2009 +0000
     5.2 +++ b/tools/firmware/hvmloader/config.h	Fri Jan 23 14:32:41 2009 +0000
     5.3 @@ -35,7 +35,8 @@ extern unsigned long pci_mem_start, pci_
     5.4  #define VGABIOS_PHYSICAL_ADDRESS      0x000C0000
     5.5  #define OPTIONROM_PHYSICAL_ADDRESS    0x000C8000
     5.6  #define OPTIONROM_PHYSICAL_END        0x000EA000
     5.7 -#define ACPI_PHYSICAL_ADDRESS         0x000EA000
     5.8 +#define BIOS_INFO_PHYSICAL_ADDRESS    0x000EA000
     5.9 +#define ACPI_PHYSICAL_ADDRESS         0x000EA020
    5.10  #define E820_PHYSICAL_ADDRESS         0x000EA100
    5.11  #define SMBIOS_PHYSICAL_ADDRESS       0x000EB000
    5.12  #define SMBIOS_MAXIMUM_SIZE           0x00005000
    5.13 @@ -48,12 +49,16 @@ extern unsigned long pci_mem_start, pci_
    5.14  /* Xen Platform Device */
    5.15  #define PFFLAG_ROM_LOCK 1 /* Sets whether ROM memory area is RW or RO */
    5.16  
    5.17 +/* Located at BIOS_INFO_PHYSICAL_ADDRESS. */
    5.18  struct bios_info {
    5.19 -    uint8_t  com1_present:1;
    5.20 -    uint8_t  com2_present:1;
    5.21 -    uint8_t  hpet_present:1;
    5.22 -    uint32_t pci_min, pci_len;
    5.23 -    uint16_t xen_pfiob;
    5.24 +    uint8_t  com1_present:1;    /* 0[0] - System has COM1? */
    5.25 +    uint8_t  com2_present:1;    /* 0[1] - System has COM2? */
    5.26 +    uint8_t  hpet_present:1;    /* 0[2] - System has HPET? */
    5.27 +    uint32_t pci_min, pci_len;  /* 4, 8 - PCI I/O hole boundaries */
    5.28 +    uint32_t bios32_entry;      /* 12   - Entry point for 32-bit BIOS */
    5.29 +    uint16_t xen_pfiob;         /* 16   - Xen platform device I/O ports */
    5.30  };
    5.31 +#define BIOSINFO_OFF_bios32_entry 12
    5.32 +#define BIOSINFO_OFF_xen_pfiob    16
    5.33  
    5.34  #endif /* __HVMLOADER_CONFIG_H__ */
     6.1 --- a/tools/firmware/hvmloader/hvmloader.c	Fri Jan 23 12:50:14 2009 +0000
     6.2 +++ b/tools/firmware/hvmloader/hvmloader.c	Fri Jan 23 14:32:41 2009 +0000
     6.3 @@ -539,25 +539,23 @@ static void cmos_write_memory_size(void)
     6.4      cmos_outb(0x35, (uint8_t)( alt_mem >> 8));
     6.5  }
     6.6  
     6.7 -static uint16_t init_xen_platform_io_base(void)
     6.8 +static uint16_t xen_platform_io_base(void)
     6.9  {
    6.10 -    struct bios_info *bios_info = (struct bios_info *)ACPI_PHYSICAL_ADDRESS;
    6.11      uint32_t devfn, bar_data;
    6.12      uint16_t vendor_id, device_id;
    6.13  
    6.14 -    bios_info->xen_pfiob = 0;
    6.15 -
    6.16      for ( devfn = 0; devfn < 128; devfn++ )
    6.17      {
    6.18          vendor_id = pci_readw(devfn, PCI_VENDOR_ID);
    6.19          device_id = pci_readw(devfn, PCI_DEVICE_ID);
    6.20 -        if ( (vendor_id != 0x5853) || (device_id != 0x0001) )
    6.21 -            continue;
    6.22 -        bar_data = pci_readl(devfn, PCI_BASE_ADDRESS_0);
    6.23 -        bios_info->xen_pfiob = bar_data & PCI_BASE_ADDRESS_IO_MASK;
    6.24 +        if ( (vendor_id == 0x5853) && (device_id == 0x0001) )
    6.25 +        {
    6.26 +            bar_data = pci_readl(devfn, PCI_BASE_ADDRESS_0);
    6.27 +            return bar_data & PCI_BASE_ADDRESS_IO_MASK;
    6.28 +        }
    6.29      }
    6.30  
    6.31 -    return bios_info->xen_pfiob;
    6.32 +    return 0;
    6.33  }
    6.34  
    6.35  /*
    6.36 @@ -648,8 +646,8 @@ int main(void)
    6.37  {
    6.38      int option_rom_sz = 0, vgabios_sz = 0, etherboot_sz = 0;
    6.39      int rombios_sz, smbios_sz;
    6.40 -    uint32_t etherboot_phys_addr, option_rom_phys_addr;
    6.41 -    uint16_t xen_pfiob;
    6.42 +    uint32_t etherboot_phys_addr, option_rom_phys_addr, bios32_addr;
    6.43 +    struct bios_info *bios_info;
    6.44  
    6.45      printf("HVM Loader\n");
    6.46  
    6.47 @@ -672,7 +670,7 @@ int main(void)
    6.48      if ( rombios_sz > 0x10000 )
    6.49          rombios_sz = 0x10000;
    6.50      memcpy((void *)ROMBIOS_PHYSICAL_ADDRESS, rombios, rombios_sz);
    6.51 -    highbios_setup();
    6.52 +    bios32_addr = highbios_setup();
    6.53  
    6.54      if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode )
    6.55          create_mp_tables();
    6.56 @@ -736,9 +734,17 @@ int main(void)
    6.57                 ROMBIOS_PHYSICAL_ADDRESS,
    6.58                 ROMBIOS_PHYSICAL_ADDRESS + rombios_sz - 1);
    6.59  
    6.60 -    xen_pfiob = init_xen_platform_io_base();
    6.61 +    build_e820_table();
    6.62  
    6.63 -    build_e820_table();
    6.64 +    bios_info = (struct bios_info *)BIOS_INFO_PHYSICAL_ADDRESS;
    6.65 +    memset(bios_info, 0, sizeof(*bios_info));
    6.66 +    bios_info->com1_present = uart_exists(0x3f8);
    6.67 +    bios_info->com2_present = uart_exists(0x2f8);
    6.68 +    bios_info->hpet_present = hpet_exists(ACPI_HPET_ADDRESS);
    6.69 +    bios_info->pci_min = pci_mem_start;
    6.70 +    bios_info->pci_len = pci_mem_end - pci_mem_start;
    6.71 +    bios_info->bios32_entry = bios32_addr;
    6.72 +    bios_info->xen_pfiob = xen_platform_io_base();
    6.73  
    6.74      printf("Invoking ROMBIOS ...\n");
    6.75      return 0;
     7.1 --- a/tools/firmware/hvmloader/util.c	Fri Jan 23 12:50:14 2009 +0000
     7.2 +++ b/tools/firmware/hvmloader/util.c	Fri Jan 23 14:32:41 2009 +0000
     7.3 @@ -629,6 +629,27 @@ uint16_t get_cpu_mhz(void)
     7.4      return cpu_mhz;
     7.5  }
     7.6  
     7.7 +int uart_exists(uint16_t uart_base)
     7.8 +{
     7.9 +    uint16_t ier = uart_base + 1;
    7.10 +    uint8_t a, b, c;
    7.11 +
    7.12 +    a = inb(ier);
    7.13 +    outb(ier, 0);
    7.14 +    b = inb(ier);
    7.15 +    outb(ier, 0xf);
    7.16 +    c = inb(ier);
    7.17 +    outb(ier, a);
    7.18 +
    7.19 +    return ((b == 0) && (c == 0xf));
    7.20 +}
    7.21 +
    7.22 +int hpet_exists(unsigned long hpet_base)
    7.23 +{
    7.24 +    uint32_t hpet_id = *(uint32_t *)hpet_base;
    7.25 +    return ((hpet_id >> 16) == 0x8086);
    7.26 +}
    7.27 +
    7.28  /*
    7.29   * Local variables:
    7.30   * mode: C
     8.1 --- a/tools/firmware/hvmloader/util.h	Fri Jan 23 12:50:14 2009 +0000
     8.2 +++ b/tools/firmware/hvmloader/util.h	Fri Jan 23 14:32:41 2009 +0000
     8.3 @@ -57,6 +57,10 @@ void pci_write(uint32_t devfn, uint32_t 
     8.4  /* Get CPU speed in MHz. */
     8.5  uint16_t get_cpu_mhz(void);
     8.6  
     8.7 +/* Hardware detection. */
     8.8 +int uart_exists(uint16_t uart_base);
     8.9 +int hpet_exists(unsigned long hpet_base);
    8.10 +
    8.11  /* Do cpuid instruction, with operation 'idx' */
    8.12  void cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx,
    8.13             uint32_t *ecx, uint32_t *edx);
    8.14 @@ -136,7 +140,7 @@ void *mem_alloc(uint32_t size, uint32_t 
    8.15  #define virt_to_phys(v) ((unsigned long)(v))
    8.16  
    8.17  /* Prepare the 32bit BIOS */
    8.18 -void highbios_setup(void);
    8.19 +uint32_t highbios_setup(void);
    8.20  
    8.21  /* Miscellaneous. */
    8.22  void cacheattr_init(void);
     9.1 --- a/tools/firmware/rombios/32bit/32bitbios.c	Fri Jan 23 12:50:14 2009 +0000
     9.2 +++ b/tools/firmware/rombios/32bit/32bitbios.c	Fri Jan 23 14:32:41 2009 +0000
     9.3 @@ -22,14 +22,13 @@
     9.4  
     9.5  #include "rombios_compat.h"
     9.6  
     9.7 -/*
     9.8 -   the jumptable that will be copied into the rombios in the 0xf000 segment
     9.9 -   for every function that is to be called from the lower BIOS, make an entry
    9.10 -   here.
    9.11 - */
    9.12 -uint32_t jumptable[] __attribute__((section (".biosjumptable"))) =
    9.13 -{
    9.14 -#define X(idx, ret, fn, args...) [idx] = (uint32_t)fn,
    9.15 +asm (
    9.16 +    "    .text                       \n"
    9.17 +    "     movzwl %bx,%eax            \n"
    9.18 +    "     jmp *jumptable(,%eax,4)    \n"
    9.19 +    "    .data                       \n"
    9.20 +    "jumptable:                      \n"
    9.21 +#define X(idx, ret, fn, args...) " .long "#fn"\n"
    9.22  #include "32bitprotos.h"
    9.23  #undef X
    9.24 -};
    9.25 +    );
    10.1 --- a/tools/firmware/rombios/32bit/Makefile	Fri Jan 23 12:50:14 2009 +0000
    10.2 +++ b/tools/firmware/rombios/32bit/Makefile	Fri Jan 23 14:32:41 2009 +0000
    10.3 @@ -1,15 +1,12 @@
    10.4  XEN_ROOT = ../../../..
    10.5  include $(XEN_ROOT)/tools/firmware/Rules.mk
    10.6  
    10.7 -SOURCES = util.c
    10.8  TARGET = 32bitbios_flat.h
    10.9  
   10.10 -CFLAGS += $(CFLAGS_include) -I.. -DGCC_PROTOS
   10.11 +CFLAGS += $(CFLAGS_include) -I..
   10.12  
   10.13  SUBDIRS = tcgbios
   10.14  
   10.15 -MODULES = tcgbios/tcgbiosext.o
   10.16 -
   10.17  .PHONY: all
   10.18  all: subdirs-all
   10.19  	$(MAKE) $(TARGET)
   10.20 @@ -18,7 +15,10 @@ all: subdirs-all
   10.21  clean: subdirs-clean
   10.22  	rm -rf *.o $(TARGET) $(DEPS)
   10.23  
   10.24 -$(TARGET): 32bitbios.o $(MODULES) util.o pmm.o
   10.25 +$(TARGET): 32bitbios_all.o
   10.26 +	sh mkhex highbios_array 32bitbios_all.o > $@
   10.27 +
   10.28 +32bitbios_all.o: 32bitbios.o tcgbios/tcgbiosext.o util.o pmm.o
   10.29  	$(LD) $(LDFLAGS_DIRECT) -s -r $^ -o 32bitbios_all.o
   10.30  	@nm 32bitbios_all.o |                                \
   10.31  	  egrep '^ +U ' >/dev/null && {                      \
   10.32 @@ -26,6 +26,5 @@ clean: subdirs-clean
   10.33  	    nm -u 32bitbios_all.o;                           \
   10.34  	    exit 11;                                         \
   10.35  	  } || :
   10.36 -	sh mkhex highbios_array 32bitbios_all.o > $@
   10.37  
   10.38  -include $(DEPS)
    11.1 --- a/tools/firmware/rombios/32bit/tcgbios/Makefile	Fri Jan 23 12:50:14 2009 +0000
    11.2 +++ b/tools/firmware/rombios/32bit/tcgbios/Makefile	Fri Jan 23 14:32:41 2009 +0000
    11.3 @@ -2,20 +2,17 @@ XEN_ROOT = ../../../../..
    11.4  include $(XEN_ROOT)/tools/firmware/Rules.mk
    11.5  
    11.6  TARGET  = tcgbiosext.o
    11.7 -FILES   = tcgbios tpm_drivers
    11.8 -OBJECTS = $(foreach f,$(FILES),$(f).o)
    11.9  
   11.10 -CFLAGS += $(CFLAGS_include) -I.. -I../.. -DGCC_PROTOS
   11.11 +CFLAGS += $(CFLAGS_include) -I.. -I../..
   11.12  
   11.13 -.PHONY: all clean
   11.14 -
   11.15 +.PHONY: all
   11.16  all: $(TARGET)
   11.17  
   11.18 +.PHONY: clean
   11.19  clean:
   11.20  	rm -rf *.o $(TARGET) $(DEPS)
   11.21  
   11.22 -$(TARGET): $(OBJECTS)
   11.23 +$(TARGET): tcgbios.o tpm_drivers.o
   11.24  	$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
   11.25  
   11.26  -include $(DEPS)
   11.27 -
    12.1 --- a/tools/firmware/rombios/32bitgateway.c	Fri Jan 23 12:50:14 2009 +0000
    12.2 +++ b/tools/firmware/rombios/32bitgateway.c	Fri Jan 23 14:32:41 2009 +0000
    12.3 @@ -96,15 +96,6 @@ Upcall:
    12.4      push ss
    12.5      push esp
    12.6  
    12.7 -    ; Find the 32-bit function address via a table lookup
    12.8 -    push si
    12.9 -    rol bx, #2
   12.10 -    mov si, #jmptable
   12.11 -    seg cs
   12.12 -    mov eax, dword ptr [si+bx]
   12.13 -    pop si
   12.14 -    push eax
   12.15 -
   12.16      ; Calculate protected-mode esp from ss:sp
   12.17      and esp, #0xffff
   12.18      xor eax, eax
   12.19 @@ -127,11 +118,11 @@ upcall1:
   12.20      mov ss, ax
   12.21  
   12.22      ; Marshal arguments and call 32-bit function
   12.23 -    pop eax
   12.24      mov ecx, #MAX_ARG_BYTES/4
   12.25  upcall2:
   12.26      push MAX_ARG_BYTES-4+args_off[esp]
   12.27      loop upcall2
   12.28 +    mov eax, [BIOS_INFO_PHYSICAL_ADDRESS + BIOSINFO_OFF_bios32_entry]
   12.29      call eax
   12.30      add esp, #MAX_ARG_BYTES
   12.31      mov ecx, eax  ; Result in ecx
    13.1 --- a/tools/firmware/rombios/rombios.c	Fri Jan 23 12:50:14 2009 +0000
    13.2 +++ b/tools/firmware/rombios/rombios.c	Fri Jan 23 14:32:41 2009 +0000
    13.3 @@ -1418,31 +1418,24 @@ fixup_base_mem_in_k()
    13.4    write_word(0x40, 0x13, base_mem >> 10);
    13.5  }
    13.6  
    13.7 -void
    13.8 -set_rom_write_access(action)
    13.9 -  Bit16u action;
   13.10 -{
   13.11 -    Bit16u off = (Bit16u)&((struct bios_info *)0)->xen_pfiob;
   13.12  ASM_START
   13.13 -    mov si,.set_rom_write_access.off[bp]
   13.14 +_rom_write_access_control:
   13.15      push ds
   13.16 -    mov ax,#(ACPI_PHYSICAL_ADDRESS >> 4)
   13.17 +    mov ax,#(BIOS_INFO_PHYSICAL_ADDRESS >> 4)
   13.18      mov ds,ax
   13.19 -    mov dx,[si]
   13.20 +    mov ax,[BIOSINFO_OFF_xen_pfiob]
   13.21      pop ds
   13.22 -    mov ax,.set_rom_write_access.action[bp]
   13.23 -    out dx,al
   13.24 +    ret
   13.25  ASM_END
   13.26 -}
   13.27  
   13.28  void enable_rom_write_access()
   13.29  {
   13.30 -    set_rom_write_access(0);
   13.31 +    outb(rom_write_access_control(), 0);
   13.32  }
   13.33  
   13.34  void disable_rom_write_access()
   13.35  {
   13.36 -    set_rom_write_access(PFFLAG_ROM_LOCK);
   13.37 +    outb(rom_write_access_control(), PFFLAG_ROM_LOCK);
   13.38  }
   13.39      
   13.40  #endif /* HVMASSIST */
   13.41 @@ -11824,15 +11817,6 @@ static Bit8u vgafont8[128*8]=
   13.42  #ifdef HVMASSIST
   13.43  ASM_START
   13.44  
   13.45 -// space for addresses in 32bit BIOS area; currently 256/4 entries
   13.46 -// are allocated
   13.47 -.org 0xcb00
   13.48 -jmptable:
   13.49 -db 0x5F, 0x5F, 0x5F, 0x4A, 0x4D, 0x50, 0x54 ;; ___JMPT
   13.50 -dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;;  64 bytes
   13.51 -dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 128 bytes
   13.52 -dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 192 bytes
   13.53 -
   13.54  //
   13.55  // MP Tables
   13.56  // just carve out some blank space for HVMLOADER to write the MP tables to