ia64/xen-unstable

changeset 12057:1bf4f15c5141

[HVM] ACPI: Clean up table definitions, move under hvmloader/
directory pending tighter integration of table generation
into hvmloader. This patch also includes the TPM TIS SSDT
generator from Stefan Berger at IBM.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Oct 31 12:42:50 2006 +0000 (2006-10-31)
parents 15b5cc51db30
children 1c506820c468
files tools/firmware/Makefile tools/firmware/acpi/Makefile tools/firmware/acpi/README tools/firmware/acpi/acpi2_0.h tools/firmware/acpi/acpi_build.c tools/firmware/acpi/acpi_dsdt.asl tools/firmware/acpi/acpi_dsdt.c tools/firmware/acpi/acpi_facs.c tools/firmware/acpi/acpi_facs.h tools/firmware/acpi/acpi_fadt.c tools/firmware/acpi/acpi_fadt.h tools/firmware/acpi/acpi_gen.c tools/firmware/acpi/acpi_madt.c tools/firmware/acpi/acpi_madt.h tools/firmware/acpi/acpi_rsdt.c tools/firmware/hvmloader/Makefile tools/firmware/hvmloader/acpi/Makefile tools/firmware/hvmloader/acpi/README tools/firmware/hvmloader/acpi/acpi2_0.h tools/firmware/hvmloader/acpi/build.c tools/firmware/hvmloader/acpi/dsdt.asl tools/firmware/hvmloader/acpi/dsdt.c tools/firmware/hvmloader/acpi/gen.c tools/firmware/hvmloader/acpi/static_tables.c tools/firmware/hvmloader/acpi_madt.c tools/firmware/hvmloader/acpi_ssdt_tpm.asl tools/firmware/hvmloader/acpi_ssdt_tpm.h tools/firmware/hvmloader/acpi_utils.c tools/firmware/hvmloader/acpi_utils.h tools/firmware/hvmloader/hvmloader.c tools/firmware/hvmloader/util.c
line diff
     1.1 --- a/tools/firmware/Makefile	Tue Oct 31 11:44:47 2006 +0000
     1.2 +++ b/tools/firmware/Makefile	Tue Oct 31 12:42:50 2006 +0000
     1.3 @@ -9,7 +9,6 @@ INST_DIR := $(DESTDIR)/usr/lib/xen/boot
     1.4  SUBDIRS :=
     1.5  SUBDIRS += rombios
     1.6  SUBDIRS += vgabios
     1.7 -SUBDIRS += acpi
     1.8  SUBDIRS += vmxassist
     1.9  SUBDIRS += hvmloader
    1.10  
     2.1 --- a/tools/firmware/acpi/Makefile	Tue Oct 31 11:44:47 2006 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,68 +0,0 @@
     2.4 -#/*
     2.5 -# * Copyright (c) 2004, Intel Corporation.
     2.6 -# *
     2.7 -# * This program is free software; you can redistribute it and/or modify it
     2.8 -# * under the terms and conditions of the GNU General Public License,
     2.9 -# * version 2, as published by the Free Software Foundation.
    2.10 -# *
    2.11 -# * This program is distributed in the hope it will be useful, but WITHOUT
    2.12 -# * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.13 -# * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    2.14 -# * more details.
    2.15 -# *
    2.16 -# * You should have received a copy of the GNU General Public License along with
    2.17 -# * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    2.18 -# * Place - Suite 330, Boston, MA 02111-1307 USA.
    2.19 -# *
    2.20 -# */
    2.21 -#
    2.22 -
    2.23 -XEN_ROOT = ../../..
    2.24 -include $(XEN_ROOT)/tools/Rules.mk
    2.25 -
    2.26 -# Compiler flag
    2.27 -HOSTCFLAGS += -I. -I../../libxc
    2.28 -
    2.29 -# TARGET
    2.30 -C_SRC=$(shell ls *.c)
    2.31 -H_SRC=$(shell ls *.h)
    2.32 -ACPI_GEN=acpigen
    2.33 -ACPI_BIN=acpi.bin
    2.34 -
    2.35 -IASL_VER=acpica-unix-20050513
    2.36 -IASL_URL=http://developer.intel.com/technology/iapc/acpi/downloads/$(IASL_VER).tar.gz
    2.37 -
    2.38 -vpath iasl $(PATH)
    2.39 -all:$(ACPI_BIN)
    2.40 -
    2.41 -acpi_dsdt.c:acpi_dsdt.asl
    2.42 -	$(MAKE) iasl
    2.43 -	iasl  -tc acpi_dsdt.asl
    2.44 -	mv acpi_dsdt.hex acpi_dsdt.c
    2.45 -	echo "int DsdtLen=sizeof(AmlCode);" >> acpi_dsdt.c
    2.46 -	rm *.aml
    2.47 -#        iasl -oa -tc acpi_dsdt.asl
    2.48 -
    2.49 -iasl:
    2.50 -	@echo
    2.51 -	@echo "ACPI ASL compiler(iasl) is needed"
    2.52 -	@echo "Download Intel ACPI CA"
    2.53 -	@echo "If wget failed, please download and compile manually from"
    2.54 -	@echo "http://developer.intel.com/technology/iapc/acpi/downloads.htm"
    2.55 -	@echo 
    2.56 -	wget $(IASL_URL)
    2.57 -	tar xzf $(IASL_VER).tar.gz
    2.58 -	make -C $(IASL_VER)/compiler
    2.59 -	$(INSTALL_PROG) $(IASL_VER)/compiler/iasl /usr/bin/iasl
    2.60 -
    2.61 -$(ACPI_GEN):$(C_SRC) $(H_SRC) acpi_dsdt.c
    2.62 -	$(HOSTCC) -o $(ACPI_GEN) $(HOSTCFLAGS) $(shell ls *.c)
    2.63 -
    2.64 -$(ACPI_BIN):$(ACPI_GEN)
    2.65 -	./$(ACPI_GEN) $(ACPI_BIN)
    2.66 -
    2.67 -clean:
    2.68 -	rm -rf *.o $(ACPI_GEN) $(ACPI_BIN) $(IASL_VER) 
    2.69 -	rm -rf  $(IASL_VER).tar.gz
    2.70 -
    2.71 -install: all
     3.1 --- a/tools/firmware/acpi/README	Tue Oct 31 11:44:47 2006 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,24 +0,0 @@
     3.4 -ACPI Table for domain firmware
     3.5 -
     3.6 -
     3.7 -INSTALL
     3.8 ------------------
     3.9 -Simply make is OK.
    3.10 -# make 
    3.11 -
    3.12 -
    3.13 -Note on DSDT Table
    3.14 -------------------
    3.15 -DSDT table source code is acpi_dsdt.asl
    3.16 -It is already compiled and the output is acpi_dsdt.c
    3.17 -Usually, user is not expected to change the acpi_dsdt.asl.
    3.18 -In case that the acpi_dsdt.asl need to be updated, please 
    3.19 -Follow the instruction:
    3.20 -
    3.21 -# make acpi_dsdt.c
    3.22 -
    3.23 -Note:
    3.24 -DSDT compiler "iasl" is needed. By default, it will be downloaded 
    3.25 -using wget in Makefile. if it failed, please download manually from 
    3.26 -http://developer.intel.com/technology/iapc/acpi/downloads.htm. 
    3.27 -then compile and install iasl
     4.1 --- a/tools/firmware/acpi/acpi2_0.h	Tue Oct 31 11:44:47 2006 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,331 +0,0 @@
     4.4 -/*
     4.5 - * Copyright (c) 2004, Intel Corporation.
     4.6 - *
     4.7 - * This program is free software; you can redistribute it and/or modify it
     4.8 - * under the terms and conditions of the GNU General Public License,
     4.9 - * version 2, as published by the Free Software Foundation.
    4.10 - *
    4.11 - * This program is distributed in the hope it will be useful, but WITHOUT
    4.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    4.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    4.14 - * more details.
    4.15 - *
    4.16 - * You should have received a copy of the GNU General Public License along with
    4.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    4.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    4.19 - *
    4.20 - */
    4.21 -#ifndef _ACPI_2_0_H_
    4.22 -#define _ACPI_2_0_H_
    4.23 -
    4.24 -typedef unsigned char  uint8_t;
    4.25 -typedef   signed char  int8_t;
    4.26 -typedef unsigned short uint16_t;
    4.27 -typedef   signed short int16_t;
    4.28 -typedef unsigned int   uint32_t;
    4.29 -typedef   signed int   int32_t;
    4.30 -#ifdef __i386__
    4.31 -typedef unsigned long long uint64_t;
    4.32 -typedef   signed long long int64_t;
    4.33 -#else
    4.34 -typedef unsigned long uint64_t;
    4.35 -typedef   signed long int64_t;
    4.36 -#endif
    4.37 -
    4.38 -#include <xen/xen.h>
    4.39 -
    4.40 -#pragma pack (1)
    4.41 -
    4.42 -//
    4.43 -// common ACPI header.  
    4.44 -//
    4.45 -
    4.46 -typedef struct {
    4.47 -		uint32_t			Signature;
    4.48 -		uint32_t     	Length;
    4.49 -		uint8_t			Revision;
    4.50 -		uint8_t			Checksum;
    4.51 -		uint8_t			OemId[6];
    4.52 -		uint64_t			OemTableId;
    4.53 -		uint32_t			OemRevision;
    4.54 -		uint32_t			CreatorId;
    4.55 -		uint32_t			CreatorRevision;
    4.56 -} ACPI_TABLE_HEADER;
    4.57 -
    4.58 -
    4.59 -#define ACPI_OEM_ID 			{'I','N','T','E','L',' '}
    4.60 -#define ACPI_OEM_TABLE_ID 		0x544244 		// "TBD"
    4.61 -#define ACPI_OEM_REVISION 		0x00000002
    4.62 -#define ACPI_CREATOR_ID 		0x00 			// TBD 
    4.63 -#define ACPI_CREATOR_REVISION 	0x00000002 		
    4.64 -
    4.65 -//
    4.66 -// ACPI 2.0 Generic Address Space definition
    4.67 -//
    4.68 -typedef struct {
    4.69 -		uint8_t                            AddressSpaceId;
    4.70 -		uint8_t                            RegisterBitWidth;
    4.71 -		uint8_t                            RegisterBitOffset;
    4.72 -		uint8_t                            Reserved;
    4.73 -		uint64_t                           Address;
    4.74 -} ACPI_GENERIC_ADDRESS_STRUCTURE;
    4.75 -
    4.76 -//
    4.77 -// Generic Address Space Address IDs
    4.78 -//
    4.79 -#define ACPI_SYSTEM_MEMORY 0
    4.80 -#define ACPI_SYSTEM_IO 1
    4.81 -#define ACPI_PCI_CONFIGURATION_SPACE 2
    4.82 -#define ACPI_EMBEDDED_CONTROLLER 3
    4.83 -#define ACPI_SMBUS 4
    4.84 -#define ACPI_FUNCTIONAL_FIXED_HARDWARE 0x7F
    4.85 -
    4.86 -//
    4.87 -// Root System Description Pointer Structure in ACPI 1.0
    4.88 -//
    4.89 -typedef struct {
    4.90 -		uint64_t                           Signature;
    4.91 -		uint8_t                            Checksum;
    4.92 -		uint8_t                            OemId[6];
    4.93 -		uint8_t                            Reserved;
    4.94 -		uint32_t                           RsdtAddress;
    4.95 -} ACPI_1_0_RSDP;
    4.96 -
    4.97 -
    4.98 -//
    4.99 -// Root System Description Pointer Structure
   4.100 -//
   4.101 -typedef struct {
   4.102 -		uint64_t                           Signature;
   4.103 -		uint8_t                            Checksum;
   4.104 -		uint8_t                            OemId[6];
   4.105 -		uint8_t                            Revision;
   4.106 -		uint32_t                           RsdtAddress;
   4.107 -		uint32_t                           Length;
   4.108 -		uint64_t                           XsdtAddress;
   4.109 -		uint8_t                            ExtendedChecksum;
   4.110 -		uint8_t                            Reserved[3];
   4.111 -} ACPI_2_0_RSDP;
   4.112 -
   4.113 -
   4.114 -//
   4.115 -// The maximum number of entrys in RSDT or XSDT
   4.116 -//
   4.117 -#define ACPI_MAX_NUM_TABLES 2
   4.118 -
   4.119 -//
   4.120 -// Root System Description Table (RSDT)
   4.121 -//
   4.122 -
   4.123 -typedef struct {
   4.124 -		ACPI_TABLE_HEADER Header;
   4.125 -		uint32_t Entry[ACPI_MAX_NUM_TABLES];
   4.126 -}ACPI_2_0_RSDT;
   4.127 -
   4.128 -//
   4.129 -// RSDT Revision (as defined in ACPI 2.0 spec.)
   4.130 -//
   4.131 -
   4.132 -#define ACPI_2_0_RSDT_REVISION 0x01
   4.133 -
   4.134 -//
   4.135 -// Extended System Description Table (XSDT)
   4.136 -//
   4.137 -
   4.138 -typedef struct _ACPI_2_0_XSDT{
   4.139 -		ACPI_TABLE_HEADER Header;
   4.140 -		uint64_t Entry[ACPI_MAX_NUM_TABLES];
   4.141 -}ACPI_2_0_XSDT;
   4.142 -#define ACPI_2_0_XSDT_REVISION 0x01
   4.143 -
   4.144 -//
   4.145 -// Fixed ACPI Description Table Structure (FADT)
   4.146 -// 
   4.147 -
   4.148 -typedef struct  {
   4.149 -		ACPI_TABLE_HEADER               Header;
   4.150 -		uint32_t                                    FirmwareCtrl;
   4.151 -		uint32_t                                    Dsdt;
   4.152 -		uint8_t                                     Reserved0;
   4.153 -		uint8_t                                     PreferredPmProfile;
   4.154 -		uint16_t                                    SciInt;
   4.155 -		uint32_t                                    SmiCmd;
   4.156 -		uint8_t                                     AcpiEnable;
   4.157 -		uint8_t                                     AcpiDisable;
   4.158 -		uint8_t                                     S4BiosReq;
   4.159 -		uint8_t                                     PstateCnt;
   4.160 -		uint32_t                                    Pm1aEvtBlk;
   4.161 -		uint32_t                                    Pm1bEvtBlk;
   4.162 -		uint32_t                                    Pm1aCntBlk;
   4.163 -		uint32_t                                    Pm1bCntBlk;
   4.164 -		uint32_t                                    Pm2CntBlk;
   4.165 -		uint32_t                                    PmTmrBlk;
   4.166 -		uint32_t                                    Gpe0Blk;
   4.167 -		uint32_t                                    Gpe1Blk;
   4.168 -		uint8_t                                     Pm1EvtLen;
   4.169 -		uint8_t                                     Pm1CntLen;
   4.170 -		uint8_t                                     Pm2CntLen;
   4.171 -		uint8_t                                     PmTmrLen;
   4.172 -		uint8_t                                     Gpe0BlkLen;
   4.173 -		uint8_t                                     Gpe1BlkLen;
   4.174 -		uint8_t                                     Gpe1Base;
   4.175 -		uint8_t                                     CstCnt;
   4.176 -		uint16_t                                    PLvl2Lat;
   4.177 -		uint16_t                                    PLvl3Lat;
   4.178 -		uint16_t                                    FlushSize;
   4.179 -		uint16_t                                    FlushStride;
   4.180 -		uint8_t                                     DutyOffset;
   4.181 -		uint8_t                                     DutyWidth;
   4.182 -		uint8_t                                     DayAlrm;
   4.183 -		uint8_t                                     MonAlrm;
   4.184 -		uint8_t                                     Century;
   4.185 -		uint16_t                                    IaPcBootArch;
   4.186 -		uint8_t                                     Reserved1;
   4.187 -		uint32_t                                    Flags;
   4.188 -		ACPI_GENERIC_ADDRESS_STRUCTURE    ResetReg;
   4.189 -		uint8_t                                     ResetValue;
   4.190 -		uint8_t                                     Reserved2[3];
   4.191 -		uint64_t                                    XFirmwareCtrl;
   4.192 -		uint64_t                                    XDsdt;
   4.193 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
   4.194 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
   4.195 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
   4.196 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
   4.197 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
   4.198 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
   4.199 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
   4.200 -		ACPI_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
   4.201 -} ACPI_2_0_FADT;
   4.202 -#define ACPI_2_0_FADT_REVISION 0x03
   4.203 -
   4.204 -//
   4.205 -// FADT Boot Architecture Flags
   4.206 -//
   4.207 -#define ACPI_LEGACY_DEVICES (1 << 0)
   4.208 -#define ACPI_8042           (1 << 1)
   4.209 -
   4.210 -//
   4.211 -// FADT Fixed Feature Flags
   4.212 -//
   4.213 -#define ACPI_WBINVD         (1 << 0)
   4.214 -#define ACPI_WBINVD_FLUSH   (1 << 1)
   4.215 -#define ACPI_PROC_C1        (1 << 2)
   4.216 -#define ACPI_P_LVL2_UP      (1 << 3)
   4.217 -#define ACPI_PWR_BUTTON     (1 << 4)
   4.218 -#define ACPI_SLP_BUTTON     (1 << 5)
   4.219 -#define ACPI_FIX_RTC        (1 << 6)
   4.220 -#define ACPI_RTC_S4         (1 << 7)
   4.221 -#define ACPI_TMR_VAL_EXT    (1 << 8)
   4.222 -#define ACPI_DCK_CAP        (1 << 9)
   4.223 -#define ACPI_RESET_REG_SUP  (1 << 10)
   4.224 -#define ACPI_SEALED_CASE    (1 << 11)
   4.225 -#define ACPI_HEADLESS       (1 << 12)
   4.226 -#define ACPI_CPU_SW_SLP     (1 << 13)
   4.227 -
   4.228 -//
   4.229 -// Firmware ACPI Control Structure (FACS)
   4.230 -//
   4.231 -typedef struct {
   4.232 -		uint32_t                               Signature;
   4.233 -		uint32_t                               Length;
   4.234 -		uint32_t                               HardwareSignature;
   4.235 -		uint32_t                               FirmwareWakingVector;
   4.236 -		uint32_t                               GlobalLock;
   4.237 -		uint32_t                               Flags;
   4.238 -		uint64_t                               XFirmwareWakingVector;
   4.239 -		uint8_t                                Version;
   4.240 -		uint8_t                                Reserved[31];
   4.241 -} ACPI_2_0_FACS;
   4.242 -
   4.243 -#define ACPI_2_0_FACS_VERSION 0x01
   4.244 -
   4.245 -//
   4.246 -// Multiple APIC Description Table header definition (MADT)
   4.247 -//
   4.248 -typedef struct {
   4.249 -		ACPI_TABLE_HEADER                       Header;
   4.250 -		uint32_t                                     LocalApicAddress;
   4.251 -		uint32_t                                     Flags;
   4.252 -} ACPI_2_0_MADT;
   4.253 -
   4.254 -#define ACPI_2_0_MADT_REVISION 0x01
   4.255 -
   4.256 -//
   4.257 -// Multiple APIC Flags
   4.258 -//
   4.259 -#define ACPI_PCAT_COMPAT (1 << 0)
   4.260 -
   4.261 -//
   4.262 -// Multiple APIC Description Table APIC structure types
   4.263 -//
   4.264 -#define ACPI_PROCESSOR_LOCAL_APIC           0x00
   4.265 -#define ACPI_IO_APIC                        0x01
   4.266 -#define ACPI_INTERRUPT_SOURCE_OVERRIDE      0x02
   4.267 -#define ACPI_NON_MASKABLE_INTERRUPT_SOURCE  0x03
   4.268 -#define ACPI_LOCAL_APIC_NMI                 0x04
   4.269 -#define ACPI_LOCAL_APIC_ADDRESS_OVERRIDE    0x05
   4.270 -#define ACPI_IO_SAPIC                       0x06
   4.271 -#define ACPI_PROCESSOR_LOCAL_SAPIC          0x07
   4.272 -#define ACPI_PLATFORM_INTERRUPT_SOURCES     0x08
   4.273 -
   4.274 -//
   4.275 -// APIC Structure Definitions
   4.276 -//
   4.277 -
   4.278 -//
   4.279 -// Processor Local APIC Structure Definition
   4.280 -//
   4.281 -
   4.282 -typedef struct {
   4.283 -		uint8_t                                             Type;
   4.284 -		uint8_t                                             Length;
   4.285 -		uint8_t                                             AcpiProcessorId;
   4.286 -		uint8_t                                             ApicId;
   4.287 -		uint32_t                                            Flags;
   4.288 -} ACPI_LOCAL_APIC_STRUCTURE;
   4.289 -
   4.290 -//
   4.291 -// Local APIC Flags.  All other bits are reserved and must be 0.
   4.292 -//
   4.293 -
   4.294 -#define ACPI_LOCAL_APIC_ENABLED (1 << 0)
   4.295 -
   4.296 -//
   4.297 -// IO APIC Structure
   4.298 -//
   4.299 -
   4.300 -typedef struct {
   4.301 -		uint8_t                                             Type;
   4.302 -		uint8_t                                             Length;
   4.303 -		uint8_t                                             IoApicId;
   4.304 -		uint8_t                                             Reserved;
   4.305 -		uint32_t                                            IoApicAddress;
   4.306 -		uint32_t                                            GlobalSystemInterruptBase;
   4.307 -} ACPI_IO_APIC_STRUCTURE;
   4.308 -
   4.309 -// Tabel Signature
   4.310 -#define ACPI_2_0_RSDP_SIGNATURE 0x2052545020445352LL  // "RSD PTR "
   4.311 -
   4.312 -#define ACPI_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344  //"DSDT"
   4.313 -
   4.314 -#define ACPI_2_0_FACS_SIGNATURE 0x53434146 // "FACS"
   4.315 -
   4.316 -#define ACPI_2_0_FADT_SIGNATURE 0x50434146 // "FADT"
   4.317 -
   4.318 -#define ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041  // "APIC"
   4.319 -
   4.320 -#define ACPI_2_0_RSDT_SIGNATURE 0x54445352  // "RSDT"
   4.321 -
   4.322 -#define ACPI_2_0_XSDT_SIGNATURE 0x54445358  // "XSDT"
   4.323 -
   4.324 -#pragma pack ()
   4.325 -
   4.326 -// The physical that acpi table reside in the guest BIOS
   4.327 -//#define ACPI_PHYSICAL_ADDRESS 0xE2000
   4.328 -#define ACPI_PHYSICAL_ADDRESS 0xEA000
   4.329 -#define ACPI_TABLE_SIZE (4*1024)  //Currently 4K is enough
   4.330 -
   4.331 -void
   4.332 -AcpiBuildTable(uint8_t* buf);
   4.333 -
   4.334 -#endif
     5.1 --- a/tools/firmware/acpi/acpi_build.c	Tue Oct 31 11:44:47 2006 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,232 +0,0 @@
     5.4 -/*
     5.5 - * Copyright (c) 2004, Intel Corporation.
     5.6 - *
     5.7 - * This program is free software; you can redistribute it and/or modify it
     5.8 - * under the terms and conditions of the GNU General Public License,
     5.9 - * version 2, as published by the Free Software Foundation.
    5.10 - *
    5.11 - * This program is distributed in the hope it will be useful, but WITHOUT
    5.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    5.14 - * more details.
    5.15 - *
    5.16 - * You should have received a copy of the GNU General Public License along with
    5.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    5.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    5.19 - *
    5.20 - */
    5.21 -
    5.22 -#include "acpi2_0.h"
    5.23 -#include "acpi_madt.h"
    5.24 -
    5.25 -extern ACPI_2_0_RSDP Rsdp;
    5.26 -extern ACPI_2_0_RSDT Rsdt;
    5.27 -extern ACPI_2_0_XSDT Xsdt;
    5.28 -extern ACPI_2_0_FADT Fadt;
    5.29 -extern ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt;
    5.30 -extern ACPI_2_0_FACS Facs;
    5.31 -extern unsigned char *AmlCode;
    5.32 -extern int DsdtLen;
    5.33 -
    5.34 -
    5.35 -typedef struct _ACPI_TABLE_ALL{
    5.36 -		ACPI_2_0_RSDP *Rsdp;
    5.37 -		ACPI_2_0_RSDT *Rsdt;
    5.38 -		ACPI_2_0_XSDT *Xsdt;
    5.39 -		ACPI_2_0_FADT *Fadt;
    5.40 -		ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *Madt;
    5.41 -		ACPI_2_0_FACS *Facs;
    5.42 -		unsigned char* Dsdt;
    5.43 -		uint32_t RsdpOffset;
    5.44 -		uint32_t RsdtOffset;
    5.45 -		uint32_t XsdtOffset;
    5.46 -		uint32_t FadtOffset;
    5.47 -		uint32_t MadtOffset;
    5.48 -		uint32_t FacsOffset;
    5.49 -		uint32_t DsdtOffset;
    5.50 -}ACPI_TABLE_ALL;
    5.51 -
    5.52 -static 
    5.53 -void
    5.54 -MemCopy(void* src, void* dst, int len){
    5.55 -
    5.56 -	uint8_t* src0=src;
    5.57 -   	uint8_t* dst0=dst;	
    5.58 -
    5.59 -	while(len--){
    5.60 -		*(dst0++)=*(src0++);
    5.61 -	}
    5.62 -}
    5.63 -
    5.64 -static
    5.65 -void
    5.66 -SetCheckSum(
    5.67 -  void*  Table, 
    5.68 -  uint32_t ChecksumOffset,
    5.69 -  uint32_t Length
    5.70 -)
    5.71 -/*
    5.72 - * Routine Description:
    5.73 - *      Calculate Checksum and store the result in the checksum 
    5.74 - * 	filed of the table	
    5.75 - *
    5.76 - * INPUT:
    5.77 - * 	Table:          Start pointer of table
    5.78 - * 	ChecksumOffset: Offset of checksum field in the table
    5.79 - * 	Length:         Length of Table
    5.80 - */
    5.81 -{
    5.82 -	uint8_t Sum = 0;  
    5.83 -	uint8_t *Ptr;
    5.84 -
    5.85 -	Ptr=Table;
    5.86 -	Ptr[ChecksumOffset]=0;
    5.87 -	while (Length--) {    
    5.88 -		Sum = (uint8_t)(Sum + (*Ptr++));
    5.89 -	}
    5.90 -	
    5.91 -	Ptr = Table;
    5.92 -	Ptr[ChecksumOffset] = (uint8_t) (0xff - Sum + 1);
    5.93 -}
    5.94 -
    5.95 -//
    5.96 -//  FIELD_OFFSET - returns the byte offset to a field within a structure
    5.97 -//
    5.98 -#define FIELD_OFFSET(TYPE,Field) ((uint32_t)(&(((TYPE *) 0)->Field)))
    5.99 -
   5.100 -static
   5.101 -void
   5.102 -UpdateTable(
   5.103 -	ACPI_TABLE_ALL *table
   5.104 -)
   5.105 -/*
   5.106 - * Update the ACPI table:
   5.107 - * 		fill in the actuall physical address of RSDT, XSDT, FADT, MADT, FACS
   5.108 - * 		Caculate the checksum
   5.109 - */
   5.110 -{    
   5.111 -	// RSDP Update	
   5.112 -	table->Rsdp->RsdtAddress = (uint32_t)(ACPI_PHYSICAL_ADDRESS+
   5.113 -					table->RsdtOffset);
   5.114 -	table->Rsdp->XsdtAddress = (uint64_t)(ACPI_PHYSICAL_ADDRESS+
   5.115 -					table->XsdtOffset);
   5.116 -	SetCheckSum(table->Rsdp,
   5.117 -					FIELD_OFFSET(ACPI_1_0_RSDP, Checksum),
   5.118 -					sizeof(ACPI_1_0_RSDP)
   5.119 -			   );
   5.120 -	SetCheckSum(table->Rsdp,
   5.121 -					FIELD_OFFSET(ACPI_2_0_RSDP,
   5.122 -							ExtendedChecksum),
   5.123 -					sizeof(ACPI_2_0_RSDP)
   5.124 -			   );
   5.125 -
   5.126 -	
   5.127 -	//RSDT Update
   5.128 -	table->Rsdt->Entry[0] = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
   5.129 -					table->FadtOffset);	
   5.130 -	table->Rsdt->Entry[1] = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
   5.131 -					table->MadtOffset);
   5.132 -	table->Rsdt->Header.Length = sizeof (ACPI_TABLE_HEADER) +
   5.133 -		   			2*sizeof(uint32_t);
   5.134 -	SetCheckSum(table->Rsdt,
   5.135 -					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   5.136 -					table->Rsdt->Header.Length
   5.137 -			   );	
   5.138 -	
   5.139 -	//XSDT	Update
   5.140 -	table->Xsdt->Entry[0] = (uint64_t)(ACPI_PHYSICAL_ADDRESS +
   5.141 -					table->FadtOffset);
   5.142 -	table->Xsdt->Entry[1] = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
   5.143 -					table->MadtOffset);	
   5.144 -	table->Xsdt->Header.Length = sizeof (ACPI_TABLE_HEADER) + 
   5.145 -					2*sizeof(uint64_t);
   5.146 -	SetCheckSum(table->Xsdt,
   5.147 -					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   5.148 -					table->Xsdt->Header.Length
   5.149 -			   );
   5.150 -
   5.151 -	// FADT Update
   5.152 -	table->Fadt->Dsdt = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
   5.153 -					table->DsdtOffset);	
   5.154 -	table->Fadt->XDsdt = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
   5.155 -				   table->DsdtOffset);
   5.156 -	table->Fadt->FirmwareCtrl = (uint32_t)(ACPI_PHYSICAL_ADDRESS +
   5.157 -					table->FacsOffset);
   5.158 -	table->Fadt->XFirmwareCtrl = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
   5.159 -					table->FacsOffset);	
   5.160 -	SetCheckSum(table->Fadt,
   5.161 -					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   5.162 -					sizeof(ACPI_2_0_FADT)
   5.163 -			   );
   5.164 -	
   5.165 -	// MADT update
   5.166 -	SetCheckSum(table->Madt,
   5.167 -					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   5.168 -					sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE)
   5.169 -			   );
   5.170 -}
   5.171 -
   5.172 -void
   5.173 -AcpiBuildTable(uint8_t* buf)
   5.174 -/*
   5.175 - * Copy all the ACPI table to buffer
   5.176 - * Buffer Layout:
   5.177 - * 		FACS
   5.178 - * 		RSDP
   5.179 - * 		RSDT
   5.180 - * 		XSDT
   5.181 - * 		FADT
   5.182 - * 		MADT
   5.183 - * 		DSDT 		
   5.184 - *
   5.185 - */		
   5.186 -{
   5.187 -	ACPI_TABLE_ALL table;
   5.188 -	int offset=0;
   5.189 -
   5.190 -	// FACS: should be 64-bit alignment 	
   5.191 -	// so it is put at the start of buffer
   5.192 -	// as the buffer is 64 bit alignment
   5.193 -	table.FacsOffset = offset;
   5.194 -	table.Facs = (ACPI_2_0_FACS*)(&buf[offset]);
   5.195 -	MemCopy(&Facs, table.Facs, sizeof(ACPI_2_0_FACS));
   5.196 -	offset += sizeof(ACPI_2_0_FACS);
   5.197 -
   5.198 -	// RSDP
   5.199 -	table.RsdpOffset = offset;
   5.200 -	table.Rsdp = (ACPI_2_0_RSDP*)(&buf[offset]);
   5.201 -	MemCopy(&Rsdp, table.Rsdp, sizeof(ACPI_2_0_RSDP));
   5.202 -	offset+=sizeof(ACPI_2_0_RSDP);
   5.203 -
   5.204 -	// RSDT
   5.205 -	table.RsdtOffset = offset;
   5.206 -	table.Rsdt = (ACPI_2_0_RSDT*)(&buf[offset]);
   5.207 -	MemCopy(&Rsdt, table.Rsdt, sizeof(ACPI_2_0_RSDT));
   5.208 -	offset+=sizeof(ACPI_2_0_RSDT);
   5.209 -	
   5.210 -	// XSDT
   5.211 -	table.XsdtOffset = offset;
   5.212 -	table.Xsdt = (ACPI_2_0_XSDT*)(&buf[offset]);
   5.213 -	MemCopy(&Xsdt, table.Xsdt, sizeof(ACPI_2_0_XSDT));
   5.214 -	offset+=sizeof(ACPI_2_0_XSDT);
   5.215 -	
   5.216 -	// FADT
   5.217 -	table.FadtOffset = offset;
   5.218 -	table.Fadt = (ACPI_2_0_FADT*)(&buf[offset]);
   5.219 -	MemCopy(&Fadt, table.Fadt, sizeof(ACPI_2_0_FADT));
   5.220 -	offset+=sizeof(ACPI_2_0_FADT);
   5.221 -	
   5.222 -	// MADT
   5.223 -	table.MadtOffset = offset;
   5.224 -	table.Madt = (ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE*)(&buf[offset]);
   5.225 -	MemCopy(&Madt, table.Madt, sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE));
   5.226 -	offset+=sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE);
   5.227 -
   5.228 -	// DSDT
   5.229 -	table.DsdtOffset = offset;
   5.230 -	table.Dsdt = (unsigned char*)(&buf[offset]);
   5.231 -	MemCopy(&AmlCode, table.Dsdt, DsdtLen);
   5.232 -	offset+=DsdtLen; 
   5.233 -	
   5.234 -	UpdateTable(&table);
   5.235 -}
     6.1 --- a/tools/firmware/acpi/acpi_dsdt.asl	Tue Oct 31 11:44:47 2006 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,521 +0,0 @@
     6.4 -//**********************************************************************//
     6.5 -//*
     6.6 -//* Copyright (c) 2004, Intel Corporation.
     6.7 -//*
     6.8 -//* This program is free software; you can redistribute it and/or modify it
     6.9 -//* under the terms and conditions of the GNU General Public License,
    6.10 -//* version 2, as published by the Free Software Foundation.
    6.11 -//*
    6.12 -//* This program is distributed in the hope it will be useful, but WITHOUT
    6.13 -//* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    6.14 -//* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    6.15 -//* more details.
    6.16 -//*
    6.17 -//* You should have received a copy of the GNU General Public License along with
    6.18 -//* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    6.19 -//* Place - Suite 330, Boston, MA 02111-1307 USA.
    6.20 -
    6.21 -//**
    6.22 -//**  DSDT for Xen with Qemu device model
    6.23 -//**
    6.24 -//**
    6.25 -
    6.26 -DefinitionBlock ("DSDT.aml", "DSDT", 1, "INTEL","int-xen", 2006)
    6.27 -{
    6.28 -    Name (\PMBS, 0x0C00)
    6.29 -    Name (\PMLN, 0x08)
    6.30 -    Name (\IOB1, 0x00)
    6.31 -    Name (\IOL1, 0x00)
    6.32 -    Name (\APCB, 0xFEC00000)
    6.33 -    Name (\APCL, 0x00010000)
    6.34 -    Name (\PUID, 0x00)
    6.35 -
    6.36 -    Scope (\_PR)
    6.37 -    {
    6.38 -        Processor (CPU0, 0x00, 0x00000000, 0x00) {}
    6.39 -        Processor (CPU1, 0x01, 0x00000000, 0x00) {}
    6.40 -        Processor (CPU2, 0x02, 0x00000000, 0x00) {}
    6.41 -        Processor (CPU3, 0x03, 0x00000000, 0x00) {}
    6.42 -
    6.43 -    }
    6.44 -
    6.45 -/* Poweroff support - ties in with qemu emulation */
    6.46 -
    6.47 -    Name (\_S5, Package (0x04)
    6.48 -    {
    6.49 -        0x07,
    6.50 -        0x07,
    6.51 -        0x00,
    6.52 -        0x00
    6.53 -    })
    6.54 -
    6.55 -
    6.56 -    Name(PICD, 0)
    6.57 -
    6.58 -    Method(_PIC, 1) { 
    6.59 - 
    6.60 -    Store(Arg0, PICD) 
    6.61 -    }
    6.62 -    Scope (\_SB)
    6.63 -    {
    6.64 -       /* Fix HCT test for 0x400 pci memory - need to report low 640 MB mem as motherboard resource            */
    6.65 -
    6.66 -       Device(MEM0) {
    6.67 -           Name(_HID, EISAID("PNP0C02"))
    6.68 -           Name(_CRS, ResourceTemplate() {
    6.69 -           QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
    6.70 -                    0x00000000,
    6.71 -                    0x00000000,
    6.72 -                    0x0009ffff,
    6.73 -                    0x00000000,
    6.74 -                    0x000a0000)
    6.75 -           }
    6.76 -           )
    6.77 -       }
    6.78 -
    6.79 -       Device (PCI0)
    6.80 -        {
    6.81 -           Name (_HID, EisaId ("PNP0A03"))
    6.82 -           Name (_UID, 0x00)
    6.83 -           Name (_ADR, 0x00)
    6.84 -           Name (_BBN, 0x00)
    6.85 -           OperationRegion (PIRP, PCI_Config, 0x3c, 0x10)
    6.86 -           Field(PIRP, ByteAcc, NoLock, Preserve){        
    6.87 -          IRQ3,3,
    6.88 -          IRQ5,5,
    6.89 -          IRQ7,7,
    6.90 -          IRQ9,9,
    6.91 -          IRQA,10,
    6.92 -          IRQB,11
    6.93 -         }
    6.94 - 
    6.95 -            Method (_CRS, 0, NotSerialized)
    6.96 -            {
    6.97 -          
    6.98 -               Name (PRT0, ResourceTemplate ()
    6.99 -                {
   6.100 -         /* bus number is from 0 - 255*/
   6.101 -                    WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
   6.102 -                        0x0000,
   6.103 -                        0x0000,
   6.104 -                        0x00FF,
   6.105 -                        0x0000,
   6.106 -                        0x0100)
   6.107 -                    IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
   6.108 -                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
   6.109 -                        0x0000,
   6.110 -                        0x0000,
   6.111 -                        0x0CF7,
   6.112 -                        0x0000,
   6.113 -                        0x0CF8)
   6.114 -                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
   6.115 -                        0x0000,
   6.116 -                        0x0D00,
   6.117 -                        0xFFFF,
   6.118 -                        0x0000,
   6.119 -                        0xF300)
   6.120 -
   6.121 -                /* reserve memory for pci devices */
   6.122 -
   6.123 -                    DWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
   6.124 -                        0x00000000,
   6.125 -                        0xF0000000,
   6.126 -                        0xF4FFFFFF,
   6.127 -                        0x00000000,
   6.128 -                        0x05000000)
   6.129 -
   6.130 -                })
   6.131 -                Return (PRT0)
   6.132 -            }
   6.133 -       Name(BUFA, ResourceTemplate() {
   6.134 -                IRQ(Level, ActiveLow, Shared) {
   6.135 -                        3,4,5,6,7,10,11,12,14,15} 
   6.136 -                }) 
   6.137 -
   6.138 -                Name(BUFB, Buffer(){
   6.139 -                0x23, 0x00, 0x00, 0x18,
   6.140 -                0x79, 0})
   6.141 -
   6.142 -                CreateWordField(BUFB, 0x01, IRQV)
   6.143 -
   6.144 -                Name(BUFC, Buffer(){
   6.145 -                5, 7, 10, 11
   6.146 -                 })
   6.147 -                
   6.148 -                CreateByteField(BUFC, 0x01, PIQA)
   6.149 -                CreateByteField(BUFC, 0x01, PIQB)
   6.150 -                CreateByteField(BUFC, 0x01, PIQC)
   6.151 -                CreateByteField(BUFC, 0x01, PIQD)
   6.152 -                
   6.153 -                Device(LNKA)    {
   6.154 -                Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
   6.155 -                Name(_UID, 1)
   6.156 -                Method(_STA, 0) {
   6.157 -                               And(PIRA, 0x80, Local0)
   6.158 -                        If(LEqual(Local0, 0x80)) {
   6.159 -                                Return(0x09)   
   6.160 -                                }
   6.161 -                        Else {
   6.162 -                                Return(0x0B) 
   6.163 -                                }
   6.164 -                        }
   6.165 -
   6.166 -                Method(_PRS) {
   6.167 -
   6.168 -                        Return(BUFA)
   6.169 -                } // Method(_PRS)
   6.170 -
   6.171 -                Method(_DIS) {
   6.172 -                               Or(PIRA, 0x80, PIRA)
   6.173 -                }
   6.174 -
   6.175 -                Method(_CRS) {
   6.176 -                        And(PIRB, 0x0f, Local0) 
   6.177 -                        ShiftLeft(0x1, Local0, IRQV) 
   6.178 -                        Return(BUFB) 
   6.179 -                } 
   6.180 -
   6.181 -                Method(_SRS, 1) {
   6.182 -                                CreateWordField(ARG0, 0x01, IRQ1) 
   6.183 -                        FindSetRightBit(IRQ1, Local0) 
   6.184 -                        Decrement(Local0) 
   6.185 -                        Store(Local0, PIRA)
   6.186 -                 } // Method(_SRS)
   6.187 -        }
   6.188 -
   6.189 -        Device(LNKB){
   6.190 -                Name(_HID, EISAID("PNP0C0F"))  
   6.191 -                Name(_UID, 2)
   6.192 -                Method(_STA, 0) {
   6.193 -                               And(PIRB, 0x80, Local0)
   6.194 -                        If(LEqual(Local0, 0x80)) {
   6.195 -                                Return(0x09) 
   6.196 -                                }
   6.197 -                        Else {
   6.198 -                                Return(0x0B) 
   6.199 -                                }
   6.200 -                        }
   6.201 -
   6.202 -                Method(_PRS) {
   6.203 -                                Return(BUFA) 
   6.204 -                } // Method(_PRS)
   6.205 -
   6.206 -                Method(_DIS) {
   6.207 -
   6.208 -                               Or(PIRB, 0x80, PIRB)
   6.209 -                }
   6.210 -
   6.211 -                Method(_CRS) {
   6.212 -                        And(PIRB, 0x0f, Local0) 
   6.213 -                        ShiftLeft(0x1, Local0, IRQV) 
   6.214 -                        Return(BUFB) 
   6.215 -                } // Method(_CRS)
   6.216 -
   6.217 -                Method(_SRS, 1) {
   6.218 -                        CreateWordField(ARG0, 0x01, IRQ1) 
   6.219 -                        FindSetRightBit(IRQ1, Local0) 
   6.220 -                        Decrement(Local0)
   6.221 -                        Store(Local0, PIRB) 
   6.222 -                 } // Method(_SRS)
   6.223 -        }
   6.224 -
   6.225 -        Device(LNKC){
   6.226 -                Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
   6.227 -                Name(_UID, 3)
   6.228 -                Method(_STA, 0) {
   6.229 -                        And(PIRC, 0x80, Local0)
   6.230 -                        If(LEqual(Local0, 0x80)) {
   6.231 -                                Return(0x09) 
   6.232 -                        }
   6.233 -                        Else {
   6.234 -                                Return(0x0B)
   6.235 -                        }
   6.236 -                }
   6.237 -
   6.238 -                Method(_PRS) { 
   6.239 -                        Return(BUFA)
   6.240 -                } // Method(_PRS)
   6.241 -
   6.242 -                Method(_DIS) {
   6.243 -
   6.244 -                               Or(PIRC, 0x80, PIRC)
   6.245 -                }
   6.246 -
   6.247 -                Method(_CRS) {
   6.248 -                        And(PIRC, 0x0f, Local0) 
   6.249 -                        ShiftLeft(0x1, Local0, IRQV) 
   6.250 -                        Return(BUFB) 
   6.251 -                } // Method(_CRS)
   6.252 -
   6.253 -                Method(_SRS, 1) {
   6.254 -                                CreateWordField(ARG0, 0x01, IRQ1) 
   6.255 -                        FindSetRightBit(IRQ1, Local0) 
   6.256 -                        Decrement(Local0) 
   6.257 -                        Store(Local0, PIRC)
   6.258 -                 } // Method(_SRS)
   6.259 -        }
   6.260 -
   6.261 -        Device(LNKD) {
   6.262 -                Name(_HID, EISAID("PNP0C0F"))  
   6.263 -                Name(_UID, 4)
   6.264 -                Method(_STA, 0) {
   6.265 -                               And(PIRD, 0x80, Local0)
   6.266 -                        If(LEqual(Local0, 0x80)) {
   6.267 -                                Return(0x09) 
   6.268 -                        }
   6.269 -                        Else {
   6.270 -                                Return(0x0B) 
   6.271 -                        }
   6.272 -                }
   6.273 -
   6.274 -                Method(_PRS) { 
   6.275 -                        Return(BUFA) 
   6.276 -                } // Method(_PRS)
   6.277 -
   6.278 -                Method(_DIS) {
   6.279 -                               Or(PIRD, 0x80, PIRD)
   6.280 -                }
   6.281 -
   6.282 -                Method(_CRS) {
   6.283 -                        And(PIRD, 0x0f, Local0) 
   6.284 -                        ShiftLeft(0x1, Local0, IRQV) 
   6.285 -                        Return(BUFB) 
   6.286 -                } // Method(_CRS)
   6.287 -
   6.288 -                Method(_SRS, 1) {
   6.289 -                                CreateWordField(ARG0, 0x01, IRQ1) 
   6.290 -                        FindSetRightBit(IRQ1, Local0) 
   6.291 -                        Decrement(Local0) 
   6.292 -                        Store(Local0, PIRD) 
   6.293 -                 } // Method(_SRS)
   6.294 -        }
   6.295 -        Method(_PRT,0) {
   6.296 -               If(PICD) {Return(PRTA)}  
   6.297 -               Return (PRTP)  
   6.298 -               } // end _PRT
   6.299 -
   6.300 -        Name(PRTP, Package() {
   6.301 -                        // Slot 1, INTA - INTD
   6.302 -                        Package(){0x0000ffff, 0, \_SB.PCI0.LNKA, 0},
   6.303 -                        Package(){0x0000ffff, 1, \_SB.PCI0.LNKB, 0},
   6.304 -                        Package(){0x0000ffff, 2, \_SB.PCI0.LNKC, 0},
   6.305 -                        Package(){0x0000ffff, 3, \_SB.PCI0.LNKD, 0},
   6.306 -
   6.307 -                        // Slot 2, INTA - INTD
   6.308 -                        Package(){0x0001ffff, 0, \_SB.PCI0.LNKB, 0},
   6.309 -                        Package(){0x0001ffff, 1, \_SB.PCI0.LNKC, 0},
   6.310 -                        Package(){0x0001ffff, 2, \_SB.PCI0.LNKD, 0},
   6.311 -                        Package(){0x0001ffff, 3, \_SB.PCI0.LNKA, 0},
   6.312 -                        
   6.313 -                        // Slot 3, INTA - INTD
   6.314 -                        Package(){0x0002ffff, 0, \_SB.PCI0.LNKC, 0},
   6.315 -                        Package(){0x0002ffff, 1, \_SB.PCI0.LNKD, 0},
   6.316 -                        Package(){0x0002ffff, 2, \_SB.PCI0.LNKA, 0},
   6.317 -                        Package(){0x0002ffff, 3, \_SB.PCI0.LNKB, 0},
   6.318 -                        
   6.319 -                        // Slot 4, INTA - INTD
   6.320 -                        Package(){0x0003ffff, 0, \_SB.PCI0.LNKD, 0},
   6.321 -                        Package(){0x0003ffff, 1, \_SB.PCI0.LNKA, 0},
   6.322 -                        Package(){0x0003ffff, 2, \_SB.PCI0.LNKB, 0},
   6.323 -                        Package(){0x0003ffff, 3, \_SB.PCI0.LNKC, 0},
   6.324 -                        
   6.325 -                        // Slot 5, INTA - INTD
   6.326 -                        Package(){0x0004ffff, 0, \_SB.PCI0.LNKA, 0},
   6.327 -                        Package(){0x0004ffff, 1, \_SB.PCI0.LNKB, 0},
   6.328 -                        Package(){0x0004ffff, 2, \_SB.PCI0.LNKC, 0},
   6.329 -                        Package(){0x0004ffff, 3, \_SB.PCI0.LNKD, 0},
   6.330 -                        }
   6.331 -            )
   6.332 -        Name(PRTA, Package(){
   6.333 -                        Package(){0x0001ffff, 0, 0, 5},  // Device 1, INTA
   6.334 -                        Package(){0x0002ffff, 0, 0, 7},  // Device 2, INTA
   6.335 -                        Package(){0x0003ffff, 0, 0, 10}, // Device 3, INTA
   6.336 -                        Package(){0x0004ffff, 0, 0, 11}, // Device 4, INTA
   6.337 -                        }
   6.338 -            )
   6.339 -            
   6.340 -            Device (ISA)
   6.341 -            {
   6.342 -                Name (_ADR, 0x00000000) /* device id, PCI bus num, ... */
   6.343 - 
   6.344 -            OperationRegion(PIRQ, PCI_Config, 0x60, 0x4)
   6.345 -                        Scope(\) {
   6.346 -                                 Field (\_SB.PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) {
   6.347 -                                        PIRA, 8,
   6.348 -                                        PIRB, 8,
   6.349 -                                        PIRC, 8,
   6.350 -                                        PIRD, 8
   6.351 -                                        }
   6.352 -                                 }
   6.353 -                Device (SYSR)
   6.354 -                {
   6.355 -                    Name (_HID, EisaId ("PNP0C02"))
   6.356 -                    Name (_UID, 0x01)
   6.357 -                    Name (CRS, ResourceTemplate ()
   6.358 -                    {
   6.359 -               /* TODO: list hidden resources */
   6.360 -                        IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
   6.361 -                        IO (Decode16, 0x0022, 0x0022, 0x00, 0x0C)
   6.362 -                        IO (Decode16, 0x0030, 0x0030, 0x00, 0x10)
   6.363 -                        IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
   6.364 -                        IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
   6.365 -                        IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
   6.366 -                        IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
   6.367 -                        IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
   6.368 -                        IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
   6.369 -                        IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
   6.370 -                        IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
   6.371 -                        IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
   6.372 -                        IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1C)
   6.373 -                        IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
   6.374 -                        IO (Decode16, 0x08A0, 0x08A0, 0x00, 0x04)
   6.375 -                        IO (Decode16, 0x0CC0, 0x0CC0, 0x00, 0x10)
   6.376 -                        IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
   6.377 -                    })
   6.378 -                    Method (_CRS, 0, NotSerialized)
   6.379 -                    {
   6.380 -                        Return (CRS)
   6.381 -                    }
   6.382 -                }
   6.383 -
   6.384 -                Device (PIC)
   6.385 -                {
   6.386 -                    Name (_HID, EisaId ("PNP0000"))
   6.387 -                    Name (_CRS, ResourceTemplate ()
   6.388 -                    {
   6.389 -                        IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
   6.390 -                        IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
   6.391 -                        IRQNoFlags () {2}
   6.392 -                    })
   6.393 -                }
   6.394 -
   6.395 -                Device (DMA0)
   6.396 -                {
   6.397 -                    Name (_HID, EisaId ("PNP0200"))
   6.398 -                    Name (_CRS, ResourceTemplate ()
   6.399 -                    {
   6.400 -                        DMA (Compatibility, BusMaster, Transfer8) {4}
   6.401 -                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
   6.402 -                        IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
   6.403 -                        IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
   6.404 -                        IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
   6.405 -                        IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
   6.406 -                        IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
   6.407 -                        IO (Decode16, 0x0480, 0x0480, 0x00, 0x10)
   6.408 -                    })
   6.409 -                }
   6.410 -
   6.411 -                Device (TMR)
   6.412 -                {
   6.413 -                    Name (_HID, EisaId ("PNP0100"))
   6.414 -                    Name (_CRS, ResourceTemplate ()
   6.415 -                    {
   6.416 -                        IO (Decode16, 0x0040, 0x0040, 0x00, 0x04)
   6.417 -                        IRQNoFlags () {0}
   6.418 -                    })
   6.419 -                }
   6.420 -
   6.421 -                Device (RTC)
   6.422 -                {
   6.423 -                    Name (_HID, EisaId ("PNP0B00"))
   6.424 -                    Name (_CRS, ResourceTemplate ()
   6.425 -                    {
   6.426 -                        IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
   6.427 -                        IRQNoFlags () {8}
   6.428 -                    })
   6.429 -                }
   6.430 -
   6.431 -                Device (SPKR)
   6.432 -                {
   6.433 -                    Name (_HID, EisaId ("PNP0800"))
   6.434 -                    Name (_CRS, ResourceTemplate ()
   6.435 -                    {
   6.436 -                        IO (Decode16, 0x0061, 0x0061, 0x00, 0x01)
   6.437 -                    })
   6.438 -                }
   6.439 -
   6.440 -                Device (PS2M)
   6.441 -                {
   6.442 -                    Name (_HID, EisaId ("PNP0F13"))
   6.443 -                    Name (_CID, 0x130FD041)
   6.444 -                    Method (_STA, 0, NotSerialized)
   6.445 -                    {
   6.446 -                        Return (0x0F)
   6.447 -                    }
   6.448 -
   6.449 -                    Name (_CRS, ResourceTemplate ()
   6.450 -                    {
   6.451 -                        IRQNoFlags () {12}
   6.452 -                    })
   6.453 -                }
   6.454 -
   6.455 -                Device (PS2K)
   6.456 -                {
   6.457 -                    Name (_HID, EisaId ("PNP0303"))
   6.458 -                    Name (_CID, 0x0B03D041)
   6.459 -                    Method (_STA, 0, NotSerialized)
   6.460 -                    {
   6.461 -                        Return (0x0F)
   6.462 -                    }
   6.463 -
   6.464 -                    Name (_CRS, ResourceTemplate ()
   6.465 -                    {
   6.466 -                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
   6.467 -                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
   6.468 -                        IRQNoFlags () {1}
   6.469 -                    })
   6.470 -                }
   6.471 -
   6.472 -                Device (FDC0)
   6.473 -                {
   6.474 -                    Name (_HID, EisaId ("PNP0700"))
   6.475 -                    Method (_STA, 0, NotSerialized)
   6.476 -                    {
   6.477 -                          Return (0x0F)
   6.478 -                    }
   6.479 -
   6.480 -                    Name (_CRS, ResourceTemplate ()
   6.481 -                    {
   6.482 -                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
   6.483 -                        IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
   6.484 -                        IRQNoFlags () {6}
   6.485 -                        DMA (Compatibility, NotBusMaster, Transfer8) {2}
   6.486 -                    })
   6.487 -                }
   6.488 -
   6.489 -                Device (UAR1)
   6.490 -                {
   6.491 -                    Name (_HID, EisaId ("PNP0501"))
   6.492 -                    Name (_UID, 0x01)
   6.493 -                    Method (_STA, 0, NotSerialized)
   6.494 -                    {
   6.495 -                        Return (0x0F)
   6.496 -                    }
   6.497 -
   6.498 -                    Name (_CRS, ResourceTemplate()
   6.499 -                    {
   6.500 -                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
   6.501 -                        IRQNoFlags () {4}
   6.502 -                    })
   6.503 -                }
   6.504 -
   6.505 -                Device (LTP1)
   6.506 -                {
   6.507 -                    Name (_HID, EisaId ("PNP0400"))
   6.508 -                    Name (_UID, 0x02)
   6.509 -                    Method (_STA, 0, NotSerialized)
   6.510 -                    {
   6.511 -                        Return (0x0F)
   6.512 -                    }
   6.513 -
   6.514 -                    Name (_CRS, ResourceTemplate()
   6.515 -                    {
   6.516 -                        IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
   6.517 -                        IRQNoFlags () {7}
   6.518 -                    })
   6.519 -                } 
   6.520 -            }
   6.521 -        }
   6.522 -    }
   6.523 -}
   6.524 -
     7.1 --- a/tools/firmware/acpi/acpi_dsdt.c	Tue Oct 31 11:44:47 2006 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,300 +0,0 @@
     7.4 -/*
     7.5 - * 
     7.6 - * Intel ACPI Component Architecture
     7.7 - * ASL Optimizing Compiler / AML Disassembler version 20050513 [Oct 12 2006]
     7.8 - * Copyright (C) 2000 - 2005 Intel Corporation
     7.9 - * Supports ACPI Specification Revision 3.0
    7.10 - * 
    7.11 - * Compilation of "acpi_dsdt.asl" - Thu Oct 12 14:08:49 2006
    7.12 - * 
    7.13 - * C source code output
    7.14 - *
    7.15 - */
    7.16 -unsigned char AmlCode[] = 
    7.17 -{
    7.18 -    0x44,0x53,0x44,0x54,0xDA,0x08,0x00,0x00,  /* 00000000    "DSDT...." */
    7.19 -    0x01,0x26,0x49,0x4E,0x54,0x45,0x4C,0x00,  /* 00000008    ".&INTEL." */
    7.20 -    0x69,0x6E,0x74,0x2D,0x78,0x65,0x6E,0x00,  /* 00000010    "int-xen." */
    7.21 -    0xD6,0x07,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    7.22 -    0x13,0x05,0x05,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
    7.23 -    0x53,0x0B,0x00,0x0C,0x08,0x50,0x4D,0x4C,  /* 00000028    "S....PML" */
    7.24 -    0x4E,0x0A,0x08,0x08,0x49,0x4F,0x42,0x31,  /* 00000030    "N...IOB1" */
    7.25 -    0x00,0x08,0x49,0x4F,0x4C,0x31,0x00,0x08,  /* 00000038    "..IOL1.." */
    7.26 -    0x41,0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,  /* 00000040    "APCB...." */
    7.27 -    0xFE,0x08,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000048    "..APCL.." */
    7.28 -    0x00,0x01,0x00,0x08,0x50,0x55,0x49,0x44,  /* 00000050    "....PUID" */
    7.29 -    0x00,0x10,0x39,0x5F,0x50,0x52,0x5F,0x5B,  /* 00000058    "..9_PR_[" */
    7.30 -    0x83,0x0B,0x43,0x50,0x55,0x30,0x00,0x00,  /* 00000060    "..CPU0.." */
    7.31 -    0x00,0x00,0x00,0x00,0x5B,0x83,0x0B,0x43,  /* 00000068    "....[..C" */
    7.32 -    0x50,0x55,0x31,0x01,0x00,0x00,0x00,0x00,  /* 00000070    "PU1....." */
    7.33 -    0x00,0x5B,0x83,0x0B,0x43,0x50,0x55,0x32,  /* 00000078    ".[..CPU2" */
    7.34 -    0x02,0x00,0x00,0x00,0x00,0x00,0x5B,0x83,  /* 00000080    "......[." */
    7.35 -    0x0B,0x43,0x50,0x55,0x33,0x03,0x00,0x00,  /* 00000088    ".CPU3..." */
    7.36 -    0x00,0x00,0x00,0x08,0x5F,0x53,0x35,0x5F,  /* 00000090    "...._S5_" */
    7.37 -    0x12,0x08,0x04,0x0A,0x07,0x0A,0x07,0x00,  /* 00000098    "........" */
    7.38 -    0x00,0x08,0x50,0x49,0x43,0x44,0x00,0x14,  /* 000000A0    "..PICD.." */
    7.39 -    0x0C,0x5F,0x50,0x49,0x43,0x01,0x70,0x68,  /* 000000A8    "._PIC.ph" */
    7.40 -    0x50,0x49,0x43,0x44,0x10,0x45,0x82,0x5F,  /* 000000B0    "PICD.E._" */
    7.41 -    0x53,0x42,0x5F,0x5B,0x82,0x49,0x04,0x4D,  /* 000000B8    "SB_[.I.M" */
    7.42 -    0x45,0x4D,0x30,0x08,0x5F,0x48,0x49,0x44,  /* 000000C0    "EM0._HID" */
    7.43 -    0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x43,  /* 000000C8    ".A...._C" */
    7.44 -    0x52,0x53,0x11,0x33,0x0A,0x30,0x8A,0x2B,  /* 000000D0    "RS.3.0.+" */
    7.45 -    0x00,0x00,0x0D,0x03,0x00,0x00,0x00,0x00,  /* 000000D8    "........" */
    7.46 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
    7.47 -    0x00,0x00,0x00,0x00,0xFF,0xFF,0x09,0x00,  /* 000000E8    "........" */
    7.48 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
    7.49 -    0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,  /* 000000F8    "........" */
    7.50 -    0x00,0x00,0x00,0x00,0x79,0x00,0x5B,0x82,  /* 00000100    "....y.[." */
    7.51 -    0x42,0x7D,0x50,0x43,0x49,0x30,0x08,0x5F,  /* 00000108    "B}PCI0._" */
    7.52 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0A,0x03,  /* 00000110    "HID.A..." */
    7.53 -    0x08,0x5F,0x55,0x49,0x44,0x00,0x08,0x5F,  /* 00000118    "._UID.._" */
    7.54 -    0x41,0x44,0x52,0x00,0x08,0x5F,0x42,0x42,  /* 00000120    "ADR.._BB" */
    7.55 -    0x4E,0x00,0x5B,0x80,0x50,0x49,0x52,0x50,  /* 00000128    "N.[.PIRP" */
    7.56 -    0x02,0x0A,0x3C,0x0A,0x10,0x5B,0x81,0x24,  /* 00000130    "..<..[.$" */
    7.57 -    0x50,0x49,0x52,0x50,0x01,0x49,0x52,0x51,  /* 00000138    "PIRP.IRQ" */
    7.58 -    0x33,0x03,0x49,0x52,0x51,0x35,0x05,0x49,  /* 00000140    "3.IRQ5.I" */
    7.59 -    0x52,0x51,0x37,0x07,0x49,0x52,0x51,0x39,  /* 00000148    "RQ7.IRQ9" */
    7.60 -    0x09,0x49,0x52,0x51,0x41,0x0A,0x49,0x52,  /* 00000150    ".IRQA.IR" */
    7.61 -    0x51,0x42,0x0B,0x14,0x4A,0x06,0x5F,0x43,  /* 00000158    "QB..J._C" */
    7.62 -    0x52,0x53,0x00,0x08,0x50,0x52,0x54,0x30,  /* 00000160    "RS..PRT0" */
    7.63 -    0x11,0x48,0x05,0x0A,0x54,0x88,0x0D,0x00,  /* 00000168    ".H..T..." */
    7.64 -    0x02,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,  /* 00000170    "........" */
    7.65 -    0x00,0x00,0x00,0x00,0x01,0x47,0x01,0xF8,  /* 00000178    ".....G.." */
    7.66 -    0x0C,0xF8,0x0C,0x01,0x08,0x88,0x0D,0x00,  /* 00000180    "........" */
    7.67 -    0x01,0x0C,0x03,0x00,0x00,0x00,0x00,0xF7,  /* 00000188    "........" */
    7.68 -    0x0C,0x00,0x00,0xF8,0x0C,0x88,0x0D,0x00,  /* 00000190    "........" */
    7.69 -    0x01,0x0C,0x03,0x00,0x00,0x00,0x0D,0xFF,  /* 00000198    "........" */
    7.70 -    0xFF,0x00,0x00,0x00,0xF3,0x87,0x17,0x00,  /* 000001A0    "........" */
    7.71 -    0x00,0x0D,0x03,0x00,0x00,0x00,0x00,0x00,  /* 000001A8    "........" */
    7.72 -    0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xF4,0x00,  /* 000001B0    "........" */
    7.73 -    0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x79,  /* 000001B8    ".......y" */
    7.74 -    0x00,0xA4,0x50,0x52,0x54,0x30,0x08,0x42,  /* 000001C0    "..PRT0.B" */
    7.75 -    0x55,0x46,0x41,0x11,0x09,0x0A,0x06,0x23,  /* 000001C8    "UFA....#" */
    7.76 -    0xF8,0xDC,0x18,0x79,0x00,0x08,0x42,0x55,  /* 000001D0    "...y..BU" */
    7.77 -    0x46,0x42,0x11,0x09,0x0A,0x06,0x23,0x00,  /* 000001D8    "FB....#." */
    7.78 -    0x00,0x18,0x79,0x00,0x8B,0x42,0x55,0x46,  /* 000001E0    "..y..BUF" */
    7.79 -    0x42,0x01,0x49,0x52,0x51,0x56,0x08,0x42,  /* 000001E8    "B.IRQV.B" */
    7.80 -    0x55,0x46,0x43,0x11,0x07,0x0A,0x04,0x05,  /* 000001F0    "UFC....." */
    7.81 -    0x07,0x0A,0x0B,0x8C,0x42,0x55,0x46,0x43,  /* 000001F8    "....BUFC" */
    7.82 -    0x01,0x50,0x49,0x51,0x41,0x8C,0x42,0x55,  /* 00000200    ".PIQA.BU" */
    7.83 -    0x46,0x43,0x01,0x50,0x49,0x51,0x42,0x8C,  /* 00000208    "FC.PIQB." */
    7.84 -    0x42,0x55,0x46,0x43,0x01,0x50,0x49,0x51,  /* 00000210    "BUFC.PIQ" */
    7.85 -    0x43,0x8C,0x42,0x55,0x46,0x43,0x01,0x50,  /* 00000218    "C.BUFC.P" */
    7.86 -    0x49,0x51,0x44,0x5B,0x82,0x48,0x08,0x4C,  /* 00000220    "IQD[.H.L" */
    7.87 -    0x4E,0x4B,0x41,0x08,0x5F,0x48,0x49,0x44,  /* 00000228    "NKA._HID" */
    7.88 -    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 00000230    ".A...._U" */
    7.89 -    0x49,0x44,0x01,0x14,0x1C,0x5F,0x53,0x54,  /* 00000238    "ID..._ST" */
    7.90 -    0x41,0x00,0x7B,0x50,0x49,0x52,0x41,0x0A,  /* 00000240    "A.{PIRA." */
    7.91 -    0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,0x80,  /* 00000248    ".`...`.." */
    7.92 -    0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,0x0B,  /* 00000250    "........" */
    7.93 -    0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,0xA4,  /* 00000258    ".._PRS.." */
    7.94 -    0x42,0x55,0x46,0x41,0x14,0x11,0x5F,0x44,  /* 00000260    "BUFA.._D" */
    7.95 -    0x49,0x53,0x00,0x7D,0x50,0x49,0x52,0x41,  /* 00000268    "IS.}PIRA" */
    7.96 -    0x0A,0x80,0x50,0x49,0x52,0x41,0x14,0x1A,  /* 00000270    "..PIRA.." */
    7.97 -    0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,0x49,  /* 00000278    "_CRS.{PI" */
    7.98 -    0x52,0x42,0x0A,0x0F,0x60,0x79,0x01,0x60,  /* 00000280    "RB..`y.`" */
    7.99 -    0x49,0x52,0x51,0x56,0xA4,0x42,0x55,0x46,  /* 00000288    "IRQV.BUF" */
   7.100 -    0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,  /* 00000290    "B.._SRS." */
   7.101 -    0x8B,0x68,0x01,0x49,0x52,0x51,0x31,0x82,  /* 00000298    ".h.IRQ1." */
   7.102 -    0x49,0x52,0x51,0x31,0x60,0x76,0x60,0x70,  /* 000002A0    "IRQ1`v`p" */
   7.103 -    0x60,0x50,0x49,0x52,0x41,0x5B,0x82,0x49,  /* 000002A8    "`PIRA[.I" */
   7.104 -    0x08,0x4C,0x4E,0x4B,0x42,0x08,0x5F,0x48,  /* 000002B0    ".LNKB._H" */
   7.105 -    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 000002B8    "ID.A...." */
   7.106 -    0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,0x1C,  /* 000002C0    "_UID...." */
   7.107 -    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 000002C8    "_STA.{PI" */
   7.108 -    0x52,0x42,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 000002D0    "RB..`..." */
   7.109 -    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 000002D8    "`......." */
   7.110 -    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 000002E0    "....._PR" */
   7.111 -    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 000002E8    "S..BUFA." */
   7.112 -    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 000002F0    "._DIS.}P" */
   7.113 -    0x49,0x52,0x42,0x0A,0x80,0x50,0x49,0x52,  /* 000002F8    "IRB..PIR" */
   7.114 -    0x42,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 00000300    "B.._CRS." */
   7.115 -    0x7B,0x50,0x49,0x52,0x42,0x0A,0x0F,0x60,  /* 00000308    "{PIRB..`" */
   7.116 -    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 00000310    "y.`IRQV." */
   7.117 -    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 00000318    "BUFB.._S" */
   7.118 -    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 00000320    "RS..h.IR" */
   7.119 -    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 00000328    "Q1.IRQ1`" */
   7.120 -    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x42,  /* 00000330    "v`p`PIRB" */
   7.121 -    0x5B,0x82,0x49,0x08,0x4C,0x4E,0x4B,0x43,  /* 00000338    "[.I.LNKC" */
   7.122 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000340    "._HID.A." */
   7.123 -    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 00000348    "..._UID." */
   7.124 -    0x03,0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,  /* 00000350    "..._STA." */
   7.125 -    0x7B,0x50,0x49,0x52,0x43,0x0A,0x80,0x60,  /* 00000358    "{PIRC..`" */
   7.126 -    0xA0,0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,  /* 00000360    "...`...." */
   7.127 -    0x09,0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,  /* 00000368    "........" */
   7.128 -    0x5F,0x50,0x52,0x53,0x00,0xA4,0x42,0x55,  /* 00000370    "_PRS..BU" */
   7.129 -    0x46,0x41,0x14,0x11,0x5F,0x44,0x49,0x53,  /* 00000378    "FA.._DIS" */
   7.130 -    0x00,0x7D,0x50,0x49,0x52,0x43,0x0A,0x80,  /* 00000380    ".}PIRC.." */
   7.131 -    0x50,0x49,0x52,0x43,0x14,0x1A,0x5F,0x43,  /* 00000388    "PIRC.._C" */
   7.132 -    0x52,0x53,0x00,0x7B,0x50,0x49,0x52,0x43,  /* 00000390    "RS.{PIRC" */
   7.133 -    0x0A,0x0F,0x60,0x79,0x01,0x60,0x49,0x52,  /* 00000398    "..`y.`IR" */
   7.134 -    0x51,0x56,0xA4,0x42,0x55,0x46,0x42,0x14,  /* 000003A0    "QV.BUFB." */
   7.135 -    0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,  /* 000003A8    "._SRS..h" */
   7.136 -    0x01,0x49,0x52,0x51,0x31,0x82,0x49,0x52,  /* 000003B0    ".IRQ1.IR" */
   7.137 -    0x51,0x31,0x60,0x76,0x60,0x70,0x60,0x50,  /* 000003B8    "Q1`v`p`P" */
   7.138 -    0x49,0x52,0x43,0x5B,0x82,0x49,0x08,0x4C,  /* 000003C0    "IRC[.I.L" */
   7.139 -    0x4E,0x4B,0x44,0x08,0x5F,0x48,0x49,0x44,  /* 000003C8    "NKD._HID" */
   7.140 -    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 000003D0    ".A...._U" */
   7.141 -    0x49,0x44,0x0A,0x04,0x14,0x1C,0x5F,0x53,  /* 000003D8    "ID...._S" */
   7.142 -    0x54,0x41,0x00,0x7B,0x50,0x49,0x52,0x44,  /* 000003E0    "TA.{PIRD" */
   7.143 -    0x0A,0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,  /* 000003E8    "..`...`." */
   7.144 -    0x80,0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,  /* 000003F0    "........" */
   7.145 -    0x0B,0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,  /* 000003F8    "..._PRS." */
   7.146 -    0xA4,0x42,0x55,0x46,0x41,0x14,0x11,0x5F,  /* 00000400    ".BUFA.._" */
   7.147 -    0x44,0x49,0x53,0x00,0x7D,0x50,0x49,0x52,  /* 00000408    "DIS.}PIR" */
   7.148 -    0x44,0x0A,0x80,0x50,0x49,0x52,0x44,0x14,  /* 00000410    "D..PIRD." */
   7.149 -    0x1A,0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,  /* 00000418    "._CRS.{P" */
   7.150 -    0x49,0x52,0x44,0x0A,0x0F,0x60,0x79,0x01,  /* 00000420    "IRD..`y." */
   7.151 -    0x60,0x49,0x52,0x51,0x56,0xA4,0x42,0x55,  /* 00000428    "`IRQV.BU" */
   7.152 -    0x46,0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,  /* 00000430    "FB.._SRS" */
   7.153 -    0x01,0x8B,0x68,0x01,0x49,0x52,0x51,0x31,  /* 00000438    "..h.IRQ1" */
   7.154 -    0x82,0x49,0x52,0x51,0x31,0x60,0x76,0x60,  /* 00000440    ".IRQ1`v`" */
   7.155 -    0x70,0x60,0x50,0x49,0x52,0x44,0x14,0x16,  /* 00000448    "p`PIRD.." */
   7.156 -    0x5F,0x50,0x52,0x54,0x00,0xA0,0x0A,0x50,  /* 00000450    "_PRT...P" */
   7.157 -    0x49,0x43,0x44,0xA4,0x50,0x52,0x54,0x41,  /* 00000458    "ICD.PRTA" */
   7.158 -    0xA4,0x50,0x52,0x54,0x50,0x08,0x50,0x52,  /* 00000460    ".PRTP.PR" */
   7.159 -    0x54,0x50,0x12,0x4D,0x11,0x14,0x12,0x0B,  /* 00000468    "TP.M...." */
   7.160 -    0x04,0x0B,0xFF,0xFF,0x00,0x4C,0x4E,0x4B,  /* 00000470    ".....LNK" */
   7.161 -    0x41,0x00,0x12,0x0B,0x04,0x0B,0xFF,0xFF,  /* 00000478    "A......." */
   7.162 -    0x01,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0C,  /* 00000480    ".LNKB..." */
   7.163 -    0x04,0x0B,0xFF,0xFF,0x0A,0x02,0x4C,0x4E,  /* 00000488    "......LN" */
   7.164 -    0x4B,0x43,0x00,0x12,0x0C,0x04,0x0B,0xFF,  /* 00000490    "KC......" */
   7.165 -    0xFF,0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,  /* 00000498    "...LNKD." */
   7.166 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 000004A0    "........" */
   7.167 -    0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 000004A8    ".LNKB..." */
   7.168 -    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x01,0x4C,  /* 000004B0    ".......L" */
   7.169 -    0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,  /* 000004B8    "NKC....." */
   7.170 -    0xFF,0xFF,0x01,0x00,0x0A,0x02,0x4C,0x4E,  /* 000004C0    "......LN" */
   7.171 -    0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000004C8    "KD......" */
   7.172 -    0xFF,0x01,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000004D0    ".....LNK" */
   7.173 -    0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000004D8    "A......." */
   7.174 -    0x02,0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,  /* 000004E0    "...LNKC." */
   7.175 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 000004E8    "........" */
   7.176 -    0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,  /* 000004F0    ".LNKD..." */
   7.177 -    0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x02,  /* 000004F8    "........" */
   7.178 -    0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,  /* 00000500    "LNKA...." */
   7.179 -    0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x03,0x4C,  /* 00000508    ".......L" */
   7.180 -    0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,  /* 00000510    "NKB....." */
   7.181 -    0xFF,0xFF,0x03,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000518    ".....LNK" */
   7.182 -    0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000520    "D......." */
   7.183 -    0x03,0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,  /* 00000528    "...LNKA." */
   7.184 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 00000530    "........" */
   7.185 -    0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 00000538    "..LNKB.." */
   7.186 -    0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,  /* 00000540    "........" */
   7.187 -    0x03,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D,  /* 00000548    ".LNKC..." */
   7.188 -    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x00,0x4C,  /* 00000550    ".......L" */
   7.189 -    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 00000558    "NKA....." */
   7.190 -    0xFF,0xFF,0x04,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000560    ".....LNK" */
   7.191 -    0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000568    "B......." */
   7.192 -    0x04,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x43,  /* 00000570    "....LNKC" */
   7.193 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x04,  /* 00000578    "........" */
   7.194 -    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,  /* 00000580    "...LNKD." */
   7.195 -    0x08,0x50,0x52,0x54,0x41,0x12,0x32,0x04,  /* 00000588    ".PRTA.2." */
   7.196 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 00000590    "........" */
   7.197 -    0x00,0x00,0x0A,0x05,0x12,0x0B,0x04,0x0C,  /* 00000598    "........" */
   7.198 -    0xFF,0xFF,0x02,0x00,0x00,0x00,0x0A,0x07,  /* 000005A0    "........" */
   7.199 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 000005A8    "........" */
   7.200 -    0x00,0x00,0x0A,0x0A,0x12,0x0B,0x04,0x0C,  /* 000005B0    "........" */
   7.201 -    0xFF,0xFF,0x04,0x00,0x00,0x00,0x0A,0x0B,  /* 000005B8    "........" */
   7.202 -    0x5B,0x82,0x48,0x31,0x49,0x53,0x41,0x5F,  /* 000005C0    "[.H1ISA_" */
   7.203 -    0x08,0x5F,0x41,0x44,0x52,0x00,0x5B,0x80,  /* 000005C8    "._ADR.[." */
   7.204 -    0x50,0x49,0x52,0x51,0x02,0x0A,0x60,0x0A,  /* 000005D0    "PIRQ..`." */
   7.205 -    0x04,0x10,0x2E,0x5C,0x00,0x5B,0x81,0x29,  /* 000005D8    "...\.[.)" */
   7.206 -    0x5C,0x2F,0x04,0x5F,0x53,0x42,0x5F,0x50,  /* 000005E0    "\/._SB_P" */
   7.207 -    0x43,0x49,0x30,0x49,0x53,0x41,0x5F,0x50,  /* 000005E8    "CI0ISA_P" */
   7.208 -    0x49,0x52,0x51,0x01,0x50,0x49,0x52,0x41,  /* 000005F0    "IRQ.PIRA" */
   7.209 -    0x08,0x50,0x49,0x52,0x42,0x08,0x50,0x49,  /* 000005F8    ".PIRB.PI" */
   7.210 -    0x52,0x43,0x08,0x50,0x49,0x52,0x44,0x08,  /* 00000600    "RC.PIRD." */
   7.211 -    0x5B,0x82,0x46,0x0B,0x53,0x59,0x53,0x52,  /* 00000608    "[.F.SYSR" */
   7.212 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000610    "._HID.A." */
   7.213 -    0x0C,0x02,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000618    "..._UID." */
   7.214 -    0x08,0x43,0x52,0x53,0x5F,0x11,0x4E,0x08,  /* 00000620    ".CRS_.N." */
   7.215 -    0x0A,0x8A,0x47,0x01,0x10,0x00,0x10,0x00,  /* 00000628    "..G....." */
   7.216 -    0x00,0x10,0x47,0x01,0x22,0x00,0x22,0x00,  /* 00000630    "..G."."." */
   7.217 -    0x00,0x0C,0x47,0x01,0x30,0x00,0x30,0x00,  /* 00000638    "..G.0.0." */
   7.218 -    0x00,0x10,0x47,0x01,0x44,0x00,0x44,0x00,  /* 00000640    "..G.D.D." */
   7.219 -    0x00,0x1C,0x47,0x01,0x62,0x00,0x62,0x00,  /* 00000648    "..G.b.b." */
   7.220 -    0x00,0x02,0x47,0x01,0x65,0x00,0x65,0x00,  /* 00000650    "..G.e.e." */
   7.221 -    0x00,0x0B,0x47,0x01,0x72,0x00,0x72,0x00,  /* 00000658    "..G.r.r." */
   7.222 -    0x00,0x0E,0x47,0x01,0x80,0x00,0x80,0x00,  /* 00000660    "..G....." */
   7.223 -    0x00,0x01,0x47,0x01,0x84,0x00,0x84,0x00,  /* 00000668    "..G....." */
   7.224 -    0x00,0x03,0x47,0x01,0x88,0x00,0x88,0x00,  /* 00000670    "..G....." */
   7.225 -    0x00,0x01,0x47,0x01,0x8C,0x00,0x8C,0x00,  /* 00000678    "..G....." */
   7.226 -    0x00,0x03,0x47,0x01,0x90,0x00,0x90,0x00,  /* 00000680    "..G....." */
   7.227 -    0x00,0x10,0x47,0x01,0xA2,0x00,0xA2,0x00,  /* 00000688    "..G....." */
   7.228 -    0x00,0x1C,0x47,0x01,0xE0,0x00,0xE0,0x00,  /* 00000690    "..G....." */
   7.229 -    0x00,0x10,0x47,0x01,0xA0,0x08,0xA0,0x08,  /* 00000698    "..G....." */
   7.230 -    0x00,0x04,0x47,0x01,0xC0,0x0C,0xC0,0x0C,  /* 000006A0    "..G....." */
   7.231 -    0x00,0x10,0x47,0x01,0xD0,0x04,0xD0,0x04,  /* 000006A8    "..G....." */
   7.232 -    0x00,0x02,0x79,0x00,0x14,0x0B,0x5F,0x43,  /* 000006B0    "..y..._C" */
   7.233 -    0x52,0x53,0x00,0xA4,0x43,0x52,0x53,0x5F,  /* 000006B8    "RS..CRS_" */
   7.234 -    0x5B,0x82,0x2B,0x50,0x49,0x43,0x5F,0x08,  /* 000006C0    "[.+PIC_." */
   7.235 -    0x5F,0x48,0x49,0x44,0x0B,0x41,0xD0,0x08,  /* 000006C8    "_HID.A.." */
   7.236 -    0x5F,0x43,0x52,0x53,0x11,0x18,0x0A,0x15,  /* 000006D0    "_CRS...." */
   7.237 -    0x47,0x01,0x20,0x00,0x20,0x00,0x01,0x02,  /* 000006D8    "G. . ..." */
   7.238 -    0x47,0x01,0xA0,0x00,0xA0,0x00,0x01,0x02,  /* 000006E0    "G......." */
   7.239 -    0x22,0x04,0x00,0x79,0x00,0x5B,0x82,0x47,  /* 000006E8    ""..y.[.G" */
   7.240 -    0x05,0x44,0x4D,0x41,0x30,0x08,0x5F,0x48,  /* 000006F0    ".DMA0._H" */
   7.241 -    0x49,0x44,0x0C,0x41,0xD0,0x02,0x00,0x08,  /* 000006F8    "ID.A...." */
   7.242 -    0x5F,0x43,0x52,0x53,0x11,0x41,0x04,0x0A,  /* 00000700    "_CRS.A.." */
   7.243 -    0x3D,0x2A,0x10,0x04,0x47,0x01,0x00,0x00,  /* 00000708    "=*..G..." */
   7.244 -    0x00,0x00,0x00,0x10,0x47,0x01,0x81,0x00,  /* 00000710    "....G..." */
   7.245 -    0x81,0x00,0x00,0x03,0x47,0x01,0x87,0x00,  /* 00000718    "....G..." */
   7.246 -    0x87,0x00,0x00,0x01,0x47,0x01,0x89,0x00,  /* 00000720    "....G..." */
   7.247 -    0x89,0x00,0x00,0x03,0x47,0x01,0x8F,0x00,  /* 00000728    "....G..." */
   7.248 -    0x8F,0x00,0x00,0x01,0x47,0x01,0xC0,0x00,  /* 00000730    "....G..." */
   7.249 -    0xC0,0x00,0x00,0x20,0x47,0x01,0x80,0x04,  /* 00000738    "... G..." */
   7.250 -    0x80,0x04,0x00,0x10,0x79,0x00,0x5B,0x82,  /* 00000740    "....y.[." */
   7.251 -    0x25,0x54,0x4D,0x52,0x5F,0x08,0x5F,0x48,  /* 00000748    "%TMR_._H" */
   7.252 -    0x49,0x44,0x0C,0x41,0xD0,0x01,0x00,0x08,  /* 00000750    "ID.A...." */
   7.253 -    0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,  /* 00000758    "_CRS...." */
   7.254 -    0x47,0x01,0x40,0x00,0x40,0x00,0x00,0x04,  /* 00000760    "G.@.@..." */
   7.255 -    0x22,0x01,0x00,0x79,0x00,0x5B,0x82,0x25,  /* 00000768    ""..y.[.%" */
   7.256 -    0x52,0x54,0x43,0x5F,0x08,0x5F,0x48,0x49,  /* 00000770    "RTC_._HI" */
   7.257 -    0x44,0x0C,0x41,0xD0,0x0B,0x00,0x08,0x5F,  /* 00000778    "D.A...._" */
   7.258 -    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000780    "CRS....G" */
   7.259 -    0x01,0x70,0x00,0x70,0x00,0x00,0x02,0x22,  /* 00000788    ".p.p..."" */
   7.260 -    0x00,0x01,0x79,0x00,0x5B,0x82,0x22,0x53,  /* 00000790    "..y.[."S" */
   7.261 -    0x50,0x4B,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 00000798    "PKR._HID" */
   7.262 -    0x0C,0x41,0xD0,0x08,0x00,0x08,0x5F,0x43,  /* 000007A0    ".A...._C" */
   7.263 -    0x52,0x53,0x11,0x0D,0x0A,0x0A,0x47,0x01,  /* 000007A8    "RS....G." */
   7.264 -    0x61,0x00,0x61,0x00,0x00,0x01,0x79,0x00,  /* 000007B0    "a.a...y." */
   7.265 -    0x5B,0x82,0x31,0x50,0x53,0x32,0x4D,0x08,  /* 000007B8    "[.1PS2M." */
   7.266 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x0F,  /* 000007C0    "_HID.A.." */
   7.267 -    0x13,0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,  /* 000007C8    ".._CID.A" */
   7.268 -    0xD0,0x0F,0x13,0x14,0x09,0x5F,0x53,0x54,  /* 000007D0    "....._ST" */
   7.269 -    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 000007D8    "A....._C" */
   7.270 -    0x52,0x53,0x11,0x08,0x0A,0x05,0x22,0x00,  /* 000007E0    "RS...."." */
   7.271 -    0x10,0x79,0x00,0x5B,0x82,0x42,0x04,0x50,  /* 000007E8    ".y.[.B.P" */
   7.272 -    0x53,0x32,0x4B,0x08,0x5F,0x48,0x49,0x44,  /* 000007F0    "S2K._HID" */
   7.273 -    0x0C,0x41,0xD0,0x03,0x03,0x08,0x5F,0x43,  /* 000007F8    ".A...._C" */
   7.274 -    0x49,0x44,0x0C,0x41,0xD0,0x03,0x0B,0x14,  /* 00000800    "ID.A...." */
   7.275 -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000808    "._STA..." */
   7.276 -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x18,  /* 00000810    ".._CRS.." */
   7.277 -    0x0A,0x15,0x47,0x01,0x60,0x00,0x60,0x00,  /* 00000818    "..G.`.`." */
   7.278 -    0x00,0x01,0x47,0x01,0x64,0x00,0x64,0x00,  /* 00000820    "..G.d.d." */
   7.279 -    0x00,0x01,0x22,0x02,0x00,0x79,0x00,0x5B,  /* 00000828    ".."..y.[" */
   7.280 -    0x82,0x3A,0x46,0x44,0x43,0x30,0x08,0x5F,  /* 00000830    ".:FDC0._" */
   7.281 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x07,0x00,  /* 00000838    "HID.A..." */
   7.282 -    0x14,0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,  /* 00000840    ".._STA.." */
   7.283 -    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000848    "..._CRS." */
   7.284 -    0x1B,0x0A,0x18,0x47,0x01,0xF0,0x03,0xF0,  /* 00000850    "...G...." */
   7.285 -    0x03,0x01,0x06,0x47,0x01,0xF7,0x03,0xF7,  /* 00000858    "...G...." */
   7.286 -    0x03,0x01,0x01,0x22,0x40,0x00,0x2A,0x04,  /* 00000860    "..."@.*." */
   7.287 -    0x00,0x79,0x00,0x5B,0x82,0x35,0x55,0x41,  /* 00000868    ".y.[.5UA" */
   7.288 -    0x52,0x31,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000870    "R1._HID." */
   7.289 -    0x41,0xD0,0x05,0x01,0x08,0x5F,0x55,0x49,  /* 00000878    "A...._UI" */
   7.290 -    0x44,0x01,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 00000880    "D..._STA" */
   7.291 -    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 00000888    "....._CR" */
   7.292 -    0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,0xF8,  /* 00000890    "S....G.." */
   7.293 -    0x03,0xF8,0x03,0x01,0x08,0x22,0x10,0x00,  /* 00000898    ".....".." */
   7.294 -    0x79,0x00,0x5B,0x82,0x36,0x4C,0x54,0x50,  /* 000008A0    "y.[.6LTP" */
   7.295 -    0x31,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000008A8    "1._HID.A" */
   7.296 -    0xD0,0x04,0x00,0x08,0x5F,0x55,0x49,0x44,  /* 000008B0    "...._UID" */
   7.297 -    0x0A,0x02,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 000008B8    "...._STA" */
   7.298 -    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 000008C0    "....._CR" */
   7.299 -    0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,0x78,  /* 000008C8    "S....G.x" */
   7.300 -    0x03,0x78,0x03,0x08,0x08,0x22,0x80,0x00,  /* 000008D0    ".x...".." */
   7.301 -    0x79,0x00,
   7.302 -};
   7.303 -int DsdtLen=sizeof(AmlCode);
     8.1 --- a/tools/firmware/acpi/acpi_facs.c	Tue Oct 31 11:44:47 2006 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,72 +0,0 @@
     8.4 -/*
     8.5 - * Copyright (c) 2004, Intel Corporation.
     8.6 - *
     8.7 - * This program is free software; you can redistribute it and/or modify it
     8.8 - * under the terms and conditions of the GNU General Public License,
     8.9 - * version 2, as published by the Free Software Foundation.
    8.10 - *
    8.11 - * This program is distributed in the hope it will be useful, but WITHOUT
    8.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    8.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    8.14 - * more details.
    8.15 - *
    8.16 - * You should have received a copy of the GNU General Public License along with
    8.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    8.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    8.19 - *
    8.20 - */
    8.21 -#include "acpi2_0.h"
    8.22 -#include "acpi_facs.h"
    8.23 -
    8.24 -//
    8.25 -// Firmware ACPI Control Structure
    8.26 -//
    8.27 -
    8.28 -ACPI_2_0_FACS Facs = {
    8.29 -		ACPI_2_0_FACS_SIGNATURE,
    8.30 -		sizeof (ACPI_2_0_FACS),
    8.31 -
    8.32 -		//
    8.33 -		// Hardware Signature
    8.34 -		//
    8.35 -		0x00000000,
    8.36 -
    8.37 -		ACPI_FIRMWARE_WAKING_VECTOR,
    8.38 -		ACPI_GLOBAL_LOCK,
    8.39 -		ACPI_FIRMWARE_CONTROL_STRUCTURE_FLAGS,
    8.40 -		ACPI_X_FIRMWARE_WAKING_VECTOR,
    8.41 -		ACPI_2_0_FACS_VERSION,
    8.42 -		{
    8.43 -				0x00,  // Reserved Fields
    8.44 -				0x00,
    8.45 -				0x00,
    8.46 -				0x00,
    8.47 -				0x00,
    8.48 -				0x00,
    8.49 -				0x00,
    8.50 -				0x00,
    8.51 -				0x00,
    8.52 -				0x00,
    8.53 -				0x00,
    8.54 -				0x00,
    8.55 -				0x00,
    8.56 -				0x00,
    8.57 -				0x00,
    8.58 -				0x00,
    8.59 -				0x00,
    8.60 -				0x00,
    8.61 -				0x00,
    8.62 -				0x00,
    8.63 -				0x00,
    8.64 -				0x00,
    8.65 -				0x00,
    8.66 -				0x00,
    8.67 -				0x00,
    8.68 -				0x00,
    8.69 -				0x00,
    8.70 -				0x00,
    8.71 -				0x00,
    8.72 -				0x00,
    8.73 -				0x00,
    8.74 -		}
    8.75 -};
     9.1 --- a/tools/firmware/acpi/acpi_facs.h	Tue Oct 31 11:44:47 2006 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,32 +0,0 @@
     9.4 -/*
     9.5 - * Copyright (c) 2004, Intel Corporation.
     9.6 - *
     9.7 - * This program is free software; you can redistribute it and/or modify it
     9.8 - * under the terms and conditions of the GNU General Public License,
     9.9 - * version 2, as published by the Free Software Foundation.
    9.10 - *
    9.11 - * This program is distributed in the hope it will be useful, but WITHOUT
    9.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    9.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    9.14 - * more details.
    9.15 - *
    9.16 - * You should have received a copy of the GNU General Public License along with
    9.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    9.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
    9.19 - *
    9.20 - */
    9.21 -#ifndef _FACS_H
    9.22 -#define _FACS_H
    9.23 -
    9.24 -//
    9.25 -// FACS Definitions
    9.26 -//
    9.27 -
    9.28 -#define ACPI_FIRMWARE_WAKING_VECTOR 0x00000000
    9.29 -#define ACPI_GLOBAL_LOCK 0x00000000
    9.30 -
    9.31 -#define ACPI_FIRMWARE_CONTROL_STRUCTURE_FLAGS 0x00000000
    9.32 -
    9.33 -#define ACPI_X_FIRMWARE_WAKING_VECTOR 0x0000000000000000
    9.34 -
    9.35 -#endif
    10.1 --- a/tools/firmware/acpi/acpi_fadt.c	Tue Oct 31 11:44:47 2006 +0000
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,193 +0,0 @@
    10.4 -/*
    10.5 - * Copyright (c) 2004, Intel Corporation.
    10.6 - *
    10.7 - * This program is free software; you can redistribute it and/or modify it
    10.8 - * under the terms and conditions of the GNU General Public License,
    10.9 - * version 2, as published by the Free Software Foundation.
   10.10 - *
   10.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   10.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   10.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   10.14 - * more details.
   10.15 - *
   10.16 - * You should have received a copy of the GNU General Public License along with
   10.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   10.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   10.19 - *
   10.20 - */
   10.21 -
   10.22 -#include "acpi2_0.h"
   10.23 -#include "acpi_fadt.h"
   10.24 -
   10.25 -//
   10.26 -// Fixed ACPI Description Table
   10.27 -//
   10.28 -
   10.29 -ACPI_2_0_FADT Fadt = {
   10.30 -		{
   10.31 -				ACPI_2_0_FADT_SIGNATURE,
   10.32 -				sizeof (ACPI_2_0_FADT),
   10.33 -				ACPI_2_0_FADT_REVISION,
   10.34 -				0x00,// Checksum will be updated later
   10.35 -				ACPI_OEM_ID,  // OEM ID
   10.36 -				ACPI_OEM_TABLE_ID,  // OEM Table ID
   10.37 -				ACPI_OEM_REVISION, // OEM Revision
   10.38 -				ACPI_CREATOR_ID,  // Creator ID
   10.39 -				ACPI_CREATOR_REVISION,  // Creator Revision 
   10.40 -		},
   10.41 -		//
   10.42 -		// These addresses will be updated later
   10.43 -		//
   10.44 -		0x00000000,   // Physical Address (0~4G) of the FACS
   10.45 -		0x00000000,   // Physical Address (0~4G) of the DSDT
   10.46 -
   10.47 -		0x00,  
   10.48 -		ACPI_PREFERRED_PM_PROFILE,  // Enterprise 
   10.49 -		ACPI_SCI_INT,               // IRQ 9
   10.50 -		ACPI_SMI_CMD,               
   10.51 -		ACPI_ACPI_ENABLE,
   10.52 -		ACPI_ACPI_DISABLE,
   10.53 -		ACPI_S4_BIOS_REQ,  // zero. not supported
   10.54 -		ACPI_PSTATE_CNT,   // not supported
   10.55 -
   10.56 -		ACPI_PM1A_EVT_BLK_ADDRESS,  // required
   10.57 -		ACPI_PM1B_EVT_BLK_ADDRESS,  // not supported 
   10.58 -		ACPI_PM1A_CNT_BLK_ADDRESS,  // required
   10.59 -		ACPI_PM1B_CNT_BLK_ADDRESS,  // not supported 
   10.60 -		ACPI_PM2_CNT_BLK_ADDRESS,   // not supported 
   10.61 -		ACPI_PM_TMR_BLK_ADDRESS,    // required
   10.62 -		ACPI_GPE0_BLK_ADDRESS,      // not supported
   10.63 -		ACPI_GPE1_BLK_ADDRESS,      // not supported 
   10.64 -		ACPI_PM1_EVT_LEN,           
   10.65 -		ACPI_PM1_CNT_LEN,
   10.66 -		ACPI_PM2_CNT_LEN,
   10.67 -		ACPI_PM_TMR_LEN,
   10.68 -		ACPI_GPE0_BLK_LEN,
   10.69 -		ACPI_GPE1_BLK_LEN,
   10.70 -		ACPI_GPE1_BASE,
   10.71 -
   10.72 -		ACPI_CST_CNT,
   10.73 -		ACPI_P_LVL2_LAT,             // >100, not support C2 state
   10.74 -		ACPI_P_LVL3_LAT,             // >1000, not support C3 state
   10.75 -		ACPI_FLUSH_SIZE,             // not support
   10.76 -		ACPI_FLUSH_STRIDE,           // not support
   10.77 -		ACPI_DUTY_OFFSET,            // not support 
   10.78 -		ACPI_DUTY_WIDTH,             // not support
   10.79 -		ACPI_DAY_ALRM,               // not support
   10.80 -		ACPI_MON_ALRM,               // not support
   10.81 -		ACPI_CENTURY,                // not support
   10.82 -		ACPI_IAPC_BOOT_ARCH,         
   10.83 -		0x00,          
   10.84 -		ACPI_FIXED_FEATURE_FLAGS,
   10.85 -
   10.86 -		//
   10.87 -		// Reset Register Block
   10.88 -		//
   10.89 -		{		ACPI_RESET_REG_ADDRESS_SPACE_ID,
   10.90 -				ACPI_RESET_REG_BIT_WIDTH,
   10.91 -				ACPI_RESET_REG_BIT_OFFSET,
   10.92 -				0x00,
   10.93 -				ACPI_RESET_REG_ADDRESS,
   10.94 -		},
   10.95 -
   10.96 -		ACPI_RESET_VALUE,
   10.97 -		{
   10.98 -				0x00,
   10.99 -				0x00,
  10.100 -				0x00,
  10.101 -		},
  10.102 -		//
  10.103 -		// These addresses will be updated later
  10.104 -		//
  10.105 -		0x0000000000000000,   // X_FIRMWARE_CTRL: 64bit physical address of the FACS.
  10.106 -		0x0000000000000000,   // X_DSDT: 64bit physical address of the DSDT.
  10.107 -
  10.108 -		//
  10.109 -		// PM1a Event Register Block
  10.110 -		//
  10.111 -		{
  10.112 -				ACPI_PM1A_EVT_BLK_ADDRESS_SPACE_ID,
  10.113 -				ACPI_PM1A_EVT_BLK_BIT_WIDTH,
  10.114 -				ACPI_PM1A_EVT_BLK_BIT_OFFSET,
  10.115 -				0x00,
  10.116 -				ACPI_PM1A_EVT_BLK_ADDRESS,
  10.117 -		},
  10.118 -
  10.119 -		//
  10.120 -		// PM1b Event Register Block
  10.121 -		//
  10.122 -		{
  10.123 -				ACPI_PM1B_EVT_BLK_ADDRESS_SPACE_ID,  // not support
  10.124 -				ACPI_PM1B_EVT_BLK_BIT_WIDTH,
  10.125 -				ACPI_PM1B_EVT_BLK_BIT_OFFSET,
  10.126 -				0x00,
  10.127 -				ACPI_PM1B_EVT_BLK_ADDRESS,
  10.128 -		},
  10.129 -
  10.130 -		//
  10.131 -		// PM1a Control Register Block
  10.132 -		//
  10.133 -		{
  10.134 -				ACPI_PM1A_CNT_BLK_ADDRESS_SPACE_ID,
  10.135 -				ACPI_PM1A_CNT_BLK_BIT_WIDTH,
  10.136 -				ACPI_PM1A_CNT_BLK_BIT_OFFSET,
  10.137 -				0x00,
  10.138 -				ACPI_PM1A_CNT_BLK_ADDRESS,
  10.139 -		},
  10.140 -
  10.141 -		//
  10.142 -		// PM1b Control Register Block
  10.143 -		//
  10.144 -		{
  10.145 -				ACPI_PM1B_CNT_BLK_ADDRESS_SPACE_ID,
  10.146 -				ACPI_PM1B_CNT_BLK_BIT_WIDTH,
  10.147 -				ACPI_PM1B_CNT_BLK_BIT_OFFSET,
  10.148 -				0x00,
  10.149 -				ACPI_PM1B_CNT_BLK_ADDRESS,
  10.150 -		},
  10.151 -
  10.152 -		//
  10.153 -		// PM2 Control Register Block
  10.154 -		//
  10.155 -		{
  10.156 -				ACPI_PM2_CNT_BLK_ADDRESS_SPACE_ID,
  10.157 -				ACPI_PM2_CNT_BLK_BIT_WIDTH,
  10.158 -				ACPI_PM2_CNT_BLK_BIT_OFFSET,
  10.159 -				0x00,
  10.160 -				ACPI_PM2_CNT_BLK_ADDRESS,
  10.161 -		},
  10.162 -
  10.163 -		//
  10.164 -		// PM Timer Control Register Block
  10.165 -		//
  10.166 -		{
  10.167 -				ACPI_PM_TMR_BLK_ADDRESS_SPACE_ID,
  10.168 -				ACPI_PM_TMR_BLK_BIT_WIDTH,
  10.169 -				ACPI_PM_TMR_BLK_BIT_OFFSET,
  10.170 -				0x00,
  10.171 -				ACPI_PM_TMR_BLK_ADDRESS,
  10.172 -		},
  10.173 -
  10.174 -		//
  10.175 -		// General Purpose Event 0 Register Block
  10.176 -		//
  10.177 -		{
  10.178 -				ACPI_GPE0_BLK_ADDRESS_SPACE_ID,
  10.179 -				ACPI_GPE0_BLK_BIT_WIDTH,
  10.180 -				ACPI_GPE0_BLK_BIT_OFFSET,
  10.181 -				0x00,
  10.182 -				ACPI_GPE0_BLK_ADDRESS,
  10.183 -		},
  10.184 -
  10.185 -		//
  10.186 -		// General Purpose Event 1 Register Block
  10.187 -		//
  10.188 -		{
  10.189 -				ACPI_GPE1_BLK_ADDRESS_SPACE_ID,
  10.190 -				ACPI_GPE1_BLK_BIT_WIDTH,
  10.191 -				ACPI_GPE1_BLK_BIT_OFFSET,
  10.192 -				0x00,
  10.193 -				ACPI_GPE1_BLK_ADDRESS
  10.194 -		}
  10.195 -		
  10.196 -};
    11.1 --- a/tools/firmware/acpi/acpi_fadt.h	Tue Oct 31 11:44:47 2006 +0000
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,166 +0,0 @@
    11.4 -/*
    11.5 - * Copyright (c) 2004, Intel Corporation.
    11.6 - *
    11.7 - * This program is free software; you can redistribute it and/or modify it
    11.8 - * under the terms and conditions of the GNU General Public License,
    11.9 - * version 2, as published by the Free Software Foundation.
   11.10 - *
   11.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   11.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   11.14 - * more details.
   11.15 - *
   11.16 - * You should have received a copy of the GNU General Public License along with
   11.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   11.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   11.19 - *
   11.20 - */
   11.21 -#ifndef _FADT_H_
   11.22 -#define _FADT_H_
   11.23 -
   11.24 -#include <xen/hvm/ioreq.h>
   11.25 -
   11.26 -//
   11.27 -// FADT Definitions, see ACPI 2.0 specification for details.
   11.28 -//
   11.29 -
   11.30 -#define ACPI_OEM_FADT_REVISION  0x00000001 // TBD
   11.31 -
   11.32 -#define ACPI_PREFERRED_PM_PROFILE 0x00
   11.33 -#define ACPI_SCI_INT              0x0009
   11.34 -#define ACPI_SMI_CMD              0x00000000
   11.35 -#define ACPI_ACPI_ENABLE    0x00
   11.36 -#define ACPI_ACPI_DISABLE   0x00
   11.37 -#define ACPI_S4_BIOS_REQ    0x00
   11.38 -#define ACPI_PSTATE_CNT     0x00
   11.39 -#define ACPI_GPE1_BASE      0x00
   11.40 -#define ACPI_CST_CNT        0x00
   11.41 -#define ACPI_P_LVL2_LAT     0x0064
   11.42 -#define ACPI_P_LVL3_LAT     0X03E8
   11.43 -#define ACPI_FLUSH_SIZE     0x00
   11.44 -#define ACPI_FLUSH_STRIDE   0x00
   11.45 -#define ACPI_DUTY_OFFSET    0x01
   11.46 -#define ACPI_DUTY_WIDTH     0x00
   11.47 -#define ACPI_DAY_ALRM       0x00
   11.48 -#define ACPI_MON_ALRM       0x00
   11.49 -#define ACPI_CENTURY        0x00
   11.50 -
   11.51 -//
   11.52 -// IA-PC Boot Architecture Flags, see ACPI 2.0 table specification and Acpi2_0.h
   11.53 -//
   11.54 -#define ACPI_IAPC_BOOT_ARCH (ACPI_LEGACY_DEVICES | ACPI_8042)
   11.55 -
   11.56 -//
   11.57 -// Fixed Feature Flags
   11.58 -// 
   11.59 -#define ACPI_FIXED_FEATURE_FLAGS (ACPI_PROC_C1 | ACPI_SLP_BUTTON | \
   11.60 -                                  ACPI_WBINVD | ACPI_PWR_BUTTON | \
   11.61 -                                  ACPI_FIX_RTC | ACPI_TMR_VAL_EXT)
   11.62 -
   11.63 -//
   11.64 -// PM1A Event Register Block Generic Address Information
   11.65 -//
   11.66 -#define ACPI_PM1A_EVT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   11.67 -#define ACPI_PM1A_EVT_BLK_BIT_WIDTH         0x20
   11.68 -#define ACPI_PM1A_EVT_BLK_BIT_OFFSET        0x00
   11.69 -
   11.70 -//
   11.71 -// PM1B Event Register Block Generic Address Information
   11.72 -//
   11.73 -#define ACPI_PM1B_EVT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   11.74 -#define ACPI_PM1B_EVT_BLK_BIT_WIDTH         0x00
   11.75 -#define ACPI_PM1B_EVT_BLK_BIT_OFFSET        0x00
   11.76 -#define ACPI_PM1B_EVT_BLK_ADDRESS           0x0000000000000000
   11.77 -
   11.78 -//
   11.79 -// PM1A Control Register Block Generic Address Information
   11.80 -//
   11.81 -#define ACPI_PM1A_CNT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   11.82 -#define ACPI_PM1A_CNT_BLK_BIT_WIDTH         0x10
   11.83 -#define ACPI_PM1A_CNT_BLK_BIT_OFFSET        0x00
   11.84 -
   11.85 -//
   11.86 -// PM1B Control Register Block Generic Address Information
   11.87 -//
   11.88 -#define ACPI_PM1B_CNT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   11.89 -#define ACPI_PM1B_CNT_BLK_BIT_WIDTH         0x00
   11.90 -#define ACPI_PM1B_CNT_BLK_BIT_OFFSET        0x00
   11.91 -#define ACPI_PM1B_CNT_BLK_ADDRESS           0x0000000000000000
   11.92 -
   11.93 -//
   11.94 -// PM2 Control Register Block Generic Address Information
   11.95 -//
   11.96 -#define ACPI_PM2_CNT_BLK_ADDRESS_SPACE_ID   ACPI_SYSTEM_IO
   11.97 -#define ACPI_PM2_CNT_BLK_BIT_WIDTH          0x00
   11.98 -#define ACPI_PM2_CNT_BLK_BIT_OFFSET         0x00
   11.99 -#define ACPI_PM2_CNT_BLK_ADDRESS            0x0000000000000000
  11.100 -
  11.101 -//
  11.102 -// Power Management Timer Control Register Block Generic Address 
  11.103 -// Information
  11.104 -//
  11.105 -#define ACPI_PM_TMR_BLK_ADDRESS_SPACE_ID    ACPI_SYSTEM_IO
  11.106 -#define ACPI_PM_TMR_BLK_BIT_WIDTH           0x20
  11.107 -#define ACPI_PM_TMR_BLK_BIT_OFFSET          0x00
  11.108 -
  11.109 -//
  11.110 -// General Purpose Event 0 Register Block Generic Address
  11.111 -// Information
  11.112 -//
  11.113 -
  11.114 -#define ACPI_GPE0_BLK_ADDRESS_SPACE_ID      ACPI_SYSTEM_IO
  11.115 -#define ACPI_GPE0_BLK_BIT_WIDTH             0x00
  11.116 -#define ACPI_GPE0_BLK_BIT_OFFSET            0x00
  11.117 -#define ACPI_GPE0_BLK_ADDRESS               0x00
  11.118 -
  11.119 -//
  11.120 -// General Purpose Event 1 Register Block Generic Address
  11.121 -// Information
  11.122 -//
  11.123 -
  11.124 -#define ACPI_GPE1_BLK_ADDRESS_SPACE_ID      ACPI_SYSTEM_IO
  11.125 -#define ACPI_GPE1_BLK_BIT_WIDTH             0x00
  11.126 -#define ACPI_GPE1_BLK_BIT_OFFSET            0x00
  11.127 -#define ACPI_GPE1_BLK_ADDRESS               0x00
  11.128 -
  11.129 -
  11.130 -//
  11.131 -// Reset Register Generic Address Information
  11.132 -//
  11.133 -#define ACPI_RESET_REG_ADDRESS_SPACE_ID     ACPI_SYSTEM_IO
  11.134 -#define ACPI_RESET_REG_BIT_WIDTH            0x08
  11.135 -#define ACPI_RESET_REG_BIT_OFFSET           0x00
  11.136 -#define ACPI_RESET_REG_ADDRESS              0x0000000000000CF9
  11.137 -#define ACPI_RESET_VALUE                    0x06
  11.138 - 
  11.139 -//
  11.140 -// Number of bytes decoded by PM1 event blocks (a and b)
  11.141 -//
  11.142 -#define ACPI_PM1_EVT_LEN ((ACPI_PM1A_EVT_BLK_BIT_WIDTH + ACPI_PM1B_EVT_BLK_BIT_WIDTH) / 8)
  11.143 -
  11.144 -//
  11.145 -// Number of bytes decoded by PM1 control blocks (a and b)
  11.146 -//
  11.147 -#define ACPI_PM1_CNT_LEN ((ACPI_PM1A_CNT_BLK_BIT_WIDTH + ACPI_PM1B_CNT_BLK_BIT_WIDTH) / 8)
  11.148 -
  11.149 -//
  11.150 -// Number of bytes decoded by PM2 control block
  11.151 -//
  11.152 -#define ACPI_PM2_CNT_LEN (ACPI_PM2_CNT_BLK_BIT_WIDTH / 8)
  11.153 -
  11.154 -//
  11.155 -// Number of bytes decoded by PM timer block
  11.156 -//
  11.157 -#define ACPI_PM_TMR_LEN (ACPI_PM_TMR_BLK_BIT_WIDTH / 8)
  11.158 -
  11.159 -//
  11.160 -// Number of bytes decoded by GPE0 block
  11.161 -//
  11.162 -#define ACPI_GPE0_BLK_LEN (ACPI_GPE0_BLK_BIT_WIDTH / 8)
  11.163 -
  11.164 -//
  11.165 -// Number of bytes decoded by GPE1 block
  11.166 -//
  11.167 -#define ACPI_GPE1_BLK_LEN   0
  11.168 -
  11.169 -#endif
    12.1 --- a/tools/firmware/acpi/acpi_gen.c	Tue Oct 31 11:44:47 2006 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,53 +0,0 @@
    12.4 -/*
    12.5 - * Copyright (c) 2004, Intel Corporation.
    12.6 - *
    12.7 - * This program is free software; you can redistribute it and/or modify it
    12.8 - * under the terms and conditions of the GNU General Public License,
    12.9 - * version 2, as published by the Free Software Foundation.
   12.10 - *
   12.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   12.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   12.14 - * more details.
   12.15 - *
   12.16 - * You should have received a copy of the GNU General Public License along with
   12.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   12.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   12.19 - *
   12.20 - */
   12.21 -#include "acpi2_0.h"
   12.22 -#include <stdio.h>
   12.23 -#include <stdlib.h>
   12.24 -#include <unistd.h>
   12.25 -
   12.26 -#define USAGE	"Usage: acpi_gen filename \n"				\
   12.27 -		"       generage acpitable and write to the binary \n"	\
   12.28 -		"       filename - the binary name\n"
   12.29 -
   12.30 -int main(int argc, char **argv)
   12.31 -{
   12.32 -	char *filename;
   12.33 -	char  buf[ACPI_TABLE_SIZE] = { 0 };
   12.34 -	FILE *f;
   12.35 -
   12.36 -	if (argc < 2) {
   12.37 -		fprintf(stderr,"%s",USAGE);
   12.38 -		exit(1);
   12.39 -	}
   12.40 -
   12.41 -	filename = argv[1];
   12.42 -		
   12.43 -	if ((f = fopen(filename, "w+")) == NULL) {
   12.44 -		fprintf(stderr,"Can not open %s", filename);
   12.45 -		exit(1);
   12.46 -	}
   12.47 -
   12.48 -	AcpiBuildTable((uint8_t *)buf);
   12.49 -
   12.50 -	if (fwrite(buf, ACPI_TABLE_SIZE, 1, f) < 1) {
   12.51 -		fprintf(stderr,"Can not write to %s\n", filename);
   12.52 -		exit(1);
   12.53 -	}
   12.54 -
   12.55 -	return 0;
   12.56 -}
    13.1 --- a/tools/firmware/acpi/acpi_madt.c	Tue Oct 31 11:44:47 2006 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,68 +0,0 @@
    13.4 -/*
    13.5 - * Copyright (c) 2004, Intel Corporation.
    13.6 - *
    13.7 - * This program is free software; you can redistribute it and/or modify it
    13.8 - * under the terms and conditions of the GNU General Public License,
    13.9 - * version 2, as published by the Free Software Foundation.
   13.10 - *
   13.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   13.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   13.14 - * more details.
   13.15 - *
   13.16 - * You should have received a copy of the GNU General Public License along with
   13.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   13.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   13.19 - *
   13.20 - */
   13.21 -#include "acpi_madt.h"
   13.22 -
   13.23 -//
   13.24 -// Multiple APIC Description Table
   13.25 -//
   13.26 -
   13.27 -ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
   13.28 -		{
   13.29 -				{
   13.30 -						ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
   13.31 -						sizeof (ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE),
   13.32 -						ACPI_2_0_MADT_REVISION,
   13.33 -						0x00,  // Checksum
   13.34 -						ACPI_OEM_ID, 
   13.35 -						ACPI_OEM_TABLE_ID,  
   13.36 -						ACPI_OEM_REVISION, 
   13.37 -						ACPI_CREATOR_ID,  
   13.38 -						ACPI_CREATOR_REVISION, 
   13.39 -				},
   13.40 -				ACPI_LOCAL_APIC_ADDRESS,
   13.41 -				ACPI_MULTIPLE_APIC_FLAGS,
   13.42 -		},
   13.43 -	
   13.44 -		//
   13.45 -		// IO APIC
   13.46 -		// 
   13.47 -		{
   13.48 -				{
   13.49 -						ACPI_IO_APIC,                         
   13.50 -						sizeof (ACPI_IO_APIC_STRUCTURE),  
   13.51 -						0x00,                                     
   13.52 -						0x00,                   
   13.53 -						ACPI_IO_APIC_ADDRESS_1,
   13.54 -						0x0000
   13.55 -				}
   13.56 -		},
   13.57 -
   13.58 -		//
   13.59 -		// LOCAL APIC Entries for up to 32 processors.
   13.60 -		//
   13.61 -		{
   13.62 -				{
   13.63 -						ACPI_PROCESSOR_LOCAL_APIC,
   13.64 -						sizeof (ACPI_LOCAL_APIC_STRUCTURE),
   13.65 -						0x00,
   13.66 -						0x00,
   13.67 -						0x00000001,
   13.68 -				}
   13.69 -
   13.70 -		}
   13.71 -};
    14.1 --- a/tools/firmware/acpi/acpi_madt.h	Tue Oct 31 11:44:47 2006 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,44 +0,0 @@
    14.4 -/*
    14.5 - * Copyright (c) 2004, Intel Corporation.
    14.6 - *
    14.7 - * This program is free software; you can redistribute it and/or modify it
    14.8 - * under the terms and conditions of the GNU General Public License,
    14.9 - * version 2, as published by the Free Software Foundation.
   14.10 - *
   14.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   14.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   14.14 - * more details.
   14.15 - *
   14.16 - * You should have received a copy of the GNU General Public License along with
   14.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   14.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   14.19 - *
   14.20 - */
   14.21 -#ifndef _MADT_H_
   14.22 -#define _MADT_H_
   14.23 -
   14.24 -#include "acpi2_0.h"
   14.25 -
   14.26 -//
   14.27 -// MADT Definitions, see ACPI 2.0 specification for details
   14.28 -//
   14.29 -
   14.30 -#define ACPI_LOCAL_APIC_ADDRESS 0xFEE00000
   14.31 -
   14.32 -#define ACPI_MULTIPLE_APIC_FLAGS      (ACPI_PCAT_COMPAT)
   14.33 -
   14.34 -#define ACPI_IO_APIC_ADDRESS_1   0xFEC00000
   14.35 -
   14.36 -//
   14.37 -// MADT structure
   14.38 -//
   14.39 -#pragma pack (1)
   14.40 -typedef struct {
   14.41 -	ACPI_2_0_MADT			Header;
   14.42 -	ACPI_IO_APIC_STRUCTURE		IoApic[1];
   14.43 -	ACPI_LOCAL_APIC_STRUCTURE	LocalApic[32];
   14.44 -} ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE;
   14.45 -#pragma pack ()
   14.46 -
   14.47 -#endif
    15.1 --- a/tools/firmware/acpi/acpi_rsdt.c	Tue Oct 31 11:44:47 2006 +0000
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,68 +0,0 @@
    15.4 -/*
    15.5 - * Copyright (c) 2004, Intel Corporation.
    15.6 - *
    15.7 - * This program is free software; you can redistribute it and/or modify it
    15.8 - * under the terms and conditions of the GNU General Public License,
    15.9 - * version 2, as published by the Free Software Foundation.
   15.10 - *
   15.11 - * This program is distributed in the hope it will be useful, but WITHOUT
   15.12 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   15.13 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   15.14 - * more details.
   15.15 - *
   15.16 - * You should have received a copy of the GNU General Public License along with
   15.17 - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   15.18 - * Place - Suite 330, Boston, MA 02111-1307 USA.
   15.19 - *
   15.20 - */
   15.21 -#include "acpi2_0.h"
   15.22 -
   15.23 -ACPI_2_0_RSDT Rsdt={	
   15.24 -		{
   15.25 -				ACPI_2_0_RSDT_SIGNATURE,
   15.26 -				sizeof (ACPI_TABLE_HEADER), // udpated later
   15.27 -				ACPI_2_0_RSDT_REVISION,
   15.28 -				0x0, 				  //Checksum, updated later
   15.29 -				ACPI_OEM_ID, 
   15.30 -				ACPI_OEM_TABLE_ID,
   15.31 -				ACPI_OEM_REVISION,
   15.32 -				ACPI_CREATOR_ID,
   15.33 -				ACPI_CREATOR_REVISION,
   15.34 -		},
   15.35 -		{0x0, 0x0}
   15.36 -};
   15.37 -
   15.38 -ACPI_2_0_XSDT Xsdt={
   15.39 -		{
   15.40 -				ACPI_2_0_XSDT_SIGNATURE,
   15.41 -				sizeof (ACPI_TABLE_HEADER),  //update later
   15.42 -				ACPI_2_0_XSDT_REVISION,
   15.43 -				0x0, 				  //Checksum, update later
   15.44 -				ACPI_OEM_ID, 
   15.45 -				ACPI_OEM_TABLE_ID,
   15.46 -				ACPI_OEM_REVISION,
   15.47 -				ACPI_CREATOR_ID,
   15.48 -				ACPI_CREATOR_REVISION,
   15.49 -		},
   15.50 -		{0x0, 0x0},
   15.51 -};
   15.52 -
   15.53 -
   15.54 -ACPI_2_0_RSDP Rsdp={
   15.55 -		ACPI_2_0_RSDP_SIGNATURE,
   15.56 -		0x00, // Checksum, updated in later
   15.57 -		ACPI_OEM_ID,  // OEM ID,
   15.58 -		ACPI_OEM_REVISION, 
   15.59 -		0x0, // RSDT address, updated later
   15.60 -		sizeof (ACPI_2_0_RSDP),
   15.61 -		0x0, // XSDT address, updated later
   15.62 -		0x0, // Extended Checksum, update later
   15.63 -		{
   15.64 -				0x0, // Reserved
   15.65 -				0x0, // Reserved
   15.66 -				0x0, // Reserved
   15.67 -		}
   15.68 -};
   15.69 -
   15.70 -
   15.71 -
    16.1 --- a/tools/firmware/hvmloader/Makefile	Tue Oct 31 11:44:47 2006 +0000
    16.2 +++ b/tools/firmware/hvmloader/Makefile	Tue Oct 31 12:42:50 2006 +0000
    16.3 @@ -40,27 +40,30 @@ OBJCOPY  = objcopy
    16.4  CFLAGS  += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float
    16.5  LDFLAGS  = -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
    16.6  
    16.7 -SRCS = hvmloader.c acpi_madt.c mp_tables.c util.c smbios.c
    16.8 +SRCS = hvmloader.c acpi_madt.c mp_tables.c util.c smbios.c acpi_utils.c
    16.9  OBJS = $(patsubst %.c,%.o,$(SRCS))
   16.10  
   16.11  .PHONY: all
   16.12  all: hvmloader
   16.13  
   16.14 +acpi/acpi.bin:
   16.15 +	$(MAKE) -C acpi
   16.16 +
   16.17  hvmloader: roms.h $(SRCS)
   16.18  	$(CC) $(CFLAGS) -c $(SRCS)
   16.19  	$(CC) $(CFLAGS) $(LDFLAGS) -o hvmloader.tmp $(OBJS)
   16.20  	$(OBJCOPY) hvmloader.tmp hvmloader
   16.21  	rm -f hvmloader.tmp
   16.22  
   16.23 -roms.h:	../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin ../acpi/acpi.bin
   16.24 +roms.h:	../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../vmxassist/vmxassist.bin acpi/acpi.bin
   16.25  	sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
   16.26  	sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
   16.27  	sh ./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
   16.28  	sh ./mkhex vmxassist ../vmxassist/vmxassist.bin >> roms.h
   16.29 -	sh ./mkhex acpi ../acpi/acpi.bin >> roms.h
   16.30 +	sh ./mkhex acpi acpi/acpi.bin >> roms.h
   16.31  
   16.32  .PHONY: clean
   16.33  clean:
   16.34  	rm -f roms.h acpi.h
   16.35  	rm -f hvmloader hvmloader.tmp hvmloader.o $(OBJS)
   16.36 -
   16.37 +	$(MAKE) -C acpi clean
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/firmware/hvmloader/acpi/Makefile	Tue Oct 31 12:42:50 2006 +0000
    17.3 @@ -0,0 +1,63 @@
    17.4 +#
    17.5 +# Copyright (c) 2004, Intel Corporation.
    17.6 +#
    17.7 +# This program is free software; you can redistribute it and/or modify it
    17.8 +# under the terms and conditions of the GNU General Public License,
    17.9 +# version 2, as published by the Free Software Foundation.
   17.10 +#
   17.11 +# This program is distributed in the hope it will be useful, but WITHOUT
   17.12 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   17.13 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   17.14 +# more details.
   17.15 +#
   17.16 +# You should have received a copy of the GNU General Public License along with
   17.17 +# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   17.18 +# Place - Suite 330, Boston, MA 02111-1307 USA.
   17.19 +#
   17.20 +
   17.21 +XEN_ROOT = ../../../..
   17.22 +include $(XEN_ROOT)/tools/Rules.mk
   17.23 +
   17.24 +HOSTCFLAGS += -I. -I.. -I$(XEN_ROOT)/tools/libxc
   17.25 +
   17.26 +C_SRC = build.c dsdt.c gen.c static_tables.c
   17.27 +H_SRC = $(wildcard *.h)
   17.28 +ACPI_GEN = acpigen
   17.29 +ACPI_BIN = acpi.bin
   17.30 +
   17.31 +IASL_VER = acpica-unix-20050513
   17.32 +IASL_URL = http://developer.intel.com/technology/iapc/acpi/downloads/$(IASL_VER).tar.gz
   17.33 +
   17.34 +vpath iasl $(PATH)
   17.35 +all:$(ACPI_BIN)
   17.36 +
   17.37 +dsdt.c: dsdt.asl
   17.38 +	$(MAKE) iasl
   17.39 +	iasl -tc dsdt.asl
   17.40 +	mv dsdt.hex dsdt.c
   17.41 +	echo "int DsdtLen=sizeof(AmlCode);" >> dsdt.c
   17.42 +	rm *.aml
   17.43 +
   17.44 +iasl:
   17.45 +	@echo
   17.46 +	@echo "ACPI ASL compiler(iasl) is needed"
   17.47 +	@echo "Download Intel ACPI CA"
   17.48 +	@echo "If wget failed, please download and compile manually from"
   17.49 +	@echo "http://developer.intel.com/technology/iapc/acpi/downloads.htm"
   17.50 +	@echo 
   17.51 +	wget $(IASL_URL)
   17.52 +	tar xzf $(IASL_VER).tar.gz
   17.53 +	make -C $(IASL_VER)/compiler
   17.54 +	$(INSTALL_PROG) $(IASL_VER)/compiler/iasl /usr/bin/iasl
   17.55 +
   17.56 +$(ACPI_GEN): $(C_SRC) $(H_SRC)
   17.57 +	$(HOSTCC) -o $(ACPI_GEN) $(HOSTCFLAGS) $(C_SRC)
   17.58 +
   17.59 +$(ACPI_BIN): $(ACPI_GEN)
   17.60 +	./$(ACPI_GEN) $(ACPI_BIN)
   17.61 +
   17.62 +clean:
   17.63 +	rm -rf *.o $(ACPI_GEN) $(ACPI_BIN) $(IASL_VER) 
   17.64 +	rm -rf  $(IASL_VER).tar.gz
   17.65 +
   17.66 +install: all
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/firmware/hvmloader/acpi/README	Tue Oct 31 12:42:50 2006 +0000
    18.3 @@ -0,0 +1,24 @@
    18.4 +ACPI Table for domain firmware
    18.5 +
    18.6 +
    18.7 +INSTALL
    18.8 +-----------------
    18.9 +Simply make is OK.
   18.10 +# make 
   18.11 +
   18.12 +
   18.13 +Note on DSDT Table
   18.14 +------------------
   18.15 +DSDT table source code is acpi_dsdt.asl
   18.16 +It is already compiled and the output is acpi_dsdt.c
   18.17 +Usually, user is not expected to change the acpi_dsdt.asl.
   18.18 +In case that the acpi_dsdt.asl need to be updated, please 
   18.19 +Follow the instruction:
   18.20 +
   18.21 +# make acpi_dsdt.c
   18.22 +
   18.23 +Note:
   18.24 +DSDT compiler "iasl" is needed. By default, it will be downloaded 
   18.25 +using wget in Makefile. if it failed, please download manually from 
   18.26 +http://developer.intel.com/technology/iapc/acpi/downloads.htm. 
   18.27 +then compile and install iasl
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tools/firmware/hvmloader/acpi/acpi2_0.h	Tue Oct 31 12:42:50 2006 +0000
    19.3 @@ -0,0 +1,324 @@
    19.4 +/*
    19.5 + * Copyright (c) 2004, Intel Corporation.
    19.6 + *
    19.7 + * This program is free software; you can redistribute it and/or modify it
    19.8 + * under the terms and conditions of the GNU General Public License,
    19.9 + * version 2, as published by the Free Software Foundation.
   19.10 + *
   19.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   19.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   19.14 + * more details.
   19.15 + *
   19.16 + * You should have received a copy of the GNU General Public License along with
   19.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   19.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   19.19 + *
   19.20 + */
   19.21 +#ifndef _ACPI_2_0_H_
   19.22 +#define _ACPI_2_0_H_
   19.23 +
   19.24 +typedef unsigned char  uint8_t;
   19.25 +typedef   signed char  int8_t;
   19.26 +typedef unsigned short uint16_t;
   19.27 +typedef   signed short int16_t;
   19.28 +typedef unsigned int   uint32_t;
   19.29 +typedef   signed int   int32_t;
   19.30 +#ifdef __i386__
   19.31 +typedef unsigned long long uint64_t;
   19.32 +typedef   signed long long int64_t;
   19.33 +#else
   19.34 +typedef unsigned long uint64_t;
   19.35 +typedef   signed long int64_t;
   19.36 +#endif
   19.37 +
   19.38 +#include <xen/xen.h>
   19.39 +
   19.40 +#pragma pack (1)
   19.41 +
   19.42 +/*
   19.43 + * Common ACPI header.
   19.44 + */
   19.45 +struct acpi_header {
   19.46 +    uint32_t signature;
   19.47 +    uint32_t length;
   19.48 +    uint8_t  revision;
   19.49 +    uint8_t  checksum;
   19.50 +    uint8_t  oem_id[6];
   19.51 +    uint64_t oem_table_id;
   19.52 +    uint32_t oem_revision;
   19.53 +    uint32_t creator_id;
   19.54 +    uint32_t creator_revision;
   19.55 +};
   19.56 +
   19.57 +#define ACPI_OEM_ID             {'I','N','T','E','L',' '}
   19.58 +#define ACPI_OEM_TABLE_ID       0x544244   /* "TBD" */
   19.59 +#define ACPI_OEM_REVISION       0x00000002
   19.60 +#define ACPI_CREATOR_ID         0x00       /* TBD */
   19.61 +#define ACPI_CREATOR_REVISION   0x00000002
   19.62 +
   19.63 +/*
   19.64 + * ACPI 2.0 Generic Address Space definition.
   19.65 + */
   19.66 +struct acpi_20_generic_address {
   19.67 +    uint8_t  address_space_id;
   19.68 +    uint8_t  register_bit_width;
   19.69 +    uint8_t  register_bit_offset;
   19.70 +    uint8_t  reserved;
   19.71 +    uint64_t address;
   19.72 +};
   19.73 +
   19.74 +/*
   19.75 + * Generic Address Space Address IDs.
   19.76 + */
   19.77 +#define ACPI_SYSTEM_MEMORY 0
   19.78 +#define ACPI_SYSTEM_IO 1
   19.79 +#define ACPI_PCI_CONFIGURATION_SPACE 2
   19.80 +#define ACPI_EMBEDDED_CONTROLLER 3
   19.81 +#define ACPI_SMBUS 4
   19.82 +#define ACPI_FUNCTIONAL_FIXED_HARDWARE 0x7F
   19.83 +
   19.84 +/*
   19.85 + * Root System Description Pointer Structure in ACPI 1.0.
   19.86 + */
   19.87 +struct acpi_10_rsdp {
   19.88 +    uint64_t signature;
   19.89 +    uint8_t  checksum;
   19.90 +    uint8_t  oem_id[6];
   19.91 +    uint8_t  reserved;
   19.92 +    uint32_t rsdt_address;
   19.93 +};
   19.94 +
   19.95 +/*
   19.96 + * Root System Description Pointer Structure.
   19.97 + */
   19.98 +struct acpi_20_rsdp {
   19.99 +    uint64_t signature;
  19.100 +    uint8_t  checksum;
  19.101 +    uint8_t  oem_id[6];
  19.102 +    uint8_t  revision;
  19.103 +    uint32_t rsdt_address;
  19.104 +    uint32_t length;
  19.105 +    uint64_t xsdt_address;
  19.106 +    uint8_t  extended_checksum;
  19.107 +    uint8_t  reserved[3];
  19.108 +};
  19.109 +
  19.110 +/*
  19.111 + * The maximum number of entrys in RSDT or XSDT.
  19.112 + */
  19.113 +#define ACPI_MAX_NUM_TABLES 5
  19.114 +
  19.115 +/*
  19.116 + * Root System Description Table (RSDT).
  19.117 + */
  19.118 +struct acpi_20_rsdt {
  19.119 +    struct acpi_header header;
  19.120 +    uint32_t entry[ACPI_MAX_NUM_TABLES];
  19.121 +};
  19.122 +#define ACPI_2_0_RSDT_REVISION 0x01
  19.123 +
  19.124 +/*
  19.125 + * Extended System Description Table (XSDT).
  19.126 + */
  19.127 +struct acpi_20_xsdt {
  19.128 +    struct acpi_header header;
  19.129 +    uint64_t entry[ACPI_MAX_NUM_TABLES];
  19.130 +};
  19.131 +#define ACPI_2_0_XSDT_REVISION 0x01
  19.132 +
  19.133 +/*
  19.134 + * Fixed ACPI Description Table Structure (FADT).
  19.135 + */
  19.136 +struct acpi_20_fadt {
  19.137 +    struct acpi_header header;
  19.138 +    uint32_t firmware_ctrl;
  19.139 +    uint32_t dsdt;
  19.140 +    uint8_t  reserved0;
  19.141 +    uint8_t  preferred_pm_profile;
  19.142 +    uint16_t sci_int;
  19.143 +    uint32_t smi_cmd;
  19.144 +    uint8_t  acpi_enable;
  19.145 +    uint8_t  acpi_disable;
  19.146 +    uint8_t  s4bios_req;
  19.147 +    uint8_t  pstate_cnt;
  19.148 +    uint32_t pm1a_evt_blk;
  19.149 +    uint32_t pm1b_evt_blk;
  19.150 +    uint32_t pm1a_cnt_blk;
  19.151 +    uint32_t pm1b_cnt_blk;
  19.152 +    uint32_t pm2_cnt_blk;
  19.153 +    uint32_t pm_tmr_blk;
  19.154 +    uint32_t gpe0_blk;
  19.155 +    uint32_t gpe1_blk;
  19.156 +    uint8_t  pm1_evt_len;
  19.157 +    uint8_t  pm1_cnt_len;
  19.158 +    uint8_t  pm2_cnt_len;
  19.159 +    uint8_t  pm_tmr_len;
  19.160 +    uint8_t  gpe0_blk_len;
  19.161 +    uint8_t  gpe1_blk_len;
  19.162 +    uint8_t  gpe1_base;
  19.163 +    uint8_t  cst_cnt;
  19.164 +    uint16_t p_lvl2_lat;
  19.165 +    uint16_t p_lvl3_lat;
  19.166 +    uint16_t flush_size;
  19.167 +    uint16_t flush_stride;
  19.168 +    uint8_t  duty_offset;
  19.169 +    uint8_t  duty_width;
  19.170 +    uint8_t  day_alrm;
  19.171 +    uint8_t  mon_alrm;
  19.172 +    uint8_t  century;
  19.173 +    uint16_t iapc_boot_arch;
  19.174 +    uint8_t  reserved1;
  19.175 +    uint32_t flags;
  19.176 +    struct acpi_20_generic_address reset_reg;
  19.177 +    uint8_t  reset_value;
  19.178 +    uint8_t  reserved2[3];
  19.179 +    uint64_t x_firmware_ctrl;
  19.180 +    uint64_t x_dsdt;
  19.181 +    struct acpi_20_generic_address x_pm1a_evt_blk;
  19.182 +    struct acpi_20_generic_address x_pm1b_evt_blk;
  19.183 +    struct acpi_20_generic_address x_pm1a_cnt_blk;
  19.184 +    struct acpi_20_generic_address x_pm1b_cnt_blk;
  19.185 +    struct acpi_20_generic_address x_pm2_cnt_blk;
  19.186 +    struct acpi_20_generic_address x_pm_tmr_blk;
  19.187 +    struct acpi_20_generic_address x_gpe0_blk;
  19.188 +    struct acpi_20_generic_address x_gpe1_blk;
  19.189 +};
  19.190 +#define ACPI_2_0_FADT_REVISION 0x03
  19.191 +
  19.192 +/*
  19.193 + * FADT Boot Architecture Flags.
  19.194 + */
  19.195 +#define ACPI_LEGACY_DEVICES (1 << 0)
  19.196 +#define ACPI_8042           (1 << 1)
  19.197 +
  19.198 +/*
  19.199 + * FADT Fixed Feature Flags.
  19.200 + */
  19.201 +#define ACPI_WBINVD         (1 << 0)
  19.202 +#define ACPI_WBINVD_FLUSH   (1 << 1)
  19.203 +#define ACPI_PROC_C1        (1 << 2)
  19.204 +#define ACPI_P_LVL2_UP      (1 << 3)
  19.205 +#define ACPI_PWR_BUTTON     (1 << 4)
  19.206 +#define ACPI_SLP_BUTTON     (1 << 5)
  19.207 +#define ACPI_FIX_RTC        (1 << 6)
  19.208 +#define ACPI_RTC_S4         (1 << 7)
  19.209 +#define ACPI_TMR_VAL_EXT    (1 << 8)
  19.210 +#define ACPI_DCK_CAP        (1 << 9)
  19.211 +#define ACPI_RESET_REG_SUP  (1 << 10)
  19.212 +#define ACPI_SEALED_CASE    (1 << 11)
  19.213 +#define ACPI_HEADLESS       (1 << 12)
  19.214 +#define ACPI_CPU_SW_SLP     (1 << 13)
  19.215 +
  19.216 +/*
  19.217 + * Firmware ACPI Control Structure (FACS).
  19.218 + */
  19.219 +struct acpi_20_facs {
  19.220 +    uint32_t signature;
  19.221 +    uint32_t length;
  19.222 +    uint32_t hardware_signature;
  19.223 +    uint32_t firmware_waking_vector;
  19.224 +    uint32_t global_lock;
  19.225 +    uint32_t flags;
  19.226 +    uint64_t x_firmware_waking_vector;
  19.227 +    uint8_t  version;
  19.228 +    uint8_t  reserved[31];
  19.229 +};
  19.230 +
  19.231 +#define ACPI_2_0_FACS_VERSION 0x01
  19.232 +
  19.233 +/*
  19.234 + * Multiple APIC Description Table header definition (MADT).
  19.235 + */
  19.236 +struct acpi_20_madt_header {
  19.237 +    struct acpi_header header;
  19.238 +    uint32_t lapic_addr;
  19.239 +    uint32_t flags;
  19.240 +};
  19.241 +
  19.242 +#define ACPI_2_0_MADT_REVISION 0x01
  19.243 +
  19.244 +/*
  19.245 + * Multiple APIC Flags.
  19.246 + */
  19.247 +#define ACPI_PCAT_COMPAT (1 << 0)
  19.248 +
  19.249 +/*
  19.250 + * Multiple APIC Description Table APIC structure types.
  19.251 + */
  19.252 +#define ACPI_PROCESSOR_LOCAL_APIC           0x00
  19.253 +#define ACPI_IO_APIC                        0x01
  19.254 +#define ACPI_INTERRUPT_SOURCE_OVERRIDE      0x02
  19.255 +#define ACPI_NON_MASKABLE_INTERRUPT_SOURCE  0x03
  19.256 +#define ACPI_LOCAL_APIC_NMI                 0x04
  19.257 +#define ACPI_LOCAL_APIC_ADDRESS_OVERRIDE    0x05
  19.258 +#define ACPI_IO_SAPIC                       0x06
  19.259 +#define ACPI_PROCESSOR_LOCAL_SAPIC          0x07
  19.260 +#define ACPI_PLATFORM_INTERRUPT_SOURCES     0x08
  19.261 +
  19.262 +/*
  19.263 + * APIC Structure Definitions.
  19.264 + */
  19.265 +
  19.266 +/*
  19.267 + * Processor Local APIC Structure Definition.
  19.268 + */
  19.269 +struct acpi_20_madt_lapic {
  19.270 +    uint8_t  type;
  19.271 +    uint8_t  length;
  19.272 +    uint8_t  acpi_processor_id;
  19.273 +    uint8_t  apic_id;
  19.274 +    uint32_t flags;
  19.275 +};
  19.276 +
  19.277 +/*
  19.278 + * Local APIC Flags.  All other bits are reserved and must be 0.
  19.279 + */
  19.280 +#define ACPI_LOCAL_APIC_ENABLED (1 << 0)
  19.281 +
  19.282 +/*
  19.283 + * IO APIC Structure.
  19.284 + */
  19.285 +struct acpi_20_madt_ioapic {
  19.286 +    uint8_t  type;
  19.287 +    uint8_t  length;
  19.288 +    uint8_t  ioapic_id;
  19.289 +    uint8_t  reserved;
  19.290 +    uint32_t ioapic_addr;
  19.291 +    uint32_t gsi_base;
  19.292 +};
  19.293 +
  19.294 +struct acpi_20_madt {
  19.295 +    struct acpi_20_madt_header header;
  19.296 +    struct acpi_20_madt_ioapic io_apic[1];
  19.297 +    struct acpi_20_madt_lapic  lapic[32];
  19.298 +};
  19.299 +
  19.300 +/*
  19.301 + * Table Signatures.
  19.302 + */
  19.303 +#define ACPI_2_0_RSDP_SIGNATURE 0x2052545020445352LL /* "RSD PTR " */
  19.304 +#define ACPI_2_0_FACS_SIGNATURE 0x53434146 /* "FACS" */
  19.305 +#define ACPI_2_0_FADT_SIGNATURE 0x50434146 /* "FADT" */
  19.306 +#define ACPI_2_0_MADT_SIGNATURE 0x43495041 /* "APIC" */
  19.307 +#define ACPI_2_0_RSDT_SIGNATURE 0x54445352 /* "RSDT" */
  19.308 +#define ACPI_2_0_XSDT_SIGNATURE 0x54445358 /* "XSDT" */
  19.309 +
  19.310 +#pragma pack ()
  19.311 +
  19.312 +#define ACPI_PHYSICAL_ADDRESS 0xEA000
  19.313 +#define ACPI_TABLE_SIZE (4*1024)
  19.314 +
  19.315 +void AcpiBuildTable(uint8_t *buf);
  19.316 +
  19.317 +#endif /* _ACPI_2_0_H_ */
  19.318 +
  19.319 +/*
  19.320 + * Local variables:
  19.321 + * mode: C
  19.322 + * c-set-style: "BSD"
  19.323 + * c-basic-offset: 4
  19.324 + * tab-width: 4
  19.325 + * indent-tabs-mode: nil
  19.326 + * End:
  19.327 + */
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tools/firmware/hvmloader/acpi/build.c	Tue Oct 31 12:42:50 2006 +0000
    20.3 @@ -0,0 +1,241 @@
    20.4 +/*
    20.5 + * Copyright (c) 2004, Intel Corporation.
    20.6 + *
    20.7 + * This program is free software; you can redistribute it and/or modify it
    20.8 + * under the terms and conditions of the GNU General Public License,
    20.9 + * version 2, as published by the Free Software Foundation.
   20.10 + *
   20.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   20.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   20.14 + * more details.
   20.15 + *
   20.16 + * You should have received a copy of the GNU General Public License along with
   20.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   20.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   20.19 + *
   20.20 + */
   20.21 +
   20.22 +#include "acpi2_0.h"
   20.23 +
   20.24 +extern struct acpi_20_rsdp Rsdp;
   20.25 +extern struct acpi_20_rsdt Rsdt;
   20.26 +extern struct acpi_20_xsdt Xsdt;
   20.27 +extern struct acpi_20_fadt Fadt;
   20.28 +extern struct acpi_20_madt Madt;
   20.29 +extern struct acpi_20_facs Facs;
   20.30 +extern unsigned char *AmlCode;
   20.31 +extern int DsdtLen;
   20.32 +
   20.33 +
   20.34 +typedef struct _ACPI_TABLE_ALL{
   20.35 +    struct acpi_20_rsdp *Rsdp;
   20.36 +    struct acpi_20_rsdt *Rsdt;
   20.37 +    struct acpi_20_xsdt *Xsdt;
   20.38 +    struct acpi_20_fadt *Fadt;
   20.39 +    struct acpi_20_madt *Madt;
   20.40 +    struct acpi_20_facs *Facs;
   20.41 +    unsigned char *Dsdt;
   20.42 +    uint32_t RsdpOffset;
   20.43 +    uint32_t RsdtOffset;
   20.44 +    uint32_t XsdtOffset;
   20.45 +    uint32_t FadtOffset;
   20.46 +    uint32_t MadtOffset;
   20.47 +    uint32_t FacsOffset;
   20.48 +    uint32_t DsdtOffset;
   20.49 +}ACPI_TABLE_ALL;
   20.50 +
   20.51 +static 
   20.52 +void
   20.53 +MemCopy(void* src, void* dst, int len){
   20.54 +
   20.55 +    uint8_t* src0=src;
   20.56 +    uint8_t* dst0=dst;	
   20.57 +
   20.58 +    while(len--){
   20.59 +        *(dst0++)=*(src0++);
   20.60 +    }
   20.61 +}
   20.62 +
   20.63 +static
   20.64 +void
   20.65 +SetCheckSum(
   20.66 +    void*  Table, 
   20.67 +    uint32_t ChecksumOffset,
   20.68 +    uint32_t Length
   20.69 +    )
   20.70 +/*
   20.71 + * Routine Description:
   20.72 + *      Calculate Checksum and store the result in the checksum 
   20.73 + * 	filed of the table	
   20.74 + *
   20.75 + * INPUT:
   20.76 + * 	Table:          Start pointer of table
   20.77 + * 	ChecksumOffset: Offset of checksum field in the table
   20.78 + * 	Length:         Length of Table
   20.79 + */
   20.80 +{
   20.81 +    uint8_t Sum = 0;  
   20.82 +    uint8_t *Ptr;
   20.83 +
   20.84 +    Ptr=Table;
   20.85 +    Ptr[ChecksumOffset]=0;
   20.86 +    while (Length--) {    
   20.87 +        Sum = (uint8_t)(Sum + (*Ptr++));
   20.88 +    }
   20.89 +	
   20.90 +    Ptr = Table;
   20.91 +    Ptr[ChecksumOffset] = (uint8_t) (0xff - Sum + 1);
   20.92 +}
   20.93 +
   20.94 +//
   20.95 +//  FIELD_OFFSET - returns the byte offset to a field within a structure
   20.96 +//
   20.97 +#define FIELD_OFFSET(TYPE,Field) ((uint32_t)(&(((TYPE *) 0)->Field)))
   20.98 +
   20.99 +static
  20.100 +void
  20.101 +UpdateTable(
  20.102 +    ACPI_TABLE_ALL *table
  20.103 +    )
  20.104 +/*
  20.105 + * Update the ACPI table:
  20.106 + * 		fill in the actuall physical address of RSDT, XSDT, FADT, MADT, FACS
  20.107 + * 		Caculate the checksum
  20.108 + */
  20.109 +{
  20.110 +    // RSDP Update	
  20.111 +    table->Rsdp->rsdt_address = (uint32_t)(ACPI_PHYSICAL_ADDRESS+
  20.112 +                                           table->RsdtOffset);
  20.113 +    table->Rsdp->xsdt_address = (uint64_t)(ACPI_PHYSICAL_ADDRESS+
  20.114 +                                           table->XsdtOffset);
  20.115 +    SetCheckSum(table->Rsdp,
  20.116 +                FIELD_OFFSET(struct acpi_10_rsdp, checksum),
  20.117 +                sizeof(struct acpi_10_rsdp)
  20.118 +        );
  20.119 +    SetCheckSum(table->Rsdp,
  20.120 +                FIELD_OFFSET(struct acpi_20_rsdp,
  20.121 +                             extended_checksum),
  20.122 +                sizeof(struct acpi_20_rsdp)
  20.123 +        );
  20.124 +
  20.125 +	
  20.126 +    //RSDT Update
  20.127 +    table->Rsdt->entry[0] = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
  20.128 +                                       table->FadtOffset);	
  20.129 +    table->Rsdt->entry[1] = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
  20.130 +                                       table->MadtOffset);
  20.131 +    table->Rsdt->header.length = sizeof (struct acpi_header) +
  20.132 +        2*sizeof(uint32_t);
  20.133 +    SetCheckSum(table->Rsdt,
  20.134 +                FIELD_OFFSET(struct acpi_header, checksum),
  20.135 +                table->Rsdt->header.length
  20.136 +        );	
  20.137 +
  20.138 +    //XSDT	Update
  20.139 +    table->Xsdt->entry[0] = (uint64_t)(ACPI_PHYSICAL_ADDRESS +
  20.140 +                                       table->FadtOffset);
  20.141 +    table->Xsdt->entry[1] = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
  20.142 +                                       table->MadtOffset);	
  20.143 +    table->Xsdt->header.length = sizeof (struct acpi_header) + 
  20.144 +        2*sizeof(uint64_t);
  20.145 +    SetCheckSum(table->Xsdt,
  20.146 +                FIELD_OFFSET(struct acpi_header, checksum),
  20.147 +                table->Xsdt->header.length
  20.148 +        );
  20.149 +
  20.150 +    // FADT Update
  20.151 +    table->Fadt->dsdt = (uint32_t)(ACPI_PHYSICAL_ADDRESS + 
  20.152 +                                   table->DsdtOffset);	
  20.153 +    table->Fadt->x_dsdt = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
  20.154 +                                     table->DsdtOffset);
  20.155 +    table->Fadt->firmware_ctrl = (uint32_t)(ACPI_PHYSICAL_ADDRESS +
  20.156 +                                            table->FacsOffset);
  20.157 +    table->Fadt->x_firmware_ctrl = (uint64_t)(ACPI_PHYSICAL_ADDRESS + 
  20.158 +                                              table->FacsOffset);	
  20.159 +    SetCheckSum(table->Fadt,
  20.160 +                FIELD_OFFSET(struct acpi_header, checksum),
  20.161 +                sizeof(struct acpi_20_fadt)
  20.162 +        );
  20.163 +	
  20.164 +    // MADT update
  20.165 +    SetCheckSum(table->Madt,
  20.166 +                FIELD_OFFSET(struct acpi_header, checksum),
  20.167 +                sizeof(struct acpi_20_madt)
  20.168 +        );
  20.169 +}
  20.170 +
  20.171 +void
  20.172 +AcpiBuildTable(uint8_t* buf)
  20.173 +/*
  20.174 + * Copy all the ACPI table to buffer
  20.175 + * Buffer Layout:
  20.176 + * 		FACS
  20.177 + * 		RSDP
  20.178 + * 		RSDT
  20.179 + * 		XSDT
  20.180 + * 		FADT
  20.181 + * 		MADT
  20.182 + * 		DSDT 		
  20.183 + *
  20.184 + */		
  20.185 +{
  20.186 +    ACPI_TABLE_ALL table;
  20.187 +    int offset=0;
  20.188 +
  20.189 +    // FACS: should be 64-bit alignment 	
  20.190 +    // so it is put at the start of buffer
  20.191 +    // as the buffer is 64 bit alignment
  20.192 +    table.FacsOffset = offset;
  20.193 +    table.Facs = (struct acpi_20_facs *)(&buf[offset]);
  20.194 +    MemCopy(&Facs, table.Facs, sizeof(struct acpi_20_facs));
  20.195 +    offset += sizeof(struct acpi_20_facs);
  20.196 +
  20.197 +    // RSDP
  20.198 +    table.RsdpOffset = offset;
  20.199 +    table.Rsdp = (struct acpi_20_rsdp *)(&buf[offset]);
  20.200 +    MemCopy(&Rsdp, table.Rsdp, sizeof(struct acpi_20_rsdp));
  20.201 +    offset += sizeof(struct acpi_20_rsdp);
  20.202 +
  20.203 +    // RSDT
  20.204 +    table.RsdtOffset = offset;
  20.205 +    table.Rsdt = (struct acpi_20_rsdt *)(&buf[offset]);
  20.206 +    MemCopy(&Rsdt, table.Rsdt, sizeof(struct acpi_20_rsdt));
  20.207 +    offset += sizeof(struct acpi_20_rsdt);
  20.208 +	
  20.209 +    // XSDT
  20.210 +    table.XsdtOffset = offset;
  20.211 +    table.Xsdt = (struct acpi_20_xsdt *)(&buf[offset]);
  20.212 +    MemCopy(&Xsdt, table.Xsdt, sizeof(struct acpi_20_xsdt));
  20.213 +    offset += sizeof(struct acpi_20_xsdt);
  20.214 +	
  20.215 +    // FADT
  20.216 +    table.FadtOffset = offset;
  20.217 +    table.Fadt = (struct acpi_20_fadt *)(&buf[offset]);
  20.218 +    MemCopy(&Fadt, table.Fadt, sizeof(struct acpi_20_fadt));
  20.219 +    offset += sizeof(struct acpi_20_fadt);
  20.220 +	
  20.221 +    // MADT
  20.222 +    table.MadtOffset = offset;
  20.223 +    table.Madt = (struct acpi_20_madt*)(&buf[offset]);
  20.224 +    MemCopy(&Madt, table.Madt, sizeof(struct acpi_20_madt));
  20.225 +    offset += sizeof(struct acpi_20_madt);
  20.226 +
  20.227 +    // DSDT
  20.228 +    table.DsdtOffset = offset;
  20.229 +    table.Dsdt = (unsigned char *)(&buf[offset]);
  20.230 +    MemCopy(&AmlCode, table.Dsdt, DsdtLen);
  20.231 +    offset += DsdtLen; 
  20.232 +	
  20.233 +    UpdateTable(&table);
  20.234 +}
  20.235 +
  20.236 +/*
  20.237 + * Local variables:
  20.238 + * mode: C
  20.239 + * c-set-style: "BSD"
  20.240 + * c-basic-offset: 4
  20.241 + * tab-width: 4
  20.242 + * indent-tabs-mode: nil
  20.243 + * End:
  20.244 + */
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Tue Oct 31 12:42:50 2006 +0000
    21.3 @@ -0,0 +1,521 @@
    21.4 +//**********************************************************************//
    21.5 +//*
    21.6 +//* Copyright (c) 2004, Intel Corporation.
    21.7 +//*
    21.8 +//* This program is free software; you can redistribute it and/or modify it
    21.9 +//* under the terms and conditions of the GNU General Public License,
   21.10 +//* version 2, as published by the Free Software Foundation.
   21.11 +//*
   21.12 +//* This program is distributed in the hope it will be useful, but WITHOUT
   21.13 +//* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   21.14 +//* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   21.15 +//* more details.
   21.16 +//*
   21.17 +//* You should have received a copy of the GNU General Public License along with
   21.18 +//* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   21.19 +//* Place - Suite 330, Boston, MA 02111-1307 USA.
   21.20 +
   21.21 +//**
   21.22 +//**  DSDT for Xen with Qemu device model
   21.23 +//**
   21.24 +//**
   21.25 +
   21.26 +DefinitionBlock ("DSDT.aml", "DSDT", 1, "INTEL","int-xen", 2006)
   21.27 +{
   21.28 +    Name (\PMBS, 0x0C00)
   21.29 +    Name (\PMLN, 0x08)
   21.30 +    Name (\IOB1, 0x00)
   21.31 +    Name (\IOL1, 0x00)
   21.32 +    Name (\APCB, 0xFEC00000)
   21.33 +    Name (\APCL, 0x00010000)
   21.34 +    Name (\PUID, 0x00)
   21.35 +
   21.36 +    Scope (\_PR)
   21.37 +    {
   21.38 +        Processor (CPU0, 0x00, 0x00000000, 0x00) {}
   21.39 +        Processor (CPU1, 0x01, 0x00000000, 0x00) {}
   21.40 +        Processor (CPU2, 0x02, 0x00000000, 0x00) {}
   21.41 +        Processor (CPU3, 0x03, 0x00000000, 0x00) {}
   21.42 +
   21.43 +    }
   21.44 +
   21.45 +/* Poweroff support - ties in with qemu emulation */
   21.46 +
   21.47 +    Name (\_S5, Package (0x04)
   21.48 +    {
   21.49 +        0x07,
   21.50 +        0x07,
   21.51 +        0x00,
   21.52 +        0x00
   21.53 +    })
   21.54 +
   21.55 +
   21.56 +    Name(PICD, 0)
   21.57 +
   21.58 +    Method(_PIC, 1) { 
   21.59 + 
   21.60 +    Store(Arg0, PICD) 
   21.61 +    }
   21.62 +    Scope (\_SB)
   21.63 +    {
   21.64 +       /* Fix HCT test for 0x400 pci memory - need to report low 640 MB mem as motherboard resource            */
   21.65 +
   21.66 +       Device(MEM0) {
   21.67 +           Name(_HID, EISAID("PNP0C02"))
   21.68 +           Name(_CRS, ResourceTemplate() {
   21.69 +           QWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
   21.70 +                    0x00000000,
   21.71 +                    0x00000000,
   21.72 +                    0x0009ffff,
   21.73 +                    0x00000000,
   21.74 +                    0x000a0000)
   21.75 +           }
   21.76 +           )
   21.77 +       }
   21.78 +
   21.79 +       Device (PCI0)
   21.80 +        {
   21.81 +           Name (_HID, EisaId ("PNP0A03"))
   21.82 +           Name (_UID, 0x00)
   21.83 +           Name (_ADR, 0x00)
   21.84 +           Name (_BBN, 0x00)
   21.85 +           OperationRegion (PIRP, PCI_Config, 0x3c, 0x10)
   21.86 +           Field(PIRP, ByteAcc, NoLock, Preserve){        
   21.87 +          IRQ3,3,
   21.88 +          IRQ5,5,
   21.89 +          IRQ7,7,
   21.90 +          IRQ9,9,
   21.91 +          IRQA,10,
   21.92 +          IRQB,11
   21.93 +         }
   21.94 + 
   21.95 +            Method (_CRS, 0, NotSerialized)
   21.96 +            {
   21.97 +          
   21.98 +               Name (PRT0, ResourceTemplate ()
   21.99 +                {
  21.100 +         /* bus number is from 0 - 255*/
  21.101 +                    WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
  21.102 +                        0x0000,
  21.103 +                        0x0000,
  21.104 +                        0x00FF,
  21.105 +                        0x0000,
  21.106 +                        0x0100)
  21.107 +                    IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
  21.108 +                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
  21.109 +                        0x0000,
  21.110 +                        0x0000,
  21.111 +                        0x0CF7,
  21.112 +                        0x0000,
  21.113 +                        0x0CF8)
  21.114 +                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
  21.115 +                        0x0000,
  21.116 +                        0x0D00,
  21.117 +                        0xFFFF,
  21.118 +                        0x0000,
  21.119 +                        0xF300)
  21.120 +
  21.121 +                /* reserve memory for pci devices */
  21.122 +
  21.123 +                    DWordMemory (ResourceConsumer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
  21.124 +                        0x00000000,
  21.125 +                        0xF0000000,
  21.126 +                        0xF4FFFFFF,
  21.127 +                        0x00000000,
  21.128 +                        0x05000000)
  21.129 +
  21.130 +                })
  21.131 +                Return (PRT0)
  21.132 +            }
  21.133 +       Name(BUFA, ResourceTemplate() {
  21.134 +                IRQ(Level, ActiveLow, Shared) {
  21.135 +                        3,4,5,6,7,10,11,12,14,15} 
  21.136 +                }) 
  21.137 +
  21.138 +                Name(BUFB, Buffer(){
  21.139 +                0x23, 0x00, 0x00, 0x18,
  21.140 +                0x79, 0})
  21.141 +
  21.142 +                CreateWordField(BUFB, 0x01, IRQV)
  21.143 +
  21.144 +                Name(BUFC, Buffer(){
  21.145 +                5, 7, 10, 11
  21.146 +                 })
  21.147 +                
  21.148 +                CreateByteField(BUFC, 0x01, PIQA)
  21.149 +                CreateByteField(BUFC, 0x01, PIQB)
  21.150 +                CreateByteField(BUFC, 0x01, PIQC)
  21.151 +                CreateByteField(BUFC, 0x01, PIQD)
  21.152 +                
  21.153 +                Device(LNKA)    {
  21.154 +                Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
  21.155 +                Name(_UID, 1)
  21.156 +                Method(_STA, 0) {
  21.157 +                               And(PIRA, 0x80, Local0)
  21.158 +                        If(LEqual(Local0, 0x80)) {
  21.159 +                                Return(0x09)   
  21.160 +                                }
  21.161 +                        Else {
  21.162 +                                Return(0x0B) 
  21.163 +                                }
  21.164 +                        }
  21.165 +
  21.166 +                Method(_PRS) {
  21.167 +
  21.168 +                        Return(BUFA)
  21.169 +                } // Method(_PRS)
  21.170 +
  21.171 +                Method(_DIS) {
  21.172 +                               Or(PIRA, 0x80, PIRA)
  21.173 +                }
  21.174 +
  21.175 +                Method(_CRS) {
  21.176 +                        And(PIRB, 0x0f, Local0) 
  21.177 +                        ShiftLeft(0x1, Local0, IRQV) 
  21.178 +                        Return(BUFB) 
  21.179 +                } 
  21.180 +
  21.181 +                Method(_SRS, 1) {
  21.182 +                                CreateWordField(ARG0, 0x01, IRQ1) 
  21.183 +                        FindSetRightBit(IRQ1, Local0) 
  21.184 +                        Decrement(Local0) 
  21.185 +                        Store(Local0, PIRA)
  21.186 +                 } // Method(_SRS)
  21.187 +        }
  21.188 +
  21.189 +        Device(LNKB){
  21.190 +                Name(_HID, EISAID("PNP0C0F"))  
  21.191 +                Name(_UID, 2)
  21.192 +                Method(_STA, 0) {
  21.193 +                               And(PIRB, 0x80, Local0)
  21.194 +                        If(LEqual(Local0, 0x80)) {
  21.195 +                                Return(0x09) 
  21.196 +                                }
  21.197 +                        Else {
  21.198 +                                Return(0x0B) 
  21.199 +                                }
  21.200 +                        }
  21.201 +
  21.202 +                Method(_PRS) {
  21.203 +                                Return(BUFA) 
  21.204 +                } // Method(_PRS)
  21.205 +
  21.206 +                Method(_DIS) {
  21.207 +
  21.208 +                               Or(PIRB, 0x80, PIRB)
  21.209 +                }
  21.210 +
  21.211 +                Method(_CRS) {
  21.212 +                        And(PIRB, 0x0f, Local0) 
  21.213 +                        ShiftLeft(0x1, Local0, IRQV) 
  21.214 +                        Return(BUFB) 
  21.215 +                } // Method(_CRS)
  21.216 +
  21.217 +                Method(_SRS, 1) {
  21.218 +                        CreateWordField(ARG0, 0x01, IRQ1) 
  21.219 +                        FindSetRightBit(IRQ1, Local0) 
  21.220 +                        Decrement(Local0)
  21.221 +                        Store(Local0, PIRB) 
  21.222 +                 } // Method(_SRS)
  21.223 +        }
  21.224 +
  21.225 +        Device(LNKC){
  21.226 +                Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
  21.227 +                Name(_UID, 3)
  21.228 +                Method(_STA, 0) {
  21.229 +                        And(PIRC, 0x80, Local0)
  21.230 +                        If(LEqual(Local0, 0x80)) {
  21.231 +                                Return(0x09) 
  21.232 +                        }
  21.233 +                        Else {
  21.234 +                                Return(0x0B)
  21.235 +                        }
  21.236 +                }
  21.237 +
  21.238 +                Method(_PRS) { 
  21.239 +                        Return(BUFA)
  21.240 +                } // Method(_PRS)
  21.241 +
  21.242 +                Method(_DIS) {
  21.243 +
  21.244 +                               Or(PIRC, 0x80, PIRC)
  21.245 +                }
  21.246 +
  21.247 +                Method(_CRS) {
  21.248 +                        And(PIRC, 0x0f, Local0) 
  21.249 +                        ShiftLeft(0x1, Local0, IRQV) 
  21.250 +                        Return(BUFB) 
  21.251 +                } // Method(_CRS)
  21.252 +
  21.253 +                Method(_SRS, 1) {
  21.254 +                                CreateWordField(ARG0, 0x01, IRQ1) 
  21.255 +                        FindSetRightBit(IRQ1, Local0) 
  21.256 +                        Decrement(Local0) 
  21.257 +                        Store(Local0, PIRC)
  21.258 +                 } // Method(_SRS)
  21.259 +        }
  21.260 +
  21.261 +        Device(LNKD) {
  21.262 +                Name(_HID, EISAID("PNP0C0F"))  
  21.263 +                Name(_UID, 4)
  21.264 +                Method(_STA, 0) {
  21.265 +                               And(PIRD, 0x80, Local0)
  21.266 +                        If(LEqual(Local0, 0x80)) {
  21.267 +                                Return(0x09) 
  21.268 +                        }
  21.269 +                        Else {
  21.270 +                                Return(0x0B) 
  21.271 +                        }
  21.272 +                }
  21.273 +
  21.274 +                Method(_PRS) { 
  21.275 +                        Return(BUFA) 
  21.276 +                } // Method(_PRS)
  21.277 +
  21.278 +                Method(_DIS) {
  21.279 +                               Or(PIRD, 0x80, PIRD)
  21.280 +                }
  21.281 +
  21.282 +                Method(_CRS) {
  21.283 +                        And(PIRD, 0x0f, Local0) 
  21.284 +                        ShiftLeft(0x1, Local0, IRQV) 
  21.285 +                        Return(BUFB) 
  21.286 +                } // Method(_CRS)
  21.287 +
  21.288 +                Method(_SRS, 1) {
  21.289 +                                CreateWordField(ARG0, 0x01, IRQ1) 
  21.290 +                        FindSetRightBit(IRQ1, Local0) 
  21.291 +                        Decrement(Local0) 
  21.292 +                        Store(Local0, PIRD) 
  21.293 +                 } // Method(_SRS)
  21.294 +        }
  21.295 +        Method(_PRT,0) {
  21.296 +               If(PICD) {Return(PRTA)}  
  21.297 +               Return (PRTP)  
  21.298 +               } // end _PRT
  21.299 +
  21.300 +        Name(PRTP, Package() {
  21.301 +                        // Slot 1, INTA - INTD
  21.302 +                        Package(){0x0000ffff, 0, \_SB.PCI0.LNKA, 0},
  21.303 +                        Package(){0x0000ffff, 1, \_SB.PCI0.LNKB, 0},
  21.304 +                        Package(){0x0000ffff, 2, \_SB.PCI0.LNKC, 0},
  21.305 +                        Package(){0x0000ffff, 3, \_SB.PCI0.LNKD, 0},
  21.306 +
  21.307 +                        // Slot 2, INTA - INTD
  21.308 +                        Package(){0x0001ffff, 0, \_SB.PCI0.LNKB, 0},
  21.309 +                        Package(){0x0001ffff, 1, \_SB.PCI0.LNKC, 0},
  21.310 +                        Package(){0x0001ffff, 2, \_SB.PCI0.LNKD, 0},
  21.311 +                        Package(){0x0001ffff, 3, \_SB.PCI0.LNKA, 0},
  21.312 +                        
  21.313 +                        // Slot 3, INTA - INTD
  21.314 +                        Package(){0x0002ffff, 0, \_SB.PCI0.LNKC, 0},
  21.315 +                        Package(){0x0002ffff, 1, \_SB.PCI0.LNKD, 0},
  21.316 +                        Package(){0x0002ffff, 2, \_SB.PCI0.LNKA, 0},
  21.317 +                        Package(){0x0002ffff, 3, \_SB.PCI0.LNKB, 0},
  21.318 +                        
  21.319 +                        // Slot 4, INTA - INTD
  21.320 +                        Package(){0x0003ffff, 0, \_SB.PCI0.LNKD, 0},
  21.321 +                        Package(){0x0003ffff, 1, \_SB.PCI0.LNKA, 0},
  21.322 +                        Package(){0x0003ffff, 2, \_SB.PCI0.LNKB, 0},
  21.323 +                        Package(){0x0003ffff, 3, \_SB.PCI0.LNKC, 0},
  21.324 +                        
  21.325 +                        // Slot 5, INTA - INTD
  21.326 +                        Package(){0x0004ffff, 0, \_SB.PCI0.LNKA, 0},
  21.327 +                        Package(){0x0004ffff, 1, \_SB.PCI0.LNKB, 0},
  21.328 +                        Package(){0x0004ffff, 2, \_SB.PCI0.LNKC, 0},
  21.329 +                        Package(){0x0004ffff, 3, \_SB.PCI0.LNKD, 0},
  21.330 +                        }
  21.331 +            )
  21.332 +        Name(PRTA, Package(){
  21.333 +                        Package(){0x0001ffff, 0, 0, 5},  // Device 1, INTA
  21.334 +                        Package(){0x0002ffff, 0, 0, 7},  // Device 2, INTA
  21.335 +                        Package(){0x0003ffff, 0, 0, 10}, // Device 3, INTA
  21.336 +                        Package(){0x0004ffff, 0, 0, 11}, // Device 4, INTA
  21.337 +                        }
  21.338 +            )
  21.339 +            
  21.340 +            Device (ISA)
  21.341 +            {
  21.342 +                Name (_ADR, 0x00000000) /* device id, PCI bus num, ... */
  21.343 + 
  21.344 +            OperationRegion(PIRQ, PCI_Config, 0x60, 0x4)
  21.345 +                        Scope(\) {
  21.346 +                                 Field (\_SB.PCI0.ISA.PIRQ, ByteAcc, NoLock, Preserve) {
  21.347 +                                        PIRA, 8,
  21.348 +                                        PIRB, 8,
  21.349 +                                        PIRC, 8,
  21.350 +                                        PIRD, 8
  21.351 +                                        }
  21.352 +                                 }
  21.353 +                Device (SYSR)
  21.354 +                {
  21.355 +                    Name (_HID, EisaId ("PNP0C02"))
  21.356 +                    Name (_UID, 0x01)
  21.357 +                    Name (CRS, ResourceTemplate ()
  21.358 +                    {
  21.359 +               /* TODO: list hidden resources */
  21.360 +                        IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
  21.361 +                        IO (Decode16, 0x0022, 0x0022, 0x00, 0x0C)
  21.362 +                        IO (Decode16, 0x0030, 0x0030, 0x00, 0x10)
  21.363 +                        IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
  21.364 +                        IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
  21.365 +                        IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
  21.366 +                        IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
  21.367 +                        IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
  21.368 +                        IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
  21.369 +                        IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
  21.370 +                        IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
  21.371 +                        IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
  21.372 +                        IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1C)
  21.373 +                        IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
  21.374 +                        IO (Decode16, 0x08A0, 0x08A0, 0x00, 0x04)
  21.375 +                        IO (Decode16, 0x0CC0, 0x0CC0, 0x00, 0x10)
  21.376 +                        IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
  21.377 +                    })
  21.378 +                    Method (_CRS, 0, NotSerialized)
  21.379 +                    {
  21.380 +                        Return (CRS)
  21.381 +                    }
  21.382 +                }
  21.383 +
  21.384 +                Device (PIC)
  21.385 +                {
  21.386 +                    Name (_HID, EisaId ("PNP0000"))
  21.387 +                    Name (_CRS, ResourceTemplate ()
  21.388 +                    {
  21.389 +                        IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
  21.390 +                        IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
  21.391 +                        IRQNoFlags () {2}
  21.392 +                    })
  21.393 +                }
  21.394 +
  21.395 +                Device (DMA0)
  21.396 +                {
  21.397 +                    Name (_HID, EisaId ("PNP0200"))
  21.398 +                    Name (_CRS, ResourceTemplate ()
  21.399 +                    {
  21.400 +                        DMA (Compatibility, BusMaster, Transfer8) {4}
  21.401 +                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
  21.402 +                        IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
  21.403 +                        IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
  21.404 +                        IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
  21.405 +                        IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
  21.406 +                        IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
  21.407 +                        IO (Decode16, 0x0480, 0x0480, 0x00, 0x10)
  21.408 +                    })
  21.409 +                }
  21.410 +
  21.411 +                Device (TMR)
  21.412 +                {
  21.413 +                    Name (_HID, EisaId ("PNP0100"))
  21.414 +                    Name (_CRS, ResourceTemplate ()
  21.415 +                    {
  21.416 +                        IO (Decode16, 0x0040, 0x0040, 0x00, 0x04)
  21.417 +                        IRQNoFlags () {0}
  21.418 +                    })
  21.419 +                }
  21.420 +
  21.421 +                Device (RTC)
  21.422 +                {
  21.423 +                    Name (_HID, EisaId ("PNP0B00"))
  21.424 +                    Name (_CRS, ResourceTemplate ()
  21.425 +                    {
  21.426 +                        IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
  21.427 +                        IRQNoFlags () {8}
  21.428 +                    })
  21.429 +                }
  21.430 +
  21.431 +                Device (SPKR)
  21.432 +                {
  21.433 +                    Name (_HID, EisaId ("PNP0800"))
  21.434 +                    Name (_CRS, ResourceTemplate ()
  21.435 +                    {
  21.436 +                        IO (Decode16, 0x0061, 0x0061, 0x00, 0x01)
  21.437 +                    })
  21.438 +                }
  21.439 +
  21.440 +                Device (PS2M)
  21.441 +                {
  21.442 +                    Name (_HID, EisaId ("PNP0F13"))
  21.443 +                    Name (_CID, 0x130FD041)
  21.444 +                    Method (_STA, 0, NotSerialized)
  21.445 +                    {
  21.446 +                        Return (0x0F)
  21.447 +                    }
  21.448 +
  21.449 +                    Name (_CRS, ResourceTemplate ()
  21.450 +                    {
  21.451 +                        IRQNoFlags () {12}
  21.452 +                    })
  21.453 +                }
  21.454 +
  21.455 +                Device (PS2K)
  21.456 +                {
  21.457 +                    Name (_HID, EisaId ("PNP0303"))
  21.458 +                    Name (_CID, 0x0B03D041)
  21.459 +                    Method (_STA, 0, NotSerialized)
  21.460 +                    {
  21.461 +                        Return (0x0F)
  21.462 +                    }
  21.463 +
  21.464 +                    Name (_CRS, ResourceTemplate ()
  21.465 +                    {
  21.466 +                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
  21.467 +                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
  21.468 +                        IRQNoFlags () {1}
  21.469 +                    })
  21.470 +                }
  21.471 +
  21.472 +                Device (FDC0)
  21.473 +                {
  21.474 +                    Name (_HID, EisaId ("PNP0700"))
  21.475 +                    Method (_STA, 0, NotSerialized)
  21.476 +                    {
  21.477 +                          Return (0x0F)
  21.478 +                    }
  21.479 +
  21.480 +                    Name (_CRS, ResourceTemplate ()
  21.481 +                    {
  21.482 +                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
  21.483 +                        IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
  21.484 +                        IRQNoFlags () {6}
  21.485 +                        DMA (Compatibility, NotBusMaster, Transfer8) {2}
  21.486 +                    })
  21.487 +                }
  21.488 +
  21.489 +                Device (UAR1)
  21.490 +                {
  21.491 +                    Name (_HID, EisaId ("PNP0501"))
  21.492 +                    Name (_UID, 0x01)
  21.493 +                    Method (_STA, 0, NotSerialized)
  21.494 +                    {
  21.495 +                        Return (0x0F)
  21.496 +                    }
  21.497 +
  21.498 +                    Name (_CRS, ResourceTemplate()
  21.499 +                    {
  21.500 +                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
  21.501 +                        IRQNoFlags () {4}
  21.502 +                    })
  21.503 +                }
  21.504 +
  21.505 +                Device (LTP1)
  21.506 +                {
  21.507 +                    Name (_HID, EisaId ("PNP0400"))
  21.508 +                    Name (_UID, 0x02)
  21.509 +                    Method (_STA, 0, NotSerialized)
  21.510 +                    {
  21.511 +                        Return (0x0F)
  21.512 +                    }
  21.513 +
  21.514 +                    Name (_CRS, ResourceTemplate()
  21.515 +                    {
  21.516 +                        IO (Decode16, 0x0378, 0x0378, 0x08, 0x08)
  21.517 +                        IRQNoFlags () {7}
  21.518 +                    })
  21.519 +                } 
  21.520 +            }
  21.521 +        }
  21.522 +    }
  21.523 +}
  21.524 +
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.c	Tue Oct 31 12:42:50 2006 +0000
    22.3 @@ -0,0 +1,300 @@
    22.4 +/*
    22.5 + * 
    22.6 + * Intel ACPI Component Architecture
    22.7 + * ASL Optimizing Compiler / AML Disassembler version 20050513 [Oct 12 2006]
    22.8 + * Copyright (C) 2000 - 2005 Intel Corporation
    22.9 + * Supports ACPI Specification Revision 3.0
   22.10 + * 
   22.11 + * Compilation of "acpi_dsdt.asl" - Thu Oct 12 14:08:49 2006
   22.12 + * 
   22.13 + * C source code output
   22.14 + *
   22.15 + */
   22.16 +unsigned char AmlCode[] = 
   22.17 +{
   22.18 +    0x44,0x53,0x44,0x54,0xDA,0x08,0x00,0x00,  /* 00000000    "DSDT...." */
   22.19 +    0x01,0x26,0x49,0x4E,0x54,0x45,0x4C,0x00,  /* 00000008    ".&INTEL." */
   22.20 +    0x69,0x6E,0x74,0x2D,0x78,0x65,0x6E,0x00,  /* 00000010    "int-xen." */
   22.21 +    0xD6,0x07,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
   22.22 +    0x13,0x05,0x05,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
   22.23 +    0x53,0x0B,0x00,0x0C,0x08,0x50,0x4D,0x4C,  /* 00000028    "S....PML" */
   22.24 +    0x4E,0x0A,0x08,0x08,0x49,0x4F,0x42,0x31,  /* 00000030    "N...IOB1" */
   22.25 +    0x00,0x08,0x49,0x4F,0x4C,0x31,0x00,0x08,  /* 00000038    "..IOL1.." */
   22.26 +    0x41,0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,  /* 00000040    "APCB...." */
   22.27 +    0xFE,0x08,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000048    "..APCL.." */
   22.28 +    0x00,0x01,0x00,0x08,0x50,0x55,0x49,0x44,  /* 00000050    "....PUID" */
   22.29 +    0x00,0x10,0x39,0x5F,0x50,0x52,0x5F,0x5B,  /* 00000058    "..9_PR_[" */
   22.30 +    0x83,0x0B,0x43,0x50,0x55,0x30,0x00,0x00,  /* 00000060    "..CPU0.." */
   22.31 +    0x00,0x00,0x00,0x00,0x5B,0x83,0x0B,0x43,  /* 00000068    "....[..C" */
   22.32 +    0x50,0x55,0x31,0x01,0x00,0x00,0x00,0x00,  /* 00000070    "PU1....." */
   22.33 +    0x00,0x5B,0x83,0x0B,0x43,0x50,0x55,0x32,  /* 00000078    ".[..CPU2" */
   22.34 +    0x02,0x00,0x00,0x00,0x00,0x00,0x5B,0x83,  /* 00000080    "......[." */
   22.35 +    0x0B,0x43,0x50,0x55,0x33,0x03,0x00,0x00,  /* 00000088    ".CPU3..." */
   22.36 +    0x00,0x00,0x00,0x08,0x5F,0x53,0x35,0x5F,  /* 00000090    "...._S5_" */
   22.37 +    0x12,0x08,0x04,0x0A,0x07,0x0A,0x07,0x00,  /* 00000098    "........" */
   22.38 +    0x00,0x08,0x50,0x49,0x43,0x44,0x00,0x14,  /* 000000A0    "..PICD.." */
   22.39 +    0x0C,0x5F,0x50,0x49,0x43,0x01,0x70,0x68,  /* 000000A8    "._PIC.ph" */
   22.40 +    0x50,0x49,0x43,0x44,0x10,0x45,0x82,0x5F,  /* 000000B0    "PICD.E._" */
   22.41 +    0x53,0x42,0x5F,0x5B,0x82,0x49,0x04,0x4D,  /* 000000B8    "SB_[.I.M" */
   22.42 +    0x45,0x4D,0x30,0x08,0x5F,0x48,0x49,0x44,  /* 000000C0    "EM0._HID" */
   22.43 +    0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x43,  /* 000000C8    ".A...._C" */
   22.44 +    0x52,0x53,0x11,0x33,0x0A,0x30,0x8A,0x2B,  /* 000000D0    "RS.3.0.+" */
   22.45 +    0x00,0x00,0x0D,0x03,0x00,0x00,0x00,0x00,  /* 000000D8    "........" */
   22.46 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
   22.47 +    0x00,0x00,0x00,0x00,0xFF,0xFF,0x09,0x00,  /* 000000E8    "........" */
   22.48 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
   22.49 +    0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,  /* 000000F8    "........" */
   22.50 +    0x00,0x00,0x00,0x00,0x79,0x00,0x5B,0x82,  /* 00000100    "....y.[." */
   22.51 +    0x42,0x7D,0x50,0x43,0x49,0x30,0x08,0x5F,  /* 00000108    "B}PCI0._" */
   22.52 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0A,0x03,  /* 00000110    "HID.A..." */
   22.53 +    0x08,0x5F,0x55,0x49,0x44,0x00,0x08,0x5F,  /* 00000118    "._UID.._" */
   22.54 +    0x41,0x44,0x52,0x00,0x08,0x5F,0x42,0x42,  /* 00000120    "ADR.._BB" */
   22.55 +    0x4E,0x00,0x5B,0x80,0x50,0x49,0x52,0x50,  /* 00000128    "N.[.PIRP" */
   22.56 +    0x02,0x0A,0x3C,0x0A,0x10,0x5B,0x81,0x24,  /* 00000130    "..<..[.$" */
   22.57 +    0x50,0x49,0x52,0x50,0x01,0x49,0x52,0x51,  /* 00000138    "PIRP.IRQ" */
   22.58 +    0x33,0x03,0x49,0x52,0x51,0x35,0x05,0x49,  /* 00000140    "3.IRQ5.I" */
   22.59 +    0x52,0x51,0x37,0x07,0x49,0x52,0x51,0x39,  /* 00000148    "RQ7.IRQ9" */
   22.60 +    0x09,0x49,0x52,0x51,0x41,0x0A,0x49,0x52,  /* 00000150    ".IRQA.IR" */
   22.61 +    0x51,0x42,0x0B,0x14,0x4A,0x06,0x5F,0x43,  /* 00000158    "QB..J._C" */
   22.62 +    0x52,0x53,0x00,0x08,0x50,0x52,0x54,0x30,  /* 00000160    "RS..PRT0" */
   22.63 +    0x11,0x48,0x05,0x0A,0x54,0x88,0x0D,0x00,  /* 00000168    ".H..T..." */
   22.64 +    0x02,0x0F,0x00,0x00,0x00,0x00,0x00,0xFF,  /* 00000170    "........" */
   22.65 +    0x00,0x00,0x00,0x00,0x01,0x47,0x01,0xF8,  /* 00000178    ".....G.." */
   22.66 +    0x0C,0xF8,0x0C,0x01,0x08,0x88,0x0D,0x00,  /* 00000180    "........" */
   22.67 +    0x01,0x0C,0x03,0x00,0x00,0x00,0x00,0xF7,  /* 00000188    "........" */
   22.68 +    0x0C,0x00,0x00,0xF8,0x0C,0x88,0x0D,0x00,  /* 00000190    "........" */
   22.69 +    0x01,0x0C,0x03,0x00,0x00,0x00,0x0D,0xFF,  /* 00000198    "........" */
   22.70 +    0xFF,0x00,0x00,0x00,0xF3,0x87,0x17,0x00,  /* 000001A0    "........" */
   22.71 +    0x00,0x0D,0x03,0x00,0x00,0x00,0x00,0x00,  /* 000001A8    "........" */
   22.72 +    0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xF4,0x00,  /* 000001B0    "........" */
   22.73 +    0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x79,  /* 000001B8    ".......y" */
   22.74 +    0x00,0xA4,0x50,0x52,0x54,0x30,0x08,0x42,  /* 000001C0    "..PRT0.B" */
   22.75 +    0x55,0x46,0x41,0x11,0x09,0x0A,0x06,0x23,  /* 000001C8    "UFA....#" */
   22.76 +    0xF8,0xDC,0x18,0x79,0x00,0x08,0x42,0x55,  /* 000001D0    "...y..BU" */
   22.77 +    0x46,0x42,0x11,0x09,0x0A,0x06,0x23,0x00,  /* 000001D8    "FB....#." */
   22.78 +    0x00,0x18,0x79,0x00,0x8B,0x42,0x55,0x46,  /* 000001E0    "..y..BUF" */
   22.79 +    0x42,0x01,0x49,0x52,0x51,0x56,0x08,0x42,  /* 000001E8    "B.IRQV.B" */
   22.80 +    0x55,0x46,0x43,0x11,0x07,0x0A,0x04,0x05,  /* 000001F0    "UFC....." */
   22.81 +    0x07,0x0A,0x0B,0x8C,0x42,0x55,0x46,0x43,  /* 000001F8    "....BUFC" */
   22.82 +    0x01,0x50,0x49,0x51,0x41,0x8C,0x42,0x55,  /* 00000200    ".PIQA.BU" */
   22.83 +    0x46,0x43,0x01,0x50,0x49,0x51,0x42,0x8C,  /* 00000208    "FC.PIQB." */
   22.84 +    0x42,0x55,0x46,0x43,0x01,0x50,0x49,0x51,  /* 00000210    "BUFC.PIQ" */
   22.85 +    0x43,0x8C,0x42,0x55,0x46,0x43,0x01,0x50,  /* 00000218    "C.BUFC.P" */
   22.86 +    0x49,0x51,0x44,0x5B,0x82,0x48,0x08,0x4C,  /* 00000220    "IQD[.H.L" */
   22.87 +    0x4E,0x4B,0x41,0x08,0x5F,0x48,0x49,0x44,  /* 00000228    "NKA._HID" */
   22.88 +    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 00000230    ".A...._U" */
   22.89 +    0x49,0x44,0x01,0x14,0x1C,0x5F,0x53,0x54,  /* 00000238    "ID..._ST" */
   22.90 +    0x41,0x00,0x7B,0x50,0x49,0x52,0x41,0x0A,  /* 00000240    "A.{PIRA." */
   22.91 +    0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,0x80,  /* 00000248    ".`...`.." */
   22.92 +    0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,0x0B,  /* 00000250    "........" */
   22.93 +    0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,0xA4,  /* 00000258    ".._PRS.." */
   22.94 +    0x42,0x55,0x46,0x41,0x14,0x11,0x5F,0x44,  /* 00000260    "BUFA.._D" */
   22.95 +    0x49,0x53,0x00,0x7D,0x50,0x49,0x52,0x41,  /* 00000268    "IS.}PIRA" */
   22.96 +    0x0A,0x80,0x50,0x49,0x52,0x41,0x14,0x1A,  /* 00000270    "..PIRA.." */
   22.97 +    0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,0x49,  /* 00000278    "_CRS.{PI" */
   22.98 +    0x52,0x42,0x0A,0x0F,0x60,0x79,0x01,0x60,  /* 00000280    "RB..`y.`" */
   22.99 +    0x49,0x52,0x51,0x56,0xA4,0x42,0x55,0x46,  /* 00000288    "IRQV.BUF" */
  22.100 +    0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,  /* 00000290    "B.._SRS." */
  22.101 +    0x8B,0x68,0x01,0x49,0x52,0x51,0x31,0x82,  /* 00000298    ".h.IRQ1." */
  22.102 +    0x49,0x52,0x51,0x31,0x60,0x76,0x60,0x70,  /* 000002A0    "IRQ1`v`p" */
  22.103 +    0x60,0x50,0x49,0x52,0x41,0x5B,0x82,0x49,  /* 000002A8    "`PIRA[.I" */
  22.104 +    0x08,0x4C,0x4E,0x4B,0x42,0x08,0x5F,0x48,  /* 000002B0    ".LNKB._H" */
  22.105 +    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 000002B8    "ID.A...." */
  22.106 +    0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,0x1C,  /* 000002C0    "_UID...." */
  22.107 +    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 000002C8    "_STA.{PI" */
  22.108 +    0x52,0x42,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 000002D0    "RB..`..." */
  22.109 +    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 000002D8    "`......." */
  22.110 +    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 000002E0    "....._PR" */
  22.111 +    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 000002E8    "S..BUFA." */
  22.112 +    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 000002F0    "._DIS.}P" */
  22.113 +    0x49,0x52,0x42,0x0A,0x80,0x50,0x49,0x52,  /* 000002F8    "IRB..PIR" */
  22.114 +    0x42,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 00000300    "B.._CRS." */
  22.115 +    0x7B,0x50,0x49,0x52,0x42,0x0A,0x0F,0x60,  /* 00000308    "{PIRB..`" */
  22.116 +    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 00000310    "y.`IRQV." */
  22.117 +    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 00000318    "BUFB.._S" */
  22.118 +    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 00000320    "RS..h.IR" */
  22.119 +    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 00000328    "Q1.IRQ1`" */
  22.120 +    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x42,  /* 00000330    "v`p`PIRB" */
  22.121 +    0x5B,0x82,0x49,0x08,0x4C,0x4E,0x4B,0x43,  /* 00000338    "[.I.LNKC" */
  22.122 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000340    "._HID.A." */
  22.123 +    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 00000348    "..._UID." */
  22.124 +    0x03,0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,  /* 00000350    "..._STA." */
  22.125 +    0x7B,0x50,0x49,0x52,0x43,0x0A,0x80,0x60,  /* 00000358    "{PIRC..`" */
  22.126 +    0xA0,0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,  /* 00000360    "...`...." */
  22.127 +    0x09,0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,  /* 00000368    "........" */
  22.128 +    0x5F,0x50,0x52,0x53,0x00,0xA4,0x42,0x55,  /* 00000370    "_PRS..BU" */
  22.129 +    0x46,0x41,0x14,0x11,0x5F,0x44,0x49,0x53,  /* 00000378    "FA.._DIS" */
  22.130 +    0x00,0x7D,0x50,0x49,0x52,0x43,0x0A,0x80,  /* 00000380    ".}PIRC.." */
  22.131 +    0x50,0x49,0x52,0x43,0x14,0x1A,0x5F,0x43,  /* 00000388    "PIRC.._C" */
  22.132 +    0x52,0x53,0x00,0x7B,0x50,0x49,0x52,0x43,  /* 00000390    "RS.{PIRC" */
  22.133 +    0x0A,0x0F,0x60,0x79,0x01,0x60,0x49,0x52,  /* 00000398    "..`y.`IR" */
  22.134 +    0x51,0x56,0xA4,0x42,0x55,0x46,0x42,0x14,  /* 000003A0    "QV.BUFB." */
  22.135 +    0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,  /* 000003A8    "._SRS..h" */
  22.136 +    0x01,0x49,0x52,0x51,0x31,0x82,0x49,0x52,  /* 000003B0    ".IRQ1.IR" */
  22.137 +    0x51,0x31,0x60,0x76,0x60,0x70,0x60,0x50,  /* 000003B8    "Q1`v`p`P" */
  22.138 +    0x49,0x52,0x43,0x5B,0x82,0x49,0x08,0x4C,  /* 000003C0    "IRC[.I.L" */
  22.139 +    0x4E,0x4B,0x44,0x08,0x5F,0x48,0x49,0x44,  /* 000003C8    "NKD._HID" */
  22.140 +    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 000003D0    ".A...._U" */
  22.141 +    0x49,0x44,0x0A,0x04,0x14,0x1C,0x5F,0x53,  /* 000003D8    "ID...._S" */
  22.142 +    0x54,0x41,0x00,0x7B,0x50,0x49,0x52,0x44,  /* 000003E0    "TA.{PIRD" */
  22.143 +    0x0A,0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,  /* 000003E8    "..`...`." */
  22.144 +    0x80,0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,  /* 000003F0    "........" */
  22.145 +    0x0B,0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,  /* 000003F8    "..._PRS." */
  22.146 +    0xA4,0x42,0x55,0x46,0x41,0x14,0x11,0x5F,  /* 00000400    ".BUFA.._" */
  22.147 +    0x44,0x49,0x53,0x00,0x7D,0x50,0x49,0x52,  /* 00000408    "DIS.}PIR" */
  22.148 +    0x44,0x0A,0x80,0x50,0x49,0x52,0x44,0x14,  /* 00000410    "D..PIRD." */
  22.149 +    0x1A,0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,  /* 00000418    "._CRS.{P" */
  22.150 +    0x49,0x52,0x44,0x0A,0x0F,0x60,0x79,0x01,  /* 00000420    "IRD..`y." */
  22.151 +    0x60,0x49,0x52,0x51,0x56,0xA4,0x42,0x55,  /* 00000428    "`IRQV.BU" */
  22.152 +    0x46,0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,  /* 00000430    "FB.._SRS" */
  22.153 +    0x01,0x8B,0x68,0x01,0x49,0x52,0x51,0x31,  /* 00000438    "..h.IRQ1" */
  22.154 +    0x82,0x49,0x52,0x51,0x31,0x60,0x76,0x60,  /* 00000440    ".IRQ1`v`" */
  22.155 +    0x70,0x60,0x50,0x49,0x52,0x44,0x14,0x16,  /* 00000448    "p`PIRD.." */
  22.156 +    0x5F,0x50,0x52,0x54,0x00,0xA0,0x0A,0x50,  /* 00000450    "_PRT...P" */
  22.157 +    0x49,0x43,0x44,0xA4,0x50,0x52,0x54,0x41,  /* 00000458    "ICD.PRTA" */
  22.158 +    0xA4,0x50,0x52,0x54,0x50,0x08,0x50,0x52,  /* 00000460    ".PRTP.PR" */
  22.159 +    0x54,0x50,0x12,0x4D,0x11,0x14,0x12,0x0B,  /* 00000468    "TP.M...." */
  22.160 +    0x04,0x0B,0xFF,0xFF,0x00,0x4C,0x4E,0x4B,  /* 00000470    ".....LNK" */
  22.161 +    0x41,0x00,0x12,0x0B,0x04,0x0B,0xFF,0xFF,  /* 00000478    "A......." */
  22.162 +    0x01,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0C,  /* 00000480    ".LNKB..." */
  22.163 +    0x04,0x0B,0xFF,0xFF,0x0A,0x02,0x4C,0x4E,  /* 00000488    "......LN" */
  22.164 +    0x4B,0x43,0x00,0x12,0x0C,0x04,0x0B,0xFF,  /* 00000490    "KC......" */
  22.165 +    0xFF,0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,  /* 00000498    "...LNKD." */
  22.166 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 000004A0    "........" */
  22.167 +    0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 000004A8    ".LNKB..." */
  22.168 +    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x01,0x4C,  /* 000004B0    ".......L" */
  22.169 +    0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,  /* 000004B8    "NKC....." */
  22.170 +    0xFF,0xFF,0x01,0x00,0x0A,0x02,0x4C,0x4E,  /* 000004C0    "......LN" */
  22.171 +    0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000004C8    "KD......" */
  22.172 +    0xFF,0x01,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000004D0    ".....LNK" */
  22.173 +    0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000004D8    "A......." */
  22.174 +    0x02,0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,  /* 000004E0    "...LNKC." */
  22.175 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 000004E8    "........" */
  22.176 +    0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,  /* 000004F0    ".LNKD..." */
  22.177 +    0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x02,  /* 000004F8    "........" */
  22.178 +    0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,  /* 00000500    "LNKA...." */
  22.179 +    0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x03,0x4C,  /* 00000508    ".......L" */
  22.180 +    0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,  /* 00000510    "NKB....." */
  22.181 +    0xFF,0xFF,0x03,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000518    ".....LNK" */
  22.182 +    0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000520    "D......." */
  22.183 +    0x03,0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,  /* 00000528    "...LNKA." */
  22.184 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 00000530    "........" */
  22.185 +    0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 00000538    "..LNKB.." */
  22.186 +    0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,  /* 00000540    "........" */
  22.187 +    0x03,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D,  /* 00000548    ".LNKC..." */
  22.188 +    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x00,0x4C,  /* 00000550    ".......L" */
  22.189 +    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 00000558    "NKA....." */
  22.190 +    0xFF,0xFF,0x04,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000560    ".....LNK" */
  22.191 +    0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000568    "B......." */
  22.192 +    0x04,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x43,  /* 00000570    "....LNKC" */
  22.193 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x04,  /* 00000578    "........" */
  22.194 +    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,  /* 00000580    "...LNKD." */
  22.195 +    0x08,0x50,0x52,0x54,0x41,0x12,0x32,0x04,  /* 00000588    ".PRTA.2." */
  22.196 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 00000590    "........" */
  22.197 +    0x00,0x00,0x0A,0x05,0x12,0x0B,0x04,0x0C,  /* 00000598    "........" */
  22.198 +    0xFF,0xFF,0x02,0x00,0x00,0x00,0x0A,0x07,  /* 000005A0    "........" */
  22.199 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 000005A8    "........" */
  22.200 +    0x00,0x00,0x0A,0x0A,0x12,0x0B,0x04,0x0C,  /* 000005B0    "........" */
  22.201 +    0xFF,0xFF,0x04,0x00,0x00,0x00,0x0A,0x0B,  /* 000005B8    "........" */
  22.202 +    0x5B,0x82,0x48,0x31,0x49,0x53,0x41,0x5F,  /* 000005C0    "[.H1ISA_" */
  22.203 +    0x08,0x5F,0x41,0x44,0x52,0x00,0x5B,0x80,  /* 000005C8    "._ADR.[." */
  22.204 +    0x50,0x49,0x52,0x51,0x02,0x0A,0x60,0x0A,  /* 000005D0    "PIRQ..`." */
  22.205 +    0x04,0x10,0x2E,0x5C,0x00,0x5B,0x81,0x29,  /* 000005D8    "...\.[.)" */
  22.206 +    0x5C,0x2F,0x04,0x5F,0x53,0x42,0x5F,0x50,  /* 000005E0    "\/._SB_P" */
  22.207 +    0x43,0x49,0x30,0x49,0x53,0x41,0x5F,0x50,  /* 000005E8    "CI0ISA_P" */
  22.208 +    0x49,0x52,0x51,0x01,0x50,0x49,0x52,0x41,  /* 000005F0    "IRQ.PIRA" */
  22.209 +    0x08,0x50,0x49,0x52,0x42,0x08,0x50,0x49,  /* 000005F8    ".PIRB.PI" */
  22.210 +    0x52,0x43,0x08,0x50,0x49,0x52,0x44,0x08,  /* 00000600    "RC.PIRD." */
  22.211 +    0x5B,0x82,0x46,0x0B,0x53,0x59,0x53,0x52,  /* 00000608    "[.F.SYSR" */
  22.212 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000610    "._HID.A." */
  22.213 +    0x0C,0x02,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000618    "..._UID." */
  22.214 +    0x08,0x43,0x52,0x53,0x5F,0x11,0x4E,0x08,  /* 00000620    ".CRS_.N." */
  22.215 +    0x0A,0x8A,0x47,0x01,0x10,0x00,0x10,0x00,  /* 00000628    "..G....." */
  22.216 +    0x00,0x10,0x47,0x01,0x22,0x00,0x22,0x00,  /* 00000630    "..G."."." */
  22.217 +    0x00,0x0C,0x47,0x01,0x30,0x00,0x30,0x00,  /* 00000638    "..G.0.0." */
  22.218 +    0x00,0x10,0x47,0x01,0x44,0x00,0x44,0x00,  /* 00000640    "..G.D.D." */
  22.219 +    0x00,0x1C,0x47,0x01,0x62,0x00,0x62,0x00,  /* 00000648    "..G.b.b." */
  22.220 +    0x00,0x02,0x47,0x01,0x65,0x00,0x65,0x00,  /* 00000650    "..G.e.e." */
  22.221 +    0x00,0x0B,0x47,0x01,0x72,0x00,0x72,0x00,  /* 00000658    "..G.r.r." */
  22.222 +    0x00,0x0E,0x47,0x01,0x80,0x00,0x80,0x00,  /* 00000660    "..G....." */
  22.223 +    0x00,0x01,0x47,0x01,0x84,0x00,0x84,0x00,  /* 00000668    "..G....." */
  22.224 +    0x00,0x03,0x47,0x01,0x88,0x00,0x88,0x00,  /* 00000670    "..G....." */
  22.225 +    0x00,0x01,0x47,0x01,0x8C,0x00,0x8C,0x00,  /* 00000678    "..G....." */
  22.226 +    0x00,0x03,0x47,0x01,0x90,0x00,0x90,0x00,  /* 00000680    "..G....." */
  22.227 +    0x00,0x10,0x47,0x01,0xA2,0x00,0xA2,0x00,  /* 00000688    "..G....." */
  22.228 +    0x00,0x1C,0x47,0x01,0xE0,0x00,0xE0,0x00,  /* 00000690    "..G....." */
  22.229 +    0x00,0x10,0x47,0x01,0xA0,0x08,0xA0,0x08,  /* 00000698    "..G....." */
  22.230 +    0x00,0x04,0x47,0x01,0xC0,0x0C,0xC0,0x0C,  /* 000006A0    "..G....." */
  22.231 +    0x00,0x10,0x47,0x01,0xD0,0x04,0xD0,0x04,  /* 000006A8    "..G....." */
  22.232 +    0x00,0x02,0x79,0x00,0x14,0x0B,0x5F,0x43,  /* 000006B0    "..y..._C" */
  22.233 +    0x52,0x53,0x00,0xA4,0x43,0x52,0x53,0x5F,  /* 000006B8    "RS..CRS_" */
  22.234 +    0x5B,0x82,0x2B,0x50,0x49,0x43,0x5F,0x08,  /* 000006C0    "[.+PIC_." */
  22.235 +    0x5F,0x48,0x49,0x44,0x0B,0x41,0xD0,0x08,  /* 000006C8    "_HID.A.." */
  22.236 +    0x5F,0x43,0x52,0x53,0x11,0x18,0x0A,0x15,  /* 000006D0    "_CRS...." */
  22.237 +    0x47,0x01,0x20,0x00,0x20,0x00,0x01,0x02,  /* 000006D8    "G. . ..." */
  22.238 +    0x47,0x01,0xA0,0x00,0xA0,0x00,0x01,0x02,  /* 000006E0    "G......." */
  22.239 +    0x22,0x04,0x00,0x79,0x00,0x5B,0x82,0x47,  /* 000006E8    ""..y.[.G" */
  22.240 +    0x05,0x44,0x4D,0x41,0x30,0x08,0x5F,0x48,  /* 000006F0    ".DMA0._H" */
  22.241 +    0x49,0x44,0x0C,0x41,0xD0,0x02,0x00,0x08,  /* 000006F8    "ID.A...." */
  22.242 +    0x5F,0x43,0x52,0x53,0x11,0x41,0x04,0x0A,  /* 00000700    "_CRS.A.." */
  22.243 +    0x3D,0x2A,0x10,0x04,0x47,0x01,0x00,0x00,  /* 00000708    "=*..G..." */
  22.244 +    0x00,0x00,0x00,0x10,0x47,0x01,0x81,0x00,  /* 00000710    "....G..." */
  22.245 +    0x81,0x00,0x00,0x03,0x47,0x01,0x87,0x00,  /* 00000718    "....G..." */
  22.246 +    0x87,0x00,0x00,0x01,0x47,0x01,0x89,0x00,  /* 00000720    "....G..." */
  22.247 +    0x89,0x00,0x00,0x03,0x47,0x01,0x8F,0x00,  /* 00000728    "....G..." */
  22.248 +    0x8F,0x00,0x00,0x01,0x47,0x01,0xC0,0x00,  /* 00000730    "....G..." */
  22.249 +    0xC0,0x00,0x00,0x20,0x47,0x01,0x80,0x04,  /* 00000738    "... G..." */
  22.250 +    0x80,0x04,0x00,0x10,0x79,0x00,0x5B,0x82,  /* 00000740    "....y.[." */
  22.251 +    0x25,0x54,0x4D,0x52,0x5F,0x08,0x5F,0x48,  /* 00000748    "%TMR_._H" */
  22.252 +    0x49,0x44,0x0C,0x41,0xD0,0x01,0x00,0x08,  /* 00000750    "ID.A...." */
  22.253 +    0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,  /* 00000758    "_CRS...." */
  22.254 +    0x47,0x01,0x40,0x00,0x40,0x00,0x00,0x04,  /* 00000760    "G.@.@..." */
  22.255 +    0x22,0x01,0x00,0x79,0x00,0x5B,0x82,0x25,  /* 00000768    ""..y.[.%" */
  22.256 +    0x52,0x54,0x43,0x5F,0x08,0x5F,0x48,0x49,  /* 00000770    "RTC_._HI" */
  22.257 +    0x44,0x0C,0x41,0xD0,0x0B,0x00,0x08,0x5F,  /* 00000778    "D.A...._" */
  22.258 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000780    "CRS....G" */
  22.259 +    0x01,0x70,0x00,0x70,0x00,0x00,0x02,0x22,  /* 00000788    ".p.p..."" */
  22.260 +    0x00,0x01,0x79,0x00,0x5B,0x82,0x22,0x53,  /* 00000790    "..y.[."S" */
  22.261 +    0x50,0x4B,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 00000798    "PKR._HID" */
  22.262 +    0x0C,0x41,0xD0,0x08,0x00,0x08,0x5F,0x43,  /* 000007A0    ".A...._C" */
  22.263 +    0x52,0x53,0x11,0x0D,0x0A,0x0A,0x47,0x01,  /* 000007A8    "RS....G." */
  22.264 +    0x61,0x00,0x61,0x00,0x00,0x01,0x79,0x00,  /* 000007B0    "a.a...y." */
  22.265 +    0x5B,0x82,0x31,0x50,0x53,0x32,0x4D,0x08,  /* 000007B8    "[.1PS2M." */
  22.266 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x0F,  /* 000007C0    "_HID.A.." */
  22.267 +    0x13,0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,  /* 000007C8    ".._CID.A" */
  22.268 +    0xD0,0x0F,0x13,0x14,0x09,0x5F,0x53,0x54,  /* 000007D0    "....._ST" */
  22.269 +    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 000007D8    "A....._C" */
  22.270 +    0x52,0x53,0x11,0x08,0x0A,0x05,0x22,0x00,  /* 000007E0    "RS...."." */
  22.271 +    0x10,0x79,0x00,0x5B,0x82,0x42,0x04,0x50,  /* 000007E8    ".y.[.B.P" */
  22.272 +    0x53,0x32,0x4B,0x08,0x5F,0x48,0x49,0x44,  /* 000007F0    "S2K._HID" */
  22.273 +    0x0C,0x41,0xD0,0x03,0x03,0x08,0x5F,0x43,  /* 000007F8    ".A...._C" */
  22.274 +    0x49,0x44,0x0C,0x41,0xD0,0x03,0x0B,0x14,  /* 00000800    "ID.A...." */
  22.275 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000808    "._STA..." */
  22.276 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x18,  /* 00000810    ".._CRS.." */
  22.277 +    0x0A,0x15,0x47,0x01,0x60,0x00,0x60,0x00,  /* 00000818    "..G.`.`." */
  22.278 +    0x00,0x01,0x47,0x01,0x64,0x00,0x64,0x00,  /* 00000820    "..G.d.d." */
  22.279 +    0x00,0x01,0x22,0x02,0x00,0x79,0x00,0x5B,  /* 00000828    ".."..y.[" */
  22.280 +    0x82,0x3A,0x46,0x44,0x43,0x30,0x08,0x5F,  /* 00000830    ".:FDC0._" */
  22.281 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x07,0x00,  /* 00000838    "HID.A..." */
  22.282 +    0x14,0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,  /* 00000840    ".._STA.." */
  22.283 +    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000848    "..._CRS." */
  22.284 +    0x1B,0x0A,0x18,0x47,0x01,0xF0,0x03,0xF0,  /* 00000850    "...G...." */
  22.285 +    0x03,0x01,0x06,0x47,0x01,0xF7,0x03,0xF7,  /* 00000858    "...G...." */
  22.286 +    0x03,0x01,0x01,0x22,0x40,0x00,0x2A,0x04,  /* 00000860    "..."@.*." */
  22.287 +    0x00,0x79,0x00,0x5B,0x82,0x35,0x55,0x41,  /* 00000868    ".y.[.5UA" */
  22.288 +    0x52,0x31,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000870    "R1._HID." */
  22.289 +    0x41,0xD0,0x05,0x01,0x08,0x5F,0x55,0x49,  /* 00000878    "A...._UI" */
  22.290 +    0x44,0x01,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 00000880    "D..._STA" */
  22.291 +    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 00000888    "....._CR" */
  22.292 +    0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,0xF8,  /* 00000890    "S....G.." */
  22.293 +    0x03,0xF8,0x03,0x01,0x08,0x22,0x10,0x00,  /* 00000898    ".....".." */
  22.294 +    0x79,0x00,0x5B,0x82,0x36,0x4C,0x54,0x50,  /* 000008A0    "y.[.6LTP" */
  22.295 +    0x31,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000008A8    "1._HID.A" */
  22.296 +    0xD0,0x04,0x00,0x08,0x5F,0x55,0x49,0x44,  /* 000008B0    "...._UID" */
  22.297 +    0x0A,0x02,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 000008B8    "...._STA" */
  22.298 +    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 000008C0    "....._CR" */
  22.299 +    0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,0x78,  /* 000008C8    "S....G.x" */
  22.300 +    0x03,0x78,0x03,0x08,0x08,0x22,0x80,0x00,  /* 000008D0    ".x...".." */
  22.301 +    0x79,0x00,
  22.302 +};
  22.303 +int DsdtLen=sizeof(AmlCode);
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/firmware/hvmloader/acpi/gen.c	Tue Oct 31 12:42:50 2006 +0000
    23.3 @@ -0,0 +1,53 @@
    23.4 +/*
    23.5 + * Copyright (c) 2004, Intel Corporation.
    23.6 + *
    23.7 + * This program is free software; you can redistribute it and/or modify it
    23.8 + * under the terms and conditions of the GNU General Public License,
    23.9 + * version 2, as published by the Free Software Foundation.
   23.10 + *
   23.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   23.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   23.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   23.14 + * more details.
   23.15 + *
   23.16 + * You should have received a copy of the GNU General Public License along with
   23.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   23.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   23.19 + *
   23.20 + */
   23.21 +#include "acpi2_0.h"
   23.22 +#include <stdio.h>
   23.23 +#include <stdlib.h>
   23.24 +#include <unistd.h>
   23.25 +
   23.26 +#define USAGE	"Usage: acpi_gen filename \n"				\
   23.27 +		"       generage acpitable and write to the binary \n"	\
   23.28 +		"       filename - the binary name\n"
   23.29 +
   23.30 +int main(int argc, char **argv)
   23.31 +{
   23.32 +	char *filename;
   23.33 +	char  buf[ACPI_TABLE_SIZE] = { 0 };
   23.34 +	FILE *f;
   23.35 +
   23.36 +	if (argc < 2) {
   23.37 +		fprintf(stderr,"%s",USAGE);
   23.38 +		exit(1);
   23.39 +	}
   23.40 +
   23.41 +	filename = argv[1];
   23.42 +		
   23.43 +	if ((f = fopen(filename, "w+")) == NULL) {
   23.44 +		fprintf(stderr,"Can not open %s", filename);
   23.45 +		exit(1);
   23.46 +	}
   23.47 +
   23.48 +	AcpiBuildTable((uint8_t *)buf);
   23.49 +
   23.50 +	if (fwrite(buf, ACPI_TABLE_SIZE, 1, f) < 1) {
   23.51 +		fprintf(stderr,"Can not write to %s\n", filename);
   23.52 +		exit(1);
   23.53 +	}
   23.54 +
   23.55 +	return 0;
   23.56 +}
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tools/firmware/hvmloader/acpi/static_tables.c	Tue Oct 31 12:42:50 2006 +0000
    24.3 @@ -0,0 +1,184 @@
    24.4 +/*
    24.5 + * Copyright (c) 2004, Intel Corporation.
    24.6 + * Copyright (c) 2006, Keir Fraser, XenSource Inc.
    24.7 + *
    24.8 + * This program is free software; you can redistribute it and/or modify it
    24.9 + * under the terms and conditions of the GNU General Public License,
   24.10 + * version 2, as published by the Free Software Foundation.
   24.11 + *
   24.12 + * This program is distributed in the hope it will be useful, but WITHOUT
   24.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   24.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   24.15 + * more details.
   24.16 + *
   24.17 + * You should have received a copy of the GNU General Public License along with
   24.18 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   24.19 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   24.20 + */
   24.21 +
   24.22 +#include "acpi2_0.h"
   24.23 +#include <xen/hvm/ioreq.h>
   24.24 +
   24.25 +/*
   24.26 + * Multiple APIC Description Table (MADT).
   24.27 + */
   24.28 +
   24.29 +struct acpi_20_madt Madt = {
   24.30 +    .header = {
   24.31 +        .header = {
   24.32 +            .signature    = ACPI_2_0_MADT_SIGNATURE,
   24.33 +            .length       = sizeof(struct acpi_20_madt),
   24.34 +            .revision     = ACPI_2_0_MADT_REVISION,
   24.35 +            .oem_id       = ACPI_OEM_ID, 
   24.36 +            .oem_table_id = ACPI_OEM_TABLE_ID,
   24.37 +            .oem_revision = ACPI_OEM_REVISION,
   24.38 +            .creator_id   = ACPI_CREATOR_ID,
   24.39 +            .creator_revision = ACPI_CREATOR_REVISION
   24.40 +        },
   24.41 +        .lapic_addr = 0xFEE00000,
   24.42 +        .flags      = ACPI_PCAT_COMPAT
   24.43 +    },
   24.44 +
   24.45 +    /* IO APIC */
   24.46 +    .io_apic = {
   24.47 +        [0] = {
   24.48 +            .type        = ACPI_IO_APIC,                         
   24.49 +            .length      = sizeof(struct acpi_20_madt_ioapic),
   24.50 +            .ioapic_addr = 0xFEC00000
   24.51 +        }
   24.52 +    },
   24.53 +
   24.54 +    /* Local APIC entries for up to 32 processors. */
   24.55 +    .lapic = {
   24.56 +        [0] = {
   24.57 +            .type   = ACPI_PROCESSOR_LOCAL_APIC,
   24.58 +            .length = sizeof(struct acpi_20_madt_lapic),
   24.59 +            .flags  = 0x00000001
   24.60 +        }
   24.61 +    }
   24.62 +};
   24.63 +
   24.64 +
   24.65 +/*
   24.66 + * Firmware ACPI Control Structure (FACS).
   24.67 + */
   24.68 +
   24.69 +struct acpi_20_facs Facs = {
   24.70 +    .signature = ACPI_2_0_FACS_SIGNATURE,
   24.71 +    .length    = sizeof(struct acpi_20_facs),
   24.72 +    .version   = ACPI_2_0_FACS_VERSION
   24.73 +};
   24.74 +
   24.75 +
   24.76 +/*
   24.77 + * Fixed ACPI Description Table (FADT).
   24.78 + */
   24.79 +
   24.80 +#define ACPI_PM1A_EVT_BLK_BIT_WIDTH         0x20
   24.81 +#define ACPI_PM1A_EVT_BLK_BIT_OFFSET        0x00
   24.82 +#define ACPI_PM1A_CNT_BLK_BIT_WIDTH         0x10
   24.83 +#define ACPI_PM1A_CNT_BLK_BIT_OFFSET        0x00
   24.84 +#define ACPI_PM_TMR_BLK_BIT_WIDTH           0x20
   24.85 +#define ACPI_PM_TMR_BLK_BIT_OFFSET          0x00
   24.86 +
   24.87 +struct acpi_20_fadt Fadt = {
   24.88 +    .header = {
   24.89 +        .signature    = ACPI_2_0_FADT_SIGNATURE,
   24.90 +        .length       = sizeof(struct acpi_20_fadt),
   24.91 +        .revision     = ACPI_2_0_FADT_REVISION,
   24.92 +        .oem_id       = ACPI_OEM_ID, 
   24.93 +        .oem_table_id = ACPI_OEM_TABLE_ID,
   24.94 +        .oem_revision = ACPI_OEM_REVISION,
   24.95 +        .creator_id   = ACPI_CREATOR_ID,
   24.96 +        .creator_revision = ACPI_CREATOR_REVISION
   24.97 +    },
   24.98 +
   24.99 +    .sci_int = 9,
  24.100 +
  24.101 +    .pm1a_evt_blk = ACPI_PM1A_EVT_BLK_ADDRESS,
  24.102 +    .pm1a_cnt_blk = ACPI_PM1A_CNT_BLK_ADDRESS,
  24.103 +    .pm_tmr_blk = ACPI_PM_TMR_BLK_ADDRESS,
  24.104 +    .pm1_evt_len = ACPI_PM1A_EVT_BLK_BIT_WIDTH / 8,
  24.105 +    .pm1_cnt_len = ACPI_PM1A_CNT_BLK_BIT_WIDTH / 8,
  24.106 +    .pm_tmr_len = ACPI_PM_TMR_BLK_BIT_WIDTH / 8,
  24.107 +
  24.108 +    .p_lvl2_lat = 0x0fff, /* >100,  means we do not support C2 state */
  24.109 +    .p_lvl3_lat = 0x0fff, /* >1000, means we do not support C3 state */
  24.110 +    .iapc_boot_arch = ACPI_LEGACY_DEVICES | ACPI_8042,
  24.111 +    .flags = (ACPI_PROC_C1 | ACPI_SLP_BUTTON |
  24.112 +              ACPI_WBINVD | ACPI_PWR_BUTTON |
  24.113 +              ACPI_FIX_RTC | ACPI_TMR_VAL_EXT),
  24.114 +
  24.115 +    .reset_reg = {
  24.116 +        .address_space_id    = ACPI_SYSTEM_IO,
  24.117 +        .register_bit_width  = 8, /* *must* be 8 */
  24.118 +        .register_bit_offset = 0, /* *must* be 0 */
  24.119 +        .address             = 0xcf9
  24.120 +    },
  24.121 +    .reset_value = 6,
  24.122 +
  24.123 +    .x_pm1a_evt_blk = {
  24.124 +        .address_space_id    = ACPI_SYSTEM_IO,
  24.125 +        .register_bit_width  = ACPI_PM1A_EVT_BLK_BIT_WIDTH,
  24.126 +        .register_bit_offset = ACPI_PM1A_EVT_BLK_BIT_OFFSET,
  24.127 +        .address             = ACPI_PM1A_EVT_BLK_ADDRESS,
  24.128 +    },
  24.129 +
  24.130 +    .x_pm1a_cnt_blk = {
  24.131 +        .address_space_id    = ACPI_SYSTEM_IO,
  24.132 +        .register_bit_width  = ACPI_PM1A_CNT_BLK_BIT_WIDTH,
  24.133 +        .register_bit_offset = ACPI_PM1A_CNT_BLK_BIT_OFFSET,
  24.134 +        .address             = ACPI_PM1A_CNT_BLK_ADDRESS,
  24.135 +    },
  24.136 +
  24.137 +    .x_pm_tmr_blk = {
  24.138 +        .address_space_id    = ACPI_SYSTEM_IO,
  24.139 +        .register_bit_width  = ACPI_PM_TMR_BLK_BIT_WIDTH,
  24.140 +        .register_bit_offset = ACPI_PM_TMR_BLK_BIT_OFFSET,
  24.141 +        .address             = ACPI_PM_TMR_BLK_ADDRESS,
  24.142 +    }
  24.143 +};
  24.144 +
  24.145 +struct acpi_20_rsdt Rsdt = {
  24.146 +    .header = {
  24.147 +        .signature    = ACPI_2_0_RSDT_SIGNATURE,
  24.148 +        .length       = sizeof(struct acpi_header),
  24.149 +        .revision     = ACPI_2_0_RSDT_REVISION,
  24.150 +        .oem_id       = ACPI_OEM_ID, 
  24.151 +        .oem_table_id = ACPI_OEM_TABLE_ID,
  24.152 +        .oem_revision = ACPI_OEM_REVISION,
  24.153 +        .creator_id   = ACPI_CREATOR_ID,
  24.154 +        .creator_revision = ACPI_CREATOR_REVISION
  24.155 +    }
  24.156 +};
  24.157 +
  24.158 +struct acpi_20_xsdt Xsdt = {
  24.159 +    .header = {
  24.160 +        .signature    = ACPI_2_0_XSDT_SIGNATURE,
  24.161 +        .length       = sizeof(struct acpi_header),
  24.162 +        .revision     = ACPI_2_0_XSDT_REVISION,
  24.163 +        .oem_id       = ACPI_OEM_ID, 
  24.164 +        .oem_table_id = ACPI_OEM_TABLE_ID,
  24.165 +        .oem_revision = ACPI_OEM_REVISION,
  24.166 +        .creator_id   = ACPI_CREATOR_ID,
  24.167 +        .creator_revision = ACPI_CREATOR_REVISION
  24.168 +    }
  24.169 +};
  24.170 +
  24.171 +
  24.172 +struct acpi_20_rsdp Rsdp = {
  24.173 +    .signature = ACPI_2_0_RSDP_SIGNATURE,
  24.174 +    .oem_id    = ACPI_OEM_ID,
  24.175 +    .revision  = ACPI_OEM_REVISION, 
  24.176 +    .length    = sizeof(struct acpi_20_rsdp)
  24.177 +};
  24.178 +
  24.179 +/*
  24.180 + * Local variables:
  24.181 + * mode: C
  24.182 + * c-set-style: "BSD"
  24.183 + * c-basic-offset: 4
  24.184 + * tab-width: 4
  24.185 + * indent-tabs-mode: nil
  24.186 + * End:
  24.187 + */
    25.1 --- a/tools/firmware/hvmloader/acpi_madt.c	Tue Oct 31 11:44:47 2006 +0000
    25.2 +++ b/tools/firmware/hvmloader/acpi_madt.c	Tue Oct 31 12:42:50 2006 +0000
    25.3 @@ -18,9 +18,9 @@
    25.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
    25.5   */
    25.6  
    25.7 -#include "../acpi/acpi2_0.h"
    25.8 -#include "../acpi/acpi_madt.h"
    25.9 +#include "acpi/acpi2_0.h"
   25.10  #include "util.h"
   25.11 +#include "acpi_utils.h"
   25.12  #include <xen/hvm/hvm_info_table.h>
   25.13  
   25.14  #define NULL ((void*)0)
   25.15 @@ -29,160 +29,134 @@ static struct hvm_info_table *table = NU
   25.16  
   25.17  static int validate_hvm_info(struct hvm_info_table *t)
   25.18  {
   25.19 -	char signature[] = "HVM INFO";
   25.20 -	uint8_t *ptr = (uint8_t *)t;
   25.21 -	uint8_t sum = 0;
   25.22 -	int i;
   25.23 +    char signature[] = "HVM INFO";
   25.24 +    uint8_t *ptr = (uint8_t *)t;
   25.25 +    uint8_t sum = 0;
   25.26 +    int i;
   25.27  
   25.28 -	/* strncmp(t->signature, "HVM INFO", 8) */
   25.29 -	for (i = 0; i < 8; i++) {
   25.30 -		if (signature[i] != t->signature[i]) {
   25.31 -			puts("Bad hvm info signature\n");
   25.32 -			return 0;
   25.33 -		}
   25.34 -	}
   25.35 +    /* strncmp(t->signature, "HVM INFO", 8) */
   25.36 +    for (i = 0; i < 8; i++) {
   25.37 +        if (signature[i] != t->signature[i]) {
   25.38 +            puts("Bad hvm info signature\n");
   25.39 +            return 0;
   25.40 +        }
   25.41 +    }
   25.42  
   25.43 -	for (i = 0; i < t->length; i++)
   25.44 -		sum += ptr[i];
   25.45 +    for (i = 0; i < t->length; i++)
   25.46 +        sum += ptr[i];
   25.47  
   25.48 -	return (sum == 0);
   25.49 +    return (sum == 0);
   25.50  }
   25.51  
   25.52  /* xc_vmx_builder wrote hvm info at 0x9F800. Return it. */
   25.53  struct hvm_info_table *
   25.54  get_hvm_info_table(void)
   25.55  {
   25.56 -	struct hvm_info_table *t;
   25.57 -
   25.58 -	if (table != NULL)
   25.59 -		return table;
   25.60 -
   25.61 -	t = (struct hvm_info_table *)HVM_INFO_PADDR;
   25.62 +    struct hvm_info_table *t;
   25.63  
   25.64 -	if (!validate_hvm_info(t)) {
   25.65 -		puts("Bad hvm info table\n");
   25.66 -		return NULL;
   25.67 -	}
   25.68 +    if (table != NULL)
   25.69 +        return table;
   25.70  
   25.71 -	table = t;
   25.72 +    t = (struct hvm_info_table *)HVM_INFO_PADDR;
   25.73  
   25.74 -	return table;
   25.75 +    if (!validate_hvm_info(t)) {
   25.76 +        puts("Bad hvm info table\n");
   25.77 +        return NULL;
   25.78 +    }
   25.79 +
   25.80 +    table = t;
   25.81 +
   25.82 +    return table;
   25.83  }
   25.84  
   25.85  int
   25.86  get_vcpu_nr(void)
   25.87  {
   25.88 -	struct hvm_info_table *t = get_hvm_info_table();
   25.89 -	return (t ? t->nr_vcpus : 1); /* default 1 vcpu */
   25.90 +    struct hvm_info_table *t = get_hvm_info_table();
   25.91 +    return (t ? t->nr_vcpus : 1); /* default 1 vcpu */
   25.92  }
   25.93  
   25.94  int
   25.95  get_acpi_enabled(void)
   25.96  {
   25.97 -	struct hvm_info_table *t = get_hvm_info_table();
   25.98 -	return (t ? t->acpi_enabled : 0); /* default no acpi */
   25.99 +    struct hvm_info_table *t = get_hvm_info_table();
  25.100 +    return (t ? t->acpi_enabled : 0); /* default no acpi */
  25.101  }
  25.102  
  25.103  
  25.104  static void *
  25.105  acpi_madt_get_madt(unsigned char *acpi_start)
  25.106  {
  25.107 -	ACPI_2_0_RSDP *rsdp=NULL;
  25.108 -	ACPI_2_0_RSDT *rsdt=NULL;
  25.109 -	ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *madt;
  25.110 -
  25.111 -	rsdp = (ACPI_2_0_RSDP *)(acpi_start + sizeof(ACPI_2_0_FACS));
  25.112 -	if (rsdp->Signature != ACPI_2_0_RSDP_SIGNATURE) {
  25.113 -		puts("Bad RSDP signature\n");
  25.114 -		return NULL;
  25.115 -	}
  25.116 -
  25.117 -	rsdt= (ACPI_2_0_RSDT *)
  25.118 -		(acpi_start + rsdp->RsdtAddress - ACPI_PHYSICAL_ADDRESS);
  25.119 -	if (rsdt->Header.Signature != ACPI_2_0_RSDT_SIGNATURE) {
  25.120 -		puts("Bad RSDT signature\n");
  25.121 -		return NULL;
  25.122 -	}
  25.123 +    struct acpi_20_rsdt *rsdt;
  25.124 +    struct acpi_20_madt *madt;
  25.125  
  25.126 -	madt = (ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *)
  25.127 -		( acpi_start+ rsdt->Entry[1] - ACPI_PHYSICAL_ADDRESS);
  25.128 -	if (madt->Header.Header.Signature !=
  25.129 -	    ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE) {
  25.130 -		puts("Bad MADT signature \n");
  25.131 -		return NULL;
  25.132 -	}
  25.133 -
  25.134 -	return madt;
  25.135 -}
  25.136 +    rsdt = acpi_rsdt_get(acpi_start);
  25.137 +    if (rsdt == NULL)
  25.138 +        return NULL;
  25.139  
  25.140 -static void
  25.141 -set_checksum(void *start, int checksum_offset, int len)
  25.142 -{
  25.143 -	unsigned char sum = 0;
  25.144 -	unsigned char *ptr;
  25.145 +    madt = (struct acpi_20_madt *)(acpi_start + rsdt->entry[1] -
  25.146 +                                   ACPI_PHYSICAL_ADDRESS);
  25.147 +    if (madt->header.header.signature != ACPI_2_0_MADT_SIGNATURE) {
  25.148 +        puts("Bad MADT signature \n");
  25.149 +        return NULL;
  25.150 +    }
  25.151  
  25.152 -	ptr = start;
  25.153 -	ptr[checksum_offset] = 0;
  25.154 -	while (len--)
  25.155 -		sum += *ptr++;
  25.156 -
  25.157 -	ptr = start;
  25.158 -	ptr[checksum_offset] = -sum;
  25.159 +    return madt;
  25.160  }
  25.161  
  25.162  static int
  25.163  acpi_madt_set_local_apics(
  25.164 -	int nr_vcpu,
  25.165 -	ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *madt)
  25.166 +    int nr_vcpu,
  25.167 +    struct acpi_20_madt *madt)
  25.168  {
  25.169 -	int i;
  25.170 -
  25.171 -	if ((nr_vcpu > MAX_VIRT_CPUS) || (nr_vcpu < 0) || !madt)
  25.172 -		return -1;
  25.173 +    int i;
  25.174  
  25.175 -	for (i = 0; i < nr_vcpu; i++) {
  25.176 -		madt->LocalApic[i].Type            = ACPI_PROCESSOR_LOCAL_APIC;
  25.177 -		madt->LocalApic[i].Length          = sizeof (ACPI_LOCAL_APIC_STRUCTURE);
  25.178 -		madt->LocalApic[i].AcpiProcessorId = i;
  25.179 -		madt->LocalApic[i].ApicId          = i;
  25.180 -		madt->LocalApic[i].Flags           = 1;
  25.181 -	}
  25.182 +    if ((nr_vcpu > MAX_VIRT_CPUS) || (nr_vcpu < 0) || !madt)
  25.183 +        return -1;
  25.184  
  25.185 -	madt->Header.Header.Length =
  25.186 -		sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE) -
  25.187 -		(MAX_VIRT_CPUS - nr_vcpu)* sizeof(ACPI_LOCAL_APIC_STRUCTURE);
  25.188 +    for (i = 0; i < nr_vcpu; i++) {
  25.189 +        madt->lapic[i].type    = ACPI_PROCESSOR_LOCAL_APIC;
  25.190 +        madt->lapic[i].length  = sizeof(struct acpi_20_madt_lapic);
  25.191 +        madt->lapic[i].acpi_processor_id = i;
  25.192 +        madt->lapic[i].apic_id = i;
  25.193 +        madt->lapic[i].flags   = 1;
  25.194 +    }
  25.195  
  25.196 -	return 0;
  25.197 +    madt->header.header.length =
  25.198 +        sizeof(struct acpi_20_madt) -
  25.199 +        (MAX_VIRT_CPUS - nr_vcpu) * sizeof(struct acpi_20_madt_lapic);
  25.200 +
  25.201 +    return 0;
  25.202  }
  25.203  
  25.204  #define FIELD_OFFSET(TYPE,Field) ((unsigned int)(&(((TYPE *) 0)->Field)))
  25.205  
  25.206  int acpi_madt_update(unsigned char *acpi_start)
  25.207  {
  25.208 -	int rc;
  25.209 -	ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *madt;
  25.210 -
  25.211 -	madt = acpi_madt_get_madt(acpi_start);
  25.212 -	if (!madt)
  25.213 -		return -1;
  25.214 +    int rc;
  25.215 +    struct acpi_20_madt *madt;
  25.216  
  25.217 -	rc = acpi_madt_set_local_apics(get_vcpu_nr(), madt);
  25.218 -	if (rc != 0)
  25.219 -		return rc;
  25.220 +    madt = acpi_madt_get_madt(acpi_start);
  25.221 +    if (!madt)
  25.222 +        return -1;
  25.223  
  25.224 -	set_checksum(
  25.225 -		madt, FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
  25.226 -		madt->Header.Header.Length);
  25.227 +    rc = acpi_madt_set_local_apics(get_vcpu_nr(), madt);
  25.228 +    if (rc != 0)
  25.229 +        return rc;
  25.230  
  25.231 -	return 0;
  25.232 +    set_checksum(
  25.233 +        madt, FIELD_OFFSET(struct acpi_header, checksum),
  25.234 +        madt->header.header.length);
  25.235 +
  25.236 +    return 0;
  25.237  }
  25.238  
  25.239  /*
  25.240   * Local variables:
  25.241 - *  c-file-style: "linux"
  25.242 - *  indent-tabs-mode: t
  25.243 - *  c-indent-level: 8
  25.244 - *  c-basic-offset: 8
  25.245 - *  tab-width: 8
  25.246 + * mode: C
  25.247 + * c-set-style: "BSD"
  25.248 + * c-basic-offset: 4
  25.249 + * tab-width: 4
  25.250 + * indent-tabs-mode: nil
  25.251   * End:
  25.252   */
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/tools/firmware/hvmloader/acpi_ssdt_tpm.asl	Tue Oct 31 12:42:50 2006 +0000
    26.3 @@ -0,0 +1,29 @@
    26.4 +//**********************************************************************//
    26.5 +//*
    26.6 +//* Copyright (c) 2006, IBM Corporation.
    26.7 +//*
    26.8 +//* This program is free software; you can redistribute it and/or modify it
    26.9 +//* under the terms and conditions of the GNU General Public License,
   26.10 +//* version 2, as published by the Free Software Foundation.
   26.11 +//*
   26.12 +//* This program is distributed in the hope it will be useful, but WITHOUT
   26.13 +//* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   26.14 +//* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   26.15 +//* more details.
   26.16 +//*
   26.17 +//* You should have received a copy of the GNU General Public License along with
   26.18 +//* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   26.19 +//* Place - Suite 330, Boston, MA 02111-1307 USA.
   26.20 +
   26.21 +//*  SSDT for TPM TIS Interface for Xen with Qemu device model
   26.22 +
   26.23 +DefinitionBlock ("SSDT_TPM.aml", "SSDT", 1, "IBM","xen", 2006)
   26.24 +{
   26.25 +    Device (TPM) {
   26.26 +        Name (_HID, EisaId ("PNP0C31"))
   26.27 +        Name (_CRS, ResourceTemplate ()
   26.28 +        {
   26.29 +            Memory32Fixed (ReadWrite, 0xFED40000, 0x5000,)
   26.30 +        })
   26.31 +    }
   26.32 +}
   26.33 \ No newline at end of file
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/tools/firmware/hvmloader/acpi_ssdt_tpm.h	Tue Oct 31 12:42:50 2006 +0000
    27.3 @@ -0,0 +1,25 @@
    27.4 +/*
    27.5 + * 
    27.6 + * Intel ACPI Component Architecture
    27.7 + * ASL Optimizing Compiler version 20060707 [Sep 11 2006]
    27.8 + * Copyright (C) 2000 - 2006 Intel Corporation
    27.9 + * Supports ACPI Specification Revision 3.0a
   27.10 + * 
   27.11 + * Compilation of "acpi_ssdt_tpm.asl" - Mon Oct 30 11:28:27 2006
   27.12 + * 
   27.13 + * C source code output
   27.14 + *
   27.15 + */
   27.16 +unsigned char AmlCode_TPM[] =
   27.17 +{
   27.18 +    0x53,0x53,0x44,0x54,0x4C,0x00,0x00,0x00,  /* 00000000    "SSDTL..." */
   27.19 +    0x01,0x6D,0x49,0x42,0x4D,0x00,0x00,0x00,  /* 00000008    ".mIBM..." */
   27.20 +    0x78,0x65,0x6E,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "xen....." */
   27.21 +    0xD6,0x07,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
   27.22 +    0x07,0x07,0x06,0x20,0x5B,0x82,0x26,0x54,  /* 00000020    "... [.&T" */
   27.23 +    0x50,0x4D,0x5F,0x08,0x5F,0x48,0x49,0x44,  /* 00000028    "PM_._HID" */
   27.24 +    0x0C,0x41,0xD0,0x0C,0x31,0x08,0x5F,0x43,  /* 00000030    ".A..1._C" */
   27.25 +    0x52,0x53,0x11,0x11,0x0A,0x0E,0x86,0x09,  /* 00000038    "RS......" */
   27.26 +    0x00,0x01,0x00,0x00,0xD4,0xFE,0x00,0x50,  /* 00000040    ".......P" */
   27.27 +    0x00,0x00,0x79,0x00,
   27.28 +};
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/tools/firmware/hvmloader/acpi_utils.c	Tue Oct 31 12:42:50 2006 +0000
    28.3 @@ -0,0 +1,207 @@
    28.4 +/*
    28.5 + * Commonly used ACPI utility functions.
    28.6 + * Probing for devices and writing SSDT entries into XSDT and RSDT tables.
    28.7 + *
    28.8 + * Yu Ke, ke.yu@intel.com
    28.9 + * Copyright (c) 2005, Intel Corporation.
   28.10 + * Copyright (c) 2006, IBM Corporation.
   28.11 + *
   28.12 + * This program is free software; you can redistribute it and/or modify it
   28.13 + * under the terms and conditions of the GNU General Public License,
   28.14 + * version 2, as published by the Free Software Foundation.
   28.15 + *
   28.16 + * This program is distributed in the hope it will be useful, but WITHOUT
   28.17 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   28.18 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   28.19 + * more details.
   28.20 + *
   28.21 + * You should have received a copy of the GNU General Public License along with
   28.22 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   28.23 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   28.24 + */
   28.25 +
   28.26 +#include "acpi/acpi2_0.h"
   28.27 +#include "acpi_utils.h"
   28.28 +#include "util.h"
   28.29 +
   28.30 +static int acpi_rsdt_add_entry_pointer(unsigned char *acpi_start,
   28.31 +                                       unsigned char *entry);
   28.32 +static unsigned char *acpi_xsdt_add_entry(unsigned char *acpi_start,
   28.33 +                                          unsigned char **freemem,
   28.34 +                                          unsigned char *limit,
   28.35 +                                          unsigned char *table,
   28.36 +                                          unsigned int table_size);
   28.37 +
   28.38 +void set_checksum(void *start, int checksum_offset, int len)
   28.39 +{
   28.40 +	unsigned char sum = 0;
   28.41 +	unsigned char *ptr;
   28.42 +
   28.43 +	ptr = start;
   28.44 +	ptr[checksum_offset] = 0;
   28.45 +	while (len--)
   28.46 +		sum += *ptr++;
   28.47 +
   28.48 +	ptr = start;
   28.49 +	ptr[checksum_offset] = -sum;
   28.50 +}
   28.51 +
   28.52 +
   28.53 +#include "acpi_ssdt_tpm.h"
   28.54 +static int acpi_tpm_tis_probe(unsigned char *acpi_start,
   28.55 +                              unsigned char **freemem,
   28.56 +                              unsigned char *limit)
   28.57 +{
   28.58 +	int success = 1; /* not successful means 'out of memory' */
   28.59 +	unsigned char *addr;
   28.60 +	/* check TPM_DID, TPM_VID, TPM_RID in ioemu/hw/tpm_tis.c */
   28.61 +	uint16_t tis_did_vid_rid[] = {0x0001, 0x0001, 0x0001};
   28.62 +
   28.63 +	/* probe for TIS interface ... */
   28.64 +	if (memcmp((char *)(0xFED40000 + 0xF00),
   28.65 +	           tis_did_vid_rid,
   28.66 +	           sizeof(tis_did_vid_rid)) == 0) {
   28.67 +		puts("TIS is available\n");
   28.68 +		addr = acpi_xsdt_add_entry(acpi_start, freemem, limit,
   28.69 +		                           AmlCode_TPM, sizeof(AmlCode_TPM));
   28.70 +		if (addr == NULL)
   28.71 +			success = 0;
   28.72 +		else {
   28.73 +			/* legacy systems need an RSDT entry */
   28.74 +			acpi_rsdt_add_entry_pointer(acpi_start,
   28.75 +			                            addr);
   28.76 +		}
   28.77 +	}
   28.78 +	return success;
   28.79 +}
   28.80 +
   28.81 +
   28.82 +/*
   28.83 + * Call functions that probe for devices and have them register their
   28.84 + * SSDT entries with the XSDT and RSDT tables.
   28.85 + */
   28.86 +void acpi_update(unsigned char *acpi_start,
   28.87 +                 unsigned long acpi_size,
   28.88 +                 unsigned char *limit,
   28.89 +                 unsigned char **freemem)
   28.90 +{
   28.91 +    acpi_tpm_tis_probe(acpi_start, freemem, limit);
   28.92 +}
   28.93 +
   28.94 +
   28.95 +struct acpi_20_rsdt *acpi_rsdt_get(unsigned char *acpi_start)
   28.96 +{
   28.97 +    struct acpi_20_rsdp *rsdp;
   28.98 +    struct acpi_20_rsdt *rsdt;
   28.99 +
  28.100 +    rsdp = (struct acpi_20_rsdp *)(acpi_start + sizeof(struct acpi_20_facs));
  28.101 +    if (rsdp->signature != ACPI_2_0_RSDP_SIGNATURE) {
  28.102 +        puts("Bad RSDP signature\n");
  28.103 +        return NULL;
  28.104 +    }
  28.105 +
  28.106 +    rsdt = (struct acpi_20_rsdt *)
  28.107 +        (acpi_start + rsdp->rsdt_address - ACPI_PHYSICAL_ADDRESS);
  28.108 +    if (rsdt->header.signature != ACPI_2_0_RSDT_SIGNATURE) {
  28.109 +        puts("Bad RSDT signature\n");
  28.110 +        return NULL;
  28.111 +    }
  28.112 +    return rsdt;
  28.113 +}
  28.114 +
  28.115 +/*
  28.116 + * Add an entry to the RSDT table given the pointer to the entry.
  28.117 + */
  28.118 +static int acpi_rsdt_add_entry_pointer(unsigned char *acpi_start,
  28.119 +                                       unsigned char *entry)
  28.120 +{
  28.121 +    struct acpi_20_rsdt *rsdt = acpi_rsdt_get(acpi_start);
  28.122 +    int found = 0;
  28.123 +    int i = 0;
  28.124 +
  28.125 +    /* get empty slot in the RSDT table */
  28.126 +    while (i < ACPI_MAX_NUM_TABLES) {
  28.127 +        if (rsdt->entry[i] == 0) {
  28.128 +            found = 1;
  28.129 +            break;
  28.130 +        }
  28.131 +        i++;
  28.132 +    }
  28.133 +
  28.134 +    if (found) {
  28.135 +        rsdt->entry[i] = (uint64_t)(long)entry;
  28.136 +        rsdt->header.length =
  28.137 +            sizeof(struct acpi_header) +
  28.138 +            (i + 1) * sizeof(uint64_t);
  28.139 +        set_checksum(rsdt,
  28.140 +                     FIELD_OFFSET(struct acpi_header, checksum),
  28.141 +                     rsdt->header.length);
  28.142 +    }
  28.143 +
  28.144 +    return found;
  28.145 +}
  28.146 +
  28.147 +/* Get the XSDT table */
  28.148 +struct acpi_20_xsdt *acpi_xsdt_get(unsigned char *acpi_start)
  28.149 +{
  28.150 +    struct acpi_20_rsdp *rsdp;
  28.151 +    struct acpi_20_xsdt *xsdt;
  28.152 +
  28.153 +    rsdp = (struct acpi_20_rsdp *)(acpi_start + sizeof(struct acpi_20_facs));
  28.154 +    if (rsdp->signature != ACPI_2_0_RSDP_SIGNATURE) {
  28.155 +        puts("Bad RSDP signature\n");
  28.156 +        return NULL;
  28.157 +    }
  28.158 +
  28.159 +    xsdt = (struct acpi_20_xsdt *)
  28.160 +        (acpi_start + rsdp->xsdt_address - ACPI_PHYSICAL_ADDRESS);
  28.161 +    if (xsdt->header.signature != ACPI_2_0_XSDT_SIGNATURE) {
  28.162 +        puts("Bad XSDT signature\n");
  28.163 +        return NULL;
  28.164 +    }
  28.165 +    return xsdt;
  28.166 +}
  28.167 +
  28.168 +/*
  28.169 +   add an entry to the xdst table entry pointers
  28.170 +   copy the given ssdt data to the current available memory at
  28.171 +   freemem, if it does not exceed the limit
  28.172 + */
  28.173 +static unsigned char *acpi_xsdt_add_entry(unsigned char *acpi_start,
  28.174 +                                          unsigned char **freemem,
  28.175 +                                          unsigned char *limit,
  28.176 +                                          unsigned char *table,
  28.177 +                                          unsigned int table_size)
  28.178 +{
  28.179 +    struct acpi_20_xsdt *xsdt = acpi_xsdt_get(acpi_start);
  28.180 +    int found = 0, i = 0;
  28.181 +    unsigned char *addr = NULL;
  28.182 +
  28.183 +    /* get empty slot in the Xsdt table */
  28.184 +    while (i < ACPI_MAX_NUM_TABLES) {
  28.185 +        if (xsdt->entry[i] == 0) {
  28.186 +            found = 1;
  28.187 +            break;
  28.188 +        }
  28.189 +        i++;
  28.190 +    }
  28.191 +
  28.192 +    if (found) {
  28.193 +        /* memory below hard limit ? */
  28.194 +        if (*freemem + table_size <= limit) {
  28.195 +            puts("Copying SSDT entry!\n");
  28.196 +            addr = *freemem;
  28.197 +            memcpy(addr, table, table_size);
  28.198 +            xsdt->entry[i] = (uint64_t)(long)addr;
  28.199 +            *freemem += table_size;
  28.200 +            /* update the XSDT table */
  28.201 +            xsdt->header.length =
  28.202 +                sizeof(struct acpi_header) +
  28.203 +                (i + 1) * sizeof(uint64_t);
  28.204 +            set_checksum(xsdt,
  28.205 +                         FIELD_OFFSET(struct acpi_header, checksum),
  28.206 +                         xsdt->header.length);
  28.207 +        }
  28.208 +    }
  28.209 +    return addr;
  28.210 +}
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/tools/firmware/hvmloader/acpi_utils.h	Tue Oct 31 12:42:50 2006 +0000
    29.3 @@ -0,0 +1,36 @@
    29.4 +/*
    29.5 + * Commonly used ACPI utility functions.
    29.6 + *
    29.7 + * Yu Ke, ke.yu@intel.com
    29.8 + * Copyright (c) 2005, Intel Corporation.
    29.9 + *
   29.10 + * This program is free software; you can redistribute it and/or modify it
   29.11 + * under the terms and conditions of the GNU General Public License,
   29.12 + * version 2, as published by the Free Software Foundation.
   29.13 + *
   29.14 + * This program is distributed in the hope it will be useful, but WITHOUT
   29.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   29.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   29.17 + * more details.
   29.18 + *
   29.19 + * You should have received a copy of the GNU General Public License along with
   29.20 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   29.21 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   29.22 + */
   29.23 +#ifndef ACPI_UTILS_H
   29.24 +#define ACPI_UTILS_H
   29.25 +
   29.26 +#define FIELD_OFFSET(TYPE,Field) ((unsigned int)(&(((TYPE *) 0)->Field)))
   29.27 +
   29.28 +#define NULL ((void*)0)
   29.29 +
   29.30 +void set_checksum(void *start, int checksum_offset, int len);
   29.31 +void acpi_update(unsigned char *acpi_start,
   29.32 +                 unsigned long acpi_size,
   29.33 +                 unsigned char *limit,
   29.34 +                 unsigned char **freemem);
   29.35 +
   29.36 +struct acpi_20_rsdt *acpi_rsdt_get(unsigned char *acpi_start);
   29.37 +struct acpi_20_xsdt *acpi_xsdt_get(unsigned char *acpi_start);
   29.38 +
   29.39 +#endif
    30.1 --- a/tools/firmware/hvmloader/hvmloader.c	Tue Oct 31 11:44:47 2006 +0000
    30.2 +++ b/tools/firmware/hvmloader/hvmloader.c	Tue Oct 31 12:42:50 2006 +0000
    30.3 @@ -22,9 +22,10 @@
    30.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
    30.5   */
    30.6  #include "roms.h"
    30.7 -#include "../acpi/acpi2_0.h"  /* for ACPI_PHYSICAL_ADDRESS */
    30.8 +#include "acpi/acpi2_0.h"  /* for ACPI_PHYSICAL_ADDRESS */
    30.9  #include "hypercall.h"
   30.10  #include "util.h"
   30.11 +#include "acpi_utils.h"
   30.12  #include "smbios.h"
   30.13  #include <xen/version.h>
   30.14  #include <xen/hvm/params.h>
   30.15 @@ -195,12 +196,18 @@ main(void)
   30.16  		puts("Loading ACPI ...\n");
   30.17  		acpi_madt_update((unsigned char *) acpi);
   30.18  		if (ACPI_PHYSICAL_ADDRESS+sizeof(acpi) <= 0xF0000) {
   30.19 +			unsigned char *freemem = (unsigned char *)
   30.20 +			         (ACPI_PHYSICAL_ADDRESS + sizeof(acpi));
   30.21  			/*
   30.22  			 * Make sure acpi table does not overlap rombios
   30.23  			 * currently acpi less than 8K will be OK.
   30.24  			 */
   30.25  			 memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi,
   30.26  			 					sizeof(acpi));
   30.27 +			acpi_update((unsigned char *)ACPI_PHYSICAL_ADDRESS,
   30.28 +			            sizeof(acpi),
   30.29 +			            (unsigned char *)0xF0000,
   30.30 +			            &freemem);
   30.31  		}
   30.32  	}
   30.33  
    31.1 --- a/tools/firmware/hvmloader/util.c	Tue Oct 31 11:44:47 2006 +0000
    31.2 +++ b/tools/firmware/hvmloader/util.c	Tue Oct 31 12:42:50 2006 +0000
    31.3 @@ -18,7 +18,7 @@
    31.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
    31.5   */
    31.6  
    31.7 -#include "../acpi/acpi2_0.h"  /* for ACPI_PHYSICAL_ADDRESS */
    31.8 +#include "acpi/acpi2_0.h"  /* for ACPI_PHYSICAL_ADDRESS */
    31.9  #include "util.h"
   31.10  #include <stdint.h>
   31.11