ia64/xen-unstable

changeset 17248:13cba2e78a65

Update ACPI headers to Linux 2.6.24.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 14:55:36 2008 +0000 (2008-03-18)
parents 5cbfc6c24d32
children c978ecfc4f41
files xen/arch/ia64/xen/acpi.c xen/arch/ia64/xen/dom_fw_common.c xen/arch/x86/acpi/boot.c xen/arch/x86/srat.c xen/drivers/acpi/numa.c xen/drivers/acpi/tables.c xen/drivers/passthrough/vtd/dmar.c xen/include/acpi/acconfig.h xen/include/acpi/acexcep.h xen/include/acpi/acglobal.h xen/include/acpi/achware.h xen/include/acpi/aclocal.h xen/include/acpi/acmacros.h xen/include/acpi/acnames.h xen/include/acpi/acobject.h xen/include/acpi/acoutput.h xen/include/acpi/acpi.h xen/include/acpi/acpi_bus.h xen/include/acpi/acpiosxf.h xen/include/acpi/acpixf.h xen/include/acpi/acstruct.h xen/include/acpi/actbl.h xen/include/acpi/actbl1.h xen/include/acpi/actbl2.h xen/include/acpi/actypes.h xen/include/acpi/acutils.h xen/include/acpi/pdc_intel.h xen/include/acpi/platform/acenv.h xen/include/acpi/platform/acgcc.h xen/include/acpi/platform/aclinux.h xen/include/asm-x86/acpi.h xen/include/asm-x86/apic.h xen/include/xen/acpi.h
line diff
     1.1 --- a/xen/arch/ia64/xen/acpi.c	Tue Mar 18 13:14:26 2008 +0000
     1.2 +++ b/xen/arch/ia64/xen/acpi.c	Tue Mar 18 14:55:36 2008 +0000
     1.3 @@ -560,7 +560,7 @@ static int __init
     1.4  acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
     1.5  {
     1.6  	struct acpi_table_header *fadt_header;
     1.7 -	struct fadt_descriptor_rev2 *fadt;
     1.8 +	struct acpi_table_fadt *fadt;
     1.9  
    1.10  	if (!phys_addr || !size)
    1.11  		return -EINVAL;
    1.12 @@ -569,16 +569,16 @@ acpi_parse_fadt (unsigned long phys_addr
    1.13  	if (fadt_header->revision != 3)
    1.14  		return -ENODEV;		/* Only deal with ACPI 2.0 FADT */
    1.15  
    1.16 -	fadt = (struct fadt_descriptor_rev2 *) fadt_header;
    1.17 +	fadt = (struct acpi_table_fadt *) fadt_header;
    1.18  
    1.19 -	if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
    1.20 +	if (!(fadt->boot_flags & BAF_8042_KEYBOARD_CONTROLLER))
    1.21  		acpi_kbd_controller_present = 0;
    1.22  
    1.23 -	if (fadt->iapc_boot_arch & BAF_LEGACY_DEVICES)
    1.24 +	if (fadt->boot_flags & BAF_LEGACY_DEVICES)
    1.25  		acpi_legacy_devices = 1;
    1.26  
    1.27  #if 0
    1.28 -	acpi_register_gsi(fadt->sci_int, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
    1.29 +	acpi_register_gsi(fadt->sci_interrupt, ACPI_ACTIVE_LOW, ACPI_LEVEL_SENSITIVE);
    1.30  #endif
    1.31  	return 0;
    1.32  }
     2.1 --- a/xen/arch/ia64/xen/dom_fw_common.c	Tue Mar 18 13:14:26 2008 +0000
     2.2 +++ b/xen/arch/ia64/xen/dom_fw_common.c	Tue Mar 18 14:55:36 2008 +0000
     2.3 @@ -209,10 +209,10 @@ print_md(efi_memory_desc_t *md)
     2.4  
     2.5  struct fake_acpi_tables {
     2.6  	struct acpi20_table_rsdp rsdp;
     2.7 -	struct xsdt_descriptor_rev2 xsdt;
     2.8 +	struct acpi_table_xsdt xsdt;
     2.9  	uint64_t madt_ptr;
    2.10 -	struct fadt_descriptor_rev2 fadt;
    2.11 -	struct facs_descriptor_rev2 facs;
    2.12 +	struct acpi_table_fadt fadt;
    2.13 +	struct acpi_table_facs facs;
    2.14  	struct acpi_table_header dsdt;
    2.15  	uint8_t aml[8 + 11 * MAX_VIRT_CPUS];
    2.16  	struct acpi_table_madt madt;
    2.17 @@ -229,9 +229,9 @@ void
    2.18  dom_fw_fake_acpi(domain_t *d, struct fake_acpi_tables *tables)
    2.19  {
    2.20  	struct acpi20_table_rsdp *rsdp = &tables->rsdp;
    2.21 -	struct xsdt_descriptor_rev2 *xsdt = &tables->xsdt;
    2.22 -	struct fadt_descriptor_rev2 *fadt = &tables->fadt;
    2.23 -	struct facs_descriptor_rev2 *facs = &tables->facs;
    2.24 +	struct acpi_table_xsdt *xsdt = &tables->xsdt;
    2.25 +	struct acpi_table_fadt *fadt = &tables->fadt;
    2.26 +	struct acpi_table_facs *facs = &tables->facs;
    2.27  	struct acpi_table_header *dsdt = &tables->dsdt;
    2.28  	struct acpi_table_madt *madt = &tables->madt;
    2.29  	struct acpi_table_lsapic *lsapic = tables->lsapic;
    2.30 @@ -247,7 +247,7 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.31  	/* setup XSDT (64bit version of RSDT) */
    2.32  	memcpy(xsdt->signature, XSDT_SIG, sizeof(xsdt->signature));
    2.33  	/* XSDT points to both the FADT and the MADT, so add one entry */
    2.34 -	xsdt->length = sizeof(struct xsdt_descriptor_rev2) + sizeof(uint64_t);
    2.35 +	xsdt->length = sizeof(struct acpi_table_xsdt) + sizeof(uint64_t);
    2.36  	xsdt->revision = 1;
    2.37  	memcpy(xsdt->oem_id, "XEN", 3);
    2.38  	memcpy(xsdt->oem_table_id, "Xen/ia64", 8);
    2.39 @@ -261,7 +261,7 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.40  
    2.41  	/* setup FADT */
    2.42  	memcpy(fadt->signature, FADT_SIG, sizeof(fadt->signature));
    2.43 -	fadt->length = sizeof(struct fadt_descriptor_rev2);
    2.44 +	fadt->length = sizeof(struct acpi_table_fadt);
    2.45  	fadt->revision = FADT2_REVISION_ID;
    2.46  	memcpy(fadt->oem_id, "XEN", 3);
    2.47  	memcpy(fadt->oem_table_id, "Xen/ia64", 8);
    2.48 @@ -270,7 +270,7 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.49  
    2.50  	memcpy(facs->signature, FACS_SIG, sizeof(facs->signature));
    2.51  	facs->version = 1;
    2.52 -	facs->length = sizeof(struct facs_descriptor_rev2);
    2.53 +	facs->length = sizeof(struct acpi_table_facs);
    2.54  
    2.55  	fadt->xfirmware_ctrl = ACPI_TABLE_MPA(facs);
    2.56  	fadt->Xdsdt = ACPI_TABLE_MPA(dsdt);
     3.1 --- a/xen/arch/x86/acpi/boot.c	Tue Mar 18 13:14:26 2008 +0000
     3.2 +++ b/xen/arch/x86/acpi/boot.c	Tue Mar 18 14:55:36 2008 +0000
     3.3 @@ -63,7 +63,7 @@ int acpi_ioapic;
     3.4  int acpi_strict;
     3.5  EXPORT_SYMBOL(acpi_strict);
     3.6  
     3.7 -acpi_interrupt_flags acpi_sci_flags __initdata;
     3.8 +u8 acpi_sci_flags __initdata;
     3.9  int acpi_sci_override_gsi __initdata;
    3.10  int acpi_skip_timer_override __initdata;
    3.11  
    3.12 @@ -148,11 +148,11 @@ static int __init acpi_parse_madt(unsign
    3.13  		return -ENODEV;
    3.14  	}
    3.15  
    3.16 -	if (madt->lapic_address) {
    3.17 -		acpi_lapic_addr = (u64) madt->lapic_address;
    3.18 +	if (madt->address) {
    3.19 +		acpi_lapic_addr = (u64) madt->address;
    3.20  
    3.21  		printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
    3.22 -		       madt->lapic_address);
    3.23 +		       madt->address);
    3.24  	}
    3.25  
    3.26  	acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
    3.27 @@ -342,15 +342,14 @@ static int __init acpi_parse_hpet(unsign
    3.28  		return -ENODEV;
    3.29  	}
    3.30  
    3.31 -	if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
    3.32 +	if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) {
    3.33  		printk(KERN_WARNING PREFIX "HPET timers must be located in "
    3.34  		       "memory.\n");
    3.35  		return -1;
    3.36  	}
    3.37  
    3.38  #if 0/*def	CONFIG_X86_64*/
    3.39 -        vxtime.hpet_address = hpet_tbl->addr.addrl |
    3.40 -                ((long) hpet_tbl->addr.addrh << 32);
    3.41 +        vxtime.hpet_address = hpet_tbl->address.address;
    3.42  
    3.43          printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
    3.44                 hpet_tbl->id, vxtime.hpet_address);
    3.45 @@ -358,7 +357,7 @@ static int __init acpi_parse_hpet(unsign
    3.46  	{
    3.47  		extern unsigned long hpet_address;
    3.48  
    3.49 -		hpet_address = hpet_tbl->addr.addrl;
    3.50 +		hpet_address = hpet_tbl->address.address;
    3.51  		printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
    3.52  		       hpet_tbl->id, hpet_address);
    3.53  	}
    3.54 @@ -377,11 +376,11 @@ extern u32 pmtmr_ioport;
    3.55  #ifdef CONFIG_ACPI_SLEEP
    3.56  /* Get pm1x_cnt and pm1x_evt information for ACPI sleep */
    3.57  static void __init
    3.58 -acpi_fadt_parse_sleep_info(struct fadt_descriptor_rev2 *fadt)
    3.59 +acpi_fadt_parse_sleep_info(struct acpi_table_fadt *fadt)
    3.60  {
    3.61  	struct acpi_table_rsdp *rsdp;
    3.62  	unsigned long rsdp_phys;
    3.63 -	struct facs_descriptor_rev2 *facs = NULL;
    3.64 +	struct acpi_table_facs *facs = NULL;
    3.65  	uint64_t facs_pa;
    3.66  
    3.67  	rsdp_phys = acpi_find_rsdp();
    3.68 @@ -389,41 +388,41 @@ acpi_fadt_parse_sleep_info(struct fadt_d
    3.69  		goto bad;
    3.70  	rsdp = __va(rsdp_phys);
    3.71  
    3.72 -	if (fadt->revision >= FADT2_REVISION_ID) {
    3.73 +	if (fadt->header.revision >= FADT2_REVISION_ID) {
    3.74  		/* Sanity check on FADT Rev. 2 */
    3.75 -		if ((fadt->xpm1a_cnt_blk.address_space_id !=
    3.76 +		if ((fadt->xpm1a_control_block.space_id !=
    3.77  		     ACPI_ADR_SPACE_SYSTEM_IO) ||
    3.78 -		    (fadt->xpm1b_cnt_blk.address_space_id !=
    3.79 +		    (fadt->xpm1b_control_block.space_id !=
    3.80  		     ACPI_ADR_SPACE_SYSTEM_IO) ||
    3.81 -		    (fadt->xpm1a_evt_blk.address_space_id !=
    3.82 +		    (fadt->xpm1a_event_block.space_id !=
    3.83  		     ACPI_ADR_SPACE_SYSTEM_IO) ||
    3.84 -		    (fadt->xpm1b_evt_blk.address_space_id !=
    3.85 +		    (fadt->xpm1b_event_block.space_id !=
    3.86  		     ACPI_ADR_SPACE_SYSTEM_IO))
    3.87  			goto bad; 
    3.88  
    3.89 -		acpi_sinfo.pm1a_cnt = (uint16_t)fadt->xpm1a_cnt_blk.address;
    3.90 -		acpi_sinfo.pm1b_cnt = (uint16_t)fadt->xpm1b_cnt_blk.address;
    3.91 -		acpi_sinfo.pm1a_evt = (uint16_t)fadt->xpm1a_evt_blk.address;
    3.92 -		acpi_sinfo.pm1b_evt = (uint16_t)fadt->xpm1b_evt_blk.address;
    3.93 +		acpi_sinfo.pm1a_cnt = (uint16_t)fadt->xpm1a_control_block.address;
    3.94 +		acpi_sinfo.pm1b_cnt = (uint16_t)fadt->xpm1b_control_block.address;
    3.95 +		acpi_sinfo.pm1a_evt = (uint16_t)fadt->xpm1a_event_block.address;
    3.96 +		acpi_sinfo.pm1b_evt = (uint16_t)fadt->xpm1b_event_block.address;
    3.97  	}
    3.98  
    3.99  	if (!acpi_sinfo.pm1a_cnt)
   3.100 -		acpi_sinfo.pm1a_cnt = (uint16_t)fadt->V1_pm1a_cnt_blk;
   3.101 +		acpi_sinfo.pm1a_cnt = (uint16_t)fadt->pm1a_control_block;
   3.102  	if (!acpi_sinfo.pm1b_cnt)
   3.103 -		acpi_sinfo.pm1b_cnt = (uint16_t)fadt->V1_pm1b_cnt_blk;
   3.104 +		acpi_sinfo.pm1b_cnt = (uint16_t)fadt->pm1b_control_block;
   3.105  	if (!acpi_sinfo.pm1a_evt)
   3.106 -		acpi_sinfo.pm1a_evt = (uint16_t)fadt->V1_pm1a_evt_blk;
   3.107 +		acpi_sinfo.pm1a_evt = (uint16_t)fadt->pm1a_event_block;
   3.108  	if (!acpi_sinfo.pm1b_evt)
   3.109 -		acpi_sinfo.pm1b_evt = (uint16_t)fadt->V1_pm1b_evt_blk;
   3.110 +		acpi_sinfo.pm1b_evt = (uint16_t)fadt->pm1b_event_block;
   3.111  
   3.112  	/* Now FACS... */
   3.113 -	if (fadt->revision >= FADT2_REVISION_ID)
   3.114 -		facs_pa = fadt->xfirmware_ctrl;
   3.115 +	if (fadt->header.revision >= FADT2_REVISION_ID)
   3.116 +		facs_pa = fadt->Xfacs;
   3.117  	else
   3.118 -		facs_pa = (uint64_t)fadt->V1_firmware_ctrl;
   3.119 +		facs_pa = (uint64_t)fadt->facs;
   3.120  
   3.121 -	facs = (struct facs_descriptor_rev2 *)
   3.122 -		__acpi_map_table(facs_pa, sizeof(struct facs_descriptor_rev2));
   3.123 +	facs = (struct acpi_table_facs *)
   3.124 +		__acpi_map_table(facs_pa, sizeof(struct acpi_table_facs));
   3.125  	if (!facs)
   3.126  		goto bad;
   3.127  
   3.128 @@ -446,12 +445,12 @@ acpi_fadt_parse_sleep_info(struct fadt_d
   3.129  
   3.130  	if ((rsdp->revision < 2) || (facs->length < 32)) {
   3.131  		acpi_sinfo.wakeup_vector = facs_pa + 
   3.132 -			offsetof(struct facs_descriptor_rev2,
   3.133 +			offsetof(struct acpi_table_facs,
   3.134  				 firmware_waking_vector);
   3.135  		acpi_sinfo.vector_width = 32;
   3.136  	} else {
   3.137  		acpi_sinfo.wakeup_vector = facs_pa +
   3.138 -			offsetof(struct facs_descriptor_rev2,
   3.139 +			offsetof(struct acpi_table_facs,
   3.140  				 xfirmware_waking_vector);
   3.141  		acpi_sinfo.vector_width = 64;
   3.142  	}
   3.143 @@ -471,9 +470,9 @@ bad:
   3.144  
   3.145  static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
   3.146  {
   3.147 -	struct fadt_descriptor_rev2 *fadt = NULL;
   3.148 +	struct acpi_table_fadt *fadt = NULL;
   3.149  
   3.150 -	fadt = (struct fadt_descriptor_rev2 *)__acpi_map_table(phys, size);
   3.151 +	fadt = (struct acpi_table_fadt *)__acpi_map_table(phys, size);
   3.152  	if (!fadt) {
   3.153  		printk(KERN_WARNING PREFIX "Unable to map FADT\n");
   3.154  		return 0;
   3.155 @@ -491,28 +490,28 @@ static int __init acpi_parse_fadt(unsign
   3.156  
   3.157  #ifdef CONFIG_X86_PM_TIMER
   3.158  	/* detect the location of the ACPI PM Timer */
   3.159 -	if (fadt->revision >= FADT2_REVISION_ID) {
   3.160 +	if (fadt->header.revision >= FADT2_REVISION_ID) {
   3.161  		/* FADT rev. 2 */
   3.162 -		if (fadt->xpm_tmr_blk.address_space_id ==
   3.163 +		if (fadt->xpm_timer_block.space_id ==
   3.164  		    ACPI_ADR_SPACE_SYSTEM_IO)
   3.165 -			pmtmr_ioport = fadt->xpm_tmr_blk.address;
   3.166 +			pmtmr_ioport = fadt->xpm_timer_block.address;
   3.167  		/*
   3.168  		 * "X" fields are optional extensions to the original V1.0
   3.169  		 * fields, so we must selectively expand V1.0 fields if the
   3.170  		 * corresponding X field is zero.
   3.171  	 	 */
   3.172  		if (!pmtmr_ioport)
   3.173 -			pmtmr_ioport = fadt->V1_pm_tmr_blk;
   3.174 +			pmtmr_ioport = fadt->pm_timer_block;
   3.175  	} else {
   3.176  		/* FADT rev. 1 */
   3.177 -		pmtmr_ioport = fadt->V1_pm_tmr_blk;
   3.178 +		pmtmr_ioport = fadt->pm_timer_block;
   3.179  	}
   3.180  	if (pmtmr_ioport)
   3.181  		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
   3.182  		       pmtmr_ioport);
   3.183  #endif
   3.184  
   3.185 -	acpi_smi_cmd       = fadt->smi_cmd;
   3.186 +	acpi_smi_cmd       = fadt->smi_command;
   3.187  	acpi_enable_value  = fadt->acpi_enable;
   3.188  	acpi_disable_value = fadt->acpi_disable;
   3.189  
     4.1 --- a/xen/arch/x86/srat.c	Tue Mar 18 13:14:26 2008 +0000
     4.2 +++ b/xen/arch/x86/srat.c	Tue Mar 18 14:55:36 2008 +0000
     4.3 @@ -106,7 +106,7 @@ static __init inline int srat_disabled(v
     4.4  static __init int slit_valid(struct acpi_table_slit *slit)
     4.5  {
     4.6  	int i, j;
     4.7 -	int d = slit->localities;
     4.8 +	int d = slit->locality_count;
     4.9  	for (i = 0; i < d; i++) {
    4.10  		for (j = 0; j < d; j++)  {
    4.11  			u8 val = slit->entry[d*i + j];
    4.12 @@ -308,7 +308,7 @@ int __node_distance(int a, int b)
    4.13  
    4.14  	if (!acpi_slit)
    4.15  		return a == b ? 10 : 20;
    4.16 -	index = acpi_slit->localities * node_to_pxm(a);
    4.17 +	index = acpi_slit->locality_count * node_to_pxm(a);
    4.18  	return acpi_slit->entry[index + node_to_pxm(b)];
    4.19  }
    4.20  
     5.1 --- a/xen/drivers/acpi/numa.c	Tue Mar 18 13:14:26 2008 +0000
     5.2 +++ b/xen/drivers/acpi/numa.c	Tue Mar 18 14:55:36 2008 +0000
     5.3 @@ -104,7 +104,7 @@ static int __init acpi_parse_slit(unsign
     5.4  	slit = (struct acpi_table_slit *)__acpi_map_table(phys_addr, size);
     5.5  
     5.6  	/* downcast just for %llu vs %lu for i386/ia64  */
     5.7 -	localities = (u32) slit->localities;
     5.8 +	localities = (u32) slit->locality_count;
     5.9  
    5.10  	acpi_numa_slit_init(slit);
    5.11  
     6.1 --- a/xen/drivers/acpi/tables.c	Tue Mar 18 13:14:26 2008 +0000
     6.2 +++ b/xen/drivers/acpi/tables.c	Tue Mar 18 14:55:36 2008 +0000
     6.3 @@ -295,15 +295,15 @@ acpi_get_table_header_early(enum acpi_ta
     6.4  
     6.5  	/* Map the DSDT header via the pointer in the FADT */
     6.6  	if (id == ACPI_DSDT) {
     6.7 -		struct fadt_descriptor_rev2 *fadt =
     6.8 -		    (struct fadt_descriptor_rev2 *)*header;
     6.9 +		struct acpi_table_fadt *fadt =
    6.10 +			(struct acpi_table_fadt *)*header;
    6.11  
    6.12 -		if (fadt->revision == 3 && fadt->Xdsdt) {
    6.13 +		if (fadt->header.revision == 3 && fadt->Xdsdt) {
    6.14  			*header = (void *)__acpi_map_table(fadt->Xdsdt,
    6.15  							   sizeof(struct
    6.16  								  acpi_table_header));
    6.17 -		} else if (fadt->V1_dsdt) {
    6.18 -			*header = (void *)__acpi_map_table(fadt->V1_dsdt,
    6.19 +		} else if (fadt->dsdt) {
    6.20 +			*header = (void *)__acpi_map_table(fadt->dsdt,
    6.21  							   sizeof(struct
    6.22  								  acpi_table_header));
    6.23  		} else
    6.24 @@ -424,12 +424,11 @@ static int __init acpi_table_get_sdt(str
    6.25  
    6.26  	/* First check XSDT (but only on ACPI 2.0-compatible systems) */
    6.27  
    6.28 -	if ((rsdp->revision >= 2) &&
    6.29 -	    (((struct acpi20_table_rsdp *)rsdp)->xsdt_address)) {
    6.30 +	if ((rsdp->revision >= 2) && rsdp->xsdt_physical_address) {
    6.31  
    6.32  		struct acpi_table_xsdt *mapped_xsdt = NULL;
    6.33  
    6.34 -		sdt_pa = ((struct acpi20_table_rsdp *)rsdp)->xsdt_address;
    6.35 +		sdt_pa = rsdp->xsdt_physical_address;
    6.36  
    6.37  		/* map in just the header */
    6.38  		header = (struct acpi_table_header *)
    6.39 @@ -471,16 +470,16 @@ static int __init acpi_table_get_sdt(str
    6.40  		}
    6.41  
    6.42  		for (i = 0; i < sdt_count; i++)
    6.43 -			sdt_entry[i].pa = (unsigned long)mapped_xsdt->entry[i];
    6.44 +			sdt_entry[i].pa = (unsigned long)mapped_xsdt->table_offset_entry[i];
    6.45  	}
    6.46  
    6.47  	/* Then check RSDT */
    6.48  
    6.49 -	else if (rsdp->rsdt_address) {
    6.50 +	else if (rsdp->rsdt_physical_address) {
    6.51  
    6.52  		struct acpi_table_rsdt *mapped_rsdt = NULL;
    6.53  
    6.54 -		sdt_pa = rsdp->rsdt_address;
    6.55 +		sdt_pa = rsdp->rsdt_physical_address;
    6.56  
    6.57  		/* map in just the header */
    6.58  		header = (struct acpi_table_header *)
    6.59 @@ -521,7 +520,7 @@ static int __init acpi_table_get_sdt(str
    6.60  		}
    6.61  
    6.62  		for (i = 0; i < sdt_count; i++)
    6.63 -			sdt_entry[i].pa = (unsigned long)mapped_rsdt->entry[i];
    6.64 +			sdt_entry[i].pa = (unsigned long)mapped_rsdt->table_offset_entry[i];
    6.65  	}
    6.66  
    6.67  	else {
    6.68 @@ -613,13 +612,10 @@ int __init acpi_table_init(void)
    6.69  
    6.70  	if (rsdp->revision < 2)
    6.71  		result =
    6.72 -		    acpi_table_compute_checksum(rsdp,
    6.73 -						sizeof(struct acpi_table_rsdp));
    6.74 +		    acpi_table_compute_checksum(rsdp, 20);
    6.75  	else
    6.76  		result =
    6.77 -		    acpi_table_compute_checksum(rsdp,
    6.78 -						((struct acpi20_table_rsdp *)
    6.79 -						 rsdp)->length);
    6.80 +		    acpi_table_compute_checksum(rsdp, rsdp->length);
    6.81  
    6.82  	if (result) {
    6.83  		printk(KERN_WARNING "  >>> ERROR: Invalid checksum\n");
    6.84 @@ -663,12 +659,11 @@ acpi_table_disable(enum acpi_table_id ta
    6.85  
    6.86  	/* First check XSDT (but only on ACPI 2.0-compatible systems) */
    6.87  
    6.88 -	if ((rsdp->revision >= 2) &&
    6.89 -	    (((struct acpi20_table_rsdp *)rsdp)->xsdt_address)) {
    6.90 +	if ((rsdp->revision >= 2) && rsdp->xsdt_physical_address) {
    6.91  
    6.92  		struct acpi_table_xsdt *mapped_xsdt = NULL;
    6.93  
    6.94 -		sdt_pa = ((struct acpi20_table_rsdp *)rsdp)->xsdt_address;
    6.95 +		sdt_pa = rsdp->xsdt_physical_address;
    6.96  
    6.97  		/* map in just the header */
    6.98  		header = (struct acpi_table_header *)
    6.99 @@ -702,7 +697,7 @@ acpi_table_disable(enum acpi_table_id ta
   6.100  
   6.101  		if (id < sdt_count) {
   6.102  			header = (struct acpi_table_header *)
   6.103 -			   __acpi_map_table(mapped_xsdt->entry[id], sizeof(struct acpi_table_header));
   6.104 +			   __acpi_map_table(mapped_xsdt->table_offset_entry[id], sizeof(struct acpi_table_header));
   6.105  		} else {
   6.106  			printk(KERN_WARNING PREFIX
   6.107  			       "Unable to disable entry %d\n",
   6.108 @@ -713,11 +708,11 @@ acpi_table_disable(enum acpi_table_id ta
   6.109  
   6.110  	/* Then check RSDT */
   6.111  
   6.112 -	else if (rsdp->rsdt_address) {
   6.113 +	else if (rsdp->rsdt_physical_address) {
   6.114  
   6.115  		struct acpi_table_rsdt *mapped_rsdt = NULL;
   6.116  
   6.117 -		sdt_pa = rsdp->rsdt_address;
   6.118 +		sdt_pa = rsdp->rsdt_physical_address;
   6.119  
   6.120  		/* map in just the header */
   6.121  		header = (struct acpi_table_header *)
   6.122 @@ -749,7 +744,7 @@ acpi_table_disable(enum acpi_table_id ta
   6.123  		}
   6.124  		if (id < sdt_count) {
   6.125  			header = (struct acpi_table_header *)
   6.126 -			   __acpi_map_table(mapped_rsdt->entry[id], sizeof(struct acpi_table_header));
   6.127 +			   __acpi_map_table(mapped_rsdt->table_offset_entry[id], sizeof(struct acpi_table_header));
   6.128  		} else {
   6.129  			printk(KERN_WARNING PREFIX
   6.130  			       "Unable to disable entry %d\n",
     7.1 --- a/xen/drivers/passthrough/vtd/dmar.c	Tue Mar 18 13:14:26 2008 +0000
     7.2 +++ b/xen/drivers/passthrough/vtd/dmar.c	Tue Mar 18 14:55:36 2008 +0000
     7.3 @@ -555,13 +555,13 @@ static int __init acpi_parse_dmar(unsign
     7.4          return -ENODEV;
     7.5      }
     7.6  
     7.7 -    if ( !dmar->haw )
     7.8 +    if ( !dmar->width )
     7.9      {
    7.10 -        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR haw\n");
    7.11 +        dprintk(XENLOG_WARNING VTDPREFIX, "Zero: Invalid DMAR width\n");
    7.12          return -EINVAL;
    7.13      }
    7.14  
    7.15 -    dmar_host_address_width = dmar->haw;
    7.16 +    dmar_host_address_width = dmar->width;
    7.17      dprintk(XENLOG_INFO VTDPREFIX, "Host address width %d\n",
    7.18              dmar_host_address_width);
    7.19  
     8.1 --- a/xen/include/acpi/acconfig.h	Tue Mar 18 13:14:26 2008 +0000
     8.2 +++ b/xen/include/acpi/acconfig.h	Tue Mar 18 14:55:36 2008 +0000
     8.3 @@ -5,7 +5,7 @@
     8.4   *****************************************************************************/
     8.5  
     8.6  /*
     8.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
     8.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
     8.9   * All rights reserved.
    8.10   *
    8.11   * Redistribution and use in source and binary forms, with or without
    8.12 @@ -44,7 +44,6 @@
    8.13  #ifndef _ACCONFIG_H
    8.14  #define _ACCONFIG_H
    8.15  
    8.16 -
    8.17  /******************************************************************************
    8.18   *
    8.19   * Configuration options
    8.20 @@ -62,9 +61,9 @@
    8.21   *
    8.22   */
    8.23  
    8.24 -/* Version string */
    8.25 +/* Current ACPICA subsystem version in YYYYMMDD format */
    8.26  
    8.27 -#define ACPI_CA_VERSION                 0x20050211
    8.28 +#define ACPI_CA_VERSION                 0x20070126
    8.29  
    8.30  /*
    8.31   * OS name, used for the _OS object.  The _OS object is essentially obsolete,
    8.32 @@ -78,19 +77,18 @@
    8.33  
    8.34  /* Maximum objects in the various object caches */
    8.35  
    8.36 -#define ACPI_MAX_STATE_CACHE_DEPTH      64          /* State objects */
    8.37 -#define ACPI_MAX_PARSE_CACHE_DEPTH      96          /* Parse tree objects */
    8.38 -#define ACPI_MAX_EXTPARSE_CACHE_DEPTH   64          /* Parse tree objects */
    8.39 -#define ACPI_MAX_OBJECT_CACHE_DEPTH     64          /* Interpreter operand objects */
    8.40 -#define ACPI_MAX_WALK_CACHE_DEPTH       4           /* Objects for parse tree walks */
    8.41 +#define ACPI_MAX_STATE_CACHE_DEPTH      96	/* State objects */
    8.42 +#define ACPI_MAX_PARSE_CACHE_DEPTH      96	/* Parse tree objects */
    8.43 +#define ACPI_MAX_EXTPARSE_CACHE_DEPTH   96	/* Parse tree objects */
    8.44 +#define ACPI_MAX_OBJECT_CACHE_DEPTH     96	/* Interpreter operand objects */
    8.45 +#define ACPI_MAX_NAMESPACE_CACHE_DEPTH  96	/* Namespace objects */
    8.46  
    8.47  /*
    8.48 - * Should the subystem abort the loading of an ACPI table if the
    8.49 + * Should the subsystem abort the loading of an ACPI table if the
    8.50   * table checksum is incorrect?
    8.51   */
    8.52  #define ACPI_CHECKSUM_ABORT             FALSE
    8.53  
    8.54 -
    8.55  /******************************************************************************
    8.56   *
    8.57   * Subsystem Constants
    8.58 @@ -101,23 +99,25 @@
    8.59  
    8.60  #define ACPI_CA_SUPPORT_LEVEL           3
    8.61  
    8.62 -/* String size constants */
    8.63 -
    8.64 -#define ACPI_MAX_STRING_LENGTH          512
    8.65 -#define ACPI_PATHNAME_MAX               256         /* A full namespace pathname */
    8.66 -
    8.67  /* Maximum count for a semaphore object */
    8.68  
    8.69  #define ACPI_MAX_SEMAPHORE_COUNT        256
    8.70  
    8.71 -/* Max reference count (for debug only) */
    8.72 +/* Maximum object reference count (detects object deletion issues) */
    8.73  
    8.74 -#define ACPI_MAX_REFERENCE_COUNT        0x400
    8.75 +#define ACPI_MAX_REFERENCE_COUNT        0x1000
    8.76  
    8.77  /* Size of cached memory mapping for system memory operation region */
    8.78  
    8.79  #define ACPI_SYSMEM_REGION_WINDOW_SIZE  4096
    8.80  
    8.81 +/* owner_id tracking. 8 entries allows for 255 owner_ids */
    8.82 +
    8.83 +#define ACPI_NUM_OWNERID_MASKS          8
    8.84 +
    8.85 +/* Size of the root table array is increased by this increment */
    8.86 +
    8.87 +#define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
    8.88  
    8.89  /******************************************************************************
    8.90   *
    8.91 @@ -130,23 +130,19 @@
    8.92  #define ACPI_MAX_GPE_BLOCKS             2
    8.93  #define ACPI_GPE_REGISTER_WIDTH         8
    8.94  
    8.95 -/*
    8.96 - * Method info (in WALK_STATE), containing local variables and argumetns
    8.97 - */
    8.98 +/* Method info (in WALK_STATE), containing local variables and argumetns */
    8.99 +
   8.100  #define ACPI_METHOD_NUM_LOCALS          8
   8.101  #define ACPI_METHOD_MAX_LOCAL           7
   8.102  
   8.103  #define ACPI_METHOD_NUM_ARGS            7
   8.104  #define ACPI_METHOD_MAX_ARG             6
   8.105  
   8.106 -/* Maximum length of resulting string when converting from a buffer */
   8.107 -
   8.108 -#define ACPI_MAX_STRING_CONVERSION      200
   8.109 -
   8.110 -/* Length of _HID, _UID, and _CID values */
   8.111 +/* Length of _HID, _UID, _CID, and UUID values */
   8.112  
   8.113  #define ACPI_DEVICE_ID_LENGTH           0x09
   8.114  #define ACPI_MAX_CID_LENGTH             48
   8.115 +#define ACPI_UUID_LENGTH                16
   8.116  
   8.117  /*
   8.118   * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
   8.119 @@ -157,15 +153,20 @@
   8.120  /* Names within the namespace are 4 bytes long */
   8.121  
   8.122  #define ACPI_NAME_SIZE                  4
   8.123 -#define ACPI_PATH_SEGMENT_LENGTH        5           /* 4 chars for name + 1 char for separator */
   8.124 +#define ACPI_PATH_SEGMENT_LENGTH        5	/* 4 chars for name + 1 char for separator */
   8.125  #define ACPI_PATH_SEPARATOR             '.'
   8.126  
   8.127 +/* Sizes for ACPI table headers */
   8.128 +
   8.129 +#define ACPI_OEM_ID_SIZE                6
   8.130 +#define ACPI_OEM_TABLE_ID_SIZE          8
   8.131 +
   8.132  /* Constants used in searching for the RSDP in low memory */
   8.133  
   8.134 -#define ACPI_EBDA_PTR_LOCATION          0x0000040E     /* Physical Address */
   8.135 +#define ACPI_EBDA_PTR_LOCATION          0x0000040E	/* Physical Address */
   8.136  #define ACPI_EBDA_PTR_LENGTH            2
   8.137  #define ACPI_EBDA_WINDOW_SIZE           1024
   8.138 -#define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000     /* Physical Address */
   8.139 +#define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000	/* Physical Address */
   8.140  #define ACPI_HI_RSDP_WINDOW_SIZE        0x00020000
   8.141  #define ACPI_RSDP_SCAN_STEP             16
   8.142  
   8.143 @@ -180,12 +181,7 @@
   8.144  
   8.145  /* Array sizes.  Used for range checking also */
   8.146  
   8.147 -#define ACPI_NUM_ACCESS_TYPES           6
   8.148 -#define ACPI_NUM_UPDATE_RULES           3
   8.149 -#define ACPI_NUM_LOCK_RULES             2
   8.150 -#define ACPI_NUM_MATCH_OPS              6
   8.151 -#define ACPI_NUM_OPCODES                256
   8.152 -#define ACPI_NUM_FIELD_NAMES            2
   8.153 +#define ACPI_MAX_MATCH_OPCODE           5
   8.154  
   8.155  /* RSDP checksums */
   8.156  
   8.157 @@ -196,22 +192,15 @@
   8.158  
   8.159  #define ACPI_SMBUS_BUFFER_SIZE          34
   8.160  
   8.161 -/* Number of strings associated with the _OSI reserved method */
   8.162 -
   8.163 -#define ACPI_NUM_OSI_STRINGS            9
   8.164 -
   8.165 -
   8.166  /******************************************************************************
   8.167   *
   8.168   * ACPI AML Debugger
   8.169   *
   8.170   *****************************************************************************/
   8.171  
   8.172 -#define ACPI_DEBUGGER_MAX_ARGS          8  /* Must be max method args + 1 */
   8.173 +#define ACPI_DEBUGGER_MAX_ARGS          8	/* Must be max method args + 1 */
   8.174  
   8.175  #define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
   8.176  #define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
   8.177  
   8.178 -
   8.179 -#endif /* _ACCONFIG_H */
   8.180 -
   8.181 +#endif				/* _ACCONFIG_H */
     9.1 --- a/xen/include/acpi/acexcep.h	Tue Mar 18 13:14:26 2008 +0000
     9.2 +++ b/xen/include/acpi/acexcep.h	Tue Mar 18 14:55:36 2008 +0000
     9.3 @@ -5,7 +5,7 @@
     9.4   *****************************************************************************/
     9.5  
     9.6  /*
     9.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
     9.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
     9.9   * All rights reserved.
    9.10   *
    9.11   * Redistribution and use in source and binary forms, with or without
    9.12 @@ -44,11 +44,9 @@
    9.13  #ifndef __ACEXCEP_H__
    9.14  #define __ACEXCEP_H__
    9.15  
    9.16 -
    9.17  /*
    9.18   * Exceptions returned by external ACPI interfaces
    9.19   */
    9.20 -
    9.21  #define AE_CODE_ENVIRONMENTAL           0x0000
    9.22  #define AE_CODE_PROGRAMMER              0x1000
    9.23  #define AE_CODE_ACPI_TABLES             0x2000
    9.24 @@ -56,11 +54,9 @@
    9.25  #define AE_CODE_CONTROL                 0x4000
    9.26  #define AE_CODE_MASK                    0xF000
    9.27  
    9.28 -
    9.29  #define ACPI_SUCCESS(a)                 (!(a))
    9.30  #define ACPI_FAILURE(a)                 (a)
    9.31  
    9.32 -
    9.33  #define AE_OK                           (acpi_status) 0x0000
    9.34  
    9.35  /*
    9.36 @@ -96,8 +92,9 @@
    9.37  #define AE_ABORT_METHOD                 (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
    9.38  #define AE_SAME_HANDLER                 (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
    9.39  #define AE_WAKE_ONLY_GPE                (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
    9.40 +#define AE_OWNER_ID_LIMIT               (acpi_status) (0x001F | AE_CODE_ENVIRONMENTAL)
    9.41  
    9.42 -#define AE_CODE_ENV_MAX                 0x001E
    9.43 +#define AE_CODE_ENV_MAX                 0x001F
    9.44  
    9.45  /*
    9.46   * Programmer exceptions
    9.47 @@ -114,7 +111,6 @@
    9.48  
    9.49  #define AE_CODE_PGM_MAX                 0x0009
    9.50  
    9.51 -
    9.52  /*
    9.53   * Acpi table exceptions
    9.54   */
    9.55 @@ -127,7 +123,6 @@
    9.56  
    9.57  #define AE_CODE_TBL_MAX                 0x0006
    9.58  
    9.59 -
    9.60  /*
    9.61   * AML exceptions.  These are caused by problems with
    9.62   * the actual AML byte stream
    9.63 @@ -165,8 +160,9 @@
    9.64  #define AE_AML_BAD_RESOURCE_VALUE       (acpi_status) (0x001F | AE_CODE_AML)
    9.65  #define AE_AML_CIRCULAR_REFERENCE       (acpi_status) (0x0020 | AE_CODE_AML)
    9.66  #define AE_AML_BAD_RESOURCE_LENGTH      (acpi_status) (0x0021 | AE_CODE_AML)
    9.67 +#define AE_AML_ILLEGAL_ADDRESS          (acpi_status) (0x0022 | AE_CODE_AML)
    9.68  
    9.69 -#define AE_CODE_AML_MAX                 0x0021
    9.70 +#define AE_CODE_AML_MAX                 0x0022
    9.71  
    9.72  /*
    9.73   * Internal exceptions used for control
    9.74 @@ -182,9 +178,10 @@
    9.75  #define AE_CTRL_BREAK                   (acpi_status) (0x0009 | AE_CODE_CONTROL)
    9.76  #define AE_CTRL_CONTINUE                (acpi_status) (0x000A | AE_CODE_CONTROL)
    9.77  #define AE_CTRL_SKIP                    (acpi_status) (0x000B | AE_CODE_CONTROL)
    9.78 +#define AE_CTRL_PARSE_CONTINUE          (acpi_status) (0x000C | AE_CODE_CONTROL)
    9.79 +#define AE_CTRL_PARSE_PENDING           (acpi_status) (0x000D | AE_CODE_CONTROL)
    9.80  
    9.81 -#define AE_CODE_CTRL_MAX                0x000B
    9.82 -
    9.83 +#define AE_CODE_CTRL_MAX                0x000D
    9.84  
    9.85  #ifdef DEFINE_ACPI_GLOBALS
    9.86  
    9.87 @@ -192,8 +189,7 @@
    9.88   * String versions of the exception codes above
    9.89   * These strings must match the corresponding defines exactly
    9.90   */
    9.91 -char const   *acpi_gbl_exception_names_env[] =
    9.92 -{
    9.93 +char const *acpi_gbl_exception_names_env[] = {
    9.94  	"AE_OK",
    9.95  	"AE_ERROR",
    9.96  	"AE_NO_ACPI_TABLES",
    9.97 @@ -224,11 +220,11 @@ char const   *acpi_gbl_exception_names_e
    9.98  	"AE_LOGICAL_ADDRESS",
    9.99  	"AE_ABORT_METHOD",
   9.100  	"AE_SAME_HANDLER",
   9.101 -	"AE_WAKE_ONLY_GPE"
   9.102 +	"AE_WAKE_ONLY_GPE",
   9.103 +	"AE_OWNER_ID_LIMIT"
   9.104  };
   9.105  
   9.106 -char const   *acpi_gbl_exception_names_pgm[] =
   9.107 -{
   9.108 +char const *acpi_gbl_exception_names_pgm[] = {
   9.109  	"AE_BAD_PARAMETER",
   9.110  	"AE_BAD_CHARACTER",
   9.111  	"AE_BAD_PATHNAME",
   9.112 @@ -240,8 +236,7 @@ char const   *acpi_gbl_exception_names_p
   9.113  	"AE_BAD_DECIMAL_CONSTANT"
   9.114  };
   9.115  
   9.116 -char const   *acpi_gbl_exception_names_tbl[] =
   9.117 -{
   9.118 +char const *acpi_gbl_exception_names_tbl[] = {
   9.119  	"AE_BAD_SIGNATURE",
   9.120  	"AE_BAD_HEADER",
   9.121  	"AE_BAD_CHECKSUM",
   9.122 @@ -250,8 +245,7 @@ char const   *acpi_gbl_exception_names_t
   9.123  	"AE_INVALID_TABLE_LENGTH"
   9.124  };
   9.125  
   9.126 -char const   *acpi_gbl_exception_names_aml[] =
   9.127 -{
   9.128 +char const *acpi_gbl_exception_names_aml[] = {
   9.129  	"AE_AML_ERROR",
   9.130  	"AE_AML_PARSE",
   9.131  	"AE_AML_BAD_OPCODE",
   9.132 @@ -284,11 +278,11 @@ char const   *acpi_gbl_exception_names_a
   9.133  	"AE_AML_NO_RESOURCE_END_TAG",
   9.134  	"AE_AML_BAD_RESOURCE_VALUE",
   9.135  	"AE_AML_CIRCULAR_REFERENCE",
   9.136 -	"AE_AML_BAD_RESOURCE_LENGTH"
   9.137 +	"AE_AML_BAD_RESOURCE_LENGTH",
   9.138 +	"AE_AML_ILLEGAL_ADDRESS"
   9.139  };
   9.140  
   9.141 -char const   *acpi_gbl_exception_names_ctrl[] =
   9.142 -{
   9.143 +char const *acpi_gbl_exception_names_ctrl[] = {
   9.144  	"AE_CTRL_RETURN_VALUE",
   9.145  	"AE_CTRL_PENDING",
   9.146  	"AE_CTRL_TERMINATE",
   9.147 @@ -299,10 +293,11 @@ char const   *acpi_gbl_exception_names_c
   9.148  	"AE_CTRL_TRANSFER",
   9.149  	"AE_CTRL_BREAK",
   9.150  	"AE_CTRL_CONTINUE",
   9.151 -	"AE_CTRL_SKIP"
   9.152 +	"AE_CTRL_SKIP",
   9.153 +	"AE_CTRL_PARSE_CONTINUE",
   9.154 +	"AE_CTRL_PARSE_PENDING"
   9.155  };
   9.156  
   9.157 -#endif /* ACPI GLOBALS */
   9.158 +#endif				/* ACPI GLOBALS */
   9.159  
   9.160 -
   9.161 -#endif /* __ACEXCEP_H__ */
   9.162 +#endif				/* __ACEXCEP_H__ */
    10.1 --- a/xen/include/acpi/acglobal.h	Tue Mar 18 13:14:26 2008 +0000
    10.2 +++ b/xen/include/acpi/acglobal.h	Tue Mar 18 14:55:36 2008 +0000
    10.3 @@ -5,7 +5,7 @@
    10.4   *****************************************************************************/
    10.5  
    10.6  /*
    10.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    10.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    10.9   * All rights reserved.
   10.10   *
   10.11   * Redistribution and use in source and binary forms, with or without
   10.12 @@ -44,7 +44,6 @@
   10.13  #ifndef __ACGLOBAL_H__
   10.14  #define __ACGLOBAL_H__
   10.15  
   10.16 -
   10.17  /*
   10.18   * Ensure that the globals are actually defined and initialized only once.
   10.19   *
   10.20 @@ -59,30 +58,6 @@
   10.21  #define ACPI_INIT_GLOBAL(a,b) a
   10.22  #endif
   10.23  
   10.24 -/*
   10.25 - * Keep local copies of these FADT-based registers.  NOTE: These globals
   10.26 - * are first in this file for alignment reasons on 64-bit systems.
   10.27 - */
   10.28 -ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1a_enable;
   10.29 -ACPI_EXTERN struct acpi_generic_address         acpi_gbl_xpm1b_enable;
   10.30 -
   10.31 -
   10.32 -/*****************************************************************************
   10.33 - *
   10.34 - * Debug support
   10.35 - *
   10.36 - ****************************************************************************/
   10.37 -
   10.38 -/* Runtime configuration of debug print levels */
   10.39 -
   10.40 -extern      u32                                 acpi_dbg_level;
   10.41 -extern      u32                                 acpi_dbg_layer;
   10.42 -
   10.43 -/* Procedure nesting level for debug output */
   10.44 -
   10.45 -extern      u32                                 acpi_gbl_nesting_level;
   10.46 -
   10.47 -
   10.48  /*****************************************************************************
   10.49   *
   10.50   * Runtime configuration (static defaults that can be overriden at runtime)
   10.51 @@ -92,36 +67,64 @@ extern      u32                         
   10.52  /*
   10.53   * Enable "slack" in the AML interpreter?  Default is FALSE, and the
   10.54   * interpreter strictly follows the ACPI specification.  Setting to TRUE
   10.55 - * allows the interpreter to forgive certain bad AML constructs.  Currently:
   10.56 + * allows the interpreter to ignore certain errors and/or bad AML constructs.
   10.57 + *
   10.58 + * Currently, these features are enabled by this flag:
   10.59 + *
   10.60   * 1) Allow "implicit return" of last value in a control method
   10.61 - * 2) Allow access beyond end of operation region
   10.62 + * 2) Allow access beyond the end of an operation region
   10.63   * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
   10.64   * 4) Allow ANY object type to be a source operand for the Store() operator
   10.65 + * 5) Allow unresolved references (invalid target name) in package objects
   10.66 + * 6) Enable warning messages for behavior that is not ACPI spec compliant
   10.67   */
   10.68 -ACPI_EXTERN u8       ACPI_INIT_GLOBAL (acpi_gbl_enable_interpreter_slack, FALSE);
   10.69 +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
   10.70  
   10.71  /*
   10.72   * Automatically serialize ALL control methods? Default is FALSE, meaning
   10.73   * to use the Serialized/not_serialized method flags on a per method basis.
   10.74   * Only change this if the ASL code is poorly written and cannot handle
   10.75 - * reentrancy even though methods are marked "not_serialized".
   10.76 + * reentrancy even though methods are marked "NotSerialized".
   10.77   */
   10.78 -ACPI_EXTERN u8       ACPI_INIT_GLOBAL (acpi_gbl_all_methods_serialized, FALSE);
   10.79 +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_all_methods_serialized, FALSE);
   10.80  
   10.81  /*
   10.82   * Create the predefined _OSI method in the namespace? Default is TRUE
   10.83   * because ACPI CA is fully compatible with other ACPI implementations.
   10.84   * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
   10.85   */
   10.86 -ACPI_EXTERN u8       ACPI_INIT_GLOBAL (acpi_gbl_create_osi_method, TRUE);
   10.87 +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
   10.88  
   10.89  /*
   10.90   * Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
   10.91   * RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
   10.92   * be enabled just before going to sleep.
   10.93   */
   10.94 -ACPI_EXTERN u8       ACPI_INIT_GLOBAL (acpi_gbl_leave_wake_gpes_disabled, TRUE);
   10.95 +ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
   10.96  
   10.97 +/*****************************************************************************
   10.98 + *
   10.99 + * Debug support
  10.100 + *
  10.101 + ****************************************************************************/
  10.102 +
  10.103 +/* Runtime configuration of debug print levels */
  10.104 +
  10.105 +extern u32 acpi_dbg_level;
  10.106 +extern u32 acpi_dbg_layer;
  10.107 +
  10.108 +/* Procedure nesting level for debug output */
  10.109 +
  10.110 +extern u32 acpi_gbl_nesting_level;
  10.111 +
  10.112 +/* Support for dynamic control method tracing mechanism */
  10.113 +
  10.114 +ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
  10.115 +ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
  10.116 +ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
  10.117 +ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
  10.118 +ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
  10.119 +ACPI_EXTERN u32 acpi_gbl_trace_flags;
  10.120  
  10.121  /*****************************************************************************
  10.122   *
  10.123 @@ -130,49 +133,56 @@ ACPI_EXTERN u8       ACPI_INIT_GLOBAL (a
  10.124   ****************************************************************************/
  10.125  
  10.126  /*
  10.127 - * Table pointers.
  10.128 - * Although these pointers are somewhat redundant with the global acpi_table,
  10.129 - * they are convenient because they are typed pointers.
  10.130 + * acpi_gbl_root_table_list is the master list of ACPI tables found in the
  10.131 + * RSDT/XSDT.
  10.132   *
  10.133 - * These tables are single-table only; meaning that there can be at most one
  10.134 - * of each in the system.  Each global points to the actual table.
  10.135 + * acpi_gbl_FADT is a local copy of the FADT, converted to a common format.
  10.136   */
  10.137 -ACPI_EXTERN u32                                 acpi_gbl_table_flags;
  10.138 -ACPI_EXTERN u32                                 acpi_gbl_rsdt_table_count;
  10.139 -ACPI_EXTERN struct rsdp_descriptor             *acpi_gbl_RSDP;
  10.140 -ACPI_EXTERN XSDT_DESCRIPTOR            *acpi_gbl_XSDT;
  10.141 -ACPI_EXTERN FADT_DESCRIPTOR            *acpi_gbl_FADT;
  10.142 -ACPI_EXTERN struct acpi_table_header           *acpi_gbl_DSDT;
  10.143 -ACPI_EXTERN FACS_DESCRIPTOR            *acpi_gbl_FACS;
  10.144 -ACPI_EXTERN struct acpi_common_facs             acpi_gbl_common_fACS;
  10.145 -/*
  10.146 - * Since there may be multiple SSDTs and PSDTS, a single pointer is not
  10.147 - * sufficient; Therefore, there isn't one!
  10.148 - */
  10.149 +ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
  10.150 +ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
  10.151 +extern acpi_native_uint acpi_gbl_permanent_mmap;
  10.152  
  10.153 +/* These addresses are calculated from FADT address values */
  10.154 +
  10.155 +ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
  10.156 +ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
  10.157  
  10.158  /*
  10.159 - * Handle both ACPI 1.0 and ACPI 2.0 Integer widths
  10.160 - * If we are running a method that exists in a 32-bit ACPI table.
  10.161 - * Use only 32 bits of the Integer for conversion.
  10.162 + * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
  10.163 + * determined by the revision of the DSDT: If the DSDT revision is less than
  10.164 + * 2, use only the lower 32 bits of the internal 64-bit Integer.
  10.165   */
  10.166 -ACPI_EXTERN u8                                  acpi_gbl_integer_bit_width;
  10.167 -ACPI_EXTERN u8                                  acpi_gbl_integer_byte_width;
  10.168 -ACPI_EXTERN u8                                  acpi_gbl_integer_nybble_width;
  10.169 +ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
  10.170 +ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
  10.171 +ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
  10.172 +
  10.173 +/*****************************************************************************
  10.174 + *
  10.175 + * Mutual exlusion within ACPICA subsystem
  10.176 + *
  10.177 + ****************************************************************************/
  10.178  
  10.179  /*
  10.180 - * ACPI Table info arrays
  10.181 - */
  10.182 -extern      struct acpi_table_list              acpi_gbl_table_lists[NUM_ACPI_TABLE_TYPES];
  10.183 -extern      struct acpi_table_support           acpi_gbl_table_data[NUM_ACPI_TABLE_TYPES];
  10.184 -
  10.185 -/*
  10.186 - * Predefined mutex objects.  This array contains the
  10.187 + * Predefined mutex objects. This array contains the
  10.188   * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
  10.189   * (The table maps local handles to the real OS handles)
  10.190   */
  10.191 -ACPI_EXTERN struct acpi_mutex_info              acpi_gbl_mutex_info[NUM_MUTEX];
  10.192 +ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
  10.193  
  10.194 +/*
  10.195 + * Global lock semaphore works in conjunction with the actual HW global lock
  10.196 + */
  10.197 +ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
  10.198 +ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
  10.199 +
  10.200 +/*
  10.201 + * Spinlocks are used for interfaces that can be possibly called at
  10.202 + * interrupt level
  10.203 + */
  10.204 +ACPI_EXTERN spinlock_t _acpi_gbl_gpe_lock;	/* For GPE data structs and registers */
  10.205 +ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock;	/* For ACPI H/W except GPE registers */
  10.206 +#define acpi_gbl_gpe_lock	&_acpi_gbl_gpe_lock
  10.207 +#define acpi_gbl_hardware_lock	&_acpi_gbl_hardware_lock
  10.208  
  10.209  /*****************************************************************************
  10.210   *
  10.211 @@ -180,41 +190,64 @@ ACPI_EXTERN struct acpi_mutex_info      
  10.212   *
  10.213   ****************************************************************************/
  10.214  
  10.215 -
  10.216 -ACPI_EXTERN struct acpi_memory_list             acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS];
  10.217 -ACPI_EXTERN struct acpi_object_notify_handler   acpi_gbl_device_notify;
  10.218 -ACPI_EXTERN struct acpi_object_notify_handler   acpi_gbl_system_notify;
  10.219 -ACPI_EXTERN acpi_exception_handler              acpi_gbl_exception_handler;
  10.220 -ACPI_EXTERN acpi_init_handler                   acpi_gbl_init_handler;
  10.221 -ACPI_EXTERN struct acpi_walk_state             *acpi_gbl_breakpoint_walk;
  10.222 -ACPI_EXTERN acpi_handle                         acpi_gbl_global_lock_semaphore;
  10.223 +#ifdef ACPI_DBG_TRACK_ALLOCATIONS
  10.224  
  10.225 -ACPI_EXTERN u32                                 acpi_gbl_global_lock_thread_count;
  10.226 -ACPI_EXTERN u32                                 acpi_gbl_original_mode;
  10.227 -ACPI_EXTERN u32                                 acpi_gbl_rsdp_original_location;
  10.228 -ACPI_EXTERN u32                                 acpi_gbl_ns_lookup_count;
  10.229 -ACPI_EXTERN u32                                 acpi_gbl_ps_find_count;
  10.230 -ACPI_EXTERN u16                                 acpi_gbl_pm1_enable_register_save;
  10.231 -ACPI_EXTERN u16                                 acpi_gbl_next_table_owner_id;
  10.232 -ACPI_EXTERN u16                                 acpi_gbl_next_method_owner_id;
  10.233 -ACPI_EXTERN u16                                 acpi_gbl_global_lock_handle;
  10.234 -ACPI_EXTERN u8                                  acpi_gbl_debugger_configuration;
  10.235 -ACPI_EXTERN u8                                  acpi_gbl_global_lock_acquired;
  10.236 -ACPI_EXTERN u8                                  acpi_gbl_step_to_next_call;
  10.237 -ACPI_EXTERN u8                                  acpi_gbl_acpi_hardware_present;
  10.238 -ACPI_EXTERN u8                                  acpi_gbl_global_lock_present;
  10.239 -ACPI_EXTERN u8                                  acpi_gbl_events_initialized;
  10.240 -ACPI_EXTERN u8                                  acpi_gbl_system_awake_and_running;
  10.241 +/* Lists for tracking memory allocations */
  10.242  
  10.243 -extern u8                                       acpi_gbl_shutdown;
  10.244 -extern u32                                      acpi_gbl_startup_flags;
  10.245 -extern const u8                                 acpi_gbl_decode_to8bit[8];
  10.246 -extern const char                              *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
  10.247 -extern const char                              *acpi_gbl_highest_dstate_names[4];
  10.248 -extern const struct acpi_opcode_info            acpi_gbl_aml_op_info[AML_NUM_OPCODES];
  10.249 -extern const char                              *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
  10.250 -extern const char                              *acpi_gbl_valid_osi_strings[ACPI_NUM_OSI_STRINGS];
  10.251 +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
  10.252 +ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
  10.253 +ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
  10.254 +#endif
  10.255  
  10.256 +/* Object caches */
  10.257 +
  10.258 +ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
  10.259 +ACPI_EXTERN acpi_cache_t *acpi_gbl_state_cache;
  10.260 +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_cache;
  10.261 +ACPI_EXTERN acpi_cache_t *acpi_gbl_ps_node_ext_cache;
  10.262 +ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
  10.263 +
  10.264 +/* Global handlers */
  10.265 +
  10.266 +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
  10.267 +ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
  10.268 +ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
  10.269 +ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
  10.270 +ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
  10.271 +
  10.272 +/* Misc */
  10.273 +
  10.274 +ACPI_EXTERN u32 acpi_gbl_original_mode;
  10.275 +ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
  10.276 +ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
  10.277 +ACPI_EXTERN u32 acpi_gbl_ps_find_count;
  10.278 +ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
  10.279 +ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
  10.280 +ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
  10.281 +ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
  10.282 +ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
  10.283 +ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
  10.284 +ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
  10.285 +ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
  10.286 +ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
  10.287 +ACPI_EXTERN u8 acpi_gbl_global_lock_present;
  10.288 +ACPI_EXTERN u8 acpi_gbl_events_initialized;
  10.289 +ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
  10.290 +
  10.291 +extern u8 acpi_gbl_shutdown;
  10.292 +extern u32 acpi_gbl_startup_flags;
  10.293 +extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
  10.294 +extern const char *acpi_gbl_highest_dstate_names[4];
  10.295 +extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
  10.296 +extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
  10.297 +
  10.298 +/* Exception codes */
  10.299 +
  10.300 +extern char const *acpi_gbl_exception_names_env[];
  10.301 +extern char const *acpi_gbl_exception_names_pgm[];
  10.302 +extern char const *acpi_gbl_exception_names_tbl[];
  10.303 +extern char const *acpi_gbl_exception_names_aml[];
  10.304 +extern char const *acpi_gbl_exception_names_ctrl[];
  10.305  
  10.306  /*****************************************************************************
  10.307   *
  10.308 @@ -230,20 +263,21 @@ extern const char                       
  10.309  #define NUM_PREDEFINED_NAMES            9
  10.310  #endif
  10.311  
  10.312 -ACPI_EXTERN struct acpi_namespace_node          acpi_gbl_root_node_struct;
  10.313 -ACPI_EXTERN struct acpi_namespace_node         *acpi_gbl_root_node;
  10.314 -ACPI_EXTERN struct acpi_namespace_node         *acpi_gbl_fadt_gpe_device;
  10.315 +ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct;
  10.316 +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node;
  10.317 +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device;
  10.318  
  10.319 -extern const u8                                 acpi_gbl_ns_properties[NUM_NS_TYPES];
  10.320 -extern const struct acpi_predefined_names       acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES];
  10.321 +extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES];
  10.322 +extern const struct acpi_predefined_names
  10.323 +    acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
  10.324  
  10.325  #ifdef ACPI_DEBUG_OUTPUT
  10.326 -ACPI_EXTERN u32                                 acpi_gbl_current_node_count;
  10.327 -ACPI_EXTERN u32                                 acpi_gbl_current_node_size;
  10.328 -ACPI_EXTERN u32                                 acpi_gbl_max_concurrent_node_count;
  10.329 -ACPI_EXTERN acpi_size                           acpi_gbl_entry_stack_pointer;
  10.330 -ACPI_EXTERN acpi_size                           acpi_gbl_lowest_stack_pointer;
  10.331 -ACPI_EXTERN u32                                 acpi_gbl_deepest_nesting;
  10.332 +ACPI_EXTERN u32 acpi_gbl_current_node_count;
  10.333 +ACPI_EXTERN u32 acpi_gbl_current_node_size;
  10.334 +ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
  10.335 +ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer;
  10.336 +ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
  10.337 +ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
  10.338  #endif
  10.339  
  10.340  /*****************************************************************************
  10.341 @@ -252,21 +286,11 @@ ACPI_EXTERN u32                         
  10.342   *
  10.343   ****************************************************************************/
  10.344  
  10.345 -
  10.346 -ACPI_EXTERN struct acpi_thread_state           *acpi_gbl_current_walk_list;
  10.347 +ACPI_EXTERN struct acpi_thread_state *acpi_gbl_current_walk_list;
  10.348  
  10.349  /* Control method single step flag */
  10.350  
  10.351 -ACPI_EXTERN u8                                  acpi_gbl_cm_single_step;
  10.352 -
  10.353 -
  10.354 -/*****************************************************************************
  10.355 - *
  10.356 - * Parser globals
  10.357 - *
  10.358 - ****************************************************************************/
  10.359 -
  10.360 -ACPI_EXTERN union acpi_parse_object            *acpi_gbl_parsed_namespace_root;
  10.361 +ACPI_EXTERN u8 acpi_gbl_cm_single_step;
  10.362  
  10.363  /*****************************************************************************
  10.364   *
  10.365 @@ -274,10 +298,10 @@ ACPI_EXTERN union acpi_parse_object     
  10.366   *
  10.367   ****************************************************************************/
  10.368  
  10.369 -extern      struct acpi_bit_register_info       acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
  10.370 -ACPI_EXTERN u8                                  acpi_gbl_sleep_type_a;
  10.371 -ACPI_EXTERN u8                                  acpi_gbl_sleep_type_b;
  10.372 -
  10.373 +extern struct acpi_bit_register_info
  10.374 +    acpi_gbl_bit_register_info[ACPI_NUM_BITREG];
  10.375 +ACPI_EXTERN u8 acpi_gbl_sleep_type_a;
  10.376 +ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
  10.377  
  10.378  /*****************************************************************************
  10.379   *
  10.380 @@ -285,12 +309,13 @@ ACPI_EXTERN u8                          
  10.381   *
  10.382   ****************************************************************************/
  10.383  
  10.384 -extern      struct acpi_fixed_event_info        acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
  10.385 -ACPI_EXTERN struct acpi_fixed_event_handler     acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
  10.386 -ACPI_EXTERN struct acpi_gpe_xrupt_info         *acpi_gbl_gpe_xrupt_list_head;
  10.387 -ACPI_EXTERN struct acpi_gpe_block_info         *acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
  10.388 -ACPI_EXTERN acpi_handle                         acpi_gbl_gpe_lock;
  10.389 -
  10.390 +extern struct acpi_fixed_event_info
  10.391 +    acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
  10.392 +ACPI_EXTERN struct acpi_fixed_event_handler
  10.393 +    acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
  10.394 +ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
  10.395 +ACPI_EXTERN struct acpi_gpe_block_info
  10.396 +*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
  10.397  
  10.398  /*****************************************************************************
  10.399   *
  10.400 @@ -298,60 +323,55 @@ ACPI_EXTERN acpi_handle                 
  10.401   *
  10.402   ****************************************************************************/
  10.403  
  10.404 -
  10.405 -ACPI_EXTERN u8                                  acpi_gbl_db_output_flags;
  10.406 +ACPI_EXTERN u8 acpi_gbl_db_output_flags;
  10.407  
  10.408  #ifdef ACPI_DISASSEMBLER
  10.409  
  10.410 -ACPI_EXTERN u8                                  acpi_gbl_db_opt_disasm;
  10.411 -ACPI_EXTERN u8                                  acpi_gbl_db_opt_verbose;
  10.412 +ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
  10.413 +ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
  10.414  #endif
  10.415  
  10.416 -
  10.417  #ifdef ACPI_DEBUGGER
  10.418  
  10.419 -extern      u8                                  acpi_gbl_method_executing;
  10.420 -extern      u8                                  acpi_gbl_abort_method;
  10.421 -extern      u8                                  acpi_gbl_db_terminate_threads;
  10.422 -
  10.423 -ACPI_EXTERN int                                 optind;
  10.424 -ACPI_EXTERN char                               *optarg;
  10.425 -
  10.426 -ACPI_EXTERN u8                                  acpi_gbl_db_opt_tables;
  10.427 -ACPI_EXTERN u8                                  acpi_gbl_db_opt_stats;
  10.428 -ACPI_EXTERN u8                                  acpi_gbl_db_opt_ini_methods;
  10.429 -
  10.430 +extern u8 acpi_gbl_method_executing;
  10.431 +extern u8 acpi_gbl_abort_method;
  10.432 +extern u8 acpi_gbl_db_terminate_threads;
  10.433  
  10.434 -ACPI_EXTERN char                               *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
  10.435 -ACPI_EXTERN char                                acpi_gbl_db_line_buf[80];
  10.436 -ACPI_EXTERN char                                acpi_gbl_db_parsed_buf[80];
  10.437 -ACPI_EXTERN char                                acpi_gbl_db_scope_buf[40];
  10.438 -ACPI_EXTERN char                                acpi_gbl_db_debug_filename[40];
  10.439 -ACPI_EXTERN u8                                  acpi_gbl_db_output_to_file;
  10.440 -ACPI_EXTERN char                               *acpi_gbl_db_buffer;
  10.441 -ACPI_EXTERN char                               *acpi_gbl_db_filename;
  10.442 -ACPI_EXTERN u32                                 acpi_gbl_db_debug_level;
  10.443 -ACPI_EXTERN u32                                 acpi_gbl_db_console_debug_level;
  10.444 -ACPI_EXTERN struct acpi_table_header           *acpi_gbl_db_table_ptr;
  10.445 -ACPI_EXTERN struct acpi_namespace_node         *acpi_gbl_db_scope_node;
  10.446 +ACPI_EXTERN int optind;
  10.447 +ACPI_EXTERN char *optarg;
  10.448 +
  10.449 +ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
  10.450 +ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
  10.451 +ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
  10.452 +
  10.453 +ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
  10.454 +ACPI_EXTERN char acpi_gbl_db_line_buf[80];
  10.455 +ACPI_EXTERN char acpi_gbl_db_parsed_buf[80];
  10.456 +ACPI_EXTERN char acpi_gbl_db_scope_buf[40];
  10.457 +ACPI_EXTERN char acpi_gbl_db_debug_filename[40];
  10.458 +ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
  10.459 +ACPI_EXTERN char *acpi_gbl_db_buffer;
  10.460 +ACPI_EXTERN char *acpi_gbl_db_filename;
  10.461 +ACPI_EXTERN u32 acpi_gbl_db_debug_level;
  10.462 +ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
  10.463 +ACPI_EXTERN struct acpi_table_header *acpi_gbl_db_table_ptr;
  10.464 +ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;
  10.465  
  10.466  /*
  10.467   * Statistic globals
  10.468   */
  10.469 -ACPI_EXTERN u16                                 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX+1];
  10.470 -ACPI_EXTERN u16                                 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX+1];
  10.471 -ACPI_EXTERN u16                                 acpi_gbl_obj_type_count_misc;
  10.472 -ACPI_EXTERN u16                                 acpi_gbl_node_type_count_misc;
  10.473 -ACPI_EXTERN u32                                 acpi_gbl_num_nodes;
  10.474 -ACPI_EXTERN u32                                 acpi_gbl_num_objects;
  10.475 -
  10.476 +ACPI_EXTERN u16 acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
  10.477 +ACPI_EXTERN u16 acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1];
  10.478 +ACPI_EXTERN u16 acpi_gbl_obj_type_count_misc;
  10.479 +ACPI_EXTERN u16 acpi_gbl_node_type_count_misc;
  10.480 +ACPI_EXTERN u32 acpi_gbl_num_nodes;
  10.481 +ACPI_EXTERN u32 acpi_gbl_num_objects;
  10.482  
  10.483 -ACPI_EXTERN u32                                 acpi_gbl_size_of_parse_tree;
  10.484 -ACPI_EXTERN u32                                 acpi_gbl_size_of_method_trees;
  10.485 -ACPI_EXTERN u32                                 acpi_gbl_size_of_node_entries;
  10.486 -ACPI_EXTERN u32                                 acpi_gbl_size_of_acpi_objects;
  10.487 +ACPI_EXTERN u32 acpi_gbl_size_of_parse_tree;
  10.488 +ACPI_EXTERN u32 acpi_gbl_size_of_method_trees;
  10.489 +ACPI_EXTERN u32 acpi_gbl_size_of_node_entries;
  10.490 +ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
  10.491  
  10.492 -#endif /* ACPI_DEBUGGER */
  10.493 +#endif				/* ACPI_DEBUGGER */
  10.494  
  10.495 -
  10.496 -#endif /* __ACGLOBAL_H__ */
  10.497 +#endif				/* __ACGLOBAL_H__ */
    11.1 --- a/xen/include/acpi/achware.h	Tue Mar 18 13:14:26 2008 +0000
    11.2 +++ b/xen/include/acpi/achware.h	Tue Mar 18 14:55:36 2008 +0000
    11.3 @@ -5,7 +5,7 @@
    11.4   *****************************************************************************/
    11.5  
    11.6  /*
    11.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    11.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    11.9   * All rights reserved.
   11.10   *
   11.11   * Redistribution and use in source and binary forms, with or without
   11.12 @@ -44,139 +44,88 @@
   11.13  #ifndef __ACHWARE_H__
   11.14  #define __ACHWARE_H__
   11.15  
   11.16 +/* PM Timer ticks per second (HZ) */
   11.17  
   11.18 -/* PM Timer ticks per second (HZ) */
   11.19  #define PM_TIMER_FREQUENCY  3579545
   11.20  
   11.21 +/* Values for the _SST reserved method */
   11.22 +
   11.23 +#define ACPI_SST_INDICATOR_OFF  0
   11.24 +#define ACPI_SST_WORKING        1
   11.25 +#define ACPI_SST_WAKING         2
   11.26 +#define ACPI_SST_SLEEPING       3
   11.27 +#define ACPI_SST_SLEEP_CONTEXT  4
   11.28  
   11.29  /* Prototypes */
   11.30  
   11.31 -
   11.32 -acpi_status
   11.33 -acpi_hw_initialize (
   11.34 -	void);
   11.35 -
   11.36 -acpi_status
   11.37 -acpi_hw_shutdown (
   11.38 -	void);
   11.39 -
   11.40 -acpi_status
   11.41 -acpi_hw_initialize_system_info (
   11.42 -	void);
   11.43 -
   11.44 -acpi_status
   11.45 -acpi_hw_set_mode (
   11.46 -	u32                             mode);
   11.47 -
   11.48 -u32
   11.49 -acpi_hw_get_mode (
   11.50 -	void);
   11.51 -
   11.52 -u32
   11.53 -acpi_hw_get_mode_capabilities (
   11.54 -	void);
   11.55 -
   11.56 -/* Register I/O Prototypes */
   11.57 +/*
   11.58 + * hwacpi - high level functions
   11.59 + */
   11.60 +acpi_status acpi_hw_set_mode(u32 mode);
   11.61  
   11.62 -struct acpi_bit_register_info *
   11.63 -acpi_hw_get_bit_register_info (
   11.64 -	u32                             register_id);
   11.65 -
   11.66 -acpi_status
   11.67 -acpi_hw_register_read (
   11.68 -	u8                              use_lock,
   11.69 -	u32                             register_id,
   11.70 -	u32                             *return_value);
   11.71 -
   11.72 -acpi_status
   11.73 -acpi_hw_register_write (
   11.74 -	u8                              use_lock,
   11.75 -	u32                             register_id,
   11.76 -	u32                             value);
   11.77 +u32 acpi_hw_get_mode(void);
   11.78  
   11.79 -acpi_status
   11.80 -acpi_hw_low_level_read (
   11.81 -	u32                             width,
   11.82 -	u32                             *value,
   11.83 -	struct acpi_generic_address     *reg);
   11.84 -
   11.85 -acpi_status
   11.86 -acpi_hw_low_level_write (
   11.87 -	u32                             width,
   11.88 -	u32                             value,
   11.89 -	struct acpi_generic_address     *reg);
   11.90 -
   11.91 -acpi_status
   11.92 -acpi_hw_clear_acpi_status (
   11.93 -	u32                             flags);
   11.94 -
   11.95 -
   11.96 -/* GPE support */
   11.97 +/*
   11.98 + * hwregs - ACPI Register I/O
   11.99 + */
  11.100 +struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);
  11.101  
  11.102  acpi_status
  11.103 -acpi_hw_write_gpe_enable_reg (
  11.104 -	struct acpi_gpe_event_info      *gpe_event_info);
  11.105 -
  11.106 -acpi_status
  11.107 -acpi_hw_disable_gpe_block (
  11.108 -	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
  11.109 -	struct acpi_gpe_block_info      *gpe_block);
  11.110 -
  11.111 -acpi_status
  11.112 -acpi_hw_clear_gpe (
  11.113 -	struct acpi_gpe_event_info      *gpe_event_info);
  11.114 +acpi_hw_register_read(u32 register_id, u32 * return_value);
  11.115  
  11.116 -acpi_status
  11.117 -acpi_hw_clear_gpe_block (
  11.118 -	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
  11.119 -	struct acpi_gpe_block_info      *gpe_block);
  11.120 -
  11.121 -#ifdef ACPI_FUTURE_USAGE
  11.122 -acpi_status
  11.123 -acpi_hw_get_gpe_status (
  11.124 -	struct acpi_gpe_event_info      *gpe_event_info,
  11.125 -	acpi_event_status               *event_status);
  11.126 -#endif
  11.127 -
  11.128 -acpi_status
  11.129 -acpi_hw_disable_all_gpes (
  11.130 -	u32                             flags);
  11.131 -
  11.132 -acpi_status
  11.133 -acpi_hw_enable_all_runtime_gpes (
  11.134 -	u32                             flags);
  11.135 +acpi_status acpi_hw_register_write(u32 register_id, u32 value);
  11.136  
  11.137  acpi_status
  11.138 -acpi_hw_enable_all_wakeup_gpes (
  11.139 -	u32                             flags);
  11.140 -
  11.141 -acpi_status
  11.142 -acpi_hw_enable_runtime_gpe_block (
  11.143 -	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
  11.144 -	struct acpi_gpe_block_info      *gpe_block);
  11.145 +acpi_hw_low_level_read(u32 width,
  11.146 +		       u32 * value, struct acpi_generic_address *reg);
  11.147  
  11.148  acpi_status
  11.149 -acpi_hw_enable_wakeup_gpe_block (
  11.150 -	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
  11.151 -	struct acpi_gpe_block_info      *gpe_block);
  11.152 -
  11.153 +acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
  11.154  
  11.155 -/* ACPI Timer prototypes */
  11.156 +acpi_status acpi_hw_clear_acpi_status(void);
  11.157  
  11.158 -#ifdef ACPI_FUTURE_USAGE
  11.159 +/*
  11.160 + * hwgpe - GPE support
  11.161 + */
  11.162  acpi_status
  11.163 -acpi_get_timer_resolution (
  11.164 -	u32                             *resolution);
  11.165 +acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info *gpe_event_info);
  11.166  
  11.167  acpi_status
  11.168 -acpi_get_timer (
  11.169 -	u32                             *ticks);
  11.170 +acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  11.171 +			  struct acpi_gpe_block_info *gpe_block);
  11.172 +
  11.173 +acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info *gpe_event_info);
  11.174  
  11.175  acpi_status
  11.176 -acpi_get_timer_duration (
  11.177 -	u32                             start_ticks,
  11.178 -	u32                             end_ticks,
  11.179 -	u32                             *time_elapsed);
  11.180 -#endif  /*  ACPI_FUTURE_USAGE  */
  11.181 +acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  11.182 +			struct acpi_gpe_block_info *gpe_block);
  11.183  
  11.184 -#endif /* __ACHWARE_H__ */
  11.185 +#ifdef	ACPI_FUTURE_USAGE
  11.186 +acpi_status
  11.187 +acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
  11.188 +		       acpi_event_status * event_status);
  11.189 +#endif				/* ACPI_FUTURE_USAGE */
  11.190 +
  11.191 +acpi_status acpi_hw_disable_all_gpes(void);
  11.192 +
  11.193 +acpi_status acpi_hw_enable_all_runtime_gpes(void);
  11.194 +
  11.195 +acpi_status acpi_hw_enable_all_wakeup_gpes(void);
  11.196 +
  11.197 +acpi_status
  11.198 +acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
  11.199 +				 struct acpi_gpe_block_info *gpe_block);
  11.200 +
  11.201 +#ifdef	ACPI_FUTURE_USAGE
  11.202 +/*
  11.203 + * hwtimer - ACPI Timer prototypes
  11.204 + */
  11.205 +acpi_status acpi_get_timer_resolution(u32 * resolution);
  11.206 +
  11.207 +acpi_status acpi_get_timer(u32 * ticks);
  11.208 +
  11.209 +acpi_status
  11.210 +acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed);
  11.211 +#endif				/* ACPI_FUTURE_USAGE */
  11.212 +
  11.213 +#endif				/* __ACHWARE_H__ */
    12.1 --- a/xen/include/acpi/aclocal.h	Tue Mar 18 13:14:26 2008 +0000
    12.2 +++ b/xen/include/acpi/aclocal.h	Tue Mar 18 14:55:36 2008 +0000
    12.3 @@ -5,7 +5,7 @@
    12.4   *****************************************************************************/
    12.5  
    12.6  /*
    12.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    12.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    12.9   * All rights reserved.
   12.10   *
   12.11   * Redistribution and use in source and binary forms, with or without
   12.12 @@ -44,17 +44,24 @@
   12.13  #ifndef __ACLOCAL_H__
   12.14  #define __ACLOCAL_H__
   12.15  
   12.16 -
   12.17 -#define ACPI_WAIT_FOREVER               0xFFFF  /* u16, as per ACPI spec */
   12.18 +/* acpisrc:struct_defs -- for acpisrc conversion */
   12.19  
   12.20 -typedef void *                                  acpi_mutex;
   12.21 -typedef u32                                     acpi_mutex_handle;
   12.22 +#define ACPI_WAIT_FOREVER               0xFFFF	/* u16, as per ACPI spec */
   12.23 +#define ACPI_DO_NOT_WAIT                0
   12.24 +#define ACPI_SERIALIZED                 0xFF
   12.25  
   12.26 +typedef u32 acpi_mutex_handle;
   12.27 +#define ACPI_GLOBAL_LOCK                (acpi_semaphore) (-1)
   12.28  
   12.29  /* Total number of aml opcodes defined */
   12.30  
   12.31  #define AML_NUM_OPCODES                 0x7F
   12.32  
   12.33 +/* Forward declarations */
   12.34 +
   12.35 +struct acpi_walk_state;
   12.36 +struct acpi_obj_mutex;
   12.37 +union acpi_parse_object;
   12.38  
   12.39  /*****************************************************************************
   12.40   *
   12.41 @@ -62,88 +69,79 @@ typedef u32                             
   12.42   *
   12.43   ****************************************************************************/
   12.44  
   12.45 -
   12.46  /*
   12.47   * Predefined handles for the mutex objects used within the subsystem
   12.48   * All mutex objects are automatically created by acpi_ut_mutex_initialize.
   12.49   *
   12.50 - * The acquire/release ordering protocol is implied via this list.  Mutexes
   12.51 + * The acquire/release ordering protocol is implied via this list. Mutexes
   12.52   * with a lower value must be acquired before mutexes with a higher value.
   12.53   *
   12.54 - * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also!
   12.55 + * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names
   12.56 + * table below also!
   12.57   */
   12.58 +#define ACPI_MTX_INTERPRETER            0	/* AML Interpreter, main lock */
   12.59 +#define ACPI_MTX_NAMESPACE              1	/* ACPI Namespace */
   12.60 +#define ACPI_MTX_TABLES                 2	/* Data for ACPI tables */
   12.61 +#define ACPI_MTX_EVENTS                 3	/* Data for ACPI events */
   12.62 +#define ACPI_MTX_CACHES                 4	/* Internal caches, general purposes */
   12.63 +#define ACPI_MTX_MEMORY                 5	/* Debug memory tracking lists */
   12.64 +#define ACPI_MTX_DEBUG_CMD_COMPLETE     6	/* AML debugger */
   12.65 +#define ACPI_MTX_DEBUG_CMD_READY        7	/* AML debugger */
   12.66  
   12.67 -#define ACPI_MTX_EXECUTE                0
   12.68 -#define ACPI_MTX_INTERPRETER            1
   12.69 -#define ACPI_MTX_PARSER                 2
   12.70 -#define ACPI_MTX_DISPATCHER             3
   12.71 -#define ACPI_MTX_TABLES                 4
   12.72 -#define ACPI_MTX_OP_REGIONS             5
   12.73 -#define ACPI_MTX_NAMESPACE              6
   12.74 -#define ACPI_MTX_EVENTS                 7
   12.75 -#define ACPI_MTX_HARDWARE               8
   12.76 -#define ACPI_MTX_CACHES                 9
   12.77 -#define ACPI_MTX_MEMORY                 10
   12.78 -#define ACPI_MTX_DEBUG_CMD_COMPLETE     11
   12.79 -#define ACPI_MTX_DEBUG_CMD_READY        12
   12.80 -
   12.81 -#define MAX_MUTEX                       12
   12.82 -#define NUM_MUTEX                       MAX_MUTEX+1
   12.83 -
   12.84 +#define ACPI_MAX_MUTEX                  7
   12.85 +#define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1
   12.86  
   12.87  #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
   12.88  #ifdef DEFINE_ACPI_GLOBALS
   12.89  
   12.90 -/* Names for the mutexes used in the subsystem */
   12.91 +/* Debug names for the mutexes above */
   12.92  
   12.93 -static char                         *acpi_gbl_mutex_names[] =
   12.94 -{
   12.95 -	"ACPI_MTX_Execute",
   12.96 +static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
   12.97  	"ACPI_MTX_Interpreter",
   12.98 -	"ACPI_MTX_Parser",
   12.99 -	"ACPI_MTX_Dispatcher",
  12.100  	"ACPI_MTX_Tables",
  12.101 -	"ACPI_MTX_op_regions",
  12.102  	"ACPI_MTX_Namespace",
  12.103  	"ACPI_MTX_Events",
  12.104 -	"ACPI_MTX_Hardware",
  12.105  	"ACPI_MTX_Caches",
  12.106  	"ACPI_MTX_Memory",
  12.107 -	"ACPI_MTX_debug_cmd_complete",
  12.108 -	"ACPI_MTX_debug_cmd_ready",
  12.109 +	"ACPI_MTX_CommandComplete",
  12.110 +	"ACPI_MTX_CommandReady"
  12.111  };
  12.112  
  12.113  #endif
  12.114  #endif
  12.115  
  12.116 +/*
  12.117 + * Predefined handles for spinlocks used within the subsystem.
  12.118 + * These spinlocks are created by acpi_ut_mutex_initialize
  12.119 + */
  12.120 +#define ACPI_LOCK_GPES                  0
  12.121 +#define ACPI_LOCK_HARDWARE              1
  12.122 +
  12.123 +#define ACPI_MAX_LOCK                   1
  12.124 +#define ACPI_NUM_LOCK                   ACPI_MAX_LOCK+1
  12.125 +
  12.126 +/* Owner IDs are used to track namespace nodes for selective deletion */
  12.127 +
  12.128 +typedef u8 acpi_owner_id;
  12.129 +#define ACPI_OWNER_ID_MAX               0xFF
  12.130 +
  12.131 +/* This Thread ID means that the mutex is not in use (unlocked) */
  12.132 +
  12.133 +#define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
  12.134  
  12.135  /* Table for the global mutexes */
  12.136  
  12.137 -struct acpi_mutex_info
  12.138 -{
  12.139 -	acpi_mutex                          mutex;
  12.140 -	u32                                 use_count;
  12.141 -	u32                                 owner_id;
  12.142 +struct acpi_mutex_info {
  12.143 +	acpi_mutex mutex;
  12.144 +	u32 use_count;
  12.145 +	acpi_thread_id thread_id;
  12.146  };
  12.147  
  12.148 -/* This owner ID means that the mutex is not in use (unlocked) */
  12.149 -
  12.150 -#define ACPI_MUTEX_NOT_ACQUIRED         (u32) (-1)
  12.151 -
  12.152 -
  12.153  /* Lock flag parameter for various interfaces */
  12.154  
  12.155  #define ACPI_MTX_DO_NOT_LOCK            0
  12.156  #define ACPI_MTX_LOCK                   1
  12.157  
  12.158 -
  12.159 -typedef u16                                     acpi_owner_id;
  12.160 -#define ACPI_OWNER_TYPE_TABLE           0x0
  12.161 -#define ACPI_OWNER_TYPE_METHOD          0x1
  12.162 -#define ACPI_FIRST_METHOD_ID            0x0001
  12.163 -#define ACPI_FIRST_TABLE_ID             0xF000
  12.164 -
  12.165 -
  12.166  /* Field access granularities */
  12.167  
  12.168  #define ACPI_FIELD_BYTE_GRANULARITY     1
  12.169 @@ -151,153 +149,196 @@ typedef u16                             
  12.170  #define ACPI_FIELD_DWORD_GRANULARITY    4
  12.171  #define ACPI_FIELD_QWORD_GRANULARITY    8
  12.172  
  12.173 +#define ACPI_ENTRY_NOT_FOUND            NULL
  12.174 +
  12.175  /*****************************************************************************
  12.176   *
  12.177   * Namespace typedefs and structs
  12.178   *
  12.179   ****************************************************************************/
  12.180  
  12.181 -
  12.182  /* Operational modes of the AML interpreter/scanner */
  12.183  
  12.184 -typedef enum
  12.185 -{
  12.186 -	ACPI_IMODE_LOAD_PASS1               = 0x01,
  12.187 -	ACPI_IMODE_LOAD_PASS2               = 0x02,
  12.188 -	ACPI_IMODE_EXECUTE                  = 0x0E
  12.189 -
  12.190 +typedef enum {
  12.191 +	ACPI_IMODE_LOAD_PASS1 = 0x01,
  12.192 +	ACPI_IMODE_LOAD_PASS2 = 0x02,
  12.193 +	ACPI_IMODE_EXECUTE = 0x03
  12.194  } acpi_interpreter_mode;
  12.195  
  12.196 -
  12.197 -/*
  12.198 - * The Node describes a named object that appears in the AML
  12.199 - * An acpi_node is used to store Nodes.
  12.200 - *
  12.201 - * data_type is used to differentiate between internal descriptors, and MUST
  12.202 - * be the first byte in this structure.
  12.203 - */
  12.204 -
  12.205 -union acpi_name_union
  12.206 -{
  12.207 -	u32                                 integer;
  12.208 -	char                                ascii[4];
  12.209 +union acpi_name_union {
  12.210 +	u32 integer;
  12.211 +	char ascii[4];
  12.212  };
  12.213  
  12.214 -struct acpi_namespace_node
  12.215 -{
  12.216 -	u8                                  descriptor;     /* Used to differentiate object descriptor types */
  12.217 -	u8                                  type;           /* Type associated with this name */
  12.218 -	u16                                 owner_id;
  12.219 -	union acpi_name_union               name;           /* ACPI Name, always 4 chars per ACPI spec */
  12.220 -	union acpi_operand_object           *object;        /* Pointer to attached ACPI object (optional) */
  12.221 -	struct acpi_namespace_node          *child;         /* First child */
  12.222 -	struct acpi_namespace_node          *peer;          /* Next peer*/
  12.223 -	u16                                 reference_count; /* Current count of references and children */
  12.224 -	u8                                  flags;
  12.225 +/*
  12.226 + * The Namespace Node describes a named object that appears in the AML.
  12.227 + * descriptor_type is used to differentiate between internal descriptors.
  12.228 + *
  12.229 + * The node is optimized for both 32-bit and 64-bit platforms:
  12.230 + * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
  12.231 + *
  12.232 + * Note: The descriptor_type and Type fields must appear in the identical
  12.233 + * position in both the struct acpi_namespace_node and union acpi_operand_object
  12.234 + * structures.
  12.235 + */
  12.236 +struct acpi_namespace_node {
  12.237 +	union acpi_operand_object *object;	/* Interpreter object */
  12.238 +	u8 descriptor_type;	/* Differentiate object descriptor types */
  12.239 +	u8 type;		/* ACPI Type associated with this name */
  12.240 +	u8 flags;		/* Miscellaneous flags */
  12.241 +	acpi_owner_id owner_id;	/* Node creator */
  12.242 +	union acpi_name_union name;	/* ACPI Name, always 4 chars per ACPI spec */
  12.243 +	struct acpi_namespace_node *child;	/* First child */
  12.244 +	struct acpi_namespace_node *peer;	/* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
  12.245 +
  12.246 +	/*
  12.247 +	 * The following fields are used by the ASL compiler and disassembler only
  12.248 +	 */
  12.249 +#ifdef ACPI_LARGE_NAMESPACE_NODE
  12.250 +	union acpi_parse_object *op;
  12.251 +	u32 value;
  12.252 +	u32 length;
  12.253 +#endif
  12.254  };
  12.255  
  12.256 -
  12.257 -#define ACPI_ENTRY_NOT_FOUND            NULL
  12.258 -
  12.259 -
  12.260 -/* Node flags */
  12.261 +/* Namespace Node flags */
  12.262  
  12.263 -#define ANOBJ_RESERVED                  0x01
  12.264 -#define ANOBJ_END_OF_PEER_LIST          0x02
  12.265 -#define ANOBJ_DATA_WIDTH_32             0x04     /* Parent table is 64-bits */
  12.266 -#define ANOBJ_METHOD_ARG                0x08
  12.267 -#define ANOBJ_METHOD_LOCAL              0x10
  12.268 -#define ANOBJ_METHOD_NO_RETVAL          0x20
  12.269 -#define ANOBJ_METHOD_SOME_NO_RETVAL     0x40
  12.270 -#define ANOBJ_IS_BIT_OFFSET             0x80
  12.271 +#define ANOBJ_END_OF_PEER_LIST          0x01	/* End-of-list, Peer field points to parent */
  12.272 +#define ANOBJ_TEMPORARY                 0x02	/* Node is create by a method and is temporary */
  12.273 +#define ANOBJ_METHOD_ARG                0x04	/* Node is a method argument */
  12.274 +#define ANOBJ_METHOD_LOCAL              0x08	/* Node is a method local */
  12.275 +#define ANOBJ_SUBTREE_HAS_INI           0x10	/* Used to optimize device initialization */
  12.276 +
  12.277 +#define ANOBJ_IS_EXTERNAL               0x08	/* i_aSL only: This object created via External() */
  12.278 +#define ANOBJ_METHOD_NO_RETVAL          0x10	/* i_aSL only: Method has no return value */
  12.279 +#define ANOBJ_METHOD_SOME_NO_RETVAL     0x20	/* i_aSL only: Method has at least one return value */
  12.280 +#define ANOBJ_IS_BIT_OFFSET             0x40	/* i_aSL only: Reference is a bit offset */
  12.281 +#define ANOBJ_IS_REFERENCED             0x80	/* i_aSL only: Object was referenced */
  12.282  
  12.283  /*
  12.284   * ACPI Table Descriptor.  One per ACPI table
  12.285   */
  12.286 -struct acpi_table_desc
  12.287 -{
  12.288 -	struct acpi_table_desc          *prev;
  12.289 -	struct acpi_table_desc          *next;
  12.290 -	struct acpi_table_desc          *installed_desc;
  12.291 -	struct acpi_table_header        *pointer;
  12.292 -	u8                              *aml_start;
  12.293 -	u64                             physical_address;
  12.294 -	u32                             aml_length;
  12.295 -	acpi_size                       length;
  12.296 -	acpi_owner_id                   table_id;
  12.297 -	u8                              type;
  12.298 -	u8                              allocation;
  12.299 -	u8                              loaded_into_namespace;
  12.300 +struct acpi_table_desc {
  12.301 +	acpi_physical_address address;
  12.302 +	struct acpi_table_header *pointer;
  12.303 +	u32 length;		/* Length fixed at 32 bits */
  12.304 +	union acpi_name_union signature;
  12.305 +	acpi_owner_id owner_id;
  12.306 +	u8 flags;
  12.307  };
  12.308  
  12.309 -struct acpi_table_list
  12.310 -{
  12.311 -	struct acpi_table_desc          *next;
  12.312 -	u32                             count;
  12.313 +/* Flags for above */
  12.314 +
  12.315 +#define ACPI_TABLE_ORIGIN_UNKNOWN       (0)
  12.316 +#define ACPI_TABLE_ORIGIN_MAPPED        (1)
  12.317 +#define ACPI_TABLE_ORIGIN_ALLOCATED     (2)
  12.318 +#define ACPI_TABLE_ORIGIN_MASK          (3)
  12.319 +#define ACPI_TABLE_IS_LOADED            (4)
  12.320 +
  12.321 +/* One internal RSDT for table management */
  12.322 +
  12.323 +struct acpi_internal_rsdt {
  12.324 +	struct acpi_table_desc *tables;
  12.325 +	u32 count;
  12.326 +	u32 size;
  12.327 +	u8 flags;
  12.328  };
  12.329  
  12.330 +/* Flags for above */
  12.331  
  12.332 -struct acpi_find_context
  12.333 -{
  12.334 -	char                            *search_for;
  12.335 -	acpi_handle                     *list;
  12.336 -	u32                             *count;
  12.337 +#define ACPI_ROOT_ORIGIN_UNKNOWN        (0)	/* ~ORIGIN_ALLOCATED */
  12.338 +#define ACPI_ROOT_ORIGIN_ALLOCATED      (1)
  12.339 +#define ACPI_ROOT_ALLOW_RESIZE          (2)
  12.340 +
  12.341 +/* Predefined (fixed) table indexes */
  12.342 +
  12.343 +#define ACPI_TABLE_INDEX_DSDT           (0)
  12.344 +#define ACPI_TABLE_INDEX_FACS           (1)
  12.345 +
  12.346 +struct acpi_find_context {
  12.347 +	char *search_for;
  12.348 +	acpi_handle *list;
  12.349 +	u32 *count;
  12.350  };
  12.351  
  12.352 -
  12.353 -struct acpi_ns_search_data
  12.354 -{
  12.355 -	struct acpi_namespace_node      *node;
  12.356 +struct acpi_ns_search_data {
  12.357 +	struct acpi_namespace_node *node;
  12.358  };
  12.359  
  12.360 -
  12.361  /*
  12.362   * Predefined Namespace items
  12.363   */
  12.364 -struct acpi_predefined_names
  12.365 -{
  12.366 -	char                            *name;
  12.367 -	u8                              type;
  12.368 -	char                            *val;
  12.369 +struct acpi_predefined_names {
  12.370 +	char *name;
  12.371 +	u8 type;
  12.372 +	char *val;
  12.373  };
  12.374  
  12.375 -
  12.376  /* Object types used during package copies */
  12.377  
  12.378 -
  12.379  #define ACPI_COPY_TYPE_SIMPLE           0
  12.380  #define ACPI_COPY_TYPE_PACKAGE          1
  12.381  
  12.382  /* Info structure used to convert external<->internal namestrings */
  12.383  
  12.384 -struct acpi_namestring_info
  12.385 -{
  12.386 -	char                            *external_name;
  12.387 -	char                            *next_external_char;
  12.388 -	char                            *internal_name;
  12.389 -	u32                             length;
  12.390 -	u32                             num_segments;
  12.391 -	u32                             num_carats;
  12.392 -	u8                              fully_qualified;
  12.393 +struct acpi_namestring_info {
  12.394 +	char *external_name;
  12.395 +	char *next_external_char;
  12.396 +	char *internal_name;
  12.397 +	u32 length;
  12.398 +	u32 num_segments;
  12.399 +	u32 num_carats;
  12.400 +	u8 fully_qualified;
  12.401  };
  12.402  
  12.403 -
  12.404  /* Field creation info */
  12.405  
  12.406 -struct acpi_create_field_info
  12.407 -{
  12.408 -	struct acpi_namespace_node      *region_node;
  12.409 -	struct acpi_namespace_node      *field_node;
  12.410 -	struct acpi_namespace_node      *register_node;
  12.411 -	struct acpi_namespace_node      *data_register_node;
  12.412 -	u32                             bank_value;
  12.413 -	u32                             field_bit_position;
  12.414 -	u32                             field_bit_length;
  12.415 -	u8                              field_flags;
  12.416 -	u8                              attribute;
  12.417 -	u8                              field_type;
  12.418 +struct acpi_create_field_info {
  12.419 +	struct acpi_namespace_node *region_node;
  12.420 +	struct acpi_namespace_node *field_node;
  12.421 +	struct acpi_namespace_node *register_node;
  12.422 +	struct acpi_namespace_node *data_register_node;
  12.423 +	u32 bank_value;
  12.424 +	u32 field_bit_position;
  12.425 +	u32 field_bit_length;
  12.426 +	u8 field_flags;
  12.427 +	u8 attribute;
  12.428 +	u8 field_type;
  12.429  };
  12.430  
  12.431 +typedef
  12.432 +acpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);
  12.433 +
  12.434 +/*
  12.435 + * Bitmapped ACPI types.  Used internally only
  12.436 + */
  12.437 +#define ACPI_BTYPE_ANY                  0x00000000
  12.438 +#define ACPI_BTYPE_INTEGER              0x00000001
  12.439 +#define ACPI_BTYPE_STRING               0x00000002
  12.440 +#define ACPI_BTYPE_BUFFER               0x00000004
  12.441 +#define ACPI_BTYPE_PACKAGE              0x00000008
  12.442 +#define ACPI_BTYPE_FIELD_UNIT           0x00000010
  12.443 +#define ACPI_BTYPE_DEVICE               0x00000020
  12.444 +#define ACPI_BTYPE_EVENT                0x00000040
  12.445 +#define ACPI_BTYPE_METHOD               0x00000080
  12.446 +#define ACPI_BTYPE_MUTEX                0x00000100
  12.447 +#define ACPI_BTYPE_REGION               0x00000200
  12.448 +#define ACPI_BTYPE_POWER                0x00000400
  12.449 +#define ACPI_BTYPE_PROCESSOR            0x00000800
  12.450 +#define ACPI_BTYPE_THERMAL              0x00001000
  12.451 +#define ACPI_BTYPE_BUFFER_FIELD         0x00002000
  12.452 +#define ACPI_BTYPE_DDB_HANDLE           0x00004000
  12.453 +#define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
  12.454 +#define ACPI_BTYPE_REFERENCE            0x00010000
  12.455 +#define ACPI_BTYPE_RESOURCE             0x00020000
  12.456 +
  12.457 +#define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
  12.458 +
  12.459 +#define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
  12.460 +#define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
  12.461 +#define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
  12.462 +#define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF	/* ARG or LOCAL */
  12.463 +#define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
  12.464  
  12.465  /*****************************************************************************
  12.466   *
  12.467 @@ -307,277 +348,221 @@ struct acpi_create_field_info
  12.468  
  12.469  /* Dispatch info for each GPE -- either a method or handler, cannot be both */
  12.470  
  12.471 -struct acpi_handler_info
  12.472 -{
  12.473 -	acpi_event_handler                      address;        /* Address of handler, if any */
  12.474 -	void                                    *context;       /* Context to be passed to handler */
  12.475 -	struct acpi_namespace_node              *method_node;   /* Method node for this GPE level (saved) */
  12.476 +struct acpi_handler_info {
  12.477 +	acpi_event_handler address;	/* Address of handler, if any */
  12.478 +	void *context;		/* Context to be passed to handler */
  12.479 +	struct acpi_namespace_node *method_node;	/* Method node for this GPE level (saved) */
  12.480  };
  12.481  
  12.482 -union acpi_gpe_dispatch_info
  12.483 -{
  12.484 -	struct acpi_namespace_node              *method_node;   /* Method node for this GPE level */
  12.485 -	struct acpi_handler_info                *handler;
  12.486 +union acpi_gpe_dispatch_info {
  12.487 +	struct acpi_namespace_node *method_node;	/* Method node for this GPE level */
  12.488 +	struct acpi_handler_info *handler;
  12.489  };
  12.490  
  12.491  /*
  12.492   * Information about a GPE, one per each GPE in an array.
  12.493   * NOTE: Important to keep this struct as small as possible.
  12.494   */
  12.495 -struct acpi_gpe_event_info
  12.496 -{
  12.497 -	union acpi_gpe_dispatch_info    dispatch;       /* Either Method or Handler */
  12.498 -	struct acpi_gpe_register_info           *register_info; /* Backpointer to register info */
  12.499 -	u8                                      flags;          /* Misc info about this GPE */
  12.500 -	u8                                      register_bit;   /* This GPE bit within the register */
  12.501 +struct acpi_gpe_event_info {
  12.502 +	union acpi_gpe_dispatch_info dispatch;	/* Either Method or Handler */
  12.503 +	struct acpi_gpe_register_info *register_info;	/* Backpointer to register info */
  12.504 +	u8 flags;		/* Misc info about this GPE */
  12.505 +	u8 gpe_number;		/* This GPE */
  12.506  };
  12.507  
  12.508  /* Information about a GPE register pair, one per each status/enable pair in an array */
  12.509  
  12.510 -struct acpi_gpe_register_info
  12.511 -{
  12.512 -	struct acpi_generic_address             status_address; /* Address of status reg */
  12.513 -	struct acpi_generic_address             enable_address; /* Address of enable reg */
  12.514 -	u8                                      enable_for_wake; /* GPEs to keep enabled when sleeping */
  12.515 -	u8                                      enable_for_run; /* GPEs to keep enabled when running */
  12.516 -	u8                                      base_gpe_number; /* Base GPE number for this register */
  12.517 +struct acpi_gpe_register_info {
  12.518 +	struct acpi_generic_address status_address;	/* Address of status reg */
  12.519 +	struct acpi_generic_address enable_address;	/* Address of enable reg */
  12.520 +	u8 enable_for_wake;	/* GPEs to keep enabled when sleeping */
  12.521 +	u8 enable_for_run;	/* GPEs to keep enabled when running */
  12.522 +	u8 base_gpe_number;	/* Base GPE number for this register */
  12.523  };
  12.524  
  12.525  /*
  12.526   * Information about a GPE register block, one per each installed block --
  12.527   * GPE0, GPE1, and one per each installed GPE Block Device.
  12.528   */
  12.529 -struct acpi_gpe_block_info
  12.530 -{
  12.531 -	struct acpi_namespace_node              *node;
  12.532 -	struct acpi_gpe_block_info              *previous;
  12.533 -	struct acpi_gpe_block_info              *next;
  12.534 -	struct acpi_gpe_xrupt_info              *xrupt_block;   /* Backpointer to interrupt block */
  12.535 -	struct acpi_gpe_register_info           *register_info; /* One per GPE register pair */
  12.536 -	struct acpi_gpe_event_info              *event_info;    /* One for each GPE */
  12.537 -	struct acpi_generic_address             block_address;  /* Base address of the block */
  12.538 -	u32                                     register_count; /* Number of register pairs in block */
  12.539 -	u8                                      block_base_number;/* Base GPE number for this block */
  12.540 +struct acpi_gpe_block_info {
  12.541 +	struct acpi_namespace_node *node;
  12.542 +	struct acpi_gpe_block_info *previous;
  12.543 +	struct acpi_gpe_block_info *next;
  12.544 +	struct acpi_gpe_xrupt_info *xrupt_block;	/* Backpointer to interrupt block */
  12.545 +	struct acpi_gpe_register_info *register_info;	/* One per GPE register pair */
  12.546 +	struct acpi_gpe_event_info *event_info;	/* One for each GPE */
  12.547 +	struct acpi_generic_address block_address;	/* Base address of the block */
  12.548 +	u32 register_count;	/* Number of register pairs in block */
  12.549 +	u8 block_base_number;	/* Base GPE number for this block */
  12.550  };
  12.551  
  12.552  /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
  12.553  
  12.554 -struct acpi_gpe_xrupt_info
  12.555 -{
  12.556 -	struct acpi_gpe_xrupt_info              *previous;
  12.557 -	struct acpi_gpe_xrupt_info              *next;
  12.558 -	struct acpi_gpe_block_info              *gpe_block_list_head; /* List of GPE blocks for this xrupt */
  12.559 -	u32                                     interrupt_level;    /* System interrupt level */
  12.560 +struct acpi_gpe_xrupt_info {
  12.561 +	struct acpi_gpe_xrupt_info *previous;
  12.562 +	struct acpi_gpe_xrupt_info *next;
  12.563 +	struct acpi_gpe_block_info *gpe_block_list_head;	/* List of GPE blocks for this xrupt */
  12.564 +	u32 interrupt_number;	/* System interrupt number */
  12.565  };
  12.566  
  12.567 -
  12.568 -struct acpi_gpe_walk_info
  12.569 -{
  12.570 -	struct acpi_namespace_node              *gpe_device;
  12.571 -	struct acpi_gpe_block_info              *gpe_block;
  12.572 +struct acpi_gpe_walk_info {
  12.573 +	struct acpi_namespace_node *gpe_device;
  12.574 +	struct acpi_gpe_block_info *gpe_block;
  12.575  };
  12.576  
  12.577 -
  12.578 -typedef acpi_status (*ACPI_GPE_CALLBACK) (
  12.579 -	struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
  12.580 -	struct acpi_gpe_block_info      *gpe_block);
  12.581 -
  12.582 +typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
  12.583 +					 gpe_xrupt_info,
  12.584 +					 struct acpi_gpe_block_info *
  12.585 +					 gpe_block);
  12.586  
  12.587  /* Information about each particular fixed event */
  12.588  
  12.589 -struct acpi_fixed_event_handler
  12.590 -{
  12.591 -	acpi_event_handler              handler;        /* Address of handler. */
  12.592 -	void                            *context;       /* Context to be passed to handler */
  12.593 +struct acpi_fixed_event_handler {
  12.594 +	acpi_event_handler handler;	/* Address of handler. */
  12.595 +	void *context;		/* Context to be passed to handler */
  12.596  };
  12.597  
  12.598 -struct acpi_fixed_event_info
  12.599 -{
  12.600 -	u8                              status_register_id;
  12.601 -	u8                              enable_register_id;
  12.602 -	u16                             status_bit_mask;
  12.603 -	u16                             enable_bit_mask;
  12.604 +struct acpi_fixed_event_info {
  12.605 +	u8 status_register_id;
  12.606 +	u8 enable_register_id;
  12.607 +	u16 status_bit_mask;
  12.608 +	u16 enable_bit_mask;
  12.609  };
  12.610  
  12.611  /* Information used during field processing */
  12.612  
  12.613 -struct acpi_field_info
  12.614 -{
  12.615 -	u8                              skip_field;
  12.616 -	u8                              field_flag;
  12.617 -	u32                             pkg_length;
  12.618 +struct acpi_field_info {
  12.619 +	u8 skip_field;
  12.620 +	u8 field_flag;
  12.621 +	u32 pkg_length;
  12.622  };
  12.623  
  12.624 -
  12.625  /*****************************************************************************
  12.626   *
  12.627   * Generic "state" object for stacks
  12.628   *
  12.629   ****************************************************************************/
  12.630  
  12.631 -
  12.632  #define ACPI_CONTROL_NORMAL                  0xC0
  12.633  #define ACPI_CONTROL_CONDITIONAL_EXECUTING   0xC1
  12.634  #define ACPI_CONTROL_PREDICATE_EXECUTING     0xC2
  12.635  #define ACPI_CONTROL_PREDICATE_FALSE         0xC3
  12.636  #define ACPI_CONTROL_PREDICATE_TRUE          0xC4
  12.637  
  12.638 -
  12.639 -/* Forward declarations */
  12.640 -struct acpi_walk_state        ;
  12.641 -struct acpi_obj_mutex;
  12.642 -union acpi_parse_object        ;
  12.643 -
  12.644 +#define ACPI_STATE_COMMON \
  12.645 +	void                            *next; \
  12.646 +	u8                              descriptor_type; /* To differentiate various internal objs */\
  12.647 +	u8                              flags; \
  12.648 +	u16                             value; \
  12.649 +	u16                             state;
  12.650  
  12.651 -#define ACPI_STATE_COMMON                  /* Two 32-bit fields and a pointer */\
  12.652 -	u8                                  data_type;          /* To differentiate various internal objs */\
  12.653 -	u8                                  flags;      \
  12.654 -	u16                                 value;      \
  12.655 -	u16                                 state;      \
  12.656 -	u16                                 reserved;   \
  12.657 -	void                                *next;      \
  12.658 +	/* There are 2 bytes available here until the next natural alignment boundary */
  12.659  
  12.660 -struct acpi_common_state
  12.661 -{
  12.662 -	ACPI_STATE_COMMON
  12.663 -};
  12.664 -
  12.665 +struct acpi_common_state {
  12.666 +ACPI_STATE_COMMON};
  12.667  
  12.668  /*
  12.669   * Update state - used to traverse complex objects such as packages
  12.670   */
  12.671 -struct acpi_update_state
  12.672 -{
  12.673 -	ACPI_STATE_COMMON
  12.674 -	union acpi_operand_object           *object;
  12.675 +struct acpi_update_state {
  12.676 +	ACPI_STATE_COMMON union acpi_operand_object *object;
  12.677  };
  12.678  
  12.679 -
  12.680  /*
  12.681   * Pkg state - used to traverse nested package structures
  12.682   */
  12.683 -struct acpi_pkg_state
  12.684 -{
  12.685 -	ACPI_STATE_COMMON
  12.686 -	union acpi_operand_object           *source_object;
  12.687 -	union acpi_operand_object           *dest_object;
  12.688 -	struct acpi_walk_state              *walk_state;
  12.689 -	void                                *this_target_obj;
  12.690 -	u32                                 num_packages;
  12.691 -	u16                                 index;
  12.692 +struct acpi_pkg_state {
  12.693 +	ACPI_STATE_COMMON u16 index;
  12.694 +	union acpi_operand_object *source_object;
  12.695 +	union acpi_operand_object *dest_object;
  12.696 +	struct acpi_walk_state *walk_state;
  12.697 +	void *this_target_obj;
  12.698 +	u32 num_packages;
  12.699  };
  12.700  
  12.701 -
  12.702  /*
  12.703   * Control state - one per if/else and while constructs.
  12.704   * Allows nesting of these constructs
  12.705   */
  12.706 -struct acpi_control_state
  12.707 -{
  12.708 -	ACPI_STATE_COMMON
  12.709 -	union acpi_parse_object             *predicate_op;
  12.710 -	u8                                  *aml_predicate_start;   /* Start of if/while predicate */
  12.711 -	u8                                  *package_end;           /* End of if/while block */
  12.712 -	u16                                 opcode;
  12.713 +struct acpi_control_state {
  12.714 +	ACPI_STATE_COMMON u16 opcode;
  12.715 +	union acpi_parse_object *predicate_op;
  12.716 +	u8 *aml_predicate_start;	/* Start of if/while predicate */
  12.717 +	u8 *package_end;	/* End of if/while block */
  12.718  };
  12.719  
  12.720 -
  12.721  /*
  12.722   * Scope state - current scope during namespace lookups
  12.723   */
  12.724 -struct acpi_scope_state
  12.725 -{
  12.726 -	ACPI_STATE_COMMON
  12.727 -	struct acpi_namespace_node          *node;
  12.728 +struct acpi_scope_state {
  12.729 +	ACPI_STATE_COMMON struct acpi_namespace_node *node;
  12.730  };
  12.731  
  12.732 -
  12.733 -struct acpi_pscope_state
  12.734 -{
  12.735 -	ACPI_STATE_COMMON
  12.736 -	union acpi_parse_object             *op;                    /* Current op being parsed */
  12.737 -	u8                                  *arg_end;               /* Current argument end */
  12.738 -	u8                                  *pkg_end;               /* Current package end */
  12.739 -	u32                                 arg_list;               /* Next argument to parse */
  12.740 -	u32                                 arg_count;              /* Number of fixed arguments */
  12.741 +struct acpi_pscope_state {
  12.742 +	ACPI_STATE_COMMON u32 arg_count;	/* Number of fixed arguments */
  12.743 +	union acpi_parse_object *op;	/* Current op being parsed */
  12.744 +	u8 *arg_end;		/* Current argument end */
  12.745 +	u8 *pkg_end;		/* Current package end */
  12.746 +	u32 arg_list;		/* Next argument to parse */
  12.747  };
  12.748  
  12.749 -
  12.750  /*
  12.751   * Thread state - one per thread across multiple walk states.  Multiple walk
  12.752   * states are created when there are nested control methods executing.
  12.753   */
  12.754 -struct acpi_thread_state
  12.755 -{
  12.756 -	ACPI_STATE_COMMON
  12.757 -	struct acpi_walk_state              *walk_state_list;       /* Head of list of walk_states for this thread */
  12.758 -	union acpi_operand_object           *acquired_mutex_list;   /* List of all currently acquired mutexes */
  12.759 -	u32                                 thread_id;              /* Running thread ID */
  12.760 -	u8                                  current_sync_level;     /* Mutex Sync (nested acquire) level */
  12.761 +struct acpi_thread_state {
  12.762 +	ACPI_STATE_COMMON u8 current_sync_level;	/* Mutex Sync (nested acquire) level */
  12.763 +	struct acpi_walk_state *walk_state_list;	/* Head of list of walk_states for this thread */
  12.764 +	union acpi_operand_object *acquired_mutex_list;	/* List of all currently acquired mutexes */
  12.765 +	acpi_thread_id thread_id;	/* Running thread ID */
  12.766  };
  12.767  
  12.768 -
  12.769  /*
  12.770   * Result values - used to accumulate the results of nested
  12.771   * AML arguments
  12.772   */
  12.773 -struct acpi_result_values
  12.774 -{
  12.775 -	ACPI_STATE_COMMON
  12.776 -	union acpi_operand_object           *obj_desc [ACPI_OBJ_NUM_OPERANDS];
  12.777 -	u8                                  num_results;
  12.778 -	u8                                  last_insert;
  12.779 +struct acpi_result_values {
  12.780 +	ACPI_STATE_COMMON u8 num_results;
  12.781 +	u8 last_insert;
  12.782 +	union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
  12.783  };
  12.784  
  12.785 -
  12.786  typedef
  12.787 -acpi_status (*acpi_parse_downwards) (
  12.788 -	struct acpi_walk_state              *walk_state,
  12.789 -	union acpi_parse_object             **out_op);
  12.790 +acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
  12.791 +				    union acpi_parse_object ** out_op);
  12.792  
  12.793 -typedef
  12.794 -acpi_status (*acpi_parse_upwards) (
  12.795 -	struct acpi_walk_state              *walk_state);
  12.796 -
  12.797 +typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
  12.798  
  12.799  /*
  12.800   * Notify info - used to pass info to the deferred notify
  12.801   * handler/dispatcher.
  12.802   */
  12.803 -struct acpi_notify_info
  12.804 -{
  12.805 -	ACPI_STATE_COMMON
  12.806 -	struct acpi_namespace_node          *node;
  12.807 -	union acpi_operand_object           *handler_obj;
  12.808 +struct acpi_notify_info {
  12.809 +	ACPI_STATE_COMMON struct acpi_namespace_node *node;
  12.810 +	union acpi_operand_object *handler_obj;
  12.811  };
  12.812  
  12.813 -
  12.814  /* Generic state is union of structs above */
  12.815  
  12.816 -union acpi_generic_state
  12.817 -{
  12.818 -	struct acpi_common_state            common;
  12.819 -	struct acpi_control_state           control;
  12.820 -	struct acpi_update_state            update;
  12.821 -	struct acpi_scope_state             scope;
  12.822 -	struct acpi_pscope_state            parse_scope;
  12.823 -	struct acpi_pkg_state               pkg;
  12.824 -	struct acpi_thread_state            thread;
  12.825 -	struct acpi_result_values           results;
  12.826 -	struct acpi_notify_info             notify;
  12.827 +union acpi_generic_state {
  12.828 +	struct acpi_common_state common;
  12.829 +	struct acpi_control_state control;
  12.830 +	struct acpi_update_state update;
  12.831 +	struct acpi_scope_state scope;
  12.832 +	struct acpi_pscope_state parse_scope;
  12.833 +	struct acpi_pkg_state pkg;
  12.834 +	struct acpi_thread_state thread;
  12.835 +	struct acpi_result_values results;
  12.836 +	struct acpi_notify_info notify;
  12.837  };
  12.838  
  12.839 -
  12.840  /*****************************************************************************
  12.841   *
  12.842   * Interpreter typedefs and structs
  12.843   *
  12.844   ****************************************************************************/
  12.845  
  12.846 -typedef
  12.847 -acpi_status (*ACPI_EXECUTE_OP) (
  12.848 -	struct acpi_walk_state              *walk_state);
  12.849 -
  12.850 +typedef acpi_status(*ACPI_EXECUTE_OP) (struct acpi_walk_state * walk_state);
  12.851  
  12.852  /*****************************************************************************
  12.853   *
  12.854 @@ -588,152 +573,137 @@ acpi_status (*ACPI_EXECUTE_OP) (
  12.855  /*
  12.856   * AML opcode, name, and argument layout
  12.857   */
  12.858 -struct acpi_opcode_info
  12.859 -{
  12.860 +struct acpi_opcode_info {
  12.861  #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
  12.862 -	char                                *name;          /* Opcode name (disassembler/debug only) */
  12.863 +	char *name;		/* Opcode name (disassembler/debug only) */
  12.864  #endif
  12.865 -	u32                                 parse_args;     /* Grammar/Parse time arguments */
  12.866 -	u32                                 runtime_args;   /* Interpret time arguments */
  12.867 -	u32                                 flags;          /* Misc flags */
  12.868 -	u8                                  object_type;    /* Corresponding internal object type */
  12.869 -	u8                                  class;          /* Opcode class */
  12.870 -	u8                                  type;           /* Opcode type */
  12.871 +	u32 parse_args;		/* Grammar/Parse time arguments */
  12.872 +	u32 runtime_args;	/* Interpret time arguments */
  12.873 +	u16 flags;		/* Misc flags */
  12.874 +	u8 object_type;		/* Corresponding internal object type */
  12.875 +	u8 class;		/* Opcode class */
  12.876 +	u8 type;		/* Opcode type */
  12.877  };
  12.878  
  12.879 -
  12.880 -union acpi_parse_value
  12.881 -{
  12.882 -	acpi_integer                        integer;        /* Integer constant (Up to 64 bits) */
  12.883 -	struct uint64_struct                integer64;      /* Structure overlay for 2 32-bit Dwords */
  12.884 -	u32                                 size;           /* bytelist or field size */
  12.885 -	char                                *string;        /* NULL terminated string */
  12.886 -	u8                                  *buffer;        /* buffer or string */
  12.887 -	char                                *name;          /* NULL terminated string */
  12.888 -	union acpi_parse_object             *arg;           /* arguments and contained ops */
  12.889 +union acpi_parse_value {
  12.890 +	acpi_integer integer;	/* Integer constant (Up to 64 bits) */
  12.891 +	struct uint64_struct integer64;	/* Structure overlay for 2 32-bit Dwords */
  12.892 +	u32 size;		/* bytelist or field size */
  12.893 +	char *string;		/* NULL terminated string */
  12.894 +	u8 *buffer;		/* buffer or string */
  12.895 +	char *name;		/* NULL terminated string */
  12.896 +	union acpi_parse_object *arg;	/* arguments and contained ops */
  12.897  };
  12.898  
  12.899 -
  12.900  #define ACPI_PARSE_COMMON \
  12.901 -	u8                                  data_type;      /* To differentiate various internal objs */\
  12.902 -	u8                                  flags;          /* Type of Op */\
  12.903 -	u16                                 aml_opcode;     /* AML opcode */\
  12.904 -	u32                                 aml_offset;     /* Offset of declaration in AML */\
  12.905 -	union acpi_parse_object             *parent;        /* Parent op */\
  12.906 -	union acpi_parse_object             *next;          /* Next op */\
  12.907 +	union acpi_parse_object         *parent;        /* Parent op */\
  12.908 +	u8                              descriptor_type; /* To differentiate various internal objs */\
  12.909 +	u8                              flags;          /* Type of Op */\
  12.910 +	u16                             aml_opcode;     /* AML opcode */\
  12.911 +	u32                             aml_offset;     /* Offset of declaration in AML */\
  12.912 +	union acpi_parse_object         *next;          /* Next op */\
  12.913 +	struct acpi_namespace_node      *node;          /* For use by interpreter */\
  12.914 +	union acpi_parse_value          value;          /* Value or args associated with the opcode */\
  12.915  	ACPI_DISASM_ONLY_MEMBERS (\
  12.916 -	u8                                  disasm_flags;   /* Used during AML disassembly */\
  12.917 -	u8                                  disasm_opcode;  /* Subtype used for disassembly */\
  12.918 -	char                                aml_op_name[16]) /* Op name (debug only) */\
  12.919 -			   /* NON-DEBUG members below: */\
  12.920 -	struct acpi_namespace_node          *node;          /* For use by interpreter */\
  12.921 -	union acpi_parse_value              value;          /* Value or args associated with the opcode */\
  12.922 +	u8                              disasm_flags;   /* Used during AML disassembly */\
  12.923 +	u8                              disasm_opcode;  /* Subtype used for disassembly */\
  12.924 +	char                            aml_op_name[16])	/* Op name (debug only) */
  12.925  
  12.926 -
  12.927 -#define ACPI_DASM_BUFFER        0x00
  12.928 -#define ACPI_DASM_RESOURCE      0x01
  12.929 -#define ACPI_DASM_STRING        0x02
  12.930 -#define ACPI_DASM_UNICODE       0x03
  12.931 -#define ACPI_DASM_EISAID        0x04
  12.932 -#define ACPI_DASM_MATCHOP       0x05
  12.933 +#define ACPI_DASM_BUFFER                0x00
  12.934 +#define ACPI_DASM_RESOURCE              0x01
  12.935 +#define ACPI_DASM_STRING                0x02
  12.936 +#define ACPI_DASM_UNICODE               0x03
  12.937 +#define ACPI_DASM_EISAID                0x04
  12.938 +#define ACPI_DASM_MATCHOP               0x05
  12.939 +#define ACPI_DASM_LNOT_PREFIX           0x06
  12.940 +#define ACPI_DASM_LNOT_SUFFIX           0x07
  12.941 +#define ACPI_DASM_IGNORE                0x08
  12.942  
  12.943  /*
  12.944 - * generic operation (for example:  If, While, Store)
  12.945 + * Generic operation (for example:  If, While, Store)
  12.946   */
  12.947 -struct acpi_parse_obj_common
  12.948 -{
  12.949 -	ACPI_PARSE_COMMON
  12.950 -};
  12.951 -
  12.952 +struct acpi_parse_obj_common {
  12.953 +ACPI_PARSE_COMMON};
  12.954  
  12.955  /*
  12.956   * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
  12.957   * and bytelists.
  12.958   */
  12.959 -struct acpi_parse_obj_named
  12.960 -{
  12.961 -	ACPI_PARSE_COMMON
  12.962 -	u8                                  *path;
  12.963 -	u8                                  *data;          /* AML body or bytelist data */
  12.964 -	u32                                 length;         /* AML length */
  12.965 -	u32                                 name;           /* 4-byte name or zero if no name */
  12.966 +struct acpi_parse_obj_named {
  12.967 +	ACPI_PARSE_COMMON u8 *path;
  12.968 +	u8 *data;		/* AML body or bytelist data */
  12.969 +	u32 length;		/* AML length */
  12.970 +	u32 name;		/* 4-byte name or zero if no name */
  12.971  };
  12.972  
  12.973 -
  12.974 -/* The parse node is the fundamental element of the parse tree */
  12.975 +/* This version is used by the i_aSL compiler only */
  12.976  
  12.977 -struct acpi_parse_obj_asl
  12.978 -{
  12.979 -	ACPI_PARSE_COMMON
  12.980 -	union acpi_parse_object             *child;
  12.981 -	union acpi_parse_object             *parent_method;
  12.982 -	char                                *filename;
  12.983 -	char                                *external_name;
  12.984 -	char                                *namepath;
  12.985 -	char                                name_seg[4];
  12.986 -	u32                                 extra_value;
  12.987 -	u32                                 column;
  12.988 -	u32                                 line_number;
  12.989 -	u32                                 logical_line_number;
  12.990 -	u32                                 logical_byte_offset;
  12.991 -	u32                                 end_line;
  12.992 -	u32                                 end_logical_line;
  12.993 -	u32                                 acpi_btype;
  12.994 -	u32                                 aml_length;
  12.995 -	u32                                 aml_subtree_length;
  12.996 -	u32                                 final_aml_length;
  12.997 -	u32                                 final_aml_offset;
  12.998 -	u32                                 compile_flags;
  12.999 -	u16                                 parse_opcode;
 12.1000 -	u8                                  aml_opcode_length;
 12.1001 -	u8                                  aml_pkg_len_bytes;
 12.1002 -	u8                                  extra;
 12.1003 -	char                                parse_op_name[12];
 12.1004 +#define ACPI_MAX_PARSEOP_NAME   20
 12.1005 +
 12.1006 +struct acpi_parse_obj_asl {
 12.1007 +	ACPI_PARSE_COMMON union acpi_parse_object *child;
 12.1008 +	union acpi_parse_object *parent_method;
 12.1009 +	char *filename;
 12.1010 +	char *external_name;
 12.1011 +	char *namepath;
 12.1012 +	char name_seg[4];
 12.1013 +	u32 extra_value;
 12.1014 +	u32 column;
 12.1015 +	u32 line_number;
 12.1016 +	u32 logical_line_number;
 12.1017 +	u32 logical_byte_offset;
 12.1018 +	u32 end_line;
 12.1019 +	u32 end_logical_line;
 12.1020 +	u32 acpi_btype;
 12.1021 +	u32 aml_length;
 12.1022 +	u32 aml_subtree_length;
 12.1023 +	u32 final_aml_length;
 12.1024 +	u32 final_aml_offset;
 12.1025 +	u32 compile_flags;
 12.1026 +	u16 parse_opcode;
 12.1027 +	u8 aml_opcode_length;
 12.1028 +	u8 aml_pkg_len_bytes;
 12.1029 +	u8 extra;
 12.1030 +	char parse_op_name[ACPI_MAX_PARSEOP_NAME];
 12.1031  };
 12.1032  
 12.1033 -
 12.1034 -union acpi_parse_object
 12.1035 -{
 12.1036 -	struct acpi_parse_obj_common        common;
 12.1037 -	struct acpi_parse_obj_named         named;
 12.1038 -	struct acpi_parse_obj_asl           asl;
 12.1039 +union acpi_parse_object {
 12.1040 +	struct acpi_parse_obj_common common;
 12.1041 +	struct acpi_parse_obj_named named;
 12.1042 +	struct acpi_parse_obj_asl asl;
 12.1043  };
 12.1044  
 12.1045 -
 12.1046  /*
 12.1047   * Parse state - one state per parser invocation and each control
 12.1048   * method.
 12.1049   */
 12.1050 -struct acpi_parse_state
 12.1051 -{
 12.1052 -	u32                                 aml_size;
 12.1053 -	u8                                  *aml_start;     /* First AML byte */
 12.1054 -	u8                                  *aml;           /* Next AML byte */
 12.1055 -	u8                                  *aml_end;       /* (last + 1) AML byte */
 12.1056 -	u8                                  *pkg_start;     /* Current package begin */
 12.1057 -	u8                                  *pkg_end;       /* Current package end */
 12.1058 -	union acpi_parse_object             *start_op;      /* Root of parse tree */
 12.1059 -	struct acpi_namespace_node          *start_node;
 12.1060 -	union acpi_generic_state            *scope;         /* Current scope */
 12.1061 -	union acpi_parse_object             *start_scope;
 12.1062 +struct acpi_parse_state {
 12.1063 +	u8 *aml_start;		/* First AML byte */
 12.1064 +	u8 *aml;		/* Next AML byte */
 12.1065 +	u8 *aml_end;		/* (last + 1) AML byte */
 12.1066 +	u8 *pkg_start;		/* Current package begin */
 12.1067 +	u8 *pkg_end;		/* Current package end */
 12.1068 +	union acpi_parse_object *start_op;	/* Root of parse tree */
 12.1069 +	struct acpi_namespace_node *start_node;
 12.1070 +	union acpi_generic_state *scope;	/* Current scope */
 12.1071 +	union acpi_parse_object *start_scope;
 12.1072 +	u32 aml_size;
 12.1073  };
 12.1074  
 12.1075 -
 12.1076  /* Parse object flags */
 12.1077  
 12.1078 -#define ACPI_PARSEOP_GENERIC                    0x01
 12.1079 -#define ACPI_PARSEOP_NAMED                      0x02
 12.1080 -#define ACPI_PARSEOP_DEFERRED                   0x04
 12.1081 -#define ACPI_PARSEOP_BYTELIST                   0x08
 12.1082 -#define ACPI_PARSEOP_IN_CACHE                   0x80
 12.1083 +#define ACPI_PARSEOP_GENERIC            0x01
 12.1084 +#define ACPI_PARSEOP_NAMED              0x02
 12.1085 +#define ACPI_PARSEOP_DEFERRED           0x04
 12.1086 +#define ACPI_PARSEOP_BYTELIST           0x08
 12.1087 +#define ACPI_PARSEOP_IN_CACHE           0x80
 12.1088  
 12.1089  /* Parse object disasm_flags */
 12.1090  
 12.1091 -#define ACPI_PARSEOP_IGNORE                     0x01
 12.1092 -#define ACPI_PARSEOP_PARAMLIST                  0x02
 12.1093 -#define ACPI_PARSEOP_EMPTY_TERMLIST             0x04
 12.1094 -#define ACPI_PARSEOP_SPECIAL                    0x10
 12.1095 -
 12.1096 +#define ACPI_PARSEOP_IGNORE             0x01
 12.1097 +#define ACPI_PARSEOP_PARAMLIST          0x02
 12.1098 +#define ACPI_PARSEOP_EMPTY_TERMLIST     0x04
 12.1099 +#define ACPI_PARSEOP_SPECIAL            0x10
 12.1100  
 12.1101  /*****************************************************************************
 12.1102   *
 12.1103 @@ -741,15 +711,21 @@ struct acpi_parse_state
 12.1104   *
 12.1105   ****************************************************************************/
 12.1106  
 12.1107 -#define PCI_ROOT_HID_STRING         "PNP0A03"
 12.1108 +#define PCI_ROOT_HID_STRING             "PNP0A03"
 12.1109 +#define PCI_EXPRESS_ROOT_HID_STRING     "PNP0A08"
 12.1110  
 12.1111 -struct acpi_bit_register_info
 12.1112 -{
 12.1113 -	u8                                  parent_register;
 12.1114 -	u8                                  bit_position;
 12.1115 -	u16                                 access_bit_mask;
 12.1116 +struct acpi_bit_register_info {
 12.1117 +	u8 parent_register;
 12.1118 +	u8 bit_position;
 12.1119 +	u16 access_bit_mask;
 12.1120  };
 12.1121  
 12.1122 +/*
 12.1123 + * Some ACPI registers have bits that must be ignored -- meaning that they
 12.1124 + * must be preserved.
 12.1125 + */
 12.1126 +#define ACPI_PM1_STATUS_PRESERVED_BITS          0x0800	/* Bit 11 */
 12.1127 +#define ACPI_PM1_CONTROL_PRESERVED_BITS         0x0200	/* Bit 9 (whatever) */
 12.1128  
 12.1129  /*
 12.1130   * Register IDs
 12.1131 @@ -765,7 +741,6 @@ struct acpi_bit_register_info
 12.1132  #define ACPI_REGISTER_PROCESSOR_BLOCK           0x08
 12.1133  #define ACPI_REGISTER_SMI_COMMAND_BLOCK         0x09
 12.1134  
 12.1135 -
 12.1136  /* Masks used to access the bit_registers */
 12.1137  
 12.1138  #define ACPI_BITMASK_TIMER_STATUS               0x0001
 12.1139 @@ -774,21 +749,24 @@ struct acpi_bit_register_info
 12.1140  #define ACPI_BITMASK_POWER_BUTTON_STATUS        0x0100
 12.1141  #define ACPI_BITMASK_SLEEP_BUTTON_STATUS        0x0200
 12.1142  #define ACPI_BITMASK_RT_CLOCK_STATUS            0x0400
 12.1143 +#define ACPI_BITMASK_PCIEXP_WAKE_STATUS         0x4000	/* ACPI 3.0 */
 12.1144  #define ACPI_BITMASK_WAKE_STATUS                0x8000
 12.1145  
 12.1146 -#define ACPI_BITMASK_ALL_FIXED_STATUS           (ACPI_BITMASK_TIMER_STATUS          | \
 12.1147 -			 ACPI_BITMASK_BUS_MASTER_STATUS     | \
 12.1148 -			 ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
 12.1149 -			 ACPI_BITMASK_POWER_BUTTON_STATUS   | \
 12.1150 -			 ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
 12.1151 -			 ACPI_BITMASK_RT_CLOCK_STATUS       | \
 12.1152 -			 ACPI_BITMASK_WAKE_STATUS)
 12.1153 +#define ACPI_BITMASK_ALL_FIXED_STATUS           (\
 12.1154 +	ACPI_BITMASK_TIMER_STATUS          | \
 12.1155 +	ACPI_BITMASK_BUS_MASTER_STATUS     | \
 12.1156 +	ACPI_BITMASK_GLOBAL_LOCK_STATUS    | \
 12.1157 +	ACPI_BITMASK_POWER_BUTTON_STATUS   | \
 12.1158 +	ACPI_BITMASK_SLEEP_BUTTON_STATUS   | \
 12.1159 +	ACPI_BITMASK_RT_CLOCK_STATUS       | \
 12.1160 +	ACPI_BITMASK_WAKE_STATUS)
 12.1161  
 12.1162  #define ACPI_BITMASK_TIMER_ENABLE               0x0001
 12.1163  #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE         0x0020
 12.1164  #define ACPI_BITMASK_POWER_BUTTON_ENABLE        0x0100
 12.1165  #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE        0x0200
 12.1166  #define ACPI_BITMASK_RT_CLOCK_ENABLE            0x0400
 12.1167 +#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE        0x4000	/* ACPI 3.0 */
 12.1168  
 12.1169  #define ACPI_BITMASK_SCI_ENABLE                 0x0001
 12.1170  #define ACPI_BITMASK_BUS_MASTER_RLD             0x0002
 12.1171 @@ -798,7 +776,6 @@ struct acpi_bit_register_info
 12.1172  
 12.1173  #define ACPI_BITMASK_ARB_DISABLE                0x0001
 12.1174  
 12.1175 -
 12.1176  /* Raw bit position of each bit_register */
 12.1177  
 12.1178  #define ACPI_BITPOSITION_TIMER_STATUS           0x00
 12.1179 @@ -807,6 +784,7 @@ struct acpi_bit_register_info
 12.1180  #define ACPI_BITPOSITION_POWER_BUTTON_STATUS    0x08
 12.1181  #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS    0x09
 12.1182  #define ACPI_BITPOSITION_RT_CLOCK_STATUS        0x0A
 12.1183 +#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS     0x0E	/* ACPI 3.0 */
 12.1184  #define ACPI_BITPOSITION_WAKE_STATUS            0x0F
 12.1185  
 12.1186  #define ACPI_BITPOSITION_TIMER_ENABLE           0x00
 12.1187 @@ -814,6 +792,7 @@ struct acpi_bit_register_info
 12.1188  #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE    0x08
 12.1189  #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE    0x09
 12.1190  #define ACPI_BITPOSITION_RT_CLOCK_ENABLE        0x0A
 12.1191 +#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE    0x0E	/* ACPI 3.0 */
 12.1192  
 12.1193  #define ACPI_BITPOSITION_SCI_ENABLE             0x00
 12.1194  #define ACPI_BITPOSITION_BUS_MASTER_RLD         0x01
 12.1195 @@ -823,56 +802,60 @@ struct acpi_bit_register_info
 12.1196  
 12.1197  #define ACPI_BITPOSITION_ARB_DISABLE            0x00
 12.1198  
 12.1199 -
 12.1200  /*****************************************************************************
 12.1201   *
 12.1202   * Resource descriptors
 12.1203   *
 12.1204   ****************************************************************************/
 12.1205  
 12.1206 -
 12.1207  /* resource_type values */
 12.1208  
 12.1209 -#define ACPI_RESOURCE_TYPE_MEMORY_RANGE         0
 12.1210 -#define ACPI_RESOURCE_TYPE_IO_RANGE             1
 12.1211 -#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE     2
 12.1212 +#define ACPI_ADDRESS_TYPE_MEMORY_RANGE          0
 12.1213 +#define ACPI_ADDRESS_TYPE_IO_RANGE              1
 12.1214 +#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE      2
 12.1215  
 12.1216  /* Resource descriptor types and masks */
 12.1217  
 12.1218 -#define ACPI_RDESC_TYPE_LARGE                   0x80
 12.1219 -#define ACPI_RDESC_TYPE_SMALL                   0x00
 12.1220 +#define ACPI_RESOURCE_NAME_LARGE                0x80
 12.1221 +#define ACPI_RESOURCE_NAME_SMALL                0x00
 12.1222  
 12.1223 -#define ACPI_RDESC_TYPE_MASK                    0x80
 12.1224 -#define ACPI_RDESC_SMALL_MASK                   0x78 /* Only bits 6:3 contain the type */
 12.1225 -
 12.1226 +#define ACPI_RESOURCE_NAME_SMALL_MASK           0x78	/* Bits 6:3 contain the type */
 12.1227 +#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK    0x07	/* Bits 2:0 contain the length */
 12.1228 +#define ACPI_RESOURCE_NAME_LARGE_MASK           0x7F	/* Bits 6:0 contain the type */
 12.1229  
 12.1230  /*
 12.1231 - * Small resource descriptor types
 12.1232 - * Note: The 3 length bits (2:0) must be zero
 12.1233 + * Small resource descriptor "names" as defined by the ACPI specification.
 12.1234 + * Note: Bits 2:0 are used for the descriptor length
 12.1235   */
 12.1236 -#define ACPI_RDESC_TYPE_IRQ_FORMAT              0x20
 12.1237 -#define ACPI_RDESC_TYPE_DMA_FORMAT              0x28
 12.1238 -#define ACPI_RDESC_TYPE_START_DEPENDENT         0x30
 12.1239 -#define ACPI_RDESC_TYPE_END_DEPENDENT           0x38
 12.1240 -#define ACPI_RDESC_TYPE_IO_PORT                 0x40
 12.1241 -#define ACPI_RDESC_TYPE_FIXED_IO_PORT           0x48
 12.1242 -#define ACPI_RDESC_TYPE_SMALL_VENDOR            0x70
 12.1243 -#define ACPI_RDESC_TYPE_END_TAG                 0x78
 12.1244 +#define ACPI_RESOURCE_NAME_IRQ                  0x20
 12.1245 +#define ACPI_RESOURCE_NAME_DMA                  0x28
 12.1246 +#define ACPI_RESOURCE_NAME_START_DEPENDENT      0x30
 12.1247 +#define ACPI_RESOURCE_NAME_END_DEPENDENT        0x38
 12.1248 +#define ACPI_RESOURCE_NAME_IO                   0x40
 12.1249 +#define ACPI_RESOURCE_NAME_FIXED_IO             0x48
 12.1250 +#define ACPI_RESOURCE_NAME_RESERVED_S1          0x50
 12.1251 +#define ACPI_RESOURCE_NAME_RESERVED_S2          0x58
 12.1252 +#define ACPI_RESOURCE_NAME_RESERVED_S3          0x60
 12.1253 +#define ACPI_RESOURCE_NAME_RESERVED_S4          0x68
 12.1254 +#define ACPI_RESOURCE_NAME_VENDOR_SMALL         0x70
 12.1255 +#define ACPI_RESOURCE_NAME_END_TAG              0x78
 12.1256  
 12.1257  /*
 12.1258 - * Large resource descriptor types
 12.1259 + * Large resource descriptor "names" as defined by the ACPI specification.
 12.1260 + * Note: includes the Large Descriptor bit in bit[7]
 12.1261   */
 12.1262 -#define ACPI_RDESC_TYPE_MEMORY_24               0x81
 12.1263 -#define ACPI_RDESC_TYPE_GENERAL_REGISTER        0x82
 12.1264 -#define ACPI_RDESC_TYPE_LARGE_VENDOR            0x84
 12.1265 -#define ACPI_RDESC_TYPE_MEMORY_32               0x85
 12.1266 -#define ACPI_RDESC_TYPE_FIXED_MEMORY_32         0x86
 12.1267 -#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE     0x87
 12.1268 -#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE      0x88
 12.1269 -#define ACPI_RDESC_TYPE_EXTENDED_XRUPT          0x89
 12.1270 -#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE     0x8A
 12.1271 -#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE  0x8B
 12.1272 -
 12.1273 +#define ACPI_RESOURCE_NAME_MEMORY24             0x81
 12.1274 +#define ACPI_RESOURCE_NAME_GENERIC_REGISTER     0x82
 12.1275 +#define ACPI_RESOURCE_NAME_RESERVED_L1          0x83
 12.1276 +#define ACPI_RESOURCE_NAME_VENDOR_LARGE         0x84
 12.1277 +#define ACPI_RESOURCE_NAME_MEMORY32             0x85
 12.1278 +#define ACPI_RESOURCE_NAME_FIXED_MEMORY32       0x86
 12.1279 +#define ACPI_RESOURCE_NAME_ADDRESS32            0x87
 12.1280 +#define ACPI_RESOURCE_NAME_ADDRESS16            0x88
 12.1281 +#define ACPI_RESOURCE_NAME_EXTENDED_IRQ         0x89
 12.1282 +#define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
 12.1283 +#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
 12.1284 +#define ACPI_RESOURCE_NAME_LARGE_MAX            0x8B
 12.1285  
 12.1286  /*****************************************************************************
 12.1287   *
 12.1288 @@ -880,8 +863,7 @@ struct acpi_bit_register_info
 12.1289   *
 12.1290   ****************************************************************************/
 12.1291  
 12.1292 -#define ACPI_ASCII_ZERO                      0x30
 12.1293 -
 12.1294 +#define ACPI_ASCII_ZERO                 0x30
 12.1295  
 12.1296  /*****************************************************************************
 12.1297   *
 12.1298 @@ -889,27 +871,41 @@ struct acpi_bit_register_info
 12.1299   *
 12.1300   ****************************************************************************/
 12.1301  
 12.1302 -struct acpi_db_method_info
 12.1303 -{
 12.1304 -	acpi_handle                     thread_gate;
 12.1305 -	char                            *name;
 12.1306 -	char                            **args;
 12.1307 -	u32                             flags;
 12.1308 -	u32                             num_loops;
 12.1309 -	char                            pathname[128];
 12.1310 +struct acpi_db_method_info {
 12.1311 +	acpi_handle main_thread_gate;
 12.1312 +	acpi_handle thread_complete_gate;
 12.1313 +	u32 *threads;
 12.1314 +	u32 num_threads;
 12.1315 +	u32 num_created;
 12.1316 +	u32 num_completed;
 12.1317 +
 12.1318 +	char *name;
 12.1319 +	u32 flags;
 12.1320 +	u32 num_loops;
 12.1321 +	char pathname[128];
 12.1322 +	char **args;
 12.1323 +
 12.1324 +	/*
 12.1325 +	 * Arguments to be passed to method for the command
 12.1326 +	 * Threads -
 12.1327 +	 *   the Number of threads, ID of current thread and
 12.1328 +	 *   Index of current thread inside all them created.
 12.1329 +	 */
 12.1330 +	char init_args;
 12.1331 +	char *arguments[4];
 12.1332 +	char num_threads_str[11];
 12.1333 +	char id_of_thread_str[11];
 12.1334 +	char index_of_thread_str[11];
 12.1335  };
 12.1336  
 12.1337 -struct acpi_integrity_info
 12.1338 -{
 12.1339 -	u32                         nodes;
 12.1340 -	u32                         objects;
 12.1341 +struct acpi_integrity_info {
 12.1342 +	u32 nodes;
 12.1343 +	u32 objects;
 12.1344  };
 12.1345  
 12.1346 -
 12.1347 -#define ACPI_DB_REDIRECTABLE_OUTPUT  0x01
 12.1348 -#define ACPI_DB_CONSOLE_OUTPUT       0x02
 12.1349 -#define ACPI_DB_DUPLICATE_OUTPUT     0x03
 12.1350 -
 12.1351 +#define ACPI_DB_REDIRECTABLE_OUTPUT     0x01
 12.1352 +#define ACPI_DB_CONSOLE_OUTPUT          0x02
 12.1353 +#define ACPI_DB_DUPLICATE_OUTPUT        0x03
 12.1354  
 12.1355  /*****************************************************************************
 12.1356   *
 12.1357 @@ -917,74 +913,53 @@ struct acpi_integrity_info
 12.1358   *
 12.1359   ****************************************************************************/
 12.1360  
 12.1361 -struct acpi_debug_print_info
 12.1362 -{
 12.1363 -	u32                             component_id;
 12.1364 -	char                            *proc_name;
 12.1365 -	char                            *module_name;
 12.1366 -};
 12.1367 -
 12.1368 -
 12.1369  /* Entry for a memory allocation (debug only) */
 12.1370  
 12.1371 -#define ACPI_MEM_MALLOC                      0
 12.1372 -#define ACPI_MEM_CALLOC                      1
 12.1373 -#define ACPI_MAX_MODULE_NAME                 16
 12.1374 +#define ACPI_MEM_MALLOC                 0
 12.1375 +#define ACPI_MEM_CALLOC                 1
 12.1376 +#define ACPI_MAX_MODULE_NAME            16
 12.1377  
 12.1378  #define ACPI_COMMON_DEBUG_MEM_HEADER \
 12.1379 -	struct acpi_debug_mem_block         *previous; \
 12.1380 -	struct acpi_debug_mem_block         *next; \
 12.1381 -	u32                                 size; \
 12.1382 -	u32                                 component; \
 12.1383 -	u32                                 line; \
 12.1384 -	char                                module[ACPI_MAX_MODULE_NAME]; \
 12.1385 -	u8                                  alloc_type;
 12.1386 +	struct acpi_debug_mem_block     *previous; \
 12.1387 +	struct acpi_debug_mem_block     *next; \
 12.1388 +	u32                             size; \
 12.1389 +	u32                             component; \
 12.1390 +	u32                             line; \
 12.1391 +	char                            module[ACPI_MAX_MODULE_NAME]; \
 12.1392 +	u8                              alloc_type;
 12.1393  
 12.1394 -struct acpi_debug_mem_header
 12.1395 -{
 12.1396 -	ACPI_COMMON_DEBUG_MEM_HEADER
 12.1397 -};
 12.1398 +struct acpi_debug_mem_header {
 12.1399 +ACPI_COMMON_DEBUG_MEM_HEADER};
 12.1400  
 12.1401 -struct acpi_debug_mem_block
 12.1402 -{
 12.1403 -	ACPI_COMMON_DEBUG_MEM_HEADER
 12.1404 -	u64                                 user_space;
 12.1405 +struct acpi_debug_mem_block {
 12.1406 +	ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space;
 12.1407  };
 12.1408  
 12.1409 -
 12.1410  #define ACPI_MEM_LIST_GLOBAL            0
 12.1411  #define ACPI_MEM_LIST_NSNODE            1
 12.1412 +#define ACPI_MEM_LIST_MAX               1
 12.1413 +#define ACPI_NUM_MEM_LISTS              2
 12.1414  
 12.1415 -#define ACPI_MEM_LIST_FIRST_CACHE_LIST  2
 12.1416 -#define ACPI_MEM_LIST_STATE             2
 12.1417 -#define ACPI_MEM_LIST_PSNODE            3
 12.1418 -#define ACPI_MEM_LIST_PSNODE_EXT        4
 12.1419 -#define ACPI_MEM_LIST_OPERAND           5
 12.1420 -#define ACPI_MEM_LIST_WALK              6
 12.1421 -#define ACPI_MEM_LIST_MAX               6
 12.1422 -#define ACPI_NUM_MEM_LISTS              7
 12.1423 -
 12.1424 -
 12.1425 -struct acpi_memory_list
 12.1426 -{
 12.1427 -	void                                *list_head;
 12.1428 -	u16                                 link_offset;
 12.1429 -	u16                                 max_cache_depth;
 12.1430 -	u16                                 cache_depth;
 12.1431 -	u16                                 object_size;
 12.1432 +struct acpi_memory_list {
 12.1433 +	char *list_name;
 12.1434 +	void *list_head;
 12.1435 +	u16 object_size;
 12.1436 +	u16 max_depth;
 12.1437 +	u16 current_depth;
 12.1438 +	u16 link_offset;
 12.1439  
 12.1440  #ifdef ACPI_DBG_TRACK_ALLOCATIONS
 12.1441  
 12.1442  	/* Statistics for debug memory tracking only */
 12.1443  
 12.1444 -	u32                                 total_allocated;
 12.1445 -	u32                                 total_freed;
 12.1446 -	u32                                 current_total_size;
 12.1447 -	u32                                 cache_requests;
 12.1448 -	u32                                 cache_hits;
 12.1449 -	char                                *list_name;
 12.1450 +	u32 total_allocated;
 12.1451 +	u32 total_freed;
 12.1452 +	u32 max_occupied;
 12.1453 +	u32 total_size;
 12.1454 +	u32 current_total_size;
 12.1455 +	u32 requests;
 12.1456 +	u32 hits;
 12.1457  #endif
 12.1458  };
 12.1459  
 12.1460 -
 12.1461 -#endif /* __ACLOCAL_H__ */
 12.1462 +#endif				/* __ACLOCAL_H__ */
    13.1 --- a/xen/include/acpi/acmacros.h	Tue Mar 18 13:14:26 2008 +0000
    13.2 +++ b/xen/include/acpi/acmacros.h	Tue Mar 18 14:55:36 2008 +0000
    13.3 @@ -5,7 +5,7 @@
    13.4   *****************************************************************************/
    13.5  
    13.6  /*
    13.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    13.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    13.9   * All rights reserved.
   13.10   *
   13.11   * Redistribution and use in source and binary forms, with or without
   13.12 @@ -44,7 +44,6 @@
   13.13  #ifndef __ACMACROS_H__
   13.14  #define __ACMACROS_H__
   13.15  
   13.16 -
   13.17  /*
   13.18   * Data manipulation macros
   13.19   */
   13.20 @@ -56,22 +55,12 @@
   13.21  #define ACPI_SET_BIT(target,bit)        ((target) |= (bit))
   13.22  #define ACPI_CLEAR_BIT(target,bit)      ((target) &= ~(bit))
   13.23  #define ACPI_MIN(a,b)                   (((a)<(b))?(a):(b))
   13.24 -
   13.25 -
   13.26 -#if ACPI_MACHINE_WIDTH == 16
   13.27 +#define ACPI_MAX(a,b)                   (((a)>(b))?(a):(b))
   13.28  
   13.29 -/*
   13.30 - * For 16-bit addresses, we have to assume that the upper 32 bits
   13.31 - * are zero.
   13.32 - */
   13.33 -#define ACPI_LODWORD(l)                 ((u32)(l))
   13.34 -#define ACPI_HIDWORD(l)                 ((u32)(0))
   13.35 +/* Size calculation */
   13.36  
   13.37 -#define ACPI_GET_ADDRESS(a)             ((a).lo)
   13.38 -#define ACPI_STORE_ADDRESS(a,b)         {(a).hi=0;(a).lo=(u32)(b);}
   13.39 -#define ACPI_VALID_ADDRESS(a)           ((a).hi | (a).lo)
   13.40 +#define ACPI_ARRAY_LENGTH(x)            (sizeof(x) / sizeof((x)[0]))
   13.41  
   13.42 -#else
   13.43  #ifdef ACPI_NO_INTEGER64_SUPPORT
   13.44  /*
   13.45   * acpi_integer is 32-bits, no 64-bit support on this platform
   13.46 @@ -79,10 +68,6 @@
   13.47  #define ACPI_LODWORD(l)                 ((u32)(l))
   13.48  #define ACPI_HIDWORD(l)                 ((u32)(0))
   13.49  
   13.50 -#define ACPI_GET_ADDRESS(a)             (a)
   13.51 -#define ACPI_STORE_ADDRESS(a,b)         ((a)=(b))
   13.52 -#define ACPI_VALID_ADDRESS(a)           (a)
   13.53 -
   13.54  #else
   13.55  
   13.56  /*
   13.57 @@ -90,49 +75,50 @@
   13.58   */
   13.59  #define ACPI_LODWORD(l)                 ((u32)(u64)(l))
   13.60  #define ACPI_HIDWORD(l)                 ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
   13.61 -
   13.62 -#define ACPI_GET_ADDRESS(a)             (a)
   13.63 -#define ACPI_STORE_ADDRESS(a,b)         ((a)=(acpi_physical_address)(b))
   13.64 -#define ACPI_VALID_ADDRESS(a)           (a)
   13.65 -#endif
   13.66  #endif
   13.67  
   13.68  /*
   13.69   * printf() format helpers
   13.70   */
   13.71  
   13.72 -/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
   13.73 +/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
   13.74  
   13.75  #define ACPI_FORMAT_UINT64(i)           ACPI_HIDWORD(i),ACPI_LODWORD(i)
   13.76  
   13.77  /*
   13.78 - * Extract a byte of data using a pointer.  Any more than a byte and we
   13.79 - * get into potential aligment issues -- see the STORE macros below
   13.80 + * Extract data using a pointer.  Any more than a byte and we
   13.81 + * get into potential aligment issues -- see the STORE macros below.
   13.82 + * Use with care.
   13.83   */
   13.84 -#define ACPI_GET8(addr)                 (*(u8*)(addr))
   13.85 +#define ACPI_GET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
   13.86 +#define ACPI_GET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
   13.87 +#define ACPI_GET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
   13.88 +#define ACPI_GET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
   13.89 +#define ACPI_SET8(ptr)                  *ACPI_CAST_PTR (u8, ptr)
   13.90 +#define ACPI_SET16(ptr)                 *ACPI_CAST_PTR (u16, ptr)
   13.91 +#define ACPI_SET32(ptr)                 *ACPI_CAST_PTR (u32, ptr)
   13.92 +#define ACPI_SET64(ptr)                 *ACPI_CAST_PTR (u64, ptr)
   13.93  
   13.94 -/* Pointer arithmetic */
   13.95 -
   13.96 -#define ACPI_PTR_ADD(t,a,b)             (t *) (void *)((char *)(a) + (acpi_native_uint)(b))
   13.97 -#define ACPI_PTR_DIFF(a,b)              (acpi_native_uint) ((char *)(a) - (char *)(b))
   13.98 +/*
   13.99 + * Pointer manipulation
  13.100 + */
  13.101 +#define ACPI_CAST_PTR(t, p)             ((t *) (acpi_uintptr_t) (p))
  13.102 +#define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **) (acpi_uintptr_t) (p))
  13.103 +#define ACPI_ADD_PTR(t,a,b)             ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b)))
  13.104 +#define ACPI_PTR_DIFF(a,b)              (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
  13.105  
  13.106  /* Pointer/Integer type conversions */
  13.107  
  13.108 -#define ACPI_TO_POINTER(i)              ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i)
  13.109 +#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
  13.110  #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p,(void *) NULL)
  13.111  #define ACPI_OFFSET(d,f)                (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
  13.112 -#define ACPI_FADT_OFFSET(f)             ACPI_OFFSET (FADT_DESCRIPTOR, f)
  13.113 -
  13.114 -#define ACPI_CAST_PTR(t, p)             ((t *)(void *)(p))
  13.115 -#define ACPI_CAST_INDIRECT_PTR(t, p)    ((t **)(void *)(p))
  13.116 -
  13.117 -#if ACPI_MACHINE_WIDTH == 16
  13.118 -#define ACPI_STORE_POINTER(d,s)         ACPI_MOVE_32_TO_32(d,s)
  13.119 -#define ACPI_PHYSADDR_TO_PTR(i)         (void *)(i)
  13.120 -#define ACPI_PTR_TO_PHYSADDR(i)         (u32) (char *)(i)
  13.121 -#else
  13.122  #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
  13.123  #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
  13.124 +
  13.125 +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
  13.126 +#define ACPI_COMPARE_NAME(a,b)          (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
  13.127 +#else
  13.128 +#define ACPI_COMPARE_NAME(a,b)          (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE))
  13.129  #endif
  13.130  
  13.131  /*
  13.132 @@ -168,7 +154,7 @@
  13.133  
  13.134  /* 32-bit source, 16/32/64 destination */
  13.135  
  13.136 -#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.137 +#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.138  
  13.139  #define ACPI_MOVE_32_TO_32(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\
  13.140  									  ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
  13.141 @@ -183,9 +169,9 @@
  13.142  
  13.143  /* 64-bit source, 16/32/64 destination */
  13.144  
  13.145 -#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.146 +#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.147  
  13.148 -#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
  13.149 +#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)	/* Truncate to 32 */
  13.150  
  13.151  #define ACPI_MOVE_64_TO_64(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\
  13.152  										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\
  13.153 @@ -204,32 +190,10 @@
  13.154  
  13.155  #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset)
  13.156  
  13.157 -#ifdef ACPI_MISALIGNED_TRANSFERS
  13.158 +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
  13.159  
  13.160  /* The hardware supports unaligned transfers, just do the little-endian move */
  13.161  
  13.162 -#if ACPI_MACHINE_WIDTH == 16
  13.163 -
  13.164 -/* No 64-bit integers */
  13.165 -/* 16-bit source, 16/32/64 destination */
  13.166 -
  13.167 -#define ACPI_MOVE_16_TO_16(d,s)         *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
  13.168 -#define ACPI_MOVE_16_TO_32(d,s)         *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
  13.169 -#define ACPI_MOVE_16_TO_64(d,s)         ACPI_MOVE_16_TO_32(d,s)
  13.170 -
  13.171 -/* 32-bit source, 16/32/64 destination */
  13.172 -
  13.173 -#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.174 -#define ACPI_MOVE_32_TO_32(d,s)         *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
  13.175 -#define ACPI_MOVE_32_TO_64(d,s)         ACPI_MOVE_32_TO_32(d,s)
  13.176 -
  13.177 -/* 64-bit source, 16/32/64 destination */
  13.178 -
  13.179 -#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.180 -#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
  13.181 -#define ACPI_MOVE_64_TO_64(d,s)         ACPI_MOVE_32_TO_32(d,s)
  13.182 -
  13.183 -#else
  13.184  /* 16-bit source, 16/32/64 destination */
  13.185  
  13.186  #define ACPI_MOVE_16_TO_16(d,s)         *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
  13.187 @@ -238,16 +202,15 @@
  13.188  
  13.189  /* 32-bit source, 16/32/64 destination */
  13.190  
  13.191 -#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.192 +#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.193  #define ACPI_MOVE_32_TO_32(d,s)         *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
  13.194  #define ACPI_MOVE_32_TO_64(d,s)         *(u64 *)(void *)(d) = *(u32 *)(void *)(s)
  13.195  
  13.196  /* 64-bit source, 16/32/64 destination */
  13.197  
  13.198 -#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.199 -#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
  13.200 +#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.201 +#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)	/* Truncate to 32 */
  13.202  #define ACPI_MOVE_64_TO_64(d,s)         *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
  13.203 -#endif
  13.204  
  13.205  #else
  13.206  /*
  13.207 @@ -266,7 +229,7 @@
  13.208  
  13.209  /* 32-bit source, 16/32/64 destination */
  13.210  
  13.211 -#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.212 +#define ACPI_MOVE_32_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.213  
  13.214  #define ACPI_MOVE_32_TO_32(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
  13.215  										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
  13.216 @@ -277,8 +240,8 @@
  13.217  
  13.218  /* 64-bit source, 16/32/64 destination */
  13.219  
  13.220 -#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)    /* Truncate to 16 */
  13.221 -#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)    /* Truncate to 32 */
  13.222 +#define ACPI_MOVE_64_TO_16(d,s)         ACPI_MOVE_16_TO_16(d,s)	/* Truncate to 16 */
  13.223 +#define ACPI_MOVE_64_TO_32(d,s)         ACPI_MOVE_32_TO_32(d,s)	/* Truncate to 32 */
  13.224  #define ACPI_MOVE_64_TO_64(d,s)         {((  u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\
  13.225  										 ((  u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\
  13.226  										 ((  u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\
  13.227 @@ -292,10 +255,7 @@
  13.228  
  13.229  /* Macros based on machine integer width */
  13.230  
  13.231 -#if ACPI_MACHINE_WIDTH == 16
  13.232 -#define ACPI_MOVE_SIZE_TO_16(d,s)       ACPI_MOVE_16_TO_16(d,s)
  13.233 -
  13.234 -#elif ACPI_MACHINE_WIDTH == 32
  13.235 +#if ACPI_MACHINE_WIDTH == 32
  13.236  #define ACPI_MOVE_SIZE_TO_16(d,s)       ACPI_MOVE_32_TO_16(d,s)
  13.237  
  13.238  #elif ACPI_MACHINE_WIDTH == 64
  13.239 @@ -305,7 +265,6 @@
  13.240  #error unknown ACPI_MACHINE_WIDTH
  13.241  #endif
  13.242  
  13.243 -
  13.244  /*
  13.245   * Fast power-of-two math macros for non-optimized compilers
  13.246   */
  13.247 @@ -329,30 +288,40 @@
  13.248  #define ACPI_MUL_16(a)                  _ACPI_MUL(a,4)
  13.249  #define ACPI_MOD_16(a)                  _ACPI_MOD(a,16)
  13.250  
  13.251 +#define ACPI_DIV_32(a)                  _ACPI_DIV(a,5)
  13.252 +#define ACPI_MUL_32(a)                  _ACPI_MUL(a,5)
  13.253 +#define ACPI_MOD_32(a)                  _ACPI_MOD(a,32)
  13.254  
  13.255  /*
  13.256   * Rounding macros (Power of two boundaries only)
  13.257   */
  13.258 -#define ACPI_ROUND_DOWN(value,boundary)      (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1)))
  13.259 -#define ACPI_ROUND_UP(value,boundary)        ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1)))
  13.260 -
  13.261 -#define ACPI_ROUND_DOWN_TO_32_BITS(a)        ACPI_ROUND_DOWN(a,4)
  13.262 -#define ACPI_ROUND_DOWN_TO_64_BITS(a)        ACPI_ROUND_DOWN(a,8)
  13.263 -#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a)    ACPI_ROUND_DOWN(a,ALIGNED_ADDRESS_BOUNDARY)
  13.264 +#define ACPI_ROUND_DOWN(value,boundary)     (((acpi_native_uint)(value)) & \
  13.265 +												(~(((acpi_native_uint) boundary)-1)))
  13.266  
  13.267 -#define ACPI_ROUND_UP_to_32_bITS(a)          ACPI_ROUND_UP(a,4)
  13.268 -#define ACPI_ROUND_UP_to_64_bITS(a)          ACPI_ROUND_UP(a,8)
  13.269 -#define ACPI_ROUND_UP_TO_NATIVE_WORD(a)      ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY)
  13.270 +#define ACPI_ROUND_UP(value,boundary)       ((((acpi_native_uint)(value)) + \
  13.271 +												(((acpi_native_uint) boundary)-1)) & \
  13.272 +												(~(((acpi_native_uint) boundary)-1)))
  13.273  
  13.274 +/* Note: sizeof(acpi_native_uint) evaluates to either 2, 4, or 8 */
  13.275  
  13.276 -#define ACPI_ROUND_BITS_UP_TO_BYTES(a)       ACPI_DIV_8((a) + 7)
  13.277 -#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a)     ACPI_DIV_8((a))
  13.278 +#define ACPI_ROUND_DOWN_TO_32BIT(a)         ACPI_ROUND_DOWN(a,4)
  13.279 +#define ACPI_ROUND_DOWN_TO_64BIT(a)         ACPI_ROUND_DOWN(a,8)
  13.280 +#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a)   ACPI_ROUND_DOWN(a,sizeof(acpi_native_uint))
  13.281  
  13.282 -#define ACPI_ROUND_UP_TO_1K(a)               (((a) + 1023) >> 10)
  13.283 +#define ACPI_ROUND_UP_TO_32BIT(a)           ACPI_ROUND_UP(a,4)
  13.284 +#define ACPI_ROUND_UP_TO_64BIT(a)           ACPI_ROUND_UP(a,8)
  13.285 +#define ACPI_ROUND_UP_TO_NATIVE_WORD(a)     ACPI_ROUND_UP(a,sizeof(acpi_native_uint))
  13.286 +
  13.287 +#define ACPI_ROUND_BITS_UP_TO_BYTES(a)      ACPI_DIV_8((a) + 7)
  13.288 +#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a)    ACPI_DIV_8((a))
  13.289 +
  13.290 +#define ACPI_ROUND_UP_TO_1K(a)              (((a) + 1023) >> 10)
  13.291  
  13.292  /* Generic (non-power-of-two) rounding */
  13.293  
  13.294 -#define ACPI_ROUND_UP_TO(value,boundary)     (((value) + ((boundary)-1)) / (boundary))
  13.295 +#define ACPI_ROUND_UP_TO(value,boundary)    (((value) + ((boundary)-1)) / (boundary))
  13.296 +
  13.297 +#define ACPI_IS_MISALIGNED(value)           (((acpi_native_uint)value) & (sizeof(acpi_native_uint)-1))
  13.298  
  13.299  /*
  13.300   * Bitmask creation
  13.301 @@ -360,17 +329,26 @@
  13.302   * MASK_BITS_ABOVE creates a mask starting AT the position and above
  13.303   * MASK_BITS_BELOW creates a mask starting one bit BELOW the position
  13.304   */
  13.305 -#define ACPI_MASK_BITS_ABOVE(position)       (~((ACPI_INTEGER_MAX) << ((u32) (position))))
  13.306 -#define ACPI_MASK_BITS_BELOW(position)       ((ACPI_INTEGER_MAX) << ((u32) (position)))
  13.307 +#define ACPI_MASK_BITS_ABOVE(position)      (~((ACPI_INTEGER_MAX) << ((u32) (position))))
  13.308 +#define ACPI_MASK_BITS_BELOW(position)      ((ACPI_INTEGER_MAX) << ((u32) (position)))
  13.309  
  13.310 -#define ACPI_IS_OCTAL_DIGIT(d)               (((char)(d) >= '0') && ((char)(d) <= '7'))
  13.311 -
  13.312 +#define ACPI_IS_OCTAL_DIGIT(d)              (((char)(d) >= '0') && ((char)(d) <= '7'))
  13.313  
  13.314  /* Bitfields within ACPI registers */
  13.315  
  13.316  #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask)      ((val << pos) & mask)
  13.317  #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val)  reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
  13.318  
  13.319 +#define ACPI_INSERT_BITS(target, mask, source)          target = ((target & (~(mask))) | (source & mask))
  13.320 +
  13.321 +/* Generate a UUID */
  13.322 +
  13.323 +#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
  13.324 +	(a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \
  13.325 +	(b) & 0xFF, ((b) >> 8) & 0xFF, \
  13.326 +	(c) & 0xFF, ((c) >> 8) & 0xFF, \
  13.327 +	(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)
  13.328 +
  13.329  /*
  13.330   * An struct acpi_namespace_node * can appear in some contexts,
  13.331   * where a pointer to an union acpi_operand_object    can also
  13.332 @@ -378,9 +356,8 @@
  13.333   *
  13.334   * The "Descriptor" field is the first field in both structures.
  13.335   */
  13.336 -#define ACPI_GET_DESCRIPTOR_TYPE(d)     (((union acpi_descriptor *)(void *)(d))->descriptor_id)
  13.337 -#define ACPI_SET_DESCRIPTOR_TYPE(d,t)   (((union acpi_descriptor *)(void *)(d))->descriptor_id = t)
  13.338 -
  13.339 +#define ACPI_GET_DESCRIPTOR_TYPE(d)     (((union acpi_descriptor *)(void *)(d))->common.descriptor_type)
  13.340 +#define ACPI_SET_DESCRIPTOR_TYPE(d,t)   (((union acpi_descriptor *)(void *)(d))->common.descriptor_type = t)
  13.341  
  13.342  /* Macro to test the object type */
  13.343  
  13.344 @@ -430,86 +407,107 @@
  13.345  #define GET_CURRENT_ARG_TYPE(list)      (list & ((u32) 0x1F))
  13.346  #define INCREMENT_ARG_LIST(list)        (list >>= ((u32) ARG_TYPE_WIDTH))
  13.347  
  13.348 -
  13.349 +#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
  13.350  /*
  13.351 - * Reporting macros that are never compiled out
  13.352 + * Module name is include in both debug and non-debug versions primarily for
  13.353 + * error messages. The __FILE__ macro is not very useful for this, because it
  13.354 + * often includes the entire pathname to the module
  13.355   */
  13.356 -#define ACPI_PARAM_LIST(pl)                 pl
  13.357 +#define ACPI_MODULE_NAME(name)          static char ACPI_UNUSED_VAR *_acpi_module_name = name;
  13.358 +#else
  13.359 +#define ACPI_MODULE_NAME(name)
  13.360 +#endif
  13.361  
  13.362  /*
  13.363 - * Error reporting.  These versions add callers module and line#.  Since
  13.364 - * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only
  13.365 - * use it in debug mode.
  13.366 + * Ascii error messages can be configured out
  13.367   */
  13.368 -#ifdef ACPI_DEBUG_OUTPUT
  13.369 +#ifndef ACPI_NO_ERROR_MESSAGES
  13.370 +#define AE_INFO                         _acpi_module_name, __LINE__
  13.371  
  13.372 -#define ACPI_REPORT_INFO(fp)                {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \
  13.373 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.374 -#define ACPI_REPORT_ERROR(fp)               {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \
  13.375 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.376 -#define ACPI_REPORT_WARNING(fp)             {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \
  13.377 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.378 -#define ACPI_REPORT_NSERROR(s,e)            acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e);
  13.379 -
  13.380 -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e)   acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e);
  13.381 +/*
  13.382 + * Error reporting. Callers module and line number are inserted by AE_INFO,
  13.383 + * the plist contains a set of parens to allow variable-length lists.
  13.384 + * These macros are used for both the debug and non-debug versions of the code.
  13.385 + */
  13.386 +#define ACPI_INFO(plist)                acpi_ut_info plist
  13.387 +#define ACPI_WARNING(plist)             acpi_ut_warning plist
  13.388 +#define ACPI_EXCEPTION(plist)           acpi_ut_exception plist
  13.389 +#define ACPI_ERROR(plist)               acpi_ut_error plist
  13.390 +#define ACPI_ERROR_NAMESPACE(s,e)       acpi_ns_report_error (AE_INFO, s, e);
  13.391 +#define ACPI_ERROR_METHOD(s,n,p,e)      acpi_ns_report_method_error (AE_INFO, s, n, p, e);
  13.392  
  13.393  #else
  13.394  
  13.395 -#define ACPI_REPORT_INFO(fp)                {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \
  13.396 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.397 -#define ACPI_REPORT_ERROR(fp)               {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \
  13.398 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.399 -#define ACPI_REPORT_WARNING(fp)             {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \
  13.400 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.401 -#define ACPI_REPORT_NSERROR(s,e)            acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e);
  13.402 -
  13.403 -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e)   acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e);
  13.404 +/* No error messages */
  13.405  
  13.406 +#define ACPI_INFO(plist)
  13.407 +#define ACPI_WARNING(plist)
  13.408 +#define ACPI_EXCEPTION(plist)
  13.409 +#define ACPI_ERROR(plist)
  13.410 +#define ACPI_ERROR_NAMESPACE(s,e)
  13.411 +#define ACPI_ERROR_METHOD(s,n,p,e)
  13.412  #endif
  13.413  
  13.414 -/* Error reporting.  These versions pass thru the module and line# */
  13.415 -
  13.416 -#define _ACPI_REPORT_INFO(a,b,c,fp)         {acpi_ut_report_info(a,b,c); \
  13.417 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.418 -#define _ACPI_REPORT_ERROR(a,b,c,fp)        {acpi_ut_report_error(a,b,c); \
  13.419 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.420 -#define _ACPI_REPORT_WARNING(a,b,c,fp)      {acpi_ut_report_warning(a,b,c); \
  13.421 -												acpi_os_printf ACPI_PARAM_LIST(fp);}
  13.422 -
  13.423  /*
  13.424   * Debug macros that are conditionally compiled
  13.425   */
  13.426  #ifdef ACPI_DEBUG_OUTPUT
  13.427  
  13.428 -#define ACPI_MODULE_NAME(name)               static char ACPI_UNUSED_VAR *_THIS_MODULE = name;
  13.429 +/*
  13.430 + * Common parameters used for debug output functions:
  13.431 + * line number, function name, module(file) name, component ID
  13.432 + */
  13.433 +#define ACPI_DEBUG_PARAMETERS           __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
  13.434  
  13.435  /*
  13.436 - * Function entry tracing.
  13.437 - * The first parameter should be the procedure name as a quoted string.  This is declared
  13.438 - * as a local string ("_proc_name) so that it can be also used by the function exit macros below.
  13.439 + * Function entry tracing
  13.440   */
  13.441 -#define ACPI_FUNCTION_NAME(a)               struct acpi_debug_print_info _debug_info; \
  13.442 -												_debug_info.component_id = _COMPONENT; \
  13.443 -												_debug_info.proc_name  = a; \
  13.444 -												_debug_info.module_name = _THIS_MODULE;
  13.445  
  13.446 -#define ACPI_FUNCTION_TRACE(a)              ACPI_FUNCTION_NAME(a) \
  13.447 -												acpi_ut_trace(__LINE__,&_debug_info)
  13.448 -#define ACPI_FUNCTION_TRACE_PTR(a,b)        ACPI_FUNCTION_NAME(a) \
  13.449 -												acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b)
  13.450 -#define ACPI_FUNCTION_TRACE_U32(a,b)        ACPI_FUNCTION_NAME(a) \
  13.451 -												acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b)
  13.452 -#define ACPI_FUNCTION_TRACE_STR(a,b)        ACPI_FUNCTION_NAME(a) \
  13.453 -												acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b)
  13.454 +/*
  13.455 + * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
  13.456 + * define it now. This is the case where there the compiler does not support
  13.457 + * a __FUNCTION__ macro or equivalent. We save the function name on the
  13.458 + * local stack.
  13.459 + */
  13.460 +#ifndef ACPI_GET_FUNCTION_NAME
  13.461 +#define ACPI_GET_FUNCTION_NAME          _acpi_function_name
  13.462 +/*
  13.463 + * The Name parameter should be the procedure name as a quoted string.
  13.464 + * This is declared as a local string ("MyFunctionName") so that it can
  13.465 + * be also used by the function exit macros below.
  13.466 + * Note: (const char) is used to be compatible with the debug interfaces
  13.467 + * and macros such as __FUNCTION__.
  13.468 + */
  13.469 +#define ACPI_FUNCTION_NAME(name)        const char *_acpi_function_name = #name;
  13.470  
  13.471 -#define ACPI_FUNCTION_ENTRY()               acpi_ut_track_stack_ptr()
  13.472 +#else
  13.473 +/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
  13.474 +
  13.475 +#define ACPI_FUNCTION_NAME(name)
  13.476 +#endif
  13.477 +
  13.478 +#ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE
  13.479 +
  13.480 +#define ACPI_FUNCTION_TRACE(a)          ACPI_FUNCTION_NAME(a) \
  13.481 +			  acpi_ut_trace(ACPI_DEBUG_PARAMETERS)
  13.482 +#define ACPI_FUNCTION_TRACE_PTR(a,b)    ACPI_FUNCTION_NAME(a) \
  13.483 +					   acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b)
  13.484 +#define ACPI_FUNCTION_TRACE_U32(a,b)    ACPI_FUNCTION_NAME(a) \
  13.485 +							 acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b)
  13.486 +#define ACPI_FUNCTION_TRACE_STR(a,b)    ACPI_FUNCTION_NAME(a) \
  13.487 +									  acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b)
  13.488 +
  13.489 +#define ACPI_FUNCTION_ENTRY()           acpi_ut_track_stack_ptr()
  13.490  
  13.491  /*
  13.492   * Function exit tracing.
  13.493   * WARNING: These macros include a return statement.  This is usually considered
  13.494   * bad form, but having a separate exit macro is very ugly and difficult to maintain.
  13.495   * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
  13.496 - * so that "_proc_name" is defined.
  13.497 + * so that "_AcpiFunctionName" is defined.
  13.498 + *
  13.499 + * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
  13.500 + * about these constructs.
  13.501   */
  13.502  #ifdef ACPI_USE_DO_WHILE_0
  13.503  #define ACPI_DO_WHILE0(a)               do a while(0)
  13.504 @@ -517,10 +515,76 @@
  13.505  #define ACPI_DO_WHILE0(a)               a
  13.506  #endif
  13.507  
  13.508 -#define return_VOID                     ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;})
  13.509 -#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));})
  13.510 -#define return_VALUE(s)                 ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));})
  13.511 -#define return_PTR(s)                   ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));})
  13.512 +#define return_VOID                     ACPI_DO_WHILE0 ({ \
  13.513 +											acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
  13.514 +											return;})
  13.515 +/*
  13.516 + * There are two versions of most of the return macros. The default version is
  13.517 + * safer, since it avoids side-effects by guaranteeing that the argument will
  13.518 + * not be evaluated twice.
  13.519 + *
  13.520 + * A less-safe version of the macros is provided for optional use if the
  13.521 + * compiler uses excessive CPU stack (for example, this may happen in the
  13.522 + * debug case if code optimzation is disabled.)
  13.523 + */
  13.524 +#ifndef ACPI_SIMPLE_RETURN_MACROS
  13.525 +
  13.526 +#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({ \
  13.527 +											register acpi_status _s = (s); \
  13.528 +											acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \
  13.529 +											return (_s); })
  13.530 +#define return_PTR(s)                   ACPI_DO_WHILE0 ({ \
  13.531 +											register void *_s = (void *) (s); \
  13.532 +											acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \
  13.533 +											return (_s); })
  13.534 +#define return_VALUE(s)                 ACPI_DO_WHILE0 ({ \
  13.535 +											register acpi_integer _s = (s); \
  13.536 +											acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \
  13.537 +											return (_s); })
  13.538 +#define return_UINT8(s)                 ACPI_DO_WHILE0 ({ \
  13.539 +											register u8 _s = (u8) (s); \
  13.540 +											acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
  13.541 +											return (_s); })
  13.542 +#define return_UINT32(s)                ACPI_DO_WHILE0 ({ \
  13.543 +											register u32 _s = (u32) (s); \
  13.544 +											acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \
  13.545 +											return (_s); })
  13.546 +#else				/* Use original less-safe macros */
  13.547 +
  13.548 +#define return_ACPI_STATUS(s)           ACPI_DO_WHILE0 ({ \
  13.549 +											acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \
  13.550 +											return((s)); })
  13.551 +#define return_PTR(s)                   ACPI_DO_WHILE0 ({ \
  13.552 +											acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \
  13.553 +											return((s)); })
  13.554 +#define return_VALUE(s)                 ACPI_DO_WHILE0 ({ \
  13.555 +											acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) (s)); \
  13.556 +											return((s)); })
  13.557 +#define return_UINT8(s)                 return_VALUE(s)
  13.558 +#define return_UINT32(s)                return_VALUE(s)
  13.559 +
  13.560 +#endif				/* ACPI_SIMPLE_RETURN_MACROS */
  13.561 +
  13.562 +#else /* !CONFIG_ACPI_DEBUG_FUNC_TRACE */
  13.563 +
  13.564 +#define ACPI_FUNCTION_TRACE(a)
  13.565 +#define ACPI_FUNCTION_TRACE_PTR(a,b)
  13.566 +#define ACPI_FUNCTION_TRACE_U32(a,b)
  13.567 +#define ACPI_FUNCTION_TRACE_STR(a,b)
  13.568 +#define ACPI_FUNCTION_EXIT
  13.569 +#define ACPI_FUNCTION_STATUS_EXIT(s)
  13.570 +#define ACPI_FUNCTION_VALUE_EXIT(s)
  13.571 +#define ACPI_FUNCTION_TRACE(a)
  13.572 +#define ACPI_FUNCTION_ENTRY()
  13.573 +
  13.574 +#define return_VOID                     return
  13.575 +#define return_ACPI_STATUS(s)           return(s)
  13.576 +#define return_VALUE(s)                 return(s)
  13.577 +#define return_UINT8(s)                 return(s)
  13.578 +#define return_UINT32(s)                return(s)
  13.579 +#define return_PTR(s)                   return(s)
  13.580 +
  13.581 +#endif /* CONFIG_ACPI_DEBUG_FUNC_TRACE */
  13.582  
  13.583  /* Conditional execution */
  13.584  
  13.585 @@ -531,35 +595,15 @@
  13.586  #define ACPI_DEBUG_ONLY_MEMBERS(a)      a;
  13.587  #define _VERBOSE_STRUCTURES
  13.588  
  13.589 -
  13.590  /* Stack and buffer dumping */
  13.591  
  13.592  #define ACPI_DUMP_STACK_ENTRY(a)        acpi_ex_dump_operand((a),0)
  13.593 -#define ACPI_DUMP_OPERANDS(a,b,c,d,e)   acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__)
  13.594 -
  13.595 +#define ACPI_DUMP_OPERANDS(a,b,c,d,e)   acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__)
  13.596  
  13.597  #define ACPI_DUMP_ENTRY(a,b)            acpi_ns_dump_entry (a,b)
  13.598 -
  13.599 -#ifdef ACPI_FUTURE_USAGE
  13.600 -#define ACPI_DUMP_TABLES(a,b)           acpi_ns_dump_tables(a,b)
  13.601 -#endif
  13.602 -
  13.603  #define ACPI_DUMP_PATHNAME(a,b,c,d)     acpi_ns_dump_pathname(a,b,c,d)
  13.604  #define ACPI_DUMP_RESOURCE_LIST(a)      acpi_rs_dump_resource_list(a)
  13.605  #define ACPI_DUMP_BUFFER(a,b)           acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
  13.606 -#define ACPI_BREAK_MSG(a)               acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a))
  13.607 -
  13.608 -
  13.609 -/*
  13.610 - * Generate INT3 on ACPI_ERROR (Debug only!)
  13.611 - */
  13.612 -#define ACPI_ERROR_BREAK
  13.613 -#ifdef  ACPI_ERROR_BREAK
  13.614 -#define ACPI_BREAK_ON_ERROR(lvl)        if ((lvl)&ACPI_ERROR) \
  13.615 -											acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n")
  13.616 -#else
  13.617 -#define ACPI_BREAK_ON_ERROR(lvl)
  13.618 -#endif
  13.619  
  13.620  /*
  13.621   * Master debug print macros
  13.622 @@ -567,50 +611,43 @@
  13.623   *    1) Debug print for the current component is enabled
  13.624   *    2) Debug error level or trace level for the print statement is enabled
  13.625   */
  13.626 -#define ACPI_DEBUG_PRINT(pl)            acpi_ut_debug_print ACPI_PARAM_LIST(pl)
  13.627 -#define ACPI_DEBUG_PRINT_RAW(pl)        acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl)
  13.628 -
  13.629 +#define ACPI_DEBUG_PRINT(plist)         acpi_ut_debug_print plist
  13.630 +#define ACPI_DEBUG_PRINT_RAW(plist)     acpi_ut_debug_print_raw plist
  13.631  
  13.632  #else
  13.633  /*
  13.634   * This is the non-debug case -- make everything go away,
  13.635   * leaving no executable debug code!
  13.636   */
  13.637 -#define ACPI_MODULE_NAME(name)
  13.638 -#define _THIS_MODULE ""
  13.639 -
  13.640  #define ACPI_DEBUG_EXEC(a)
  13.641  #define ACPI_NORMAL_EXEC(a)             a;
  13.642  
  13.643 -#define ACPI_DEBUG_DEFINE(a)
  13.644 -#define ACPI_DEBUG_ONLY_MEMBERS(a)
  13.645 -#define ACPI_FUNCTION_NAME(a)
  13.646 -#define ACPI_FUNCTION_TRACE(a)
  13.647 -#define ACPI_FUNCTION_TRACE_PTR(a,b)
  13.648 -#define ACPI_FUNCTION_TRACE_U32(a,b)
  13.649 -#define ACPI_FUNCTION_TRACE_STR(a,b)
  13.650 -#define ACPI_FUNCTION_EXIT
  13.651 -#define ACPI_FUNCTION_STATUS_EXIT(s)
  13.652 -#define ACPI_FUNCTION_VALUE_EXIT(s)
  13.653 -#define ACPI_FUNCTION_ENTRY()
  13.654 -#define ACPI_DUMP_STACK_ENTRY(a)
  13.655 -#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
  13.656 -#define ACPI_DUMP_ENTRY(a,b)
  13.657 -
  13.658 -#ifdef ACPI_FUTURE_USAGE
  13.659 -#define ACPI_DUMP_TABLES(a,b)
  13.660 -#endif
  13.661 -
  13.662 -#define ACPI_DUMP_PATHNAME(a,b,c,d)
  13.663 -#define ACPI_DUMP_RESOURCE_LIST(a)
  13.664 -#define ACPI_DUMP_BUFFER(a,b)
  13.665 -#define ACPI_DEBUG_PRINT(pl)
  13.666 -#define ACPI_DEBUG_PRINT_RAW(pl)
  13.667 -#define ACPI_BREAK_MSG(a)
  13.668 +#define ACPI_DEBUG_DEFINE(a)		do { } while(0)
  13.669 +#define ACPI_DEBUG_ONLY_MEMBERS(a)	do { } while(0)
  13.670 +#define ACPI_FUNCTION_NAME(a)		do { } while(0)
  13.671 +#define ACPI_FUNCTION_TRACE(a)		do { } while(0)
  13.672 +#define ACPI_FUNCTION_TRACE_PTR(a,b)	do { } while(0)
  13.673 +#define ACPI_FUNCTION_TRACE_U32(a,b)	do { } while(0)
  13.674 +#define ACPI_FUNCTION_TRACE_STR(a,b)	do { } while(0)
  13.675 +#define ACPI_FUNCTION_EXIT		do { } while(0)
  13.676 +#define ACPI_FUNCTION_STATUS_EXIT(s)	do { } while(0)
  13.677 +#define ACPI_FUNCTION_VALUE_EXIT(s)	do { } while(0)
  13.678 +#define ACPI_FUNCTION_ENTRY()		do { } while(0)
  13.679 +#define ACPI_DUMP_STACK_ENTRY(a)	do { } while(0)
  13.680 +#define ACPI_DUMP_OPERANDS(a,b,c,d,e)	do { } while(0)
  13.681 +#define ACPI_DUMP_ENTRY(a,b)		do { } while(0)
  13.682 +#define ACPI_DUMP_TABLES(a,b)		do { } while(0)
  13.683 +#define ACPI_DUMP_PATHNAME(a,b,c,d)	do { } while(0)
  13.684 +#define ACPI_DUMP_RESOURCE_LIST(a)	do { } while(0)
  13.685 +#define ACPI_DUMP_BUFFER(a,b)		do { } while(0)
  13.686 +#define ACPI_DEBUG_PRINT(pl)		do { } while(0)
  13.687 +#define ACPI_DEBUG_PRINT_RAW(pl)	do { } while(0)
  13.688  
  13.689  #define return_VOID                     return
  13.690  #define return_ACPI_STATUS(s)           return(s)
  13.691  #define return_VALUE(s)                 return(s)
  13.692 +#define return_UINT8(s)                 return(s)
  13.693 +#define return_UINT32(s)                return(s)
  13.694  #define return_PTR(s)                   return(s)
  13.695  
  13.696  #endif
  13.697 @@ -626,18 +663,6 @@
  13.698  #define ACPI_DEBUGGER_EXEC(a)
  13.699  #endif
  13.700  
  13.701 -
  13.702 -/*
  13.703 - * For 16-bit code, we want to shrink some things even though
  13.704 - * we are using ACPI_DEBUG_OUTPUT to get the debug output
  13.705 - */
  13.706 -#if ACPI_MACHINE_WIDTH == 16
  13.707 -#undef ACPI_DEBUG_ONLY_MEMBERS
  13.708 -#undef _VERBOSE_STRUCTURES
  13.709 -#define ACPI_DEBUG_ONLY_MEMBERS(a)
  13.710 -#endif
  13.711 -
  13.712 -
  13.713  #ifdef ACPI_DEBUG_OUTPUT
  13.714  /*
  13.715   * 1) Set name to blanks
  13.716 @@ -650,7 +675,6 @@
  13.717  #define ACPI_ADD_OBJECT_NAME(a,b)
  13.718  #endif
  13.719  
  13.720 -
  13.721  /*
  13.722   * Memory allocation tracking (DEBUG ONLY)
  13.723   */
  13.724 @@ -658,21 +682,26 @@
  13.725  
  13.726  /* Memory allocation */
  13.727  
  13.728 -#define ACPI_MEM_ALLOCATE(a)            acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
  13.729 -#define ACPI_MEM_CALLOCATE(a)           acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
  13.730 -#define ACPI_MEM_FREE(a)                acpi_os_free(a)
  13.731 +#ifndef ACPI_ALLOCATE
  13.732 +#define ACPI_ALLOCATE(a)            acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
  13.733 +#endif
  13.734 +#ifndef ACPI_ALLOCATE_ZEROED
  13.735 +#define ACPI_ALLOCATE_ZEROED(a)     acpi_ut_allocate_zeroed((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
  13.736 +#endif
  13.737 +#ifndef ACPI_FREE
  13.738 +#define ACPI_FREE(a)                acpio_os_free(a)
  13.739 +#endif
  13.740  #define ACPI_MEM_TRACKING(a)
  13.741  
  13.742 -
  13.743  #else
  13.744  
  13.745  /* Memory allocation */
  13.746  
  13.747 -#define ACPI_MEM_ALLOCATE(a)            acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__)
  13.748 -#define ACPI_MEM_CALLOCATE(a)           acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__)
  13.749 -#define ACPI_MEM_FREE(a)                acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__)
  13.750 -#define ACPI_MEM_TRACKING(a)            a
  13.751 +#define ACPI_ALLOCATE(a)            acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__)
  13.752 +#define ACPI_ALLOCATE_ZEROED(a)     acpi_ut_allocate_zeroed_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__)
  13.753 +#define ACPI_FREE(a)                acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__)
  13.754 +#define ACPI_MEM_TRACKING(a)        a
  13.755  
  13.756 -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
  13.757 +#endif				/* ACPI_DBG_TRACK_ALLOCATIONS */
  13.758  
  13.759 -#endif /* ACMACROS_H */
  13.760 +#endif				/* ACMACROS_H */
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/xen/include/acpi/acnames.h	Tue Mar 18 14:55:36 2008 +0000
    14.3 @@ -0,0 +1,83 @@
    14.4 +/******************************************************************************
    14.5 + *
    14.6 + * Name: acnames.h - Global names and strings
    14.7 + *
    14.8 + *****************************************************************************/
    14.9 +
   14.10 +/*
   14.11 + * Copyright (C) 2000 - 2007, R. Byron Moore
   14.12 + * All rights reserved.
   14.13 + *
   14.14 + * Redistribution and use in source and binary forms, with or without
   14.15 + * modification, are permitted provided that the following conditions
   14.16 + * are met:
   14.17 + * 1. Redistributions of source code must retain the above copyright
   14.18 + *    notice, this list of conditions, and the following disclaimer,
   14.19 + *    without modification.
   14.20 + * 2. Redistributions in binary form must reproduce at minimum a disclaimer
   14.21 + *    substantially similar to the "NO WARRANTY" disclaimer below
   14.22 + *    ("Disclaimer") and any redistribution must be conditioned upon
   14.23 + *    including a substantially similar Disclaimer requirement for further
   14.24 + *    binary redistribution.
   14.25 + * 3. Neither the names of the above-listed copyright holders nor the names
   14.26 + *    of any contributors may be used to endorse or promote products derived
   14.27 + *    from this software without specific prior written permission.
   14.28 + *
   14.29 + * Alternatively, this software may be distributed under the terms of the
   14.30 + * GNU General Public License ("GPL") version 2 as published by the Free
   14.31 + * Software Foundation.
   14.32 + *
   14.33 + * NO WARRANTY
   14.34 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   14.35 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   14.36 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
   14.37 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   14.38 + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   14.39 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   14.40 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   14.41 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   14.42 + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
   14.43 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   14.44 + * POSSIBILITY OF SUCH DAMAGES.
   14.45 + */
   14.46 +
   14.47 +#ifndef __ACNAMES_H__
   14.48 +#define __ACNAMES_H__
   14.49 +
   14.50 +/* Method names - these methods can appear anywhere in the namespace */
   14.51 +
   14.52 +#define METHOD_NAME__HID        "_HID"
   14.53 +#define METHOD_NAME__CID        "_CID"
   14.54 +#define METHOD_NAME__UID        "_UID"
   14.55 +#define METHOD_NAME__ADR        "_ADR"
   14.56 +#define METHOD_NAME__INI        "_INI"
   14.57 +#define METHOD_NAME__STA        "_STA"
   14.58 +#define METHOD_NAME__REG        "_REG"
   14.59 +#define METHOD_NAME__SEG        "_SEG"
   14.60 +#define METHOD_NAME__BBN        "_BBN"
   14.61 +#define METHOD_NAME__PRT        "_PRT"
   14.62 +#define METHOD_NAME__CRS        "_CRS"
   14.63 +#define METHOD_NAME__PRS        "_PRS"
   14.64 +#define METHOD_NAME__PRW        "_PRW"
   14.65 +#define METHOD_NAME__SRS        "_SRS"
   14.66 +
   14.67 +/* Method names - these methods must appear at the namespace root */
   14.68 +
   14.69 +#define METHOD_NAME__BFS        "\\_BFS"
   14.70 +#define METHOD_NAME__GTS        "\\_GTS"
   14.71 +#define METHOD_NAME__PTS        "\\_PTS"
   14.72 +#define METHOD_NAME__SST        "\\_SI._SST"
   14.73 +#define METHOD_NAME__WAK        "\\_WAK"
   14.74 +
   14.75 +/* Definitions of the predefined namespace names  */
   14.76 +
   14.77 +#define ACPI_UNKNOWN_NAME       (u32) 0x3F3F3F3F	/* Unknown name is "????" */
   14.78 +#define ACPI_ROOT_NAME          (u32) 0x5F5F5F5C	/* Root name is    "\___" */
   14.79 +
   14.80 +#define ACPI_PREFIX_MIXED       (u32) 0x69706341	/* "Acpi" */
   14.81 +#define ACPI_PREFIX_LOWER       (u32) 0x69706361	/* "acpi" */
   14.82 +
   14.83 +#define ACPI_NS_ROOT_PATH       "\\"
   14.84 +#define ACPI_NS_SYSTEM_BUS      "_SB_"
   14.85 +
   14.86 +#endif				/* __ACNAMES_H__  */
    15.1 --- a/xen/include/acpi/acobject.h	Tue Mar 18 13:14:26 2008 +0000
    15.2 +++ b/xen/include/acpi/acobject.h	Tue Mar 18 14:55:36 2008 +0000
    15.3 @@ -1,12 +1,12 @@
    15.4  
    15.5  /******************************************************************************
    15.6   *
    15.7 - * Name: acobject.h - Definition of union acpi_operand_object    (Internal object only)
    15.8 + * Name: acobject.h - Definition of union acpi_operand_object  (Internal object only)
    15.9   *
   15.10   *****************************************************************************/
   15.11  
   15.12  /*
   15.13 - * Copyright (C) 2000 - 2005, R. Byron Moore
   15.14 + * Copyright (C) 2000 - 2007, R. Byron Moore
   15.15   * All rights reserved.
   15.16   *
   15.17   * Redistribution and use in source and binary forms, with or without
   15.18 @@ -45,13 +45,22 @@
   15.19  #ifndef _ACOBJECT_H
   15.20  #define _ACOBJECT_H
   15.21  
   15.22 +/* acpisrc:struct_defs -- for acpisrc conversion */
   15.23  
   15.24  /*
   15.25 - * The union acpi_operand_object    is used to pass AML operands from the dispatcher
   15.26 + * The union acpi_operand_object is used to pass AML operands from the dispatcher
   15.27   * to the interpreter, and to keep track of the various handlers such as
   15.28 - * address space handlers and notify handlers.  The object is a constant
   15.29 + * address space handlers and notify handlers. The object is a constant
   15.30   * size in order to allow it to be cached and reused.
   15.31 + *
   15.32 + * Note: The object is optimized to be aligned and will not work if it is
   15.33 + * byte-packed.
   15.34   */
   15.35 +#if ACPI_MACHINE_WIDTH == 64
   15.36 +#pragma pack(8)
   15.37 +#else
   15.38 +#pragma pack(4)
   15.39 +#endif
   15.40  
   15.41  /*******************************************************************************
   15.42   *
   15.43 @@ -62,17 +71,25 @@
   15.44  /*
   15.45   * Common area for all objects.
   15.46   *
   15.47 - * data_type is used to differentiate between internal descriptors, and MUST
   15.48 - * be the first byte in this structure.
   15.49 + * descriptor_type is used to differentiate between internal descriptors, and
   15.50 + * must be in the same place across all descriptors
   15.51 + *
   15.52 + * Note: The descriptor_type and Type fields must appear in the identical
   15.53 + * position in both the struct acpi_namespace_node and union acpi_operand_object
   15.54 + * structures.
   15.55   */
   15.56 -#define ACPI_OBJECT_COMMON_HEADER   /* SIZE/ALIGNMENT: 32 bits, one ptr plus trailing 8-bit flag */\
   15.57 -	u8                                      descriptor;         /* To differentiate various internal objs */\
   15.58 -	u8                                      type;               /* acpi_object_type */\
   15.59 -	u16                                     reference_count;    /* For object deletion management */\
   15.60 -	union acpi_operand_object               *next_object;       /* Objects linked to parent NS node */\
   15.61 -	u8                                      flags; \
   15.62 +#define ACPI_OBJECT_COMMON_HEADER \
   15.63 +	union acpi_operand_object       *next_object;       /* Objects linked to parent NS node */\
   15.64 +	u8                              descriptor_type;    /* To differentiate various internal objs */\
   15.65 +	u8                              type;               /* acpi_object_type */\
   15.66 +	u16                             reference_count;    /* For object deletion management */\
   15.67 +	u8                              flags;
   15.68 +	/*
   15.69 +	 * Note: There are 3 bytes available here before the
   15.70 +	 * next natural alignment boundary (for both 32/64 cases)
   15.71 +	 */
   15.72  
   15.73 -/* Values for flag byte above */
   15.74 +/* Values for Flag byte above */
   15.75  
   15.76  #define AOPOBJ_AML_CONSTANT         0x01
   15.77  #define AOPOBJ_STATIC_POINTER       0x02
   15.78 @@ -80,40 +97,7 @@
   15.79  #define AOPOBJ_OBJECT_INITIALIZED   0x08
   15.80  #define AOPOBJ_SETUP_COMPLETE       0x10
   15.81  #define AOPOBJ_SINGLE_DATUM         0x20
   15.82 -
   15.83 -
   15.84 -/*
   15.85 - * Common bitfield for the field objects
   15.86 - * "Field Datum"  -- a datum from the actual field object
   15.87 - * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
   15.88 - */
   15.89 -#define ACPI_COMMON_FIELD_INFO      /* SIZE/ALIGNMENT: 24 bits + three 32-bit values */\
   15.90 -	u8                                      field_flags;        /* Access, update, and lock bits */\
   15.91 -	u8                                      attribute;          /* From access_as keyword */\
   15.92 -	u8                                      access_byte_width;  /* Read/Write size in bytes */\
   15.93 -	u32                                     bit_length;         /* Length of field in bits */\
   15.94 -	u32                                     base_byte_offset;   /* Byte offset within containing object */\
   15.95 -	u8                                      start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
   15.96 -	u8                                      access_bit_width;   /* Read/Write size in bits (8-64) */\
   15.97 -	u32                                     value;              /* Value to store into the Bank or Index register */\
   15.98 -	struct acpi_namespace_node              *node;              /* Link back to parent node */
   15.99 -
  15.100 -
  15.101 -/*
  15.102 - * Fields common to both Strings and Buffers
  15.103 - */
  15.104 -#define ACPI_COMMON_BUFFER_INFO \
  15.105 -	u32                                     length;
  15.106 -
  15.107 -
  15.108 -/*
  15.109 - * Common fields for objects that support ASL notifications
  15.110 - */
  15.111 -#define ACPI_COMMON_NOTIFY_INFO \
  15.112 -	union acpi_operand_object               *system_notify;     /* Handler for system notifies */\
  15.113 -	union acpi_operand_object               *device_notify;     /* Handler for driver notifies */\
  15.114 -	union acpi_operand_object               *handler;           /* Handler for Address space */
  15.115 -
  15.116 +#define AOPOBJ_INVALID              0x40	/* Used if host OS won't allow an op_region address */
  15.117  
  15.118  /******************************************************************************
  15.119   *
  15.120 @@ -121,113 +105,84 @@
  15.121   *
  15.122   *****************************************************************************/
  15.123  
  15.124 -struct acpi_object_common
  15.125 -{
  15.126 -	ACPI_OBJECT_COMMON_HEADER
  15.127 -};
  15.128 +struct acpi_object_common {
  15.129 +ACPI_OBJECT_COMMON_HEADER};
  15.130  
  15.131 -
  15.132 -struct acpi_object_integer
  15.133 -{
  15.134 -	ACPI_OBJECT_COMMON_HEADER
  15.135 -	acpi_integer                            value;
  15.136 +struct acpi_object_integer {
  15.137 +	ACPI_OBJECT_COMMON_HEADER u8 fill[3];	/* Prevent warning on some compilers */
  15.138 +	acpi_integer value;
  15.139  };
  15.140  
  15.141  /*
  15.142   * Note: The String and Buffer object must be identical through the Pointer
  15.143 - * element.  There is code that depends on this.
  15.144 + * and length elements.  There is code that depends on this.
  15.145 + *
  15.146 + * Fields common to both Strings and Buffers
  15.147   */
  15.148 -struct acpi_object_string           /* Null terminated, ASCII characters only */
  15.149 -{
  15.150 -	ACPI_OBJECT_COMMON_HEADER
  15.151 -	ACPI_COMMON_BUFFER_INFO
  15.152 -	char                                    *pointer;           /* String in AML stream or allocated string */
  15.153 +#define ACPI_COMMON_BUFFER_INFO(_type) \
  15.154 +	_type                           *pointer; \
  15.155 +	u32                             length;
  15.156 +
  15.157 +struct acpi_object_string {	/* Null terminated, ASCII characters only */
  15.158 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(char)	/* String in AML stream or allocated string */
  15.159  };
  15.160  
  15.161 -
  15.162 -struct acpi_object_buffer
  15.163 -{
  15.164 -	ACPI_OBJECT_COMMON_HEADER
  15.165 -	ACPI_COMMON_BUFFER_INFO
  15.166 -	u8                                      *pointer;           /* Buffer in AML stream or allocated buffer */
  15.167 -	struct acpi_namespace_node              *node;              /* Link back to parent node */
  15.168 -	u8                                      *aml_start;
  15.169 -	u32                                     aml_length;
  15.170 +struct acpi_object_buffer {
  15.171 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_BUFFER_INFO(u8)	/* Buffer in AML stream or allocated buffer */
  15.172 +	u32 aml_length;
  15.173 +	u8 *aml_start;
  15.174 +	struct acpi_namespace_node *node;	/* Link back to parent node */
  15.175  };
  15.176  
  15.177 -
  15.178 -struct acpi_object_package
  15.179 -{
  15.180 -	ACPI_OBJECT_COMMON_HEADER
  15.181 -
  15.182 -	u32                                     count;              /* # of elements in package */
  15.183 -	u32                                     aml_length;
  15.184 -	u8                                      *aml_start;
  15.185 -	struct acpi_namespace_node              *node;              /* Link back to parent node */
  15.186 -	union acpi_operand_object               **elements;         /* Array of pointers to acpi_objects */
  15.187 +struct acpi_object_package {
  15.188 +	ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node;	/* Link back to parent node */
  15.189 +	union acpi_operand_object **elements;	/* Array of pointers to acpi_objects */
  15.190 +	u8 *aml_start;
  15.191 +	u32 aml_length;
  15.192 +	u32 count;		/* # of elements in package */
  15.193  };
  15.194  
  15.195 -
  15.196  /******************************************************************************
  15.197   *
  15.198   * Complex data types
  15.199   *
  15.200   *****************************************************************************/
  15.201  
  15.202 -struct acpi_object_event
  15.203 -{
  15.204 -	ACPI_OBJECT_COMMON_HEADER
  15.205 -	void                                    *semaphore;
  15.206 -};
  15.207 -
  15.208 -
  15.209 -#define ACPI_INFINITE_CONCURRENCY   0xFF
  15.210 -
  15.211 -typedef
  15.212 -acpi_status (*ACPI_INTERNAL_METHOD) (
  15.213 -	struct acpi_walk_state          *walk_state);
  15.214 -
  15.215 -struct acpi_object_method
  15.216 -{
  15.217 -	ACPI_OBJECT_COMMON_HEADER
  15.218 -	u8                                      method_flags;
  15.219 -	u8                                      param_count;
  15.220 -	u32                                     aml_length;
  15.221 -	void                                    *semaphore;
  15.222 -	u8                                      *aml_start;
  15.223 -	ACPI_INTERNAL_METHOD            implementation;
  15.224 -	u8                                      concurrency;
  15.225 -	u8                                      thread_count;
  15.226 -	acpi_owner_id                           owning_id;
  15.227 +struct acpi_object_event {
  15.228 +	ACPI_OBJECT_COMMON_HEADER acpi_semaphore os_semaphore;	/* Actual OS synchronization object */
  15.229  };
  15.230  
  15.231 -
  15.232 -struct acpi_object_mutex
  15.233 -{
  15.234 -	ACPI_OBJECT_COMMON_HEADER
  15.235 -	u8                                      sync_level;         /* 0-15, specified in Mutex() call */
  15.236 -	u16                                     acquisition_depth;  /* Allow multiple Acquires, same thread */
  15.237 -	struct acpi_thread_state                *owner_thread;      /* Current owner of the mutex */
  15.238 -	void                                    *semaphore;         /* Actual OS synchronization object */
  15.239 -	union acpi_operand_object               *prev;              /* Link for list of acquired mutexes */
  15.240 -	union acpi_operand_object               *next;              /* Link for list of acquired mutexes */
  15.241 -	struct acpi_namespace_node              *node;              /* Containing namespace node */
  15.242 -	u8                                      original_sync_level; /* Owner's original sync level (0-15) */
  15.243 +struct acpi_object_mutex {
  15.244 +	ACPI_OBJECT_COMMON_HEADER u8 sync_level;	/* 0-15, specified in Mutex() call */
  15.245 +	u16 acquisition_depth;	/* Allow multiple Acquires, same thread */
  15.246 +	struct acpi_thread_state *owner_thread;	/* Current owner of the mutex */
  15.247 +	acpi_mutex os_mutex;	/* Actual OS synchronization object */
  15.248 +	union acpi_operand_object *prev;	/* Link for list of acquired mutexes */
  15.249 +	union acpi_operand_object *next;	/* Link for list of acquired mutexes */
  15.250 +	struct acpi_namespace_node *node;	/* Containing namespace node */
  15.251 +	u8 original_sync_level;	/* Owner's original sync level (0-15) */
  15.252  };
  15.253  
  15.254 -
  15.255 -struct acpi_object_region
  15.256 -{
  15.257 -	ACPI_OBJECT_COMMON_HEADER
  15.258 -
  15.259 -	u8                                      space_id;
  15.260 -	union acpi_operand_object               *handler;           /* Handler for region access */
  15.261 -	struct acpi_namespace_node              *node;              /* Containing namespace node */
  15.262 -	union acpi_operand_object               *next;
  15.263 -	u32                                     length;
  15.264 -	acpi_physical_address                   address;
  15.265 +struct acpi_object_region {
  15.266 +	ACPI_OBJECT_COMMON_HEADER u8 space_id;
  15.267 +	struct acpi_namespace_node *node;	/* Containing namespace node */
  15.268 +	union acpi_operand_object *handler;	/* Handler for region access */
  15.269 +	union acpi_operand_object *next;
  15.270 +	acpi_physical_address address;
  15.271 +	u32 length;
  15.272  };
  15.273  
  15.274 +struct acpi_object_method {
  15.275 +	ACPI_OBJECT_COMMON_HEADER u8 method_flags;
  15.276 +	u8 param_count;
  15.277 +	u8 sync_level;
  15.278 +	union acpi_operand_object *mutex;
  15.279 +	u8 *aml_start;
  15.280 +	ACPI_INTERNAL_METHOD implementation;
  15.281 +	u32 aml_length;
  15.282 +	u8 thread_count;
  15.283 +	acpi_owner_id owner_id;
  15.284 +};
  15.285  
  15.286  /******************************************************************************
  15.287   *
  15.288 @@ -235,46 +190,37 @@ struct acpi_object_region
  15.289   *
  15.290   *****************************************************************************/
  15.291  
  15.292 -struct acpi_object_notify_common            /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
  15.293 -{
  15.294 -	ACPI_OBJECT_COMMON_HEADER
  15.295 -	ACPI_COMMON_NOTIFY_INFO
  15.296 -};
  15.297 +/*
  15.298 + * Common fields for objects that support ASL notifications
  15.299 + */
  15.300 +#define ACPI_COMMON_NOTIFY_INFO \
  15.301 +	union acpi_operand_object       *system_notify;     /* Handler for system notifies */\
  15.302 +	union acpi_operand_object       *device_notify;     /* Handler for driver notifies */\
  15.303 +	union acpi_operand_object       *handler;	/* Handler for Address space */
  15.304  
  15.305 +struct acpi_object_notify_common {	/* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
  15.306 +ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
  15.307  
  15.308 -struct acpi_object_device
  15.309 -{
  15.310 +struct acpi_object_device {
  15.311  	ACPI_OBJECT_COMMON_HEADER
  15.312 -	ACPI_COMMON_NOTIFY_INFO
  15.313 -	struct acpi_gpe_block_info              *gpe_block;
  15.314 +	    ACPI_COMMON_NOTIFY_INFO struct acpi_gpe_block_info *gpe_block;
  15.315  };
  15.316  
  15.317 -
  15.318 -struct acpi_object_power_resource
  15.319 -{
  15.320 -	ACPI_OBJECT_COMMON_HEADER
  15.321 -	ACPI_COMMON_NOTIFY_INFO
  15.322 -	u32                                     system_level;
  15.323 -	u32                                     resource_order;
  15.324 +struct acpi_object_power_resource {
  15.325 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO u32 system_level;
  15.326 +	u32 resource_order;
  15.327  };
  15.328  
  15.329 -
  15.330 -struct acpi_object_processor
  15.331 -{
  15.332 +struct acpi_object_processor {
  15.333  	ACPI_OBJECT_COMMON_HEADER
  15.334 -	ACPI_COMMON_NOTIFY_INFO
  15.335 -	u32                                     proc_id;
  15.336 -	u32                                     length;
  15.337 -	acpi_io_address                         address;
  15.338 +	    /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
  15.339 +	u8 proc_id;
  15.340 +	u8 length;
  15.341 +	ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
  15.342  };
  15.343  
  15.344 -
  15.345 -struct acpi_object_thermal_zone
  15.346 -{
  15.347 -	ACPI_OBJECT_COMMON_HEADER
  15.348 -	ACPI_COMMON_NOTIFY_INFO
  15.349 -};
  15.350 -
  15.351 +struct acpi_object_thermal_zone {
  15.352 +ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_NOTIFY_INFO};
  15.353  
  15.354  /******************************************************************************
  15.355   *
  15.356 @@ -282,89 +228,77 @@ struct acpi_object_thermal_zone
  15.357   *
  15.358   *****************************************************************************/
  15.359  
  15.360 -struct acpi_object_field_common                         /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
  15.361 -{
  15.362 -	ACPI_OBJECT_COMMON_HEADER
  15.363 -	ACPI_COMMON_FIELD_INFO
  15.364 -	union acpi_operand_object               *region_obj;        /* Containing Operation Region object */
  15.365 -			  /* (REGION/BANK fields only) */
  15.366 -};
  15.367 +/*
  15.368 + * Common bitfield for the field objects
  15.369 + * "Field Datum"  -- a datum from the actual field object
  15.370 + * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
  15.371 + */
  15.372 +#define ACPI_COMMON_FIELD_INFO \
  15.373 +	u8                              field_flags;        /* Access, update, and lock bits */\
  15.374 +	u8                              attribute;          /* From access_as keyword */\
  15.375 +	u8                              access_byte_width;  /* Read/Write size in bytes */\
  15.376 +	struct acpi_namespace_node      *node;              /* Link back to parent node */\
  15.377 +	u32                             bit_length;         /* Length of field in bits */\
  15.378 +	u32                             base_byte_offset;   /* Byte offset within containing object */\
  15.379 +	u32                             value;              /* Value to store into the Bank or Index register */\
  15.380 +	u8                              start_field_bit_offset;/* Bit offset within first field datum (0-63) */\
  15.381 +	u8                              access_bit_width;	/* Read/Write size in bits (8-64) */
  15.382  
  15.383 -
  15.384 -struct acpi_object_region_field
  15.385 -{
  15.386 -	ACPI_OBJECT_COMMON_HEADER
  15.387 -	ACPI_COMMON_FIELD_INFO
  15.388 -	union acpi_operand_object               *region_obj;        /* Containing op_region object */
  15.389 +struct acpi_object_field_common {	/* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
  15.390 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj;	/* Parent Operation Region object (REGION/BANK fields only) */
  15.391  };
  15.392  
  15.393 -
  15.394 -struct acpi_object_bank_field
  15.395 -{
  15.396 -	ACPI_OBJECT_COMMON_HEADER
  15.397 -	ACPI_COMMON_FIELD_INFO
  15.398 -	union acpi_operand_object               *region_obj;        /* Containing op_region object */
  15.399 -	union acpi_operand_object               *bank_obj;          /* bank_select Register object */
  15.400 +struct acpi_object_region_field {
  15.401 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj;	/* Containing op_region object */
  15.402  };
  15.403  
  15.404 -
  15.405 -struct acpi_object_index_field
  15.406 -{
  15.407 -	ACPI_OBJECT_COMMON_HEADER
  15.408 -	ACPI_COMMON_FIELD_INFO
  15.409 -
  15.410 -	/*
  15.411 -	 * No "region_obj" pointer needed since the Index and Data registers
  15.412 -	 * are each field definitions unto themselves.
  15.413 -	 */
  15.414 -	union acpi_operand_object               *index_obj;         /* Index register */
  15.415 -	union acpi_operand_object               *data_obj;          /* Data register */
  15.416 +struct acpi_object_bank_field {
  15.417 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *region_obj;	/* Containing op_region object */
  15.418 +	union acpi_operand_object *bank_obj;	/* bank_select Register object */
  15.419  };
  15.420  
  15.421 +struct acpi_object_index_field {
  15.422 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO
  15.423 +	    /*
  15.424 +	     * No "RegionObj" pointer needed since the Index and Data registers
  15.425 +	     * are each field definitions unto themselves.
  15.426 +	     */
  15.427 +	union acpi_operand_object *index_obj;	/* Index register */
  15.428 +	union acpi_operand_object *data_obj;	/* Data register */
  15.429 +};
  15.430  
  15.431  /* The buffer_field is different in that it is part of a Buffer, not an op_region */
  15.432  
  15.433 -struct acpi_object_buffer_field
  15.434 -{
  15.435 -	ACPI_OBJECT_COMMON_HEADER
  15.436 -	ACPI_COMMON_FIELD_INFO
  15.437 -	union acpi_operand_object               *buffer_obj;        /* Containing Buffer object */
  15.438 +struct acpi_object_buffer_field {
  15.439 +	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object *buffer_obj;	/* Containing Buffer object */
  15.440  };
  15.441  
  15.442 -
  15.443  /******************************************************************************
  15.444   *
  15.445   * Objects for handlers
  15.446   *
  15.447   *****************************************************************************/
  15.448  
  15.449 -struct acpi_object_notify_handler
  15.450 -{
  15.451 -	ACPI_OBJECT_COMMON_HEADER
  15.452 -	struct acpi_namespace_node              *node;              /* Parent device */
  15.453 -	acpi_notify_handler                     handler;
  15.454 -	void                                    *context;
  15.455 +struct acpi_object_notify_handler {
  15.456 +	ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *node;	/* Parent device */
  15.457 +	acpi_notify_handler handler;
  15.458 +	void *context;
  15.459  };
  15.460  
  15.461 -
  15.462 -/* Flags for address handler */
  15.463 -
  15.464 -#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED  0x1
  15.465 -
  15.466 -
  15.467 -struct acpi_object_addr_handler
  15.468 -{
  15.469 -	ACPI_OBJECT_COMMON_HEADER
  15.470 -	u8                                      space_id;
  15.471 -	u16                                     hflags;
  15.472 -	acpi_adr_space_handler                  handler;
  15.473 -	struct acpi_namespace_node              *node;              /* Parent device */
  15.474 -	void                                    *context;
  15.475 -	acpi_adr_space_setup                    setup;
  15.476 -	union acpi_operand_object               *region_list;       /* regions using this handler */
  15.477 -	union acpi_operand_object               *next;
  15.478 +struct acpi_object_addr_handler {
  15.479 +	ACPI_OBJECT_COMMON_HEADER u8 space_id;
  15.480 +	u8 handler_flags;
  15.481 +	acpi_adr_space_handler handler;
  15.482 +	struct acpi_namespace_node *node;	/* Parent device */
  15.483 +	void *context;
  15.484 +	acpi_adr_space_setup setup;
  15.485 +	union acpi_operand_object *region_list;	/* regions using this handler */
  15.486 +	union acpi_operand_object *next;
  15.487  };
  15.488  
  15.489 +/* Flags for address handler (handler_flags) */
  15.490 +
  15.491 +#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED  0x01
  15.492  
  15.493  /******************************************************************************
  15.494   *
  15.495 @@ -376,18 +310,15 @@ struct acpi_object_addr_handler
  15.496   * The Reference object type is used for these opcodes:
  15.497   * Arg[0-6], Local[0-7], index_op, name_op, zero_op, one_op, ones_op, debug_op
  15.498   */
  15.499 -struct acpi_object_reference
  15.500 -{
  15.501 -	ACPI_OBJECT_COMMON_HEADER
  15.502 -	u8                                      target_type;        /* Used for index_op */
  15.503 -	u16                                     opcode;
  15.504 -	u32                                     offset;             /* Used for arg_op, local_op, and index_op */
  15.505 -	void                                    *object;            /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object  */
  15.506 -	struct acpi_namespace_node              *node;
  15.507 -	union acpi_operand_object               **where;
  15.508 +struct acpi_object_reference {
  15.509 +	ACPI_OBJECT_COMMON_HEADER u8 target_type;	/* Used for index_op */
  15.510 +	u16 opcode;
  15.511 +	void *object;		/* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
  15.512 +	struct acpi_namespace_node *node;
  15.513 +	union acpi_operand_object **where;
  15.514 +	u32 offset;		/* Used for arg_op, local_op, and index_op */
  15.515  };
  15.516  
  15.517 -
  15.518  /*
  15.519   * Extra object is used as additional storage for types that
  15.520   * have AML code in their declarations (term_args) that must be
  15.521 @@ -395,83 +326,69 @@ struct acpi_object_reference
  15.522   *
  15.523   * Currently: Region and field_unit types
  15.524   */
  15.525 -struct acpi_object_extra
  15.526 -{
  15.527 -	ACPI_OBJECT_COMMON_HEADER
  15.528 -	u8                                      byte_fill1;
  15.529 -	u16                                     word_fill1;
  15.530 -	u32                                     aml_length;
  15.531 -	u8                                      *aml_start;
  15.532 -	struct acpi_namespace_node              *method_REG;        /* _REG method for this region (if any) */
  15.533 -	void                                    *region_context;    /* Region-specific data */
  15.534 +struct acpi_object_extra {
  15.535 +	ACPI_OBJECT_COMMON_HEADER struct acpi_namespace_node *method_REG;	/* _REG method for this region (if any) */
  15.536 +	void *region_context;	/* Region-specific data */
  15.537 +	u8 *aml_start;
  15.538 +	u32 aml_length;
  15.539  };
  15.540  
  15.541 -
  15.542  /* Additional data that can be attached to namespace nodes */
  15.543  
  15.544 -struct acpi_object_data
  15.545 -{
  15.546 -	ACPI_OBJECT_COMMON_HEADER
  15.547 -	acpi_object_handler                     handler;
  15.548 -	void                                    *pointer;
  15.549 +struct acpi_object_data {
  15.550 +	ACPI_OBJECT_COMMON_HEADER acpi_object_handler handler;
  15.551 +	void *pointer;
  15.552  };
  15.553  
  15.554 -
  15.555  /* Structure used when objects are cached for reuse */
  15.556  
  15.557 -struct acpi_object_cache_list
  15.558 -{
  15.559 -	ACPI_OBJECT_COMMON_HEADER
  15.560 -	union acpi_operand_object               *next;              /* Link for object cache and internal lists*/
  15.561 +struct acpi_object_cache_list {
  15.562 +	ACPI_OBJECT_COMMON_HEADER union acpi_operand_object *next;	/* Link for object cache and internal lists */
  15.563  };
  15.564  
  15.565 -
  15.566  /******************************************************************************
  15.567   *
  15.568   * union acpi_operand_object Descriptor - a giant union of all of the above
  15.569   *
  15.570   *****************************************************************************/
  15.571  
  15.572 -union acpi_operand_object
  15.573 -{
  15.574 -	struct acpi_object_common               common;
  15.575 -	struct acpi_object_integer              integer;
  15.576 -	struct acpi_object_string               string;
  15.577 -	struct acpi_object_buffer               buffer;
  15.578 -	struct acpi_object_package              package;
  15.579 -	struct acpi_object_event                event;
  15.580 -	struct acpi_object_method               method;
  15.581 -	struct acpi_object_mutex                mutex;
  15.582 -	struct acpi_object_region               region;
  15.583 -	struct acpi_object_notify_common        common_notify;
  15.584 -	struct acpi_object_device               device;
  15.585 -	struct acpi_object_power_resource       power_resource;
  15.586 -	struct acpi_object_processor            processor;
  15.587 -	struct acpi_object_thermal_zone         thermal_zone;
  15.588 -	struct acpi_object_field_common         common_field;
  15.589 -	struct acpi_object_region_field         field;
  15.590 -	struct acpi_object_buffer_field         buffer_field;
  15.591 -	struct acpi_object_bank_field           bank_field;
  15.592 -	struct acpi_object_index_field          index_field;
  15.593 -	struct acpi_object_notify_handler       notify;
  15.594 -	struct acpi_object_addr_handler         address_space;
  15.595 -	struct acpi_object_reference            reference;
  15.596 -	struct acpi_object_extra                extra;
  15.597 -	struct acpi_object_data                 data;
  15.598 -	struct acpi_object_cache_list           cache;
  15.599 +union acpi_operand_object {
  15.600 +	struct acpi_object_common common;
  15.601 +	struct acpi_object_integer integer;
  15.602 +	struct acpi_object_string string;
  15.603 +	struct acpi_object_buffer buffer;
  15.604 +	struct acpi_object_package package;
  15.605 +	struct acpi_object_event event;
  15.606 +	struct acpi_object_method method;
  15.607 +	struct acpi_object_mutex mutex;
  15.608 +	struct acpi_object_region region;
  15.609 +	struct acpi_object_notify_common common_notify;
  15.610 +	struct acpi_object_device device;
  15.611 +	struct acpi_object_power_resource power_resource;
  15.612 +	struct acpi_object_processor processor;
  15.613 +	struct acpi_object_thermal_zone thermal_zone;
  15.614 +	struct acpi_object_field_common common_field;
  15.615 +	struct acpi_object_region_field field;
  15.616 +	struct acpi_object_buffer_field buffer_field;
  15.617 +	struct acpi_object_bank_field bank_field;
  15.618 +	struct acpi_object_index_field index_field;
  15.619 +	struct acpi_object_notify_handler notify;
  15.620 +	struct acpi_object_addr_handler address_space;
  15.621 +	struct acpi_object_reference reference;
  15.622 +	struct acpi_object_extra extra;
  15.623 +	struct acpi_object_data data;
  15.624 +	struct acpi_object_cache_list cache;
  15.625  };
  15.626  
  15.627 -
  15.628  /******************************************************************************
  15.629   *
  15.630   * union acpi_descriptor - objects that share a common descriptor identifier
  15.631   *
  15.632   *****************************************************************************/
  15.633  
  15.634 -
  15.635  /* Object descriptor types */
  15.636  
  15.637 -#define ACPI_DESC_TYPE_CACHED           0x01        /* Used only when object is cached */
  15.638 +#define ACPI_DESC_TYPE_CACHED           0x01	/* Used only when object is cached */
  15.639  #define ACPI_DESC_TYPE_STATE            0x02
  15.640  #define ACPI_DESC_TYPE_STATE_UPDATE     0x03
  15.641  #define ACPI_DESC_TYPE_STATE_PACKAGE    0x04
  15.642 @@ -488,14 +405,18 @@ union acpi_operand_object
  15.643  #define ACPI_DESC_TYPE_NAMED            0x0F
  15.644  #define ACPI_DESC_TYPE_MAX              0x0F
  15.645  
  15.646 -
  15.647 -union acpi_descriptor
  15.648 -{
  15.649 -	u8                                      descriptor_id;  /* To differentiate various internal objs */\
  15.650 -	union acpi_operand_object               object;
  15.651 -	struct acpi_namespace_node              node;
  15.652 -	union acpi_parse_object                 op;
  15.653 +struct acpi_common_descriptor {
  15.654 +	void *common_pointer;
  15.655 +	u8 descriptor_type;	/* To differentiate various internal objs */
  15.656  };
  15.657  
  15.658 +union acpi_descriptor {
  15.659 +	struct acpi_common_descriptor common;
  15.660 +	union acpi_operand_object object;
  15.661 +	struct acpi_namespace_node node;
  15.662 +	union acpi_parse_object op;
  15.663 +};
  15.664  
  15.665 -#endif /* _ACOBJECT_H */
  15.666 +#pragma pack()
  15.667 +
  15.668 +#endif				/* _ACOBJECT_H */
    16.1 --- a/xen/include/acpi/acoutput.h	Tue Mar 18 13:14:26 2008 +0000
    16.2 +++ b/xen/include/acpi/acoutput.h	Tue Mar 18 14:55:36 2008 +0000
    16.3 @@ -5,7 +5,7 @@
    16.4   *****************************************************************************/
    16.5  
    16.6  /*
    16.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    16.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    16.9   * All rights reserved.
   16.10   *
   16.11   * Redistribution and use in source and binary forms, with or without
   16.12 @@ -50,7 +50,7 @@
   16.13   * component basis and a per-exception-type basis.
   16.14   */
   16.15  
   16.16 -/* Component IDs are used in the global "debug_layer" */
   16.17 +/* Component IDs are used in the global "DebugLayer" */
   16.18  
   16.19  #define ACPI_UTILITIES              0x00000001
   16.20  #define ACPI_HARDWARE               0x00000002
   16.21 @@ -73,12 +73,10 @@
   16.22  #define ACPI_ALL_COMPONENTS         0x00003FFF
   16.23  #define ACPI_COMPONENT_DEFAULT      (ACPI_ALL_COMPONENTS)
   16.24  
   16.25 -
   16.26  /* Component IDs reserved for ACPI drivers */
   16.27  
   16.28  #define ACPI_ALL_DRIVERS            0xFFFF0000
   16.29  
   16.30 -
   16.31  /*
   16.32   * Raw debug output levels, do not use these in the DEBUG_PRINT macros
   16.33   */
   16.34 @@ -123,7 +121,7 @@
   16.35  #define ACPI_LV_INTERRUPTS          0x08000000
   16.36  #define ACPI_LV_VERBOSITY3          0x0F000000 | ACPI_LV_VERBOSITY2
   16.37  
   16.38 -/* Exceptionally verbose output -- also used in the global "debug_level" */
   16.39 +/* Exceptionally verbose output -- also used in the global "DebugLevel"  */
   16.40  
   16.41  #define ACPI_LV_AML_DISASSEMBLE     0x10000000
   16.42  #define ACPI_LV_VERBOSE_INFO        0x20000000
   16.43 @@ -132,23 +130,27 @@
   16.44  
   16.45  #define ACPI_LV_VERBOSE             0xF0000000
   16.46  
   16.47 -
   16.48  /*
   16.49   * Debug level macros that are used in the DEBUG_PRINT macros
   16.50   */
   16.51 -#define ACPI_DEBUG_LEVEL(dl)        (u32) dl,__LINE__,&_debug_info
   16.52 +#define ACPI_DEBUG_LEVEL(dl)        (u32) dl,ACPI_DEBUG_PARAMETERS
   16.53  
   16.54 -/* Exception level -- used in the global "debug_level" */
   16.55 +/* Exception level -- used in the global "DebugLevel" */
   16.56  
   16.57 -#define ACPI_DB_ERROR               ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
   16.58 -#define ACPI_DB_WARN                ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
   16.59  #define ACPI_DB_INIT                ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
   16.60  #define ACPI_DB_DEBUG_OBJECT        ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
   16.61  #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
   16.62  #define ACPI_DB_ALL_EXCEPTIONS      ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
   16.63  
   16.64 +/*
   16.65 + * These two levels are essentially obsolete, all instances in the
   16.66 + * ACPICA core code have been replaced by ACPI_ERROR and ACPI_WARNING
   16.67 + * (Kept here because some drivers may still use them)
   16.68 + */
   16.69 +#define ACPI_DB_ERROR               ACPI_DEBUG_LEVEL (ACPI_LV_ERROR)
   16.70 +#define ACPI_DB_WARN                ACPI_DEBUG_LEVEL (ACPI_LV_WARN)
   16.71  
   16.72 -/* Trace level -- also used in the global "debug_level" */
   16.73 +/* Trace level -- also used in the global "DebugLevel" */
   16.74  
   16.75  #define ACPI_DB_INIT_NAMES          ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
   16.76  #define ACPI_DB_THREADS             ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
   16.77 @@ -174,12 +176,10 @@
   16.78  
   16.79  #define ACPI_DB_ALL                 ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
   16.80  
   16.81 -
   16.82  /* Defaults for debug_level, debug and normal */
   16.83  
   16.84 -#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
   16.85 -#define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT)
   16.86 +#define ACPI_DEBUG_DEFAULT          (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
   16.87 +#define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR)
   16.88  #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
   16.89  
   16.90 -
   16.91 -#endif /* __ACOUTPUT_H__ */
   16.92 +#endif				/* __ACOUTPUT_H__ */
    17.1 --- a/xen/include/acpi/acpi.h	Tue Mar 18 13:14:26 2008 +0000
    17.2 +++ b/xen/include/acpi/acpi.h	Tue Mar 18 14:55:36 2008 +0000
    17.3 @@ -5,7 +5,7 @@
    17.4   *****************************************************************************/
    17.5  
    17.6  /*
    17.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    17.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    17.9   * All rights reserved.
   17.10   *
   17.11   * Redistribution and use in source and binary forms, with or without
   17.12 @@ -49,21 +49,21 @@
   17.13   * We put them here because we don't want to duplicate them
   17.14   * in the rest of the source code again and again.
   17.15   */
   17.16 -#include "acconfig.h"           /* Configuration constants */
   17.17 -#include "platform/acenv.h"     /* Target environment specific items */
   17.18 -#include "actypes.h"            /* Fundamental common data types */
   17.19 -#include "acexcep.h"            /* ACPI exception codes */
   17.20 -#include "acmacros.h"           /* C macros */
   17.21 -#include "actbl.h"              /* ACPI table definitions */
   17.22 -#include "aclocal.h"            /* Internal data types */
   17.23 -#include "acoutput.h"           /* Error output and Debug macros */
   17.24 -#include "acpiosxf.h"           /* Interfaces to the ACPI-to-OS layer*/
   17.25 -#include "acpixf.h"             /* ACPI core subsystem external interfaces */
   17.26 -#include "acobject.h"           /* ACPI internal object */
   17.27 -#include "acstruct.h"           /* Common structures */
   17.28 -#include "acglobal.h"           /* All global variables */
   17.29 -#include "achware.h"            /* Hardware defines and interfaces */
   17.30 -#include "acutils.h"            /* Utility interfaces */
   17.31 +#include "acnames.h"		/* Global ACPI names and strings */
   17.32 +#include "acconfig.h"		/* Configuration constants */
   17.33 +#include "platform/acenv.h"	/* Target environment specific items */
   17.34 +#include "actypes.h"		/* Fundamental common data types */
   17.35 +#include "acexcep.h"		/* ACPI exception codes */
   17.36 +#include "acmacros.h"		/* C macros */
   17.37 +#include "actbl.h"		/* ACPI table definitions */
   17.38 +#include "aclocal.h"		/* Internal data types */
   17.39 +#include "acoutput.h"		/* Error output and Debug macros */
   17.40 +#include "acpiosxf.h"		/* Interfaces to the ACPI-to-OS layer */
   17.41 +#include "acpixf.h"		/* ACPI core subsystem external interfaces */
   17.42 +#include "acobject.h"		/* ACPI internal object */
   17.43 +#include "acstruct.h"		/* Common structures */
   17.44 +#include "acglobal.h"		/* All global variables */
   17.45 +#include "achware.h"		/* Hardware defines and interfaces */
   17.46 +#include "acutils.h"		/* Utility interfaces */
   17.47  
   17.48 -
   17.49 -#endif /* __ACPI_H__ */
   17.50 +#endif				/* __ACPI_H__ */
    18.1 --- a/xen/include/acpi/acpi_bus.h	Tue Mar 18 13:14:26 2008 +0000
    18.2 +++ b/xen/include/acpi/acpi_bus.h	Tue Mar 18 14:55:36 2008 +0000
    18.3 @@ -33,48 +33,40 @@
    18.4  /* TBD: Make dynamic */
    18.5  #define ACPI_MAX_HANDLES	10
    18.6  struct acpi_handle_list {
    18.7 -	u32			count;
    18.8 -	acpi_handle		handles[ACPI_MAX_HANDLES];
    18.9 +	u32 count;
   18.10 +	acpi_handle handles[ACPI_MAX_HANDLES];
   18.11  };
   18.12  
   18.13 -
   18.14  /* acpi_utils.h */
   18.15  acpi_status
   18.16 -acpi_extract_package (
   18.17 -	union acpi_object       *package,
   18.18 -	struct acpi_buffer      *format,
   18.19 -	struct acpi_buffer      *buffer);
   18.20 +acpi_extract_package(union acpi_object *package,
   18.21 +		     struct acpi_buffer *format, struct acpi_buffer *buffer);
   18.22  acpi_status
   18.23 -acpi_evaluate_integer (
   18.24 -	acpi_handle             handle,
   18.25 -	acpi_string             pathname,
   18.26 -	struct acpi_object_list *arguments,
   18.27 -	unsigned long           *data);
   18.28 +acpi_evaluate_integer(acpi_handle handle,
   18.29 +		      acpi_string pathname,
   18.30 +		      struct acpi_object_list *arguments, unsigned long *data);
   18.31  acpi_status
   18.32 -acpi_evaluate_reference (
   18.33 -	acpi_handle             handle,
   18.34 -	acpi_string             pathname,
   18.35 -	struct acpi_object_list *arguments,
   18.36 -	struct acpi_handle_list *list);
   18.37 +acpi_evaluate_reference(acpi_handle handle,
   18.38 +			acpi_string pathname,
   18.39 +			struct acpi_object_list *arguments,
   18.40 +			struct acpi_handle_list *list);
   18.41  
   18.42 -
   18.43 -#ifdef CONFIG_ACPI_BUS
   18.44 +#if 0//def CONFIG_ACPI
   18.45  
   18.46  #include <linux/proc_fs.h>
   18.47  
   18.48  #define ACPI_BUS_FILE_ROOT	"acpi"
   18.49 -extern struct proc_dir_entry	*acpi_root_dir;
   18.50 -extern FADT_DESCRIPTOR		acpi_fadt;
   18.51 +extern struct proc_dir_entry *acpi_root_dir;
   18.52  
   18.53  enum acpi_bus_removal_type {
   18.54 -	ACPI_BUS_REMOVAL_NORMAL	= 0,
   18.55 +	ACPI_BUS_REMOVAL_NORMAL = 0,
   18.56  	ACPI_BUS_REMOVAL_EJECT,
   18.57  	ACPI_BUS_REMOVAL_SUPRISE,
   18.58  	ACPI_BUS_REMOVAL_TYPE_COUNT
   18.59  };
   18.60  
   18.61  enum acpi_bus_device_type {
   18.62 -	ACPI_BUS_TYPE_DEVICE	= 0,
   18.63 +	ACPI_BUS_TYPE_DEVICE = 0,
   18.64  	ACPI_BUS_TYPE_POWER,
   18.65  	ACPI_BUS_TYPE_PROCESSOR,
   18.66  	ACPI_BUS_TYPE_THERMAL,
   18.67 @@ -87,46 +79,60 @@ enum acpi_bus_device_type {
   18.68  struct acpi_driver;
   18.69  struct acpi_device;
   18.70  
   18.71 -
   18.72  /*
   18.73   * ACPI Driver
   18.74   * -----------
   18.75   */
   18.76  
   18.77 -typedef int (*acpi_op_add)	(struct acpi_device *device);
   18.78 -typedef int (*acpi_op_remove)	(struct acpi_device *device, int type);
   18.79 -typedef int (*acpi_op_lock)	(struct acpi_device *device, int type);
   18.80 -typedef int (*acpi_op_start)	(struct acpi_device *device);
   18.81 -typedef int (*acpi_op_stop)	(struct acpi_device *device, int type);
   18.82 -typedef int (*acpi_op_suspend)	(struct acpi_device *device, int state);
   18.83 -typedef int (*acpi_op_resume)	(struct acpi_device *device, int state);
   18.84 -typedef int (*acpi_op_scan)	(struct acpi_device *device);
   18.85 -typedef int (*acpi_op_bind)	(struct acpi_device *device);
   18.86 -typedef int (*acpi_op_unbind)	(struct acpi_device *device);
   18.87 -typedef int (*acpi_op_match)	(struct acpi_device *device,
   18.88 -				 struct acpi_driver *driver);
   18.89 +typedef int (*acpi_op_add) (struct acpi_device * device);
   18.90 +typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
   18.91 +typedef int (*acpi_op_lock) (struct acpi_device * device, int type);
   18.92 +typedef int (*acpi_op_start) (struct acpi_device * device);
   18.93 +typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
   18.94 +typedef int (*acpi_op_suspend) (struct acpi_device * device,
   18.95 +				pm_message_t state);
   18.96 +typedef int (*acpi_op_resume) (struct acpi_device * device);
   18.97 +typedef int (*acpi_op_scan) (struct acpi_device * device);
   18.98 +typedef int (*acpi_op_bind) (struct acpi_device * device);
   18.99 +typedef int (*acpi_op_unbind) (struct acpi_device * device);
  18.100 +typedef int (*acpi_op_shutdown) (struct acpi_device * device);
  18.101 +
  18.102 +struct acpi_bus_ops {
  18.103 +	u32 acpi_op_add:1;
  18.104 +	u32 acpi_op_remove:1;
  18.105 +	u32 acpi_op_lock:1;
  18.106 +	u32 acpi_op_start:1;
  18.107 +	u32 acpi_op_stop:1;
  18.108 +	u32 acpi_op_suspend:1;
  18.109 +	u32 acpi_op_resume:1;
  18.110 +	u32 acpi_op_scan:1;
  18.111 +	u32 acpi_op_bind:1;
  18.112 +	u32 acpi_op_unbind:1;
  18.113 +	u32 acpi_op_shutdown:1;
  18.114 +	u32 reserved:21;
  18.115 +};
  18.116  
  18.117  struct acpi_device_ops {
  18.118 -	acpi_op_add		add;
  18.119 -	acpi_op_remove		remove;
  18.120 -	acpi_op_lock		lock;
  18.121 -	acpi_op_start		start;
  18.122 -	acpi_op_stop		stop;
  18.123 -	acpi_op_suspend		suspend;
  18.124 -	acpi_op_resume		resume;
  18.125 -	acpi_op_scan		scan;
  18.126 -	acpi_op_bind		bind;
  18.127 -	acpi_op_unbind		unbind;
  18.128 -	acpi_op_match		match;
  18.129 +	acpi_op_add add;
  18.130 +	acpi_op_remove remove;
  18.131 +	acpi_op_lock lock;
  18.132 +	acpi_op_start start;
  18.133 +	acpi_op_stop stop;
  18.134 +	acpi_op_suspend suspend;
  18.135 +	acpi_op_resume resume;
  18.136 +	acpi_op_scan scan;
  18.137 +	acpi_op_bind bind;
  18.138 +	acpi_op_unbind unbind;
  18.139 +	acpi_op_shutdown shutdown;
  18.140  };
  18.141  
  18.142  struct acpi_driver {
  18.143 -	struct list_head	node;
  18.144 -	char			name[80];
  18.145 -	char			class[80];
  18.146 -	atomic_t		references;
  18.147 -	char			*ids;		/* Supported Hardware IDs */
  18.148 -	struct acpi_device_ops	ops;
  18.149 +	char name[80];
  18.150 +	char class[80];
  18.151 +	const struct acpi_device_id *ids; /* Supported Hardware IDs */
  18.152 +	struct acpi_device_ops ops;
  18.153 +	struct device_driver drv;
  18.154 +	struct module *owner;
  18.155  };
  18.156  
  18.157  /*
  18.158 @@ -137,60 +143,58 @@ struct acpi_driver {
  18.159  /* Status (_STA) */
  18.160  
  18.161  struct acpi_device_status {
  18.162 -	u32			present:1;
  18.163 -	u32			enabled:1;
  18.164 -	u32			show_in_ui:1;
  18.165 -	u32			functional:1;
  18.166 -	u32			battery_present:1;
  18.167 -	u32			reserved:27;
  18.168 +	u32 present:1;
  18.169 +	u32 enabled:1;
  18.170 +	u32 show_in_ui:1;
  18.171 +	u32 functional:1;
  18.172 +	u32 battery_present:1;
  18.173 +	u32 reserved:27;
  18.174  };
  18.175  
  18.176 -
  18.177  /* Flags */
  18.178  
  18.179  struct acpi_device_flags {
  18.180 -	u32			dynamic_status:1;
  18.181 -	u32			hardware_id:1;
  18.182 -	u32			compatible_ids:1;
  18.183 -	u32			bus_address:1;
  18.184 -	u32			unique_id:1;
  18.185 -	u32			removable:1;
  18.186 -	u32			ejectable:1;
  18.187 -	u32			lockable:1;
  18.188 -	u32			suprise_removal_ok:1;
  18.189 -	u32			power_manageable:1;
  18.190 -	u32			performance_manageable:1;
  18.191 -	u32			wake_capable:1; /* Wakeup(_PRW) supported? */
  18.192 -	u32			reserved:20;
  18.193 +	u32 dynamic_status:1;
  18.194 +	u32 hardware_id:1;
  18.195 +	u32 compatible_ids:1;
  18.196 +	u32 bus_address:1;
  18.197 +	u32 unique_id:1;
  18.198 +	u32 removable:1;
  18.199 +	u32 ejectable:1;
  18.200 +	u32 lockable:1;
  18.201 +	u32 suprise_removal_ok:1;
  18.202 +	u32 power_manageable:1;
  18.203 +	u32 performance_manageable:1;
  18.204 +	u32 wake_capable:1;	/* Wakeup(_PRW) supported? */
  18.205 +	u32 force_power_state:1;
  18.206 +	u32 reserved:19;
  18.207  };
  18.208  
  18.209 -
  18.210  /* File System */
  18.211  
  18.212  struct acpi_device_dir {
  18.213 -	struct proc_dir_entry	*entry;
  18.214 +	struct proc_dir_entry *entry;
  18.215  };
  18.216  
  18.217  #define acpi_device_dir(d)	((d)->dir.entry)
  18.218  
  18.219 -
  18.220  /* Plug and Play */
  18.221  
  18.222 -typedef char			acpi_bus_id[5];
  18.223 -typedef unsigned long		acpi_bus_address;
  18.224 -typedef char			acpi_hardware_id[9];
  18.225 -typedef char			acpi_unique_id[9];
  18.226 -typedef char			acpi_device_name[40];
  18.227 -typedef char			acpi_device_class[20];
  18.228 +typedef char acpi_bus_id[5];
  18.229 +typedef unsigned long acpi_bus_address;
  18.230 +typedef char acpi_hardware_id[15];
  18.231 +typedef char acpi_unique_id[9];
  18.232 +typedef char acpi_device_name[40];
  18.233 +typedef char acpi_device_class[20];
  18.234  
  18.235  struct acpi_device_pnp {
  18.236 -	acpi_bus_id		bus_id;		               /* Object name */
  18.237 -	acpi_bus_address	bus_address;	                      /* _ADR */
  18.238 -	acpi_hardware_id	hardware_id;	                      /* _HID */
  18.239 -	struct acpi_compatible_id_list *cid_list;		     /* _CIDs */
  18.240 -	acpi_unique_id		unique_id;	                      /* _UID */
  18.241 -	acpi_device_name	device_name;	         /* Driver-determined */
  18.242 -	acpi_device_class	device_class;	         /*        "          */
  18.243 +	acpi_bus_id bus_id;	/* Object name */
  18.244 +	acpi_bus_address bus_address;	/* _ADR */
  18.245 +	acpi_hardware_id hardware_id;	/* _HID */
  18.246 +	struct acpi_compatible_id_list *cid_list;	/* _CIDs */
  18.247 +	acpi_unique_id unique_id;	/* _UID */
  18.248 +	acpi_device_name device_name;	/* Driver-determined */
  18.249 +	acpi_device_class device_class;	/*        "          */
  18.250  };
  18.251  
  18.252  #define acpi_device_bid(d)	((d)->pnp.bus_id)
  18.253 @@ -200,102 +204,105 @@ struct acpi_device_pnp {
  18.254  #define acpi_device_name(d)	((d)->pnp.device_name)
  18.255  #define acpi_device_class(d)	((d)->pnp.device_class)
  18.256  
  18.257 -
  18.258  /* Power Management */
  18.259  
  18.260  struct acpi_device_power_flags {
  18.261 -	u32			explicit_get:1;		     /* _PSC present? */
  18.262 -	u32			power_resources:1;	   /* Power resources */
  18.263 -	u32			inrush_current:1;	  /* Serialize Dx->D0 */
  18.264 -	u32			power_removed:1;	   /* Optimize Dx->D0 */
  18.265 -	u32			reserved:28;
  18.266 +	u32 explicit_get:1;	/* _PSC present? */
  18.267 +	u32 power_resources:1;	/* Power resources */
  18.268 +	u32 inrush_current:1;	/* Serialize Dx->D0 */
  18.269 +	u32 power_removed:1;	/* Optimize Dx->D0 */
  18.270 +	u32 reserved:28;
  18.271  };
  18.272  
  18.273  struct acpi_device_power_state {
  18.274  	struct {
  18.275 -		u8			valid:1;	
  18.276 -		u8			explicit_set:1;	     /* _PSx present? */
  18.277 -		u8			reserved:6;
  18.278 -	}			flags;
  18.279 -	int			power;		  /* % Power (compared to D0) */
  18.280 -	int			latency;	/* Dx->D0 time (microseconds) */
  18.281 -	struct acpi_handle_list	resources;	/* Power resources referenced */
  18.282 +		u8 valid:1;
  18.283 +		u8 explicit_set:1;	/* _PSx present? */
  18.284 +		u8 reserved:6;
  18.285 +	} flags;
  18.286 +	int power;		/* % Power (compared to D0) */
  18.287 +	int latency;		/* Dx->D0 time (microseconds) */
  18.288 +	struct acpi_handle_list resources;	/* Power resources referenced */
  18.289  };
  18.290  
  18.291  struct acpi_device_power {
  18.292 -	int			state;		             /* Current state */
  18.293 +	int state;		/* Current state */
  18.294  	struct acpi_device_power_flags flags;
  18.295 -	struct acpi_device_power_state states[4];     /* Power states (D0-D3) */
  18.296 +	struct acpi_device_power_state states[4];	/* Power states (D0-D3) */
  18.297  };
  18.298  
  18.299 -
  18.300  /* Performance Management */
  18.301  
  18.302  struct acpi_device_perf_flags {
  18.303 -	u8			reserved:8;
  18.304 +	u8 reserved:8;
  18.305  };
  18.306  
  18.307  struct acpi_device_perf_state {
  18.308  	struct {
  18.309 -		u8			valid:1;	
  18.310 -		u8			reserved:7;
  18.311 -	}			flags;
  18.312 -	u8			power;		  /* % Power (compared to P0) */
  18.313 -	u8			performance;	  /* % Performance (    "   ) */
  18.314 -	int			latency;	/* Px->P0 time (microseconds) */
  18.315 +		u8 valid:1;
  18.316 +		u8 reserved:7;
  18.317 +	} flags;
  18.318 +	u8 power;		/* % Power (compared to P0) */
  18.319 +	u8 performance;		/* % Performance (    "   ) */
  18.320 +	int latency;		/* Px->P0 time (microseconds) */
  18.321  };
  18.322  
  18.323  struct acpi_device_perf {
  18.324 -	int			state;
  18.325 +	int state;
  18.326  	struct acpi_device_perf_flags flags;
  18.327 -	int			state_count;
  18.328 +	int state_count;
  18.329  	struct acpi_device_perf_state *states;
  18.330  };
  18.331  
  18.332  /* Wakeup Management */
  18.333  struct acpi_device_wakeup_flags {
  18.334 -	u8	valid:1; /* Can successfully enable wakeup? */
  18.335 -	u8	run_wake:1; /* Run-Wake GPE devices */
  18.336 +	u8 valid:1;		/* Can successfully enable wakeup? */
  18.337 +	u8 run_wake:1;		/* Run-Wake GPE devices */
  18.338  };
  18.339  
  18.340  struct acpi_device_wakeup_state {
  18.341 -	u8	enabled:1;
  18.342 -	u8	active:1;
  18.343 +	u8 enabled:1;
  18.344  };
  18.345  
  18.346  struct acpi_device_wakeup {
  18.347 -	acpi_handle		gpe_device;
  18.348 -	acpi_integer		gpe_number;;
  18.349 -	acpi_integer		sleep_state;
  18.350 -	struct acpi_handle_list	resources;
  18.351 -	struct acpi_device_wakeup_state	state;
  18.352 -	struct acpi_device_wakeup_flags	flags;
  18.353 +	acpi_handle gpe_device;
  18.354 +	acpi_integer gpe_number;
  18.355 +	acpi_integer sleep_state;
  18.356 +	struct acpi_handle_list resources;
  18.357 +	struct acpi_device_wakeup_state state;
  18.358 +	struct acpi_device_wakeup_flags flags;
  18.359  };
  18.360  
  18.361  /* Device */
  18.362  
  18.363  struct acpi_device {
  18.364 -	acpi_handle		handle;
  18.365 -	struct acpi_device	*parent;
  18.366 -	struct list_head	children;
  18.367 -	struct list_head	node;
  18.368 -	struct list_head	wakeup_list;
  18.369 -	struct list_head	g_list;
  18.370 +	acpi_handle handle;
  18.371 +	struct acpi_device *parent;
  18.372 +	struct list_head children;
  18.373 +	struct list_head node;
  18.374 +	struct list_head wakeup_list;
  18.375 +	struct list_head g_list;
  18.376  	struct acpi_device_status status;
  18.377  	struct acpi_device_flags flags;
  18.378 -	struct acpi_device_pnp	pnp;
  18.379 +	struct acpi_device_pnp pnp;
  18.380  	struct acpi_device_power power;
  18.381  	struct acpi_device_wakeup wakeup;
  18.382 -	struct acpi_device_perf	performance;
  18.383 -	struct acpi_device_dir	dir;
  18.384 -	struct acpi_device_ops	ops;
  18.385 -	struct acpi_driver	*driver;
  18.386 -	void			*driver_data;
  18.387 -	struct kobject		kobj;
  18.388 +	struct acpi_device_perf performance;
  18.389 +	struct acpi_device_dir dir;
  18.390 +	struct acpi_device_ops ops;
  18.391 +	struct acpi_driver *driver;
  18.392 +	void *driver_data;
  18.393 +	struct device dev;
  18.394 +	struct acpi_bus_ops bus_ops;	/* workaround for different code path for hotplug */
  18.395 +	enum acpi_bus_removal_type removal_type;	/* indicate for different removal type */
  18.396  };
  18.397  
  18.398  #define acpi_driver_data(d)	((d)->driver_data)
  18.399 +#define to_acpi_device(d)	container_of(d, struct acpi_device, dev)
  18.400 +#define to_acpi_driver(d)	container_of(d, struct acpi_driver, drv)
  18.401  
  18.402 +/* acpi_device.dev.bus == &acpi_bus_type */
  18.403 +extern struct bus_type acpi_bus_type;
  18.404  
  18.405  /*
  18.406   * Events
  18.407 @@ -303,38 +310,80 @@ struct acpi_device {
  18.408   */
  18.409  
  18.410  struct acpi_bus_event {
  18.411 -	struct list_head	node;
  18.412 -	acpi_device_class	device_class;
  18.413 -	acpi_bus_id		bus_id;
  18.414 -	u32			type;
  18.415 -	u32			data;
  18.416 +	struct list_head node;
  18.417 +	acpi_device_class device_class;
  18.418 +	acpi_bus_id bus_id;
  18.419 +	u32 type;
  18.420 +	u32 data;
  18.421  };
  18.422  
  18.423 -extern struct subsystem acpi_subsys;
  18.424 -
  18.425 +extern struct kobject *acpi_kobj;
  18.426 +extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
  18.427 +void acpi_bus_private_data_handler(acpi_handle, u32, void *);
  18.428 +int acpi_bus_get_private_data(acpi_handle, void **);
  18.429 +extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
  18.430 +extern int register_acpi_notifier(struct notifier_block *);
  18.431 +extern int unregister_acpi_notifier(struct notifier_block *);
  18.432  /*
  18.433   * External Functions
  18.434   */
  18.435  
  18.436  int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
  18.437  void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context);
  18.438 -int acpi_bus_get_status (struct acpi_device *device);
  18.439 -int acpi_bus_get_power (acpi_handle handle, int *state);
  18.440 -int acpi_bus_set_power (acpi_handle handle, int state);
  18.441 -int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data);
  18.442 -int acpi_bus_receive_event (struct acpi_bus_event *event);
  18.443 -int acpi_bus_register_driver (struct acpi_driver *driver);
  18.444 -int acpi_bus_unregister_driver (struct acpi_driver *driver);
  18.445 -int acpi_bus_scan (struct acpi_device *start);
  18.446 +int acpi_bus_get_status(struct acpi_device *device);
  18.447 +int acpi_bus_get_power(acpi_handle handle, int *state);
  18.448 +int acpi_bus_set_power(acpi_handle handle, int state);
  18.449 +#ifdef CONFIG_ACPI_PROC_EVENT
  18.450 +int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
  18.451 +int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
  18.452 +int acpi_bus_receive_event(struct acpi_bus_event *event);
  18.453 +#else
  18.454 +static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
  18.455 +	{ return 0; }
  18.456 +#endif
  18.457 +int acpi_bus_register_driver(struct acpi_driver *driver);
  18.458 +void acpi_bus_unregister_driver(struct acpi_driver *driver);
  18.459 +int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
  18.460 +		 acpi_handle handle, int type);
  18.461  int acpi_bus_trim(struct acpi_device *start, int rmdevice);
  18.462 -int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
  18.463 -		acpi_handle handle, int type);
  18.464 -
  18.465 -
  18.466 -int acpi_match_ids (struct acpi_device	*device, char	*ids);
  18.467 +int acpi_bus_start(struct acpi_device *device);
  18.468 +acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
  18.469 +int acpi_match_device_ids(struct acpi_device *device,
  18.470 +			  const struct acpi_device_id *ids);
  18.471  int acpi_create_dir(struct acpi_device *);
  18.472  void acpi_remove_dir(struct acpi_device *);
  18.473  
  18.474 -#endif /*CONFIG_ACPI_BUS*/
  18.475 +/*
  18.476 + * Bind physical devices with ACPI devices
  18.477 + */
  18.478 +#include <linux/device.h>
  18.479 +struct acpi_bus_type {
  18.480 +	struct list_head list;
  18.481 +	struct bus_type *bus;
  18.482 +	/* For general devices under the bus */
  18.483 +	int (*find_device) (struct device *, acpi_handle *);
  18.484 +	/* For bridges, such as PCI root bridge, IDE controller */
  18.485 +	int (*find_bridge) (struct device *, acpi_handle *);
  18.486 +};
  18.487 +int register_acpi_bus_type(struct acpi_bus_type *);
  18.488 +int unregister_acpi_bus_type(struct acpi_bus_type *);
  18.489 +struct device *acpi_get_physical_device(acpi_handle);
  18.490 +/* helper */
  18.491 +acpi_handle acpi_get_child(acpi_handle, acpi_integer);
  18.492 +acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
  18.493 +#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
  18.494 +
  18.495 +#ifdef CONFIG_PM_SLEEP
  18.496 +int acpi_pm_device_sleep_state(struct device *, int, int *);
  18.497 +#else /* !CONFIG_PM_SLEEP */
  18.498 +static inline int acpi_pm_device_sleep_state(struct device *d, int w, int *p)
  18.499 +{
  18.500 +	if (p)
  18.501 +		*p = ACPI_STATE_D0;
  18.502 +	return ACPI_STATE_D3;
  18.503 +}
  18.504 +#endif /* !CONFIG_PM_SLEEP */
  18.505 +
  18.506 +#endif				/* CONFIG_ACPI */
  18.507  
  18.508  #endif /*__ACPI_BUS_H__*/
    19.1 --- a/xen/include/acpi/acpiosxf.h	Tue Mar 18 13:14:26 2008 +0000
    19.2 +++ b/xen/include/acpi/acpiosxf.h	Tue Mar 18 14:55:36 2008 +0000
    19.3 @@ -7,9 +7,8 @@
    19.4   *
    19.5   *****************************************************************************/
    19.6  
    19.7 -
    19.8  /*
    19.9 - * Copyright (C) 2000 - 2005, R. Byron Moore
   19.10 + * Copyright (C) 2000 - 2007, R. Byron Moore
   19.11   * All rights reserved.
   19.12   *
   19.13   * Redistribution and use in source and binary forms, with or without
   19.14 @@ -51,335 +50,234 @@
   19.15  #include "platform/acenv.h"
   19.16  #include "actypes.h"
   19.17  
   19.18 -
   19.19 -/* Priorities for acpi_os_queue_for_execution */
   19.20 +/* Types for acpi_os_execute */
   19.21  
   19.22 -#define OSD_PRIORITY_GPE            1
   19.23 -#define OSD_PRIORITY_HIGH           2
   19.24 -#define OSD_PRIORITY_MED            3
   19.25 -#define OSD_PRIORITY_LO             4
   19.26 +typedef enum {
   19.27 +	OSL_GLOBAL_LOCK_HANDLER,
   19.28 +	OSL_NOTIFY_HANDLER,
   19.29 +	OSL_GPE_HANDLER,
   19.30 +	OSL_DEBUGGER_THREAD,
   19.31 +	OSL_EC_POLL_HANDLER,
   19.32 +	OSL_EC_BURST_HANDLER
   19.33 +} acpi_execute_type;
   19.34  
   19.35  #define ACPI_NO_UNIT_LIMIT          ((u32) -1)
   19.36  #define ACPI_MUTEX_SEM              1
   19.37  
   19.38 -
   19.39  /* Functions for acpi_os_signal */
   19.40  
   19.41  #define ACPI_SIGNAL_FATAL           0
   19.42  #define ACPI_SIGNAL_BREAKPOINT      1
   19.43  
   19.44 -struct acpi_signal_fatal_info
   19.45 -{
   19.46 -	u32                             type;
   19.47 -	u32                             code;
   19.48 -	u32                             argument;
   19.49 +struct acpi_signal_fatal_info {
   19.50 +	u32 type;
   19.51 +	u32 code;
   19.52 +	u32 argument;
   19.53  };
   19.54  
   19.55 -
   19.56  /*
   19.57   * OSL Initialization and shutdown primitives
   19.58   */
   19.59 +acpi_status acpi_os_initialize(void);
   19.60  
   19.61 -acpi_status
   19.62 -acpi_os_initialize (
   19.63 -	void);
   19.64 -
   19.65 -acpi_status
   19.66 -acpi_os_terminate (
   19.67 -	void);
   19.68 -
   19.69 +acpi_status acpi_os_terminate(void);
   19.70  
   19.71  /*
   19.72   * ACPI Table interfaces
   19.73   */
   19.74 -
   19.75 -acpi_status
   19.76 -acpi_os_get_root_pointer (
   19.77 -	u32                             flags,
   19.78 -	struct acpi_pointer             *address);
   19.79 -
   19.80 -acpi_status
   19.81 -acpi_os_predefined_override (
   19.82 -	const struct acpi_predefined_names *init_val,
   19.83 -	acpi_string                         *new_val);
   19.84 -
   19.85 -acpi_status
   19.86 -acpi_os_table_override (
   19.87 -	struct acpi_table_header        *existing_table,
   19.88 -	struct acpi_table_header        **new_table);
   19.89 -
   19.90 -
   19.91 -/*
   19.92 - * Synchronization primitives
   19.93 - */
   19.94 -
   19.95 -acpi_status
   19.96 -acpi_os_create_semaphore (
   19.97 -	u32                             max_units,
   19.98 -	u32                             initial_units,
   19.99 -	acpi_handle                     *out_handle);
  19.100 +acpi_physical_address acpi_os_get_root_pointer(void);
  19.101  
  19.102  acpi_status
  19.103 -acpi_os_delete_semaphore (
  19.104 -	acpi_handle                     handle);
  19.105 -
  19.106 -acpi_status
  19.107 -acpi_os_wait_semaphore (
  19.108 -	acpi_handle                     handle,
  19.109 -	u32                             units,
  19.110 -	u16                             timeout);
  19.111 -
  19.112 -acpi_status
  19.113 -acpi_os_signal_semaphore (
  19.114 -	acpi_handle                     handle,
  19.115 -	u32                             units);
  19.116 +acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
  19.117 +			    acpi_string * new_val);
  19.118  
  19.119  acpi_status
  19.120 -acpi_os_create_lock (
  19.121 -	acpi_handle                     *out_handle);
  19.122 -
  19.123 -void
  19.124 -acpi_os_delete_lock (
  19.125 -	acpi_handle                     handle);
  19.126 +acpi_os_table_override(struct acpi_table_header *existing_table,
  19.127 +		       struct acpi_table_header **new_table);
  19.128  
  19.129 -void
  19.130 -acpi_os_acquire_lock (
  19.131 -	acpi_handle                     handle,
  19.132 -	u32                             flags);
  19.133 +/*
  19.134 + * Spinlock primitives
  19.135 + */
  19.136 +acpi_status acpi_os_create_lock(acpi_spinlock * out_handle);
  19.137  
  19.138 -void
  19.139 -acpi_os_release_lock (
  19.140 -	acpi_handle                     handle,
  19.141 -	u32                             flags);
  19.142 +void acpi_os_delete_lock(acpi_spinlock handle);
  19.143  
  19.144 +acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle);
  19.145 +
  19.146 +void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags);
  19.147 +
  19.148 +/*
  19.149 + * Semaphore primitives
  19.150 + */
  19.151 +acpi_status
  19.152 +acpi_os_create_semaphore(u32 max_units,
  19.153 +			 u32 initial_units, acpi_semaphore * out_handle);
  19.154 +
  19.155 +acpi_status acpi_os_delete_semaphore(acpi_semaphore handle);
  19.156 +
  19.157 +acpi_status
  19.158 +acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout);
  19.159 +
  19.160 +acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units);
  19.161 +
  19.162 +/*
  19.163 + * Mutex primitives
  19.164 + */
  19.165 +acpi_status acpi_os_create_mutex(acpi_mutex * out_handle);
  19.166 +
  19.167 +void acpi_os_delete_mutex(acpi_mutex handle);
  19.168 +
  19.169 +acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout);
  19.170 +
  19.171 +void acpi_os_release_mutex(acpi_mutex handle);
  19.172 +
  19.173 +/* Temporary macros for Mutex* interfaces, map to existing semaphore xfaces */
  19.174 +
  19.175 +#define acpi_os_create_mutex(out_handle)    acpi_os_create_semaphore (1, 1, out_handle)
  19.176 +#define acpi_os_delete_mutex(handle)        (void) acpi_os_delete_semaphore (handle)
  19.177 +#define acpi_os_acquire_mutex(handle,time)  acpi_os_wait_semaphore (handle, 1, time)
  19.178 +#define acpi_os_release_mutex(handle)       (void) acpi_os_signal_semaphore (handle, 1)
  19.179  
  19.180  /*
  19.181   * Memory allocation and mapping
  19.182   */
  19.183 -
  19.184 -void *
  19.185 -acpi_os_allocate (
  19.186 -	acpi_size                       size);
  19.187 -
  19.188 -void
  19.189 -acpi_os_free (
  19.190 -	void *                          memory);
  19.191 +void *acpi_os_allocate(acpi_size size);
  19.192  
  19.193 -acpi_status
  19.194 -acpi_os_map_memory (
  19.195 -	acpi_physical_address           physical_address,
  19.196 -	acpi_size                       size,
  19.197 -	void __iomem                  **logical_address);
  19.198 +void __iomem *acpi_os_map_memory(acpi_physical_address where,
  19.199 +				 acpi_native_uint length);
  19.200  
  19.201 -void
  19.202 -acpi_os_unmap_memory (
  19.203 -	void __iomem                  *logical_address,
  19.204 -	acpi_size                       size);
  19.205 +void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
  19.206  
  19.207  #ifdef ACPI_FUTURE_USAGE
  19.208  acpi_status
  19.209 -acpi_os_get_physical_address (
  19.210 -	void                            *logical_address,
  19.211 -	acpi_physical_address           *physical_address);
  19.212 +acpi_os_get_physical_address(void *logical_address,
  19.213 +			     acpi_physical_address * physical_address);
  19.214  #endif
  19.215  
  19.216 +/*
  19.217 + * Memory/Object Cache
  19.218 + */
  19.219 +acpi_status
  19.220 +acpi_os_create_cache(char *cache_name,
  19.221 +		     u16 object_size,
  19.222 +		     u16 max_depth, acpi_cache_t ** return_cache);
  19.223 +
  19.224 +acpi_status acpi_os_delete_cache(acpi_cache_t * cache);
  19.225 +
  19.226 +acpi_status acpi_os_purge_cache(acpi_cache_t * cache);
  19.227 +
  19.228 +void *acpi_os_acquire_object(acpi_cache_t * cache);
  19.229 +
  19.230 +acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object);
  19.231  
  19.232  /*
  19.233   * Interrupt handlers
  19.234   */
  19.235 +acpi_status
  19.236 +acpi_os_install_interrupt_handler(u32 gsi,
  19.237 +				  acpi_osd_handler service_routine,
  19.238 +				  void *context);
  19.239  
  19.240  acpi_status
  19.241 -acpi_os_install_interrupt_handler (
  19.242 -	u32                             gsi,
  19.243 -	acpi_osd_handler                service_routine,
  19.244 -	void                            *context);
  19.245 +acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
  19.246  
  19.247 -acpi_status
  19.248 -acpi_os_remove_interrupt_handler (
  19.249 -	u32                             gsi,
  19.250 -	acpi_osd_handler                service_routine);
  19.251 -
  19.252 +void acpi_os_gpe_count(u32 gpe_number);
  19.253 +void acpi_os_fixed_event_count(u32 fixed_event_number);
  19.254  
  19.255  /*
  19.256   * Threads and Scheduling
  19.257   */
  19.258 -
  19.259 -u32
  19.260 -acpi_os_get_thread_id (
  19.261 -	void);
  19.262 +acpi_thread_id acpi_os_get_thread_id(void);
  19.263  
  19.264  acpi_status
  19.265 -acpi_os_queue_for_execution (
  19.266 -	u32                             priority,
  19.267 -	acpi_osd_exec_callback          function,
  19.268 -	void                            *context);
  19.269 +acpi_os_execute(acpi_execute_type type,
  19.270 +		acpi_osd_exec_callback function, void *context);
  19.271  
  19.272 -void
  19.273 -acpi_os_wait_events_complete (
  19.274 -	void                            *context);
  19.275 +void acpi_os_wait_events_complete(void *context);
  19.276  
  19.277 -void
  19.278 -acpi_os_sleep (
  19.279 -	acpi_integer                    milliseconds);
  19.280 +void acpi_os_sleep(acpi_integer milliseconds);
  19.281  
  19.282 -void
  19.283 -acpi_os_stall (
  19.284 -	u32                             microseconds);
  19.285 -
  19.286 +void acpi_os_stall(u32 microseconds);
  19.287  
  19.288  /*
  19.289   * Platform and hardware-independent I/O interfaces
  19.290   */
  19.291 +acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width);
  19.292  
  19.293 -acpi_status
  19.294 -acpi_os_read_port (
  19.295 -	acpi_io_address                 address,
  19.296 -	u32                             *value,
  19.297 -	u32                             width);
  19.298 -
  19.299 -acpi_status
  19.300 -acpi_os_write_port (
  19.301 -	acpi_io_address                 address,
  19.302 -	u32                             value,
  19.303 -	u32                             width);
  19.304 -
  19.305 +acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width);
  19.306  
  19.307  /*
  19.308   * Platform and hardware-independent physical memory interfaces
  19.309   */
  19.310 +acpi_status
  19.311 +acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width);
  19.312  
  19.313  acpi_status
  19.314 -acpi_os_read_memory (
  19.315 -	acpi_physical_address           address,
  19.316 -	u32                             *value,
  19.317 -	u32                             width);
  19.318 -
  19.319 -acpi_status
  19.320 -acpi_os_write_memory (
  19.321 -	acpi_physical_address           address,
  19.322 -	u32                             value,
  19.323 -	u32                             width);
  19.324 -
  19.325 +acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width);
  19.326  
  19.327  /*
  19.328   * Platform and hardware-independent PCI configuration space access
  19.329   * Note: Can't use "Register" as a parameter, changed to "Reg" --
  19.330   * certain compilers complain.
  19.331   */
  19.332 +acpi_status
  19.333 +acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id,
  19.334 +			       u32 reg, u32 *value, u32 width);
  19.335  
  19.336  acpi_status
  19.337 -acpi_os_read_pci_configuration (
  19.338 -	struct acpi_pci_id              *pci_id,
  19.339 -	u32                             reg,
  19.340 -	void                            *value,
  19.341 -	u32                             width);
  19.342 -
  19.343 -acpi_status
  19.344 -acpi_os_write_pci_configuration (
  19.345 -	struct acpi_pci_id              *pci_id,
  19.346 -	u32                             reg,
  19.347 -	acpi_integer                    value,
  19.348 -	u32                             width);
  19.349 +acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id,
  19.350 +				u32 reg, acpi_integer value, u32 width);
  19.351  
  19.352  /*
  19.353   * Interim function needed for PCI IRQ routing
  19.354   */
  19.355 -
  19.356  void
  19.357 -acpi_os_derive_pci_id(
  19.358 -	acpi_handle                     rhandle,
  19.359 -	acpi_handle                     chandle,
  19.360 -	struct acpi_pci_id              **pci_id);
  19.361 +acpi_os_derive_pci_id(acpi_handle rhandle,
  19.362 +		      acpi_handle chandle, struct acpi_pci_id **pci_id);
  19.363  
  19.364  /*
  19.365   * Miscellaneous
  19.366   */
  19.367 -
  19.368 -u8
  19.369 -acpi_os_readable (
  19.370 -	void                            *pointer,
  19.371 -	acpi_size                       length);
  19.372 -
  19.373 -#ifdef ACPI_FUTURE_USAGE
  19.374 -u8
  19.375 -acpi_os_writable (
  19.376 -	void                            *pointer,
  19.377 -	acpi_size                       length);
  19.378 -#endif
  19.379 -
  19.380 -u64
  19.381 -acpi_os_get_timer (
  19.382 -	void);
  19.383 +acpi_status acpi_os_validate_interface(char *interface);
  19.384 +acpi_status acpi_osi_invalidate(char* interface);
  19.385  
  19.386  acpi_status
  19.387 -acpi_os_signal (
  19.388 -	u32                             function,
  19.389 -	void                            *info);
  19.390 +acpi_os_validate_address(u8 space_id, acpi_physical_address address,
  19.391 +			 acpi_size length, char *name);
  19.392 +
  19.393 +u64 acpi_os_get_timer(void);
  19.394 +
  19.395 +acpi_status acpi_os_signal(u32 function, void *info);
  19.396  
  19.397  /*
  19.398   * Debug print routines
  19.399   */
  19.400 -
  19.401 -void ACPI_INTERNAL_VAR_XFACE
  19.402 -acpi_os_printf (
  19.403 -	const char                      *format,
  19.404 -	...);
  19.405 +void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
  19.406  
  19.407 -void
  19.408 -acpi_os_vprintf (
  19.409 -	const char                      *format,
  19.410 -	va_list                 args);
  19.411 +void acpi_os_vprintf(const char *format, va_list args);
  19.412  
  19.413 -void
  19.414 -acpi_os_redirect_output (
  19.415 -	void                            *destination);
  19.416 +void acpi_os_redirect_output(void *destination);
  19.417  
  19.418 -
  19.419 +#ifdef ACPI_FUTURE_USAGE
  19.420  /*
  19.421   * Debug input
  19.422   */
  19.423 -
  19.424 -#ifdef ACPI_FUTURE_USAGE
  19.425 -u32
  19.426 -acpi_os_get_line (
  19.427 -	char                            *buffer);
  19.428 +u32 acpi_os_get_line(char *buffer);
  19.429  #endif
  19.430  
  19.431 -
  19.432  /*
  19.433   * Directory manipulation
  19.434   */
  19.435 -
  19.436 -void *
  19.437 -acpi_os_open_directory (
  19.438 -	char                            *pathname,
  19.439 -	char                            *wildcard_spec,
  19.440 -	char                            requested_file_type);
  19.441 +void *acpi_os_open_directory(char *pathname,
  19.442 +			     char *wildcard_spec, char requested_file_type);
  19.443  
  19.444  /* requeste_file_type values */
  19.445  
  19.446  #define REQUEST_FILE_ONLY                   0
  19.447  #define REQUEST_DIR_ONLY                    1
  19.448  
  19.449 -
  19.450 -char *
  19.451 -acpi_os_get_next_filename (
  19.452 -	void                            *dir_handle);
  19.453 -
  19.454 -void
  19.455 -acpi_os_close_directory (
  19.456 -	void                            *dir_handle);
  19.457 +char *acpi_os_get_next_filename(void *dir_handle);
  19.458  
  19.459 -/*
  19.460 - * Debug
  19.461 - */
  19.462 +void acpi_os_close_directory(void *dir_handle);
  19.463  
  19.464 -void
  19.465 -acpi_os_dbg_assert(
  19.466 -	void                            *failed_assertion,
  19.467 -	void                            *file_name,
  19.468 -	u32                             line_number,
  19.469 -	char                            *message);
  19.470 -
  19.471 -
  19.472 -#endif /* __ACPIOSXF_H__ */
  19.473 +#endif				/* __ACPIOSXF_H__ */
    20.1 --- a/xen/include/acpi/acpixf.h	Tue Mar 18 13:14:26 2008 +0000
    20.2 +++ b/xen/include/acpi/acpixf.h	Tue Mar 18 14:55:36 2008 +0000
    20.3 @@ -6,7 +6,7 @@
    20.4   *****************************************************************************/
    20.5  
    20.6  /*
    20.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    20.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    20.9   * All rights reserved.
   20.10   *
   20.11   * Redistribution and use in source and binary forms, with or without
   20.12 @@ -42,456 +42,301 @@
   20.13   * POSSIBILITY OF SUCH DAMAGES.
   20.14   */
   20.15  
   20.16 -
   20.17  #ifndef __ACXFACE_H__
   20.18  #define __ACXFACE_H__
   20.19  
   20.20  #include "actypes.h"
   20.21  #include "actbl.h"
   20.22  
   20.23 -
   20.24 - /*
   20.25 +/*
   20.26   * Global interfaces
   20.27   */
   20.28 -
   20.29 -acpi_status
   20.30 -acpi_initialize_subsystem (
   20.31 -	void);
   20.32 -
   20.33  acpi_status
   20.34 -acpi_enable_subsystem (
   20.35 -	u32                             flags);
   20.36 +acpi_initialize_tables(struct acpi_table_desc *initial_storage,
   20.37 +		       u32 initial_table_count, u8 allow_resize);
   20.38  
   20.39 -acpi_status
   20.40 -acpi_initialize_objects (
   20.41 -	u32                             flags);
   20.42 +acpi_status acpi_initialize_subsystem(void);
   20.43  
   20.44 -acpi_status
   20.45 -acpi_terminate (
   20.46 -	void);
   20.47 +acpi_status acpi_enable_subsystem(u32 flags);
   20.48 +
   20.49 +acpi_status acpi_initialize_objects(u32 flags);
   20.50 +
   20.51 +acpi_status acpi_terminate(void);
   20.52 +
   20.53 +#ifdef ACPI_FUTURE_USAGE
   20.54 +acpi_status acpi_subsystem_status(void);
   20.55 +#endif
   20.56 +
   20.57 +acpi_status acpi_enable(void);
   20.58 +
   20.59 +acpi_status acpi_disable(void);
   20.60 +
   20.61 +#ifdef ACPI_FUTURE_USAGE
   20.62 +acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
   20.63 +#endif
   20.64 +
   20.65 +const char *acpi_format_exception(acpi_status exception);
   20.66 +
   20.67 +acpi_status acpi_purge_cached_objects(void);
   20.68  
   20.69  #ifdef ACPI_FUTURE_USAGE
   20.70  acpi_status
   20.71 -acpi_subsystem_status (
   20.72 -	void);
   20.73 -#endif
   20.74 -
   20.75 -acpi_status
   20.76 -acpi_enable (
   20.77 -	void);
   20.78 -
   20.79 -acpi_status
   20.80 -acpi_disable (
   20.81 -	void);
   20.82 -
   20.83 -#ifdef ACPI_FUTURE_USAGE
   20.84 -acpi_status
   20.85 -acpi_get_system_info (
   20.86 -	struct acpi_buffer              *ret_buffer);
   20.87 -#endif
   20.88 -
   20.89 -const char *
   20.90 -acpi_format_exception (
   20.91 -	acpi_status                     exception);
   20.92 -
   20.93 -acpi_status
   20.94 -acpi_purge_cached_objects (
   20.95 -	void);
   20.96 -
   20.97 -#ifdef ACPI_FUTURE_USAGE
   20.98 -acpi_status
   20.99 -acpi_install_initialization_handler (
  20.100 -	acpi_init_handler               handler,
  20.101 -	u32                             function);
  20.102 +acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
  20.103  #endif
  20.104  
  20.105  /*
  20.106 - * ACPI Memory manager
  20.107 + * ACPI Memory management
  20.108   */
  20.109 -
  20.110 -void *
  20.111 -acpi_allocate (
  20.112 -	u32                             size);
  20.113 +void *acpi_allocate(u32 size);
  20.114  
  20.115 -void *
  20.116 -acpi_callocate (
  20.117 -	u32                             size);
  20.118 +void *acpi_callocate(u32 size);
  20.119  
  20.120 -void
  20.121 -acpi_free (
  20.122 -	void                            *address);
  20.123 -
  20.124 +void acpi_free(void *address);
  20.125  
  20.126  /*
  20.127   * ACPI table manipulation interfaces
  20.128   */
  20.129 -
  20.130 -acpi_status
  20.131 -acpi_find_root_pointer (
  20.132 -	u32                             flags,
  20.133 -	struct acpi_pointer             *rsdp_address);
  20.134 +acpi_status acpi_reallocate_root_table(void);
  20.135  
  20.136 -acpi_status
  20.137 -acpi_load_tables (
  20.138 -	void);
  20.139 +acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address);
  20.140  
  20.141 -#ifdef ACPI_FUTURE_USAGE
  20.142 -acpi_status
  20.143 -acpi_load_table (
  20.144 -	struct acpi_table_header        *table_ptr);
  20.145 +acpi_status acpi_load_tables(void);
  20.146 +
  20.147 +acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
  20.148 +
  20.149 +acpi_status acpi_unload_table_id(acpi_owner_id id);
  20.150  
  20.151  acpi_status
  20.152 -acpi_unload_table (
  20.153 -	acpi_table_type                 table_type);
  20.154 -
  20.155 -acpi_status
  20.156 -acpi_get_table_header (
  20.157 -	acpi_table_type                 table_type,
  20.158 -	u32                             instance,
  20.159 -	struct acpi_table_header        *out_table_header);
  20.160 -#endif  /*  ACPI_FUTURE_USAGE  */
  20.161 +acpi_get_table_header(acpi_string signature,
  20.162 +		      acpi_native_uint instance,
  20.163 +		      struct acpi_table_header *out_table_header);
  20.164  
  20.165  acpi_status
  20.166 -acpi_get_table (
  20.167 -	acpi_table_type                 table_type,
  20.168 -	u32                             instance,
  20.169 -	struct acpi_buffer              *ret_buffer);
  20.170 +acpi_get_table(acpi_string signature,
  20.171 +	       acpi_native_uint instance, struct acpi_table_header **out_table);
  20.172  
  20.173  acpi_status
  20.174 -acpi_get_firmware_table (
  20.175 -	acpi_string                     signature,
  20.176 -	u32                             instance,
  20.177 -	u32                             flags,
  20.178 -	struct acpi_table_header        **table_pointer);
  20.179 -
  20.180 +acpi_get_table_by_index(acpi_native_uint table_index,
  20.181 +			struct acpi_table_header **out_table);
  20.182  
  20.183  /*
  20.184   * Namespace and name interfaces
  20.185   */
  20.186 -
  20.187  acpi_status
  20.188 -acpi_walk_namespace (
  20.189 -	acpi_object_type                type,
  20.190 -	acpi_handle                     start_object,
  20.191 -	u32                             max_depth,
  20.192 -	acpi_walk_callback              user_function,
  20.193 -	void                            *context,
  20.194 -	void                            **return_value);
  20.195 -
  20.196 -acpi_status
  20.197 -acpi_get_devices (
  20.198 -	char                            *HID,
  20.199 -	acpi_walk_callback              user_function,
  20.200 -	void                            *context,
  20.201 -	void                            **return_value);
  20.202 +acpi_walk_namespace(acpi_object_type type,
  20.203 +		    acpi_handle start_object,
  20.204 +		    u32 max_depth,
  20.205 +		    acpi_walk_callback user_function,
  20.206 +		    void *context, void **return_value);
  20.207  
  20.208  acpi_status
  20.209 -acpi_get_name (
  20.210 -	acpi_handle                     handle,
  20.211 -	u32                             name_type,
  20.212 -	struct acpi_buffer              *ret_path_ptr);
  20.213 -
  20.214 -acpi_status
  20.215 -acpi_get_handle (
  20.216 -	acpi_handle                     parent,
  20.217 -	acpi_string                     pathname,
  20.218 -	acpi_handle                     *ret_handle);
  20.219 +acpi_get_devices(const char *HID,
  20.220 +		 acpi_walk_callback user_function,
  20.221 +		 void *context, void **return_value);
  20.222  
  20.223  acpi_status
  20.224 -acpi_attach_data (
  20.225 -	acpi_handle                     obj_handle,
  20.226 -	acpi_object_handler             handler,
  20.227 -	void                            *data);
  20.228 +acpi_get_name(acpi_handle handle,
  20.229 +	      u32 name_type, struct acpi_buffer *ret_path_ptr);
  20.230  
  20.231  acpi_status
  20.232 -acpi_detach_data (
  20.233 -	acpi_handle                     obj_handle,
  20.234 -	acpi_object_handler             handler);
  20.235 +acpi_get_handle(acpi_handle parent,
  20.236 +		acpi_string pathname, acpi_handle * ret_handle);
  20.237  
  20.238  acpi_status
  20.239 -acpi_get_data (
  20.240 -	acpi_handle                     obj_handle,
  20.241 -	acpi_object_handler             handler,
  20.242 -	void                            **data);
  20.243 +acpi_attach_data(acpi_handle obj_handle,
  20.244 +		 acpi_object_handler handler, void *data);
  20.245  
  20.246 +acpi_status
  20.247 +acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler);
  20.248 +
  20.249 +acpi_status
  20.250 +acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data);
  20.251 +
  20.252 +acpi_status
  20.253 +acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
  20.254  
  20.255  /*
  20.256   * Object manipulation and enumeration
  20.257   */
  20.258 -
  20.259  acpi_status
  20.260 -acpi_evaluate_object (
  20.261 -	acpi_handle                     object,
  20.262 -	acpi_string                     pathname,
  20.263 -	struct acpi_object_list         *parameter_objects,
  20.264 -	struct acpi_buffer              *return_object_buffer);
  20.265 +acpi_evaluate_object(acpi_handle object,
  20.266 +		     acpi_string pathname,
  20.267 +		     struct acpi_object_list *parameter_objects,
  20.268 +		     struct acpi_buffer *return_object_buffer);
  20.269  
  20.270  #ifdef ACPI_FUTURE_USAGE
  20.271  acpi_status
  20.272 -acpi_evaluate_object_typed (
  20.273 -	acpi_handle                     object,
  20.274 -	acpi_string                     pathname,
  20.275 -	struct acpi_object_list         *external_params,
  20.276 -	struct acpi_buffer              *return_buffer,
  20.277 -	acpi_object_type                return_type);
  20.278 +acpi_evaluate_object_typed(acpi_handle object,
  20.279 +			   acpi_string pathname,
  20.280 +			   struct acpi_object_list *external_params,
  20.281 +			   struct acpi_buffer *return_buffer,
  20.282 +			   acpi_object_type return_type);
  20.283  #endif
  20.284  
  20.285  acpi_status
  20.286 -acpi_get_object_info (
  20.287 -	acpi_handle                     handle,
  20.288 -	struct acpi_buffer              *return_buffer);
  20.289 +acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer);
  20.290  
  20.291  acpi_status
  20.292 -acpi_get_next_object (
  20.293 -	acpi_object_type                type,
  20.294 -	acpi_handle                     parent,
  20.295 -	acpi_handle                     child,
  20.296 -	acpi_handle                     *out_handle);
  20.297 +acpi_get_next_object(acpi_object_type type,
  20.298 +		     acpi_handle parent,
  20.299 +		     acpi_handle child, acpi_handle * out_handle);
  20.300  
  20.301 -acpi_status
  20.302 -acpi_get_type (
  20.303 -	acpi_handle                     object,
  20.304 -	acpi_object_type                *out_type);
  20.305 +acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type);
  20.306  
  20.307 -acpi_status
  20.308 -acpi_get_parent (
  20.309 -	acpi_handle                     object,
  20.310 -	acpi_handle                     *out_handle);
  20.311 +acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
  20.312  
  20.313 +acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
  20.314  
  20.315  /*
  20.316   * Event handler interfaces
  20.317   */
  20.318 -
  20.319 -acpi_status
  20.320 -acpi_install_fixed_event_handler (
  20.321 -	u32                             acpi_event,
  20.322 -	acpi_event_handler              handler,
  20.323 -	void                            *context);
  20.324 -
  20.325  acpi_status
  20.326 -acpi_remove_fixed_event_handler (
  20.327 -	u32                             acpi_event,
  20.328 -	acpi_event_handler              handler);
  20.329 -
  20.330 -acpi_status
  20.331 -acpi_install_notify_handler (
  20.332 -	acpi_handle                     device,
  20.333 -	u32                             handler_type,
  20.334 -	acpi_notify_handler             handler,
  20.335 -	void                            *context);
  20.336 -
  20.337 -acpi_status
  20.338 -acpi_remove_notify_handler (
  20.339 -	acpi_handle                     device,
  20.340 -	u32                             handler_type,
  20.341 -	acpi_notify_handler             handler);
  20.342 +acpi_install_fixed_event_handler(u32 acpi_event,
  20.343 +				 acpi_event_handler handler, void *context);
  20.344  
  20.345  acpi_status
  20.346 -acpi_install_address_space_handler (
  20.347 -	acpi_handle                     device,
  20.348 -	acpi_adr_space_type             space_id,
  20.349 -	acpi_adr_space_handler          handler,
  20.350 -	acpi_adr_space_setup            setup,
  20.351 -	void                            *context);
  20.352 +acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler);
  20.353  
  20.354  acpi_status
  20.355 -acpi_remove_address_space_handler (
  20.356 -	acpi_handle                     device,
  20.357 -	acpi_adr_space_type             space_id,
  20.358 -	acpi_adr_space_handler          handler);
  20.359 +acpi_install_notify_handler(acpi_handle device,
  20.360 +			    u32 handler_type,
  20.361 +			    acpi_notify_handler handler, void *context);
  20.362  
  20.363  acpi_status
  20.364 -acpi_install_gpe_handler (
  20.365 -	acpi_handle                     gpe_device,
  20.366 -	u32                             gpe_number,
  20.367 -	u32                             type,
  20.368 -	acpi_event_handler              address,
  20.369 -	void                            *context);
  20.370 +acpi_remove_notify_handler(acpi_handle device,
  20.371 +			   u32 handler_type, acpi_notify_handler handler);
  20.372 +
  20.373 +acpi_status
  20.374 +acpi_install_address_space_handler(acpi_handle device,
  20.375 +				   acpi_adr_space_type space_id,
  20.376 +				   acpi_adr_space_handler handler,
  20.377 +				   acpi_adr_space_setup setup, void *context);
  20.378 +
  20.379 +acpi_status
  20.380 +acpi_remove_address_space_handler(acpi_handle device,
  20.381 +				  acpi_adr_space_type space_id,
  20.382 +				  acpi_adr_space_handler handler);
  20.383 +
  20.384 +acpi_status
  20.385 +acpi_install_gpe_handler(acpi_handle gpe_device,
  20.386 +			 u32 gpe_number,
  20.387 +			 u32 type, acpi_event_handler address, void *context);
  20.388  
  20.389  #ifdef ACPI_FUTURE_USAGE
  20.390 -acpi_status
  20.391 -acpi_install_exception_handler (
  20.392 -	acpi_exception_handler          handler);
  20.393 +acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
  20.394  #endif
  20.395  
  20.396 -
  20.397  /*
  20.398   * Event interfaces
  20.399   */
  20.400 +acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle);
  20.401  
  20.402 -acpi_status
  20.403 -acpi_acquire_global_lock (
  20.404 -	u16                             timeout,
  20.405 -	u32                             *handle);
  20.406 -
  20.407 -acpi_status
  20.408 -acpi_release_global_lock (
  20.409 -	u32                             handle);
  20.410 +acpi_status acpi_release_global_lock(u32 handle);
  20.411  
  20.412  acpi_status
  20.413 -acpi_remove_gpe_handler (
  20.414 -	acpi_handle                     gpe_device,
  20.415 -	u32                             gpe_number,
  20.416 -	acpi_event_handler              address);
  20.417 +acpi_remove_gpe_handler(acpi_handle gpe_device,
  20.418 +			u32 gpe_number, acpi_event_handler address);
  20.419  
  20.420 -acpi_status
  20.421 -acpi_enable_event (
  20.422 -	u32                             event,
  20.423 -	u32                             flags);
  20.424 +acpi_status acpi_enable_event(u32 event, u32 flags);
  20.425  
  20.426 -acpi_status
  20.427 -acpi_disable_event (
  20.428 -	u32                             event,
  20.429 -	u32                             flags);
  20.430 +acpi_status acpi_disable_event(u32 event, u32 flags);
  20.431  
  20.432 -acpi_status
  20.433 -acpi_clear_event (
  20.434 -	u32                             event);
  20.435 +acpi_status acpi_clear_event(u32 event);
  20.436 +
  20.437 +#ifdef ACPI_FUTURE_USAGE
  20.438 +acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status);
  20.439 +#endif				/*  ACPI_FUTURE_USAGE  */
  20.440 +
  20.441 +acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type);
  20.442 +
  20.443 +acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
  20.444 +
  20.445 +acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
  20.446 +
  20.447 +acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags);
  20.448  
  20.449  #ifdef ACPI_FUTURE_USAGE
  20.450  acpi_status
  20.451 -acpi_get_event_status (
  20.452 -	u32                             event,
  20.453 -	acpi_event_status               *event_status);
  20.454 -#endif  /*  ACPI_FUTURE_USAGE  */
  20.455 -
  20.456 -acpi_status
  20.457 -acpi_set_gpe_type (
  20.458 -	acpi_handle                     gpe_device,
  20.459 -	u32                             gpe_number,
  20.460 -	u8                              type);
  20.461 -
  20.462 -acpi_status
  20.463 -acpi_enable_gpe (
  20.464 -	acpi_handle                     gpe_device,
  20.465 -	u32                             gpe_number,
  20.466 -	u32                             flags);
  20.467 -
  20.468 -acpi_status
  20.469 -acpi_disable_gpe (
  20.470 -	acpi_handle                     gpe_device,
  20.471 -	u32                             gpe_number,
  20.472 -	u32                             flags);
  20.473 +acpi_get_gpe_status(acpi_handle gpe_device,
  20.474 +		    u32 gpe_number,
  20.475 +		    u32 flags, acpi_event_status * event_status);
  20.476 +#endif				/*  ACPI_FUTURE_USAGE  */
  20.477  
  20.478  acpi_status
  20.479 -acpi_clear_gpe (
  20.480 -	acpi_handle                     gpe_device,
  20.481 -	u32                             gpe_number,
  20.482 -	u32                             flags);
  20.483 +acpi_install_gpe_block(acpi_handle gpe_device,
  20.484 +		       struct acpi_generic_address *gpe_block_address,
  20.485 +		       u32 register_count, u32 interrupt_number);
  20.486  
  20.487 -#ifdef ACPI_FUTURE_USAGE
  20.488 -acpi_status
  20.489 -acpi_get_gpe_status (
  20.490 -	acpi_handle                     gpe_device,
  20.491 -	u32                             gpe_number,
  20.492 -	u32                             flags,
  20.493 -	acpi_event_status               *event_status);
  20.494 -#endif  /*  ACPI_FUTURE_USAGE  */
  20.495 -
  20.496 -acpi_status
  20.497 -acpi_install_gpe_block (
  20.498 -	acpi_handle                     gpe_device,
  20.499 -	struct acpi_generic_address     *gpe_block_address,
  20.500 -	u32                             register_count,
  20.501 -	u32                             interrupt_level);
  20.502 -
  20.503 -acpi_status
  20.504 -acpi_remove_gpe_block (
  20.505 -	acpi_handle                     gpe_device);
  20.506 -
  20.507 +acpi_status acpi_remove_gpe_block(acpi_handle gpe_device);
  20.508  
  20.509  /*
  20.510   * Resource interfaces
  20.511   */
  20.512 -
  20.513  typedef
  20.514 -acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
  20.515 -	struct acpi_resource            *resource,
  20.516 -	void                            *context);
  20.517 -
  20.518 +acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
  20.519 +					   void *context);
  20.520  
  20.521  acpi_status
  20.522 -acpi_get_current_resources(
  20.523 -	acpi_handle                     device_handle,
  20.524 -	struct acpi_buffer              *ret_buffer);
  20.525 +acpi_get_vendor_resource(acpi_handle device_handle,
  20.526 +			 char *name,
  20.527 +			 struct acpi_vendor_uuid *uuid,
  20.528 +			 struct acpi_buffer *ret_buffer);
  20.529 +
  20.530 +acpi_status
  20.531 +acpi_get_current_resources(acpi_handle device_handle,
  20.532 +			   struct acpi_buffer *ret_buffer);
  20.533  
  20.534  #ifdef ACPI_FUTURE_USAGE
  20.535  acpi_status
  20.536 -acpi_get_possible_resources(
  20.537 -	acpi_handle                     device_handle,
  20.538 -	struct acpi_buffer              *ret_buffer);
  20.539 +acpi_get_possible_resources(acpi_handle device_handle,
  20.540 +			    struct acpi_buffer *ret_buffer);
  20.541  #endif
  20.542  
  20.543  acpi_status
  20.544 -acpi_walk_resources (
  20.545 -	acpi_handle                             device_handle,
  20.546 -	char                                    *path,
  20.547 -	ACPI_WALK_RESOURCE_CALLBACK     user_function,
  20.548 -	void                                    *context);
  20.549 +acpi_walk_resources(acpi_handle device_handle,
  20.550 +		    char *name,
  20.551 +		    acpi_walk_resource_callback user_function, void *context);
  20.552  
  20.553  acpi_status
  20.554 -acpi_set_current_resources (
  20.555 -	acpi_handle                     device_handle,
  20.556 -	struct acpi_buffer              *in_buffer);
  20.557 +acpi_set_current_resources(acpi_handle device_handle,
  20.558 +			   struct acpi_buffer *in_buffer);
  20.559  
  20.560  acpi_status
  20.561 -acpi_get_irq_routing_table (
  20.562 -	acpi_handle                     bus_device_handle,
  20.563 -	struct acpi_buffer              *ret_buffer);
  20.564 +acpi_get_irq_routing_table(acpi_handle bus_device_handle,
  20.565 +			   struct acpi_buffer *ret_buffer);
  20.566  
  20.567  acpi_status
  20.568 -acpi_resource_to_address64 (
  20.569 -	struct acpi_resource            *resource,
  20.570 -	struct acpi_resource_address64 *out);
  20.571 +acpi_resource_to_address64(struct acpi_resource *resource,
  20.572 +			   struct acpi_resource_address64 *out);
  20.573  
  20.574  /*
  20.575   * Hardware (ACPI device) interfaces
  20.576   */
  20.577 +acpi_status acpi_get_register(u32 register_id, u32 * return_value);
  20.578  
  20.579 -acpi_status
  20.580 -acpi_get_register (
  20.581 -	u32                             register_id,
  20.582 -	u32                             *return_value,
  20.583 -	u32                             flags);
  20.584 +acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
  20.585 +
  20.586 +acpi_status acpi_set_register(u32 register_id, u32 value);
  20.587  
  20.588  acpi_status
  20.589 -acpi_set_register (
  20.590 -	u32                             register_id,
  20.591 -	u32                             value,
  20.592 -	u32                             flags);
  20.593 -
  20.594 -acpi_status
  20.595 -acpi_set_firmware_waking_vector (
  20.596 -	acpi_physical_address           physical_address);
  20.597 +acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
  20.598  
  20.599  #ifdef ACPI_FUTURE_USAGE
  20.600  acpi_status
  20.601 -acpi_get_firmware_waking_vector (
  20.602 -	acpi_physical_address           *physical_address);
  20.603 +acpi_get_firmware_waking_vector(acpi_physical_address * physical_address);
  20.604  #endif
  20.605  
  20.606  acpi_status
  20.607 -acpi_get_sleep_type_data (
  20.608 -	u8                              sleep_state,
  20.609 -	u8                              *slp_typ_a,
  20.610 -	u8                              *slp_typ_b);
  20.611 -
  20.612 -acpi_status
  20.613 -acpi_enter_sleep_state_prep (
  20.614 -	u8                              sleep_state);
  20.615 +acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);
  20.616  
  20.617 -acpi_status asmlinkage
  20.618 -acpi_enter_sleep_state (
  20.619 -	u8                              sleep_state);
  20.620 +acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
  20.621  
  20.622 -acpi_status asmlinkage
  20.623 -acpi_enter_sleep_state_s4bios (
  20.624 -	void);
  20.625 +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state);
  20.626  
  20.627 -acpi_status
  20.628 -acpi_leave_sleep_state (
  20.629 -	u8                              sleep_state);
  20.630 +acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void);
  20.631  
  20.632 +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
  20.633  
  20.634 -#endif /* __ACXFACE_H__ */
  20.635 +acpi_status acpi_leave_sleep_state(u8 sleep_state);
  20.636 +
  20.637 +#endif				/* __ACXFACE_H__ */
    21.1 --- a/xen/include/acpi/acstruct.h	Tue Mar 18 13:14:26 2008 +0000
    21.2 +++ b/xen/include/acpi/acstruct.h	Tue Mar 18 14:55:36 2008 +0000
    21.3 @@ -5,7 +5,7 @@
    21.4   *****************************************************************************/
    21.5  
    21.6  /*
    21.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    21.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    21.9   * All rights reserved.
   21.10   *
   21.11   * Redistribution and use in source and binary forms, with or without
   21.12 @@ -44,6 +44,7 @@
   21.13  #ifndef __ACSTRUCT_H__
   21.14  #define __ACSTRUCT_H__
   21.15  
   21.16 +/* acpisrc:struct_defs -- for acpisrc conversion */
   21.17  
   21.18  /*****************************************************************************
   21.19   *
   21.20 @@ -51,166 +52,144 @@
   21.21   *
   21.22   ****************************************************************************/
   21.23  
   21.24 -
   21.25  /*
   21.26 - * Walk state - current state of a parse tree walk.  Used for both a leisurely stroll through
   21.27 - * the tree (for whatever reason), and for control method execution.
   21.28 + * Walk state - current state of a parse tree walk.  Used for both a leisurely
   21.29 + * stroll through the tree (for whatever reason), and for control method
   21.30 + * execution.
   21.31   */
   21.32 -
   21.33  #define ACPI_NEXT_OP_DOWNWARD       1
   21.34  #define ACPI_NEXT_OP_UPWARD         2
   21.35  
   21.36 +/*
   21.37 + * Groups of definitions for walk_type used for different implementations of
   21.38 + * walkers (never simultaneously) - flags for interpreter:
   21.39 + */
   21.40  #define ACPI_WALK_NON_METHOD        0
   21.41 -#define ACPI_WALK_METHOD            1
   21.42 -#define ACPI_WALK_METHOD_RESTART    2
   21.43 -#define ACPI_WALK_CONST_REQUIRED    3
   21.44 -#define ACPI_WALK_CONST_OPTIONAL    4
   21.45 -
   21.46 -struct acpi_walk_state
   21.47 -{
   21.48 -	u8                                  data_type;                          /* To differentiate various internal objs MUST BE FIRST!*/\
   21.49 -	u8                                  walk_type;
   21.50 -	acpi_owner_id                       owner_id;                           /* Owner of objects created during the walk */
   21.51 -	u8                                  last_predicate;                     /* Result of last predicate */
   21.52 -	u8                                  reserved;                           /* For alignment */
   21.53 -	u8                                  current_result;                     /* */
   21.54 -	u8                                  next_op_info;                       /* Info about next_op */
   21.55 -	u8                                  num_operands;                       /* Stack pointer for Operands[] array */
   21.56 -	u8                                  return_used;
   21.57 -	u16                                 opcode;                             /* Current AML opcode */
   21.58 -	u8                                  scope_depth;
   21.59 -	u8                                  reserved1;
   21.60 -	u32                                 arg_count;                          /* push for fixed or var args */
   21.61 -	u32                                 aml_offset;
   21.62 -	u32                                 arg_types;
   21.63 -	u32                                 method_breakpoint;                  /* For single stepping */
   21.64 -	u32                                 user_breakpoint;                    /* User AML breakpoint */
   21.65 -	u32                                 parse_flags;
   21.66 -	u32                                 prev_arg_types;
   21.67 +#define ACPI_WALK_METHOD            0x01
   21.68 +#define ACPI_WALK_METHOD_RESTART    0x02
   21.69  
   21.70 -	u8                                  *aml_last_while;
   21.71 -	struct acpi_namespace_node          arguments[ACPI_METHOD_NUM_ARGS];    /* Control method arguments */
   21.72 -	union acpi_operand_object           **caller_return_desc;
   21.73 -	union acpi_generic_state            *control_state;                     /* List of control states (nested IFs) */
   21.74 -	struct acpi_namespace_node          *deferred_node;                     /* Used when executing deferred opcodes */
   21.75 -	struct acpi_gpe_event_info          *gpe_event_info;                    /* Info for GPE (_Lxx/_Exx methods only */
   21.76 -	struct acpi_namespace_node          local_variables[ACPI_METHOD_NUM_LOCALS];    /* Control method locals */
   21.77 -	struct acpi_namespace_node          *method_call_node;                  /* Called method Node*/
   21.78 -	union acpi_parse_object             *method_call_op;                    /* method_call Op if running a method */
   21.79 -	union acpi_operand_object           *method_desc;                       /* Method descriptor if running a method */
   21.80 -	struct acpi_namespace_node          *method_node;                       /* Method node if running a method. */
   21.81 -	union acpi_parse_object             *op;                                /* Current parser op */
   21.82 -	union acpi_operand_object           *operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
   21.83 -	const struct acpi_opcode_info       *op_info;                           /* Info on current opcode */
   21.84 -	union acpi_parse_object             *origin;                            /* Start of walk [Obsolete] */
   21.85 -	union acpi_operand_object           **params;
   21.86 -	struct acpi_parse_state             parser_state;                       /* Current state of parser */
   21.87 -	union acpi_operand_object           *result_obj;
   21.88 -	union acpi_generic_state            *results;                           /* Stack of accumulated results */
   21.89 -	union acpi_operand_object           *return_desc;                       /* Return object, if any */
   21.90 -	union acpi_generic_state            *scope_info;                        /* Stack of nested scopes */
   21.91 +/* Flags for i_aSL compiler only */
   21.92  
   21.93 -	union acpi_parse_object             *prev_op;                           /* Last op that was processed */
   21.94 -	union acpi_parse_object             *next_op;                           /* next op to be processed */
   21.95 -	acpi_parse_downwards                descending_callback;
   21.96 -	acpi_parse_upwards                  ascending_callback;
   21.97 -	struct acpi_thread_state            *thread;
   21.98 -	struct acpi_walk_state              *next;                              /* Next walk_state in list */
   21.99 +#define ACPI_WALK_CONST_REQUIRED    0x10
  21.100 +#define ACPI_WALK_CONST_OPTIONAL    0x20
  21.101 +
  21.102 +struct acpi_walk_state {
  21.103 +	struct acpi_walk_state *next;	/* Next walk_state in list */
  21.104 +	u8 descriptor_type;	/* To differentiate various internal objs */
  21.105 +	u8 walk_type;
  21.106 +	u16 opcode;		/* Current AML opcode */
  21.107 +	u8 next_op_info;	/* Info about next_op */
  21.108 +	u8 num_operands;	/* Stack pointer for Operands[] array */
  21.109 +	acpi_owner_id owner_id;	/* Owner of objects created during the walk */
  21.110 +	u8 last_predicate;	/* Result of last predicate */
  21.111 +	u8 current_result;
  21.112 +	u8 return_used;
  21.113 +	u8 scope_depth;
  21.114 +	u8 pass_number;		/* Parse pass during table load */
  21.115 +	u32 aml_offset;
  21.116 +	u32 arg_types;
  21.117 +	u32 method_breakpoint;	/* For single stepping */
  21.118 +	u32 user_breakpoint;	/* User AML breakpoint */
  21.119 +	u32 parse_flags;
  21.120 +
  21.121 +	struct acpi_parse_state parser_state;	/* Current state of parser */
  21.122 +	u32 prev_arg_types;
  21.123 +	u32 arg_count;		/* push for fixed or var args */
  21.124 +
  21.125 +	struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS];	/* Control method arguments */
  21.126 +	struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS];	/* Control method locals */
  21.127 +	union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1];	/* Operands passed to the interpreter (+1 for NULL terminator) */
  21.128 +	union acpi_operand_object **params;
  21.129 +
  21.130 +	u8 *aml_last_while;
  21.131 +	union acpi_operand_object **caller_return_desc;
  21.132 +	union acpi_generic_state *control_state;	/* List of control states (nested IFs) */
  21.133 +	struct acpi_namespace_node *deferred_node;	/* Used when executing deferred opcodes */
  21.134 +	struct acpi_gpe_event_info *gpe_event_info;	/* Info for GPE (_Lxx/_Exx methods only */
  21.135 +	union acpi_operand_object *implicit_return_obj;
  21.136 +	struct acpi_namespace_node *method_call_node;	/* Called method Node */
  21.137 +	union acpi_parse_object *method_call_op;	/* method_call Op if running a method */
  21.138 +	union acpi_operand_object *method_desc;	/* Method descriptor if running a method */
  21.139 +	struct acpi_namespace_node *method_node;	/* Method node if running a method. */
  21.140 +	union acpi_parse_object *op;	/* Current parser op */
  21.141 +	const struct acpi_opcode_info *op_info;	/* Info on current opcode */
  21.142 +	union acpi_parse_object *origin;	/* Start of walk [Obsolete] */
  21.143 +	union acpi_operand_object *result_obj;
  21.144 +	union acpi_generic_state *results;	/* Stack of accumulated results */
  21.145 +	union acpi_operand_object *return_desc;	/* Return object, if any */
  21.146 +	union acpi_generic_state *scope_info;	/* Stack of nested scopes */
  21.147 +	union acpi_parse_object *prev_op;	/* Last op that was processed */
  21.148 +	union acpi_parse_object *next_op;	/* next op to be processed */
  21.149 +	struct acpi_thread_state *thread;
  21.150 +	acpi_parse_downwards descending_callback;
  21.151 +	acpi_parse_upwards ascending_callback;
  21.152  };
  21.153  
  21.154 -
  21.155  /* Info used by acpi_ps_init_objects */
  21.156  
  21.157 -struct acpi_init_walk_info
  21.158 -{
  21.159 -	u16                             method_count;
  21.160 -	u16                             device_count;
  21.161 -	u16                             op_region_count;
  21.162 -	u16                             field_count;
  21.163 -	u16                             buffer_count;
  21.164 -	u16                             package_count;
  21.165 -	u16                             op_region_init;
  21.166 -	u16                             field_init;
  21.167 -	u16                             buffer_init;
  21.168 -	u16                             package_init;
  21.169 -	u16                             object_count;
  21.170 -	struct acpi_table_desc          *table_desc;
  21.171 -};
  21.172 -
  21.173 -
  21.174 -/* Info used by acpi_ns_initialize_devices */
  21.175 -
  21.176 -struct acpi_device_walk_info
  21.177 -{
  21.178 -	u16                             device_count;
  21.179 -	u16                             num_STA;
  21.180 -	u16                             num_INI;
  21.181 -	struct acpi_table_desc          *table_desc;
  21.182 +struct acpi_init_walk_info {
  21.183 +	u16 method_count;
  21.184 +	u16 device_count;
  21.185 +	u16 op_region_count;
  21.186 +	u16 field_count;
  21.187 +	u16 buffer_count;
  21.188 +	u16 package_count;
  21.189 +	u16 op_region_init;
  21.190 +	u16 field_init;
  21.191 +	u16 buffer_init;
  21.192 +	u16 package_init;
  21.193 +	u16 object_count;
  21.194 +	acpi_owner_id owner_id;
  21.195 +	acpi_native_uint table_index;
  21.196  };
  21.197  
  21.198 -
  21.199 -/* TBD: [Restructure] Merge with struct above */
  21.200 -
  21.201 -struct acpi_walk_info
  21.202 -{
  21.203 -	u32                             debug_level;
  21.204 -	u32                             owner_id;
  21.205 -	u8                              display_type;
  21.206 +struct acpi_get_devices_info {
  21.207 +	acpi_walk_callback user_function;
  21.208 +	void *context;
  21.209 +	const char *hid;
  21.210  };
  21.211  
  21.212 -/* Display Types */
  21.213 -
  21.214 -#define ACPI_DISPLAY_SUMMARY    0
  21.215 -#define ACPI_DISPLAY_OBJECTS    1
  21.216 +union acpi_aml_operands {
  21.217 +	union acpi_operand_object *operands[7];
  21.218  
  21.219 -struct acpi_get_devices_info
  21.220 -{
  21.221 -	acpi_walk_callback              user_function;
  21.222 -	void                            *context;
  21.223 -	char                            *hid;
  21.224 -};
  21.225 -
  21.226 -
  21.227 -union acpi_aml_operands
  21.228 -{
  21.229 -	union acpi_operand_object           *operands[7];
  21.230 -
  21.231 -	struct
  21.232 -	{
  21.233 -		struct acpi_object_integer      *type;
  21.234 -		struct acpi_object_integer      *code;
  21.235 -		struct acpi_object_integer      *argument;
  21.236 +	struct {
  21.237 +		struct acpi_object_integer *type;
  21.238 +		struct acpi_object_integer *code;
  21.239 +		struct acpi_object_integer *argument;
  21.240  
  21.241  	} fatal;
  21.242  
  21.243 -	struct
  21.244 -	{
  21.245 -		union acpi_operand_object       *source;
  21.246 -		struct acpi_object_integer      *index;
  21.247 -		union acpi_operand_object       *target;
  21.248 +	struct {
  21.249 +		union acpi_operand_object *source;
  21.250 +		struct acpi_object_integer *index;
  21.251 +		union acpi_operand_object *target;
  21.252  
  21.253  	} index;
  21.254  
  21.255 -	struct
  21.256 -	{
  21.257 -		union acpi_operand_object       *source;
  21.258 -		struct acpi_object_integer      *index;
  21.259 -		struct acpi_object_integer      *length;
  21.260 -		union acpi_operand_object       *target;
  21.261 +	struct {
  21.262 +		union acpi_operand_object *source;
  21.263 +		struct acpi_object_integer *index;
  21.264 +		struct acpi_object_integer *length;
  21.265 +		union acpi_operand_object *target;
  21.266  
  21.267  	} mid;
  21.268  };
  21.269  
  21.270 -
  21.271 -/* Internal method parameter list */
  21.272 -
  21.273 -struct acpi_parameter_info
  21.274 -{
  21.275 -	struct acpi_namespace_node      *node;
  21.276 -	union acpi_operand_object       **parameters;
  21.277 -	union acpi_operand_object       *return_object;
  21.278 -	u8                              parameter_type;
  21.279 -	u8                              return_object_type;
  21.280 +/*
  21.281 + * Structure used to pass object evaluation parameters.
  21.282 + * Purpose is to reduce CPU stack use.
  21.283 + */
  21.284 +struct acpi_evaluate_info {
  21.285 +	struct acpi_namespace_node *prefix_node;
  21.286 +	char *pathname;
  21.287 +	union acpi_operand_object *obj_desc;
  21.288 +	union acpi_operand_object **parameters;
  21.289 +	struct acpi_namespace_node *resolved_node;
  21.290 +	union acpi_operand_object *return_object;
  21.291 +	u8 pass_number;
  21.292 +	u8 parameter_type;
  21.293 +	u8 return_object_type;
  21.294 +	u8 flags;
  21.295  };
  21.296  
  21.297  /* Types for parameter_type above */
  21.298 @@ -218,5 +197,35 @@ struct acpi_parameter_info
  21.299  #define ACPI_PARAM_ARGS                 0
  21.300  #define ACPI_PARAM_GPE                  1
  21.301  
  21.302 +/* Values for Flags above */
  21.303 +
  21.304 +#define ACPI_IGNORE_RETURN_VALUE        1
  21.305 +
  21.306 +/* Info used by acpi_ns_initialize_devices */
  21.307 +
  21.308 +struct acpi_device_walk_info {
  21.309 +	u16 device_count;
  21.310 +	u16 num_STA;
  21.311 +	u16 num_INI;
  21.312 +	struct acpi_table_desc *table_desc;
  21.313 +	struct acpi_evaluate_info *evaluate_info;
  21.314 +};
  21.315 +
  21.316 +/* TBD: [Restructure] Merge with struct above */
  21.317 +
  21.318 +struct acpi_walk_info {
  21.319 +	u32 debug_level;
  21.320 +	u32 count;
  21.321 +	acpi_owner_id owner_id;
  21.322 +	u8 display_type;
  21.323 +};
  21.324 +
  21.325 +/* Display Types */
  21.326 +
  21.327 +#define ACPI_DISPLAY_SUMMARY        (u8) 0
  21.328 +#define ACPI_DISPLAY_OBJECTS        (u8) 1
  21.329 +#define ACPI_DISPLAY_MASK           (u8) 1
  21.330 +
  21.331 +#define ACPI_DISPLAY_SHORT          (u8) 2
  21.332  
  21.333  #endif
    22.1 --- a/xen/include/acpi/actbl.h	Tue Mar 18 13:14:26 2008 +0000
    22.2 +++ b/xen/include/acpi/actbl.h	Tue Mar 18 14:55:36 2008 +0000
    22.3 @@ -1,11 +1,11 @@
    22.4  /******************************************************************************
    22.5   *
    22.6 - * Name: actbl.h - Table data structures defined in ACPI specification
    22.7 + * Name: actbl.h - Basic ACPI Table Definitions
    22.8   *
    22.9   *****************************************************************************/
   22.10  
   22.11  /*
   22.12 - * Copyright (C) 2000 - 2005, R. Byron Moore
   22.13 + * Copyright (C) 2000 - 2007, R. Byron Moore
   22.14   * All rights reserved.
   22.15   *
   22.16   * Redistribution and use in source and binary forms, with or without
   22.17 @@ -44,309 +44,253 @@
   22.18  #ifndef __ACTBL_H__
   22.19  #define __ACTBL_H__
   22.20  
   22.21 +/*
   22.22 + * Values for description table header signatures. Useful because they make
   22.23 + * it more difficult to inadvertently type in the wrong signature.
   22.24 + */
   22.25 +#define ACPI_SIG_DSDT           "DSDT"	/* Differentiated System Description Table */
   22.26 +#define ACPI_SIG_FADT           "FACP"	/* Fixed ACPI Description Table */
   22.27 +#define ACPI_SIG_FACS           "FACS"	/* Firmware ACPI Control Structure */
   22.28 +#define ACPI_SIG_PSDT           "PSDT"	/* Persistent System Description Table */
   22.29 +#define ACPI_SIG_RSDP           "RSD PTR "	/* Root System Description Pointer */
   22.30 +#define ACPI_SIG_RSDT           "RSDT"	/* Root System Description Table */
   22.31 +#define ACPI_SIG_XSDT           "XSDT"	/* Extended  System Description Table */
   22.32 +#define ACPI_SIG_SSDT           "SSDT"	/* Secondary System Description Table */
   22.33 +#define ACPI_RSDP_NAME          "RSDP"	/* Short name for RSDP, not signature */
   22.34  
   22.35  /*
   22.36 - *  Values for description table header signatures
   22.37 + * All tables and structures must be byte-packed to match the ACPI
   22.38 + * specification, since the tables are provided by the system BIOS
   22.39   */
   22.40 -#define RSDP_NAME               "RSDP"
   22.41 -#define RSDP_SIG                "RSD PTR "  /* RSDT Pointer signature */
   22.42 -#define APIC_SIG                "APIC"      /* Multiple APIC Description Table */
   22.43 -#define DSDT_SIG                "DSDT"      /* Differentiated System Description Table */
   22.44 -#define FADT_SIG                "FACP"      /* Fixed ACPI Description Table */
   22.45 -#define FACS_SIG                "FACS"      /* Firmware ACPI Control Structure */
   22.46 -#define PSDT_SIG                "PSDT"      /* Persistent System Description Table */
   22.47 -#define RSDT_SIG                "RSDT"      /* Root System Description Table */
   22.48 -#define XSDT_SIG                "XSDT"      /* Extended  System Description Table */
   22.49 -#define SSDT_SIG                "SSDT"      /* Secondary System Description Table */
   22.50 -#define SBST_SIG                "SBST"      /* Smart Battery Specification Table */
   22.51 -#define SPIC_SIG                "SPIC"      /* IOSAPIC table */
   22.52 -#define BOOT_SIG                "BOOT"      /* Boot table */
   22.53 -
   22.54 -
   22.55 -#define GL_OWNED                0x02        /* Ownership of global lock is bit 1 */
   22.56 -
   22.57 -
   22.58 -/*
   22.59 - * Common table types.  The base code can remain
   22.60 - * constant if the underlying tables are changed
   22.61 - */
   22.62 -#define RSDT_DESCRIPTOR         struct rsdt_descriptor_rev2
   22.63 -#define XSDT_DESCRIPTOR         struct xsdt_descriptor_rev2
   22.64 -#define FACS_DESCRIPTOR         struct facs_descriptor_rev2
   22.65 -#define FADT_DESCRIPTOR         struct fadt_descriptor_rev2
   22.66 -
   22.67 -
   22.68  #pragma pack(1)
   22.69  
   22.70  /*
   22.71 - * ACPI Version-independent tables
   22.72 + * These are the ACPI tables that are directly consumed by the subsystem.
   22.73   *
   22.74 - * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.)
   22.75 - * are in separate files.
   22.76 - */
   22.77 -struct rsdp_descriptor         /* Root System Descriptor Pointer */
   22.78 -{
   22.79 -	char                            signature [8];          /* ACPI signature, contains "RSD PTR " */
   22.80 -	u8                              checksum;               /* To make sum of struct == 0 */
   22.81 -	char                            oem_id [6];             /* OEM identification */
   22.82 -	u8                              revision;               /* Must be 0 for 1.0, 2 for 2.0 */
   22.83 -	u32                             rsdt_physical_address;  /* 32-bit physical address of RSDT */
   22.84 -	u32                             length;                 /* XSDT Length in bytes including hdr */
   22.85 -	u64                             xsdt_physical_address;  /* 64-bit physical address of XSDT */
   22.86 -	u8                              extended_checksum;      /* Checksum of entire table */
   22.87 -	char                            reserved [3];           /* Reserved field must be 0 */
   22.88 -};
   22.89 -
   22.90 -
   22.91 -struct acpi_common_facs          /* Common FACS for internal use */
   22.92 -{
   22.93 -	u32                             *global_lock;
   22.94 -	u64                             *firmware_waking_vector;
   22.95 -	u8                              vector_width;
   22.96 -};
   22.97 -
   22.98 -
   22.99 -#define ACPI_TABLE_HEADER_DEF   /* ACPI common table header */ \
  22.100 -	char                            signature [4];          /* ACPI signature (4 ASCII characters) */\
  22.101 -	u32                             length;                 /* Length of table, in bytes, including header */\
  22.102 -	u8                              revision;               /* ACPI Specification minor version # */\
  22.103 -	u8                              checksum;               /* To make sum of entire table == 0 */\
  22.104 -	char                            oem_id [6];             /* OEM identification */\
  22.105 -	char                            oem_table_id [8];       /* OEM table identification */\
  22.106 -	u32                             oem_revision;           /* OEM revision number */\
  22.107 -	char                            asl_compiler_id [4];    /* ASL compiler vendor ID */\
  22.108 -	u32                             asl_compiler_revision;  /* ASL compiler revision number */
  22.109 -
  22.110 -
  22.111 -struct acpi_table_header         /* ACPI common table header */
  22.112 -{
  22.113 -	ACPI_TABLE_HEADER_DEF
  22.114 -};
  22.115 -
  22.116 -
  22.117 -/*
  22.118 - * MADT values and structures
  22.119 + * The RSDP and FACS do not use the common ACPI table header. All other ACPI
  22.120 + * tables use the header.
  22.121 + *
  22.122 + * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
  22.123 + * This is the only type that is even remotely portable. Anything else is not
  22.124 + * portable, so do not use any other bitfield types.
  22.125   */
  22.126  
  22.127 -/* Values for MADT PCATCompat */
  22.128 -
  22.129 -#define DUAL_PIC                0
  22.130 -#define MULTIPLE_APIC           1
  22.131 -
  22.132 -
  22.133 -/* Master MADT */
  22.134 -
  22.135 -struct multiple_apic_table
  22.136 -{
  22.137 -	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
  22.138 -	u32                             local_apic_address;     /* Physical address of local APIC */
  22.139 -	u32                             PCATcompat      : 1;    /* A one indicates system also has dual 8259s */
  22.140 -	u32                             reserved1       : 31;
  22.141 -};
  22.142 -
  22.143 -
  22.144 -/* Values for Type in APIC_HEADER_DEF */
  22.145 +/*******************************************************************************
  22.146 + *
  22.147 + * ACPI Table Header. This common header is used by all tables except the
  22.148 + * RSDP and FACS. The define is used for direct inclusion of header into
  22.149 + * other ACPI tables
  22.150 + *
  22.151 + ******************************************************************************/
  22.152  
  22.153 -#define APIC_PROCESSOR          0
  22.154 -#define APIC_IO                 1
  22.155 -#define APIC_XRUPT_OVERRIDE     2
  22.156 -#define APIC_NMI                3
  22.157 -#define APIC_LOCAL_NMI          4
  22.158 -#define APIC_ADDRESS_OVERRIDE   5
  22.159 -#define APIC_IO_SAPIC           6
  22.160 -#define APIC_LOCAL_SAPIC        7
  22.161 -#define APIC_XRUPT_SOURCE       8
  22.162 -#define APIC_RESERVED           9           /* 9 and greater are reserved */
  22.163 -
  22.164 -/*
  22.165 - * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
  22.166 - */
  22.167 -#define APIC_HEADER_DEF                     /* Common APIC sub-structure header */\
  22.168 -	u8                              type; \
  22.169 -	u8                              length;
  22.170 -
  22.171 -struct apic_header
  22.172 -{
  22.173 -	APIC_HEADER_DEF
  22.174 +struct acpi_table_header {
  22.175 +	char signature[ACPI_NAME_SIZE];	/* ASCII table signature */
  22.176 +	u32 length;		/* Length of table in bytes, including this header */
  22.177 +	u8 revision;		/* ACPI Specification minor version # */
  22.178 +	u8 checksum;		/* To make sum of entire table == 0 */
  22.179 +	char oem_id[ACPI_OEM_ID_SIZE];	/* ASCII OEM identification */
  22.180 +	char oem_table_id[ACPI_OEM_TABLE_ID_SIZE];	/* ASCII OEM table identification */
  22.181 +	u32 oem_revision;	/* OEM revision number */
  22.182 +	char asl_compiler_id[ACPI_NAME_SIZE];	/* ASCII ASL compiler vendor ID */
  22.183 +	u32 asl_compiler_revision;	/* ASL compiler version */
  22.184  };
  22.185  
  22.186 -/* Values for MPS INTI flags */
  22.187 -
  22.188 -#define POLARITY_CONFORMS       0
  22.189 -#define POLARITY_ACTIVE_HIGH    1
  22.190 -#define POLARITY_RESERVED       2
  22.191 -#define POLARITY_ACTIVE_LOW     3
  22.192 -
  22.193 -#define TRIGGER_CONFORMS        0
  22.194 -#define TRIGGER_EDGE            1
  22.195 -#define TRIGGER_RESERVED        2
  22.196 -#define TRIGGER_LEVEL           3
  22.197 -
  22.198 -/* Common flag definitions */
  22.199 -
  22.200 -#define MPS_INTI_FLAGS \
  22.201 -	u16                             polarity        : 2;    /* Polarity of APIC I/O input signals */\
  22.202 -	u16                             trigger_mode    : 2;    /* Trigger mode of APIC input signals */\
  22.203 -	u16                             reserved1       : 12;   /* Reserved, must be zero */
  22.204 -
  22.205 -#define LOCAL_APIC_FLAGS \
  22.206 -	u32                             processor_enabled: 1;   /* Processor is usable if set */\
  22.207 -	u32                             reserved2       : 31;   /* Reserved, must be zero */
  22.208 -
  22.209 -/* Sub-structures for MADT */
  22.210 -
  22.211 -struct madt_processor_apic
  22.212 -{
  22.213 -	APIC_HEADER_DEF
  22.214 -	u8                              processor_id;           /* ACPI processor id */
  22.215 -	u8                              local_apic_id;          /* Processor's local APIC id */
  22.216 -	LOCAL_APIC_FLAGS
  22.217 -};
  22.218 -
  22.219 -struct madt_io_apic
  22.220 -{
  22.221 -	APIC_HEADER_DEF
  22.222 -	u8                              io_apic_id;             /* I/O APIC ID */
  22.223 -	u8                              reserved;               /* Reserved - must be zero */
  22.224 -	u32                             address;                /* APIC physical address */
  22.225 -	u32                             interrupt;              /* Global system interrupt where INTI
  22.226 -			  * lines start */
  22.227 -};
  22.228 -
  22.229 -struct madt_interrupt_override
  22.230 -{
  22.231 -	APIC_HEADER_DEF
  22.232 -	u8                              bus;                    /* 0 - ISA */
  22.233 -	u8                              source;                 /* Interrupt source (IRQ) */
  22.234 -	u32                             interrupt;              /* Global system interrupt */
  22.235 -	MPS_INTI_FLAGS
  22.236 +/*
  22.237 + * GAS - Generic Address Structure (ACPI 2.0+)
  22.238 + *
  22.239 + * Note: Since this structure is used in the ACPI tables, it is byte aligned.
  22.240 + * If misalignment is not supported, access to the Address field must be
  22.241 + * performed with care.
  22.242 + */
  22.243 +struct acpi_generic_address {
  22.244 +	u8 space_id;		/* Address space where struct or register exists */
  22.245 +	u8 bit_width;		/* Size in bits of given register */
  22.246 +	u8 bit_offset;		/* Bit offset within the register */
  22.247 +	u8 access_width;	/* Minimum Access size (ACPI 3.0) */
  22.248 +	u64 address;		/* 64-bit address of struct or register */
  22.249  };
  22.250  
  22.251 -struct madt_nmi_source
  22.252 -{
  22.253 -	APIC_HEADER_DEF
  22.254 -	MPS_INTI_FLAGS
  22.255 -	u32                             interrupt;              /* Global system interrupt */
  22.256 -};
  22.257 +/*******************************************************************************
  22.258 + *
  22.259 + * RSDP - Root System Description Pointer (Signature is "RSD PTR ")
  22.260 + *
  22.261 + ******************************************************************************/
  22.262  
  22.263 -struct madt_local_apic_nmi
  22.264 -{
  22.265 -	APIC_HEADER_DEF
  22.266 -	u8                              processor_id;           /* ACPI processor id */
  22.267 -	MPS_INTI_FLAGS
  22.268 -	u8                              lint;                   /* LINTn to which NMI is connected */
  22.269 -};
  22.270 -
  22.271 -struct madt_address_override
  22.272 -{
  22.273 -	APIC_HEADER_DEF
  22.274 -	u16                             reserved;               /* Reserved - must be zero */
  22.275 -	u64                             address;                /* APIC physical address */
  22.276 -};
  22.277 -
  22.278 -struct madt_io_sapic
  22.279 -{
  22.280 -	APIC_HEADER_DEF
  22.281 -	u8                              io_sapic_id;            /* I/O SAPIC ID */
  22.282 -	u8                              reserved;               /* Reserved - must be zero */
  22.283 -	u32                             interrupt_base;         /* Glocal interrupt for SAPIC start */
  22.284 -	u64                             address;                /* SAPIC physical address */
  22.285 +struct acpi_table_rsdp {
  22.286 +	char signature[8];	/* ACPI signature, contains "RSD PTR " */
  22.287 +	u8 checksum;		/* ACPI 1.0 checksum */
  22.288 +	char oem_id[ACPI_OEM_ID_SIZE];	/* OEM identification */
  22.289 +	u8 revision;		/* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
  22.290 +	u32 rsdt_physical_address;	/* 32-bit physical address of the RSDT */
  22.291 +	u32 length;		/* Table length in bytes, including header (ACPI 2.0+) */
  22.292 +	u64 xsdt_physical_address;	/* 64-bit physical address of the XSDT (ACPI 2.0+) */
  22.293 +	u8 extended_checksum;	/* Checksum of entire table (ACPI 2.0+) */
  22.294 +	u8 reserved[3];		/* Reserved, must be zero */
  22.295  };
  22.296  
  22.297 -struct madt_local_sapic
  22.298 -{
  22.299 -	APIC_HEADER_DEF
  22.300 -	u8                              processor_id;           /* ACPI processor id */
  22.301 -	u8                              local_sapic_id;         /* SAPIC ID */
  22.302 -	u8                              local_sapic_eid;        /* SAPIC EID */
  22.303 -	u8                              reserved [3];           /* Reserved - must be zero */
  22.304 -	LOCAL_APIC_FLAGS
  22.305 +#define ACPI_RSDP_REV0_SIZE     20	/* Size of original ACPI 1.0 RSDP */
  22.306 +
  22.307 +/*******************************************************************************
  22.308 + *
  22.309 + * RSDT/XSDT - Root System Description Tables
  22.310 + *
  22.311 + ******************************************************************************/
  22.312 +
  22.313 +struct acpi_table_rsdt {
  22.314 +	struct acpi_table_header header;	/* Common ACPI table header */
  22.315 +	u32 table_offset_entry[1];	/* Array of pointers to ACPI tables */
  22.316  };
  22.317  
  22.318 -struct madt_interrupt_source
  22.319 -{
  22.320 -	APIC_HEADER_DEF
  22.321 -	MPS_INTI_FLAGS
  22.322 -	u8                              interrupt_type;         /* 1=PMI, 2=INIT, 3=corrected */
  22.323 -	u8                              processor_id;           /* Processor ID */
  22.324 -	u8                              processor_eid;          /* Processor EID */
  22.325 -	u8                              io_sapic_vector;        /* Vector value for PMI interrupts */
  22.326 -	u32                             interrupt;              /* Global system interrupt */
  22.327 -	u32                             reserved;               /* Reserved - must be zero */
  22.328 +struct acpi_table_xsdt {
  22.329 +	struct acpi_table_header header;	/* Common ACPI table header */
  22.330 +	u64 table_offset_entry[1];	/* Array of pointers to ACPI tables */
  22.331  };
  22.332  
  22.333 +/*******************************************************************************
  22.334 + *
  22.335 + * FACS - Firmware ACPI Control Structure (FACS)
  22.336 + *
  22.337 + ******************************************************************************/
  22.338 +
  22.339 +struct acpi_table_facs {
  22.340 +	char signature[4];	/* ASCII table signature */
  22.341 +	u32 length;		/* Length of structure, in bytes */
  22.342 +	u32 hardware_signature;	/* Hardware configuration signature */
  22.343 +	u32 firmware_waking_vector;	/* 32-bit physical address of the Firmware Waking Vector */
  22.344 +	u32 global_lock;	/* Global Lock for shared hardware resources */
  22.345 +	u32 flags;
  22.346 +	u64 xfirmware_waking_vector;	/* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
  22.347 +	u8 version;		/* Version of this table (ACPI 2.0+) */
  22.348 +	u8 reserved[31];	/* Reserved, must be zero */
  22.349 +};
  22.350 +
  22.351 +/* Flag macros */
  22.352 +
  22.353 +#define ACPI_FACS_S4_BIOS_PRESENT (1)	/* 00: S4BIOS support is present */
  22.354 +
  22.355 +/* Global lock flags */
  22.356 +
  22.357 +#define ACPI_GLOCK_PENDING      0x01	/* 00: Pending global lock ownership */
  22.358 +#define ACPI_GLOCK_OWNED        0x02	/* 01: Global lock is owned */
  22.359 +
  22.360 +/*******************************************************************************
  22.361 + *
  22.362 + * FADT - Fixed ACPI Description Table (Signature "FACP")
  22.363 + *
  22.364 + ******************************************************************************/
  22.365 +
  22.366 +/* Fields common to all versions of the FADT */
  22.367 +
  22.368 +struct acpi_table_fadt {
  22.369 +	struct acpi_table_header header;	/* Common ACPI table header */
  22.370 +	u32 facs;		/* 32-bit physical address of FACS */
  22.371 +	u32 dsdt;		/* 32-bit physical address of DSDT */
  22.372 +	u8 model;		/* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
  22.373 +	u8 preferred_profile;	/* Conveys preferred power management profile to OSPM. */
  22.374 +	u16 sci_interrupt;	/* System vector of SCI interrupt */
  22.375 +	u32 smi_command;	/* 32-bit Port address of SMI command port */
  22.376 +	u8 acpi_enable;		/* Value to write to smi_cmd to enable ACPI */
  22.377 +	u8 acpi_disable;	/* Value to write to smi_cmd to disable ACPI */
  22.378 +	u8 S4bios_request;	/* Value to write to SMI CMD to enter S4BIOS state */
  22.379 +	u8 pstate_control;	/* Processor performance state control */
  22.380 +	u32 pm1a_event_block;	/* 32-bit Port address of Power Mgt 1a Event Reg Blk */
  22.381 +	u32 pm1b_event_block;	/* 32-bit Port address of Power Mgt 1b Event Reg Blk */
  22.382 +	u32 pm1a_control_block;	/* 32-bit Port address of Power Mgt 1a Control Reg Blk */
  22.383 +	u32 pm1b_control_block;	/* 32-bit Port address of Power Mgt 1b Control Reg Blk */
  22.384 +	u32 pm2_control_block;	/* 32-bit Port address of Power Mgt 2 Control Reg Blk */
  22.385 +	u32 pm_timer_block;	/* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
  22.386 +	u32 gpe0_block;		/* 32-bit Port address of General Purpose Event 0 Reg Blk */
  22.387 +	u32 gpe1_block;		/* 32-bit Port address of General Purpose Event 1 Reg Blk */
  22.388 +	u8 pm1_event_length;	/* Byte Length of ports at pm1x_event_block */
  22.389 +	u8 pm1_control_length;	/* Byte Length of ports at pm1x_control_block */
  22.390 +	u8 pm2_control_length;	/* Byte Length of ports at pm2_control_block */
  22.391 +	u8 pm_timer_length;	/* Byte Length of ports at pm_timer_block */
  22.392 +	u8 gpe0_block_length;	/* Byte Length of ports at gpe0_block */
  22.393 +	u8 gpe1_block_length;	/* Byte Length of ports at gpe1_block */
  22.394 +	u8 gpe1_base;		/* Offset in GPE number space where GPE1 events start */
  22.395 +	u8 cst_control;		/* Support for the _CST object and C States change notification */
  22.396 +	u16 C2latency;		/* Worst case HW latency to enter/exit C2 state */
  22.397 +	u16 C3latency;		/* Worst case HW latency to enter/exit C3 state */
  22.398 +	u16 flush_size;		/* Processor's memory cache line width, in bytes */
  22.399 +	u16 flush_stride;	/* Number of flush strides that need to be read */
  22.400 +	u8 duty_offset;		/* Processor duty cycle index in processor's P_CNT reg */
  22.401 +	u8 duty_width;		/* Processor duty cycle value bit width in P_CNT register. */
  22.402 +	u8 day_alarm;		/* Index to day-of-month alarm in RTC CMOS RAM */
  22.403 +	u8 month_alarm;		/* Index to month-of-year alarm in RTC CMOS RAM */
  22.404 +	u8 century;		/* Index to century in RTC CMOS RAM */
  22.405 +	u16 boot_flags;		/* IA-PC Boot Architecture Flags. See Table 5-10 for description */
  22.406 +	u8 reserved;		/* Reserved, must be zero */
  22.407 +	u32 flags;		/* Miscellaneous flag bits (see below for individual flags) */
  22.408 +	struct acpi_generic_address reset_register;	/* 64-bit address of the Reset register */
  22.409 +	u8 reset_value;		/* Value to write to the reset_register port to reset the system */
  22.410 +	u8 reserved4[3];	/* Reserved, must be zero */
  22.411 +	u64 Xfacs;		/* 64-bit physical address of FACS */
  22.412 +	u64 Xdsdt;		/* 64-bit physical address of DSDT */
  22.413 +	struct acpi_generic_address xpm1a_event_block;	/* 64-bit Extended Power Mgt 1a Event Reg Blk address */
  22.414 +	struct acpi_generic_address xpm1b_event_block;	/* 64-bit Extended Power Mgt 1b Event Reg Blk address */
  22.415 +	struct acpi_generic_address xpm1a_control_block;	/* 64-bit Extended Power Mgt 1a Control Reg Blk address */
  22.416 +	struct acpi_generic_address xpm1b_control_block;	/* 64-bit Extended Power Mgt 1b Control Reg Blk address */
  22.417 +	struct acpi_generic_address xpm2_control_block;	/* 64-bit Extended Power Mgt 2 Control Reg Blk address */
  22.418 +	struct acpi_generic_address xpm_timer_block;	/* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
  22.419 +	struct acpi_generic_address xgpe0_block;	/* 64-bit Extended General Purpose Event 0 Reg Blk address */
  22.420 +	struct acpi_generic_address xgpe1_block;	/* 64-bit Extended General Purpose Event 1 Reg Blk address */
  22.421 +};
  22.422 +
  22.423 +/* FADT flags */
  22.424 +
  22.425 +#define ACPI_FADT_WBINVD            (1)	/* 00: The wbinvd instruction works properly */
  22.426 +#define ACPI_FADT_WBINVD_FLUSH      (1<<1)	/* 01: The wbinvd flushes but does not invalidate */
  22.427 +#define ACPI_FADT_C1_SUPPORTED      (1<<2)	/* 02: All processors support C1 state */
  22.428 +#define ACPI_FADT_C2_MP_SUPPORTED   (1<<3)	/* 03: C2 state works on MP system */
  22.429 +#define ACPI_FADT_POWER_BUTTON      (1<<4)	/* 04: Power button is handled as a generic feature */
  22.430 +#define ACPI_FADT_SLEEP_BUTTON      (1<<5)	/* 05: Sleep button is handled as a generic feature, or  not present */
  22.431 +#define ACPI_FADT_FIXED_RTC         (1<<6)	/* 06: RTC wakeup stat not in fixed register space */
  22.432 +#define ACPI_FADT_S4_RTC_WAKE       (1<<7)	/* 07: RTC wakeup stat not possible from S4 */
  22.433 +#define ACPI_FADT_32BIT_TIMER       (1<<8)	/* 08: tmr_val is 32 bits 0=24-bits */
  22.434 +#define ACPI_FADT_DOCKING_SUPPORTED (1<<9)	/* 09: Docking supported */
  22.435 +#define ACPI_FADT_RESET_REGISTER    (1<<10)	/* 10: System reset via the FADT RESET_REG supported */
  22.436 +#define ACPI_FADT_SEALED_CASE       (1<<11)	/* 11: No internal expansion capabilities and case is sealed */
  22.437 +#define ACPI_FADT_HEADLESS          (1<<12)	/* 12: No local video capabilities or local input devices */
  22.438 +#define ACPI_FADT_SLEEP_TYPE        (1<<13)	/* 13: Must execute native instruction after writing  SLP_TYPx register */
  22.439 +#define ACPI_FADT_PCI_EXPRESS_WAKE  (1<<14)	/* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
  22.440 +#define ACPI_FADT_PLATFORM_CLOCK    (1<<15)	/* 15: OSPM should use platform-provided timer (ACPI 3.0) */
  22.441 +#define ACPI_FADT_S4_RTC_VALID      (1<<16)	/* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
  22.442 +#define ACPI_FADT_REMOTE_POWER_ON   (1<<17)	/* 17: System is compatible with remote power on (ACPI 3.0) */
  22.443 +#define ACPI_FADT_APIC_CLUSTER      (1<<18)	/* 18: All local APICs must use cluster model (ACPI 3.0) */
  22.444 +#define ACPI_FADT_APIC_PHYSICAL     (1<<19)	/* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
  22.445  
  22.446  /*
  22.447 - * Smart Battery
  22.448 + * FADT Prefered Power Management Profiles
  22.449   */
  22.450 -struct smart_battery_table
  22.451 -{
  22.452 -	ACPI_TABLE_HEADER_DEF
  22.453 -	u32                             warning_level;
  22.454 -	u32                             low_level;
  22.455 -	u32                             critical_level;
  22.456 +enum acpi_prefered_pm_profiles {
  22.457 +	PM_UNSPECIFIED = 0,
  22.458 +	PM_DESKTOP = 1,
  22.459 +	PM_MOBILE = 2,
  22.460 +	PM_WORKSTATION = 3,
  22.461 +	PM_ENTERPRISE_SERVER = 4,
  22.462 +	PM_SOHO_SERVER = 5,
  22.463 +	PM_APPLIANCE_PC = 6
  22.464  };
  22.465  
  22.466 +/* FADT Boot Arch Flags */
  22.467 +
  22.468 +#define BAF_LEGACY_DEVICES              0x0001
  22.469 +#define BAF_8042_KEYBOARD_CONTROLLER    0x0002
  22.470 +#define BAF_MSI_NOT_SUPPORTED           0x0008
  22.471 +
  22.472 +#define FADT2_REVISION_ID               3
  22.473 +#define FADT2_MINUS_REVISION_ID         2
  22.474 +
  22.475 +/* Reset to default packing */
  22.476  
  22.477  #pragma pack()
  22.478  
  22.479 +#define ACPI_FADT_OFFSET(f)             (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
  22.480  
  22.481  /*
  22.482 - * ACPI Table information.  We save the table address, length,
  22.483 - * and type of memory allocation (mapped or allocated) for each
  22.484 - * table for 1) when we exit, and 2) if a new table is installed
  22.485 + * Get the remaining ACPI tables
  22.486   */
  22.487 -#define ACPI_MEM_NOT_ALLOCATED  0
  22.488 -#define ACPI_MEM_ALLOCATED      1
  22.489 -#define ACPI_MEM_MAPPED         2
  22.490 -
  22.491 -/* Definitions for the Flags bitfield member of struct acpi_table_support */
  22.492 -
  22.493 -#define ACPI_TABLE_SINGLE       0x00
  22.494 -#define ACPI_TABLE_MULTIPLE     0x01
  22.495 -#define ACPI_TABLE_EXECUTABLE   0x02
  22.496 -
  22.497 -#define ACPI_TABLE_ROOT         0x00
  22.498 -#define ACPI_TABLE_PRIMARY      0x10
  22.499 -#define ACPI_TABLE_SECONDARY    0x20
  22.500 -#define ACPI_TABLE_ALL          0x30
  22.501 -#define ACPI_TABLE_TYPE_MASK    0x30
  22.502 -
  22.503 -/* Data about each known table type */
  22.504  
  22.505 -struct acpi_table_support
  22.506 -{
  22.507 -	char                            *name;
  22.508 -	char                            *signature;
  22.509 -	void                            **global_ptr;
  22.510 -	u8                              sig_length;
  22.511 -	u8                              flags;
  22.512 -};
  22.513 -
  22.514 -
  22.515 -/*
  22.516 - * Get the ACPI version-specific tables
  22.517 - */
  22.518 -#include "actbl1.h"   /* Acpi 1.0 table definitions */
  22.519 -#include "actbl2.h"   /* Acpi 2.0 table definitions */
  22.520 +#include <acpi/actbl1.h>
  22.521  
  22.522 -extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
  22.523 -			    * needed for certain workarounds */
  22.524 -
  22.525 -#pragma pack(1)
  22.526 -/*
  22.527 - * High performance timer
  22.528 - */
  22.529 -struct hpet_table
  22.530 -{
  22.531 -	ACPI_TABLE_HEADER_DEF
  22.532 -	u32                             hardware_id;
  22.533 -	struct acpi_generic_address     base_address;
  22.534 -	u8                              hpet_number;
  22.535 -	u16                             clock_tick;
  22.536 -	u8                              attributes;
  22.537 -};
  22.538 -
  22.539 -#pragma pack()
  22.540 -
  22.541 -#endif /* __ACTBL_H__ */
  22.542 +#endif				/* __ACTBL_H__ */
    23.1 --- a/xen/include/acpi/actbl1.h	Tue Mar 18 13:14:26 2008 +0000
    23.2 +++ b/xen/include/acpi/actbl1.h	Tue Mar 18 14:55:36 2008 +0000
    23.3 @@ -1,11 +1,11 @@
    23.4  /******************************************************************************
    23.5   *
    23.6 - * Name: actbl1.h - ACPI 1.0 tables
    23.7 + * Name: actbl1.h - Additional ACPI table definitions
    23.8   *
    23.9   *****************************************************************************/
   23.10  
   23.11  /*
   23.12 - * Copyright (C) 2000 - 2005, R. Byron Moore
   23.13 + * Copyright (C) 2000 - 2007, R. Byron Moore
   23.14   * All rights reserved.
   23.15   *
   23.16   * Redistribution and use in source and binary forms, with or without
   23.17 @@ -44,93 +44,684 @@
   23.18  #ifndef __ACTBL1_H__
   23.19  #define __ACTBL1_H__
   23.20  
   23.21 +/*******************************************************************************
   23.22 + *
   23.23 + * Additional ACPI Tables
   23.24 + *
   23.25 + * These tables are not consumed directly by the ACPICA subsystem, but are
   23.26 + * included here to support device drivers and the AML disassembler.
   23.27 + *
   23.28 + ******************************************************************************/
   23.29 +
   23.30 +/*
   23.31 + * Values for description table header signatures. Useful because they make
   23.32 + * it more difficult to inadvertently type in the wrong signature.
   23.33 + */
   23.34 +#define ACPI_SIG_ASF            "ASF!"	/* Alert Standard Format table */
   23.35 +#define ACPI_SIG_BOOT           "BOOT"	/* Simple Boot Flag Table */
   23.36 +#define ACPI_SIG_CPEP           "CPEP"	/* Corrected Platform Error Polling table */
   23.37 +#define ACPI_SIG_DBGP           "DBGP"	/* Debug Port table */
   23.38 +#define ACPI_SIG_DMAR           "DMAR"	/* DMA Remapping table */
   23.39 +#define ACPI_SIG_ECDT           "ECDT"	/* Embedded Controller Boot Resources Table */
   23.40 +#define ACPI_SIG_HPET           "HPET"	/* High Precision Event Timer table */
   23.41 +#define ACPI_SIG_MADT           "APIC"	/* Multiple APIC Description Table */
   23.42 +#define ACPI_SIG_MCFG           "MCFG"	/* PCI Memory Mapped Configuration table */
   23.43 +#define ACPI_SIG_SBST           "SBST"	/* Smart Battery Specification Table */
   23.44 +#define ACPI_SIG_SLIT           "SLIT"	/* System Locality Distance Information Table */
   23.45 +#define ACPI_SIG_SPCR           "SPCR"	/* Serial Port Console Redirection table */
   23.46 +#define ACPI_SIG_SPMI           "SPMI"	/* Server Platform Management Interface table */
   23.47 +#define ACPI_SIG_SRAT           "SRAT"	/* System Resource Affinity Table */
   23.48 +#define ACPI_SIG_TCPA           "TCPA"	/* Trusted Computing Platform Alliance table */
   23.49 +#define ACPI_SIG_WDRT           "WDRT"	/* Watchdog Resource Table */
   23.50 +
   23.51 +/*
   23.52 + * All tables must be byte-packed to match the ACPI specification, since
   23.53 + * the tables are provided by the system BIOS.
   23.54 + */
   23.55  #pragma pack(1)
   23.56  
   23.57  /*
   23.58 - * ACPI 1.0 Root System Description Table (RSDT)
   23.59 + * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
   23.60 + * This is the only type that is even remotely portable. Anything else is not
   23.61 + * portable, so do not use any other bitfield types.
   23.62   */
   23.63 -struct rsdt_descriptor_rev1
   23.64 -{
   23.65 -	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
   23.66 -	u32                             table_offset_entry [1]; /* Array of pointers to other */
   23.67 -			 /* ACPI tables */
   23.68 +
   23.69 +/* Common Sub-table header (used in MADT, SRAT, etc.) */
   23.70 +
   23.71 +struct acpi_subtable_header {
   23.72 +	u8 type;
   23.73 +	u8 length;
   23.74  };
   23.75  
   23.76 +/*******************************************************************************
   23.77 + *
   23.78 + * ASF - Alert Standard Format table (Signature "ASF!")
   23.79 + *
   23.80 + * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
   23.81 + *
   23.82 + ******************************************************************************/
   23.83  
   23.84 -/*
   23.85 - * ACPI 1.0 Firmware ACPI Control Structure (FACS)
   23.86 - */
   23.87 -struct facs_descriptor_rev1
   23.88 -{
   23.89 -	char                            signature[4];           /* ACPI Signature */
   23.90 -	u32                             length;                 /* Length of structure, in bytes */
   23.91 -	u32                             hardware_signature;     /* Hardware configuration signature */
   23.92 -	u32                             firmware_waking_vector; /* ACPI OS waking vector */
   23.93 -	u32                             global_lock;            /* Global Lock */
   23.94 -	u32                             S4bios_f        : 1;    /* Indicates if S4BIOS support is present */
   23.95 -	u32                             reserved1       : 31;   /* Must be 0 */
   23.96 -	u8                              resverved3 [40];        /* Reserved - must be zero */
   23.97 +struct acpi_table_asf {
   23.98 +	struct acpi_table_header header;	/* Common ACPI table header */
   23.99  };
  23.100  
  23.101 +/* ASF subtable header */
  23.102 +
  23.103 +struct acpi_asf_header {
  23.104 +	u8 type;
  23.105 +	u8 reserved;
  23.106 +	u16 length;
  23.107 +};
  23.108 +
  23.109 +/* Values for Type field above */
  23.110 +
  23.111 +enum acpi_asf_type {
  23.112 +	ACPI_ASF_TYPE_INFO = 0,
  23.113 +	ACPI_ASF_TYPE_ALERT = 1,
  23.114 +	ACPI_ASF_TYPE_CONTROL = 2,
  23.115 +	ACPI_ASF_TYPE_BOOT = 3,
  23.116 +	ACPI_ASF_TYPE_ADDRESS = 4,
  23.117 +	ACPI_ASF_TYPE_RESERVED = 5
  23.118 +};
  23.119  
  23.120  /*
  23.121 - * ACPI 1.0 Fixed ACPI Description Table (FADT)
  23.122 + * ASF subtables
  23.123   */
  23.124 -struct fadt_descriptor_rev1
  23.125 -{
  23.126 -	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
  23.127 -	u32                             firmware_ctrl;          /* Physical address of FACS */
  23.128 -	u32                             dsdt;                   /* Physical address of DSDT */
  23.129 -	u8                              model;                  /* System Interrupt Model */
  23.130 -	u8                              reserved1;              /* Reserved */
  23.131 -	u16                             sci_int;                /* System vector of SCI interrupt */
  23.132 -	u32                             smi_cmd;                /* Port address of SMI command port */
  23.133 -	u8                              acpi_enable;            /* Value to write to smi_cmd to enable ACPI */
  23.134 -	u8                              acpi_disable;           /* Value to write to smi_cmd to disable ACPI */
  23.135 -	u8                              S4bios_req;             /* Value to write to SMI CMD to enter S4BIOS state */
  23.136 -	u8                              reserved2;              /* Reserved - must be zero */
  23.137 -	u32                             pm1a_evt_blk;           /* Port address of Power Mgt 1a acpi_event Reg Blk */
  23.138 -	u32                             pm1b_evt_blk;           /* Port address of Power Mgt 1b acpi_event Reg Blk */
  23.139 -	u32                             pm1a_cnt_blk;           /* Port address of Power Mgt 1a Control Reg Blk */
  23.140 -	u32                             pm1b_cnt_blk;           /* Port address of Power Mgt 1b Control Reg Blk */
  23.141 -	u32                             pm2_cnt_blk;            /* Port address of Power Mgt 2 Control Reg Blk */
  23.142 -	u32                             pm_tmr_blk;             /* Port address of Power Mgt Timer Ctrl Reg Blk */
  23.143 -	u32                             gpe0_blk;               /* Port addr of General Purpose acpi_event 0 Reg Blk */
  23.144 -	u32                             gpe1_blk;               /* Port addr of General Purpose acpi_event 1 Reg Blk */
  23.145 -	u8                              pm1_evt_len;            /* Byte length of ports at pm1_x_evt_blk */
  23.146 -	u8                              pm1_cnt_len;            /* Byte length of ports at pm1_x_cnt_blk */
  23.147 -	u8                              pm2_cnt_len;            /* Byte Length of ports at pm2_cnt_blk */
  23.148 -	u8                              pm_tm_len;              /* Byte Length of ports at pm_tm_blk */
  23.149 -	u8                              gpe0_blk_len;           /* Byte Length of ports at gpe0_blk */
  23.150 -	u8                              gpe1_blk_len;           /* Byte Length of ports at gpe1_blk */
  23.151 -	u8                              gpe1_base;              /* Offset in gpe model where gpe1 events start */
  23.152 -	u8                              reserved3;              /* Reserved */
  23.153 -	u16                             plvl2_lat;              /* Worst case HW latency to enter/exit C2 state */
  23.154 -	u16                             plvl3_lat;              /* Worst case HW latency to enter/exit C3 state */
  23.155 -	u16                             flush_size;             /* Size of area read to flush caches */
  23.156 -	u16                             flush_stride;           /* Stride used in flushing caches */
  23.157 -	u8                              duty_offset;            /* Bit location of duty cycle field in p_cnt reg */
  23.158 -	u8                              duty_width;             /* Bit width of duty cycle field in p_cnt reg */
  23.159 -	u8                              day_alrm;               /* Index to day-of-month alarm in RTC CMOS RAM */
  23.160 -	u8                              mon_alrm;               /* Index to month-of-year alarm in RTC CMOS RAM */
  23.161 -	u8                              century;                /* Index to century in RTC CMOS RAM */
  23.162 -	u8                              reserved4;              /* Reserved */
  23.163 -	u8                              reserved4a;             /* Reserved */
  23.164 -	u8                              reserved4b;             /* Reserved */
  23.165 -	u32                             wb_invd         : 1;    /* The wbinvd instruction works properly */
  23.166 -	u32                             wb_invd_flush   : 1;    /* The wbinvd flushes but does not invalidate */
  23.167 -	u32                             proc_c1         : 1;    /* All processors support C1 state */
  23.168 -	u32                             plvl2_up        : 1;    /* C2 state works on MP system */
  23.169 -	u32                             pwr_button      : 1;    /* Power button is handled as a generic feature */
  23.170 -	u32                             sleep_button    : 1;    /* Sleep button is handled as a generic feature, or not present */
  23.171 -	u32                             fixed_rTC       : 1;    /* RTC wakeup stat not in fixed register space */
  23.172 -	u32                             rtcs4           : 1;    /* RTC wakeup stat not possible from S4 */
  23.173 -	u32                             tmr_val_ext     : 1;    /* The tmr_val width is 32 bits (0 = 24 bits) */
  23.174 -	u32                             reserved5       : 23;   /* Reserved - must be zero */
  23.175 +
  23.176 +/* 0: ASF Information */
  23.177 +
  23.178 +struct acpi_asf_info {
  23.179 +	struct acpi_asf_header header;
  23.180 +	u8 min_reset_value;
  23.181 +	u8 min_poll_interval;
  23.182 +	u16 system_id;
  23.183 +	u32 mfg_id;
  23.184 +	u8 flags;
  23.185 +	u8 reserved2[3];
  23.186  };
  23.187  
  23.188 +/* 1: ASF Alerts */
  23.189 +
  23.190 +struct acpi_asf_alert {
  23.191 +	struct acpi_asf_header header;
  23.192 +	u8 assert_mask;
  23.193 +	u8 deassert_mask;
  23.194 +	u8 alerts;
  23.195 +	u8 data_length;
  23.196 +};
  23.197 +
  23.198 +struct acpi_asf_alert_data {
  23.199 +	u8 address;
  23.200 +	u8 command;
  23.201 +	u8 mask;
  23.202 +	u8 value;
  23.203 +	u8 sensor_type;
  23.204 +	u8 type;
  23.205 +	u8 offset;
  23.206 +	u8 source_type;
  23.207 +	u8 severity;
  23.208 +	u8 sensor_number;
  23.209 +	u8 entity;
  23.210 +	u8 instance;
  23.211 +};
  23.212 +
  23.213 +/* 2: ASF Remote Control */
  23.214 +
  23.215 +struct acpi_asf_remote {
  23.216 +	struct acpi_asf_header header;
  23.217 +	u8 controls;
  23.218 +	u8 data_length;
  23.219 +	u16 reserved2;
  23.220 +};
  23.221 +
  23.222 +struct acpi_asf_control_data {
  23.223 +	u8 function;
  23.224 +	u8 address;
  23.225 +	u8 command;
  23.226 +	u8 value;
  23.227 +};
  23.228 +
  23.229 +/* 3: ASF RMCP Boot Options */
  23.230 +
  23.231 +struct acpi_asf_rmcp {
  23.232 +	struct acpi_asf_header header;
  23.233 +	u8 capabilities[7];
  23.234 +	u8 completion_code;
  23.235 +	u32 enterprise_id;
  23.236 +	u8 command;
  23.237 +	u16 parameter;
  23.238 +	u16 boot_options;
  23.239 +	u16 oem_parameters;
  23.240 +};
  23.241 +
  23.242 +/* 4: ASF Address */
  23.243 +
  23.244 +struct acpi_asf_address {
  23.245 +	struct acpi_asf_header header;
  23.246 +	u8 eprom_address;
  23.247 +	u8 devices;
  23.248 +};
  23.249 +
  23.250 +/*******************************************************************************
  23.251 + *
  23.252 + * BOOT - Simple Boot Flag Table
  23.253 + *
  23.254 + ******************************************************************************/
  23.255 +
  23.256 +struct acpi_table_boot {
  23.257 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.258 +	u8 cmos_index;		/* Index in CMOS RAM for the boot register */
  23.259 +	u8 reserved[3];
  23.260 +};
  23.261 +
  23.262 +/*******************************************************************************
  23.263 + *
  23.264 + * CPEP - Corrected Platform Error Polling table
  23.265 + *
  23.266 + ******************************************************************************/
  23.267 +
  23.268 +struct acpi_table_cpep {
  23.269 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.270 +	u64 reserved;
  23.271 +};
  23.272 +
  23.273 +/* Subtable */
  23.274 +
  23.275 +struct acpi_cpep_polling {
  23.276 +	u8 type;
  23.277 +	u8 length;
  23.278 +	u8 id;			/* Processor ID */
  23.279 +	u8 eid;			/* Processor EID */
  23.280 +	u32 interval;		/* Polling interval (msec) */
  23.281 +};
  23.282 +
  23.283 +/*******************************************************************************
  23.284 + *
  23.285 + * DBGP - Debug Port table
  23.286 + *
  23.287 + ******************************************************************************/
  23.288 +
  23.289 +struct acpi_table_dbgp {
  23.290 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.291 +	u8 type;		/* 0=full 16550, 1=subset of 16550 */
  23.292 +	u8 reserved[3];
  23.293 +	struct acpi_generic_address debug_port;
  23.294 +};
  23.295 +
  23.296 +/*******************************************************************************
  23.297 + *
  23.298 + * DMAR - DMA Remapping table
  23.299 + *
  23.300 + ******************************************************************************/
  23.301 +
  23.302 +struct acpi_table_dmar {
  23.303 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.304 +	u8 width;		/* Host Address Width */
  23.305 +	u8 flags;
  23.306 +	u8 reserved[10];
  23.307 +};
  23.308 +
  23.309 +/* DMAR subtable header */
  23.310 +
  23.311 +struct acpi_dmar_header {
  23.312 +	u16 type;
  23.313 +	u16 length;
  23.314 +};
  23.315 +
  23.316 +/* Values for subtable type in struct acpi_dmar_header */
  23.317 +
  23.318 +enum acpi_dmar_type {
  23.319 +	ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
  23.320 +	ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
  23.321 +	ACPI_DMAR_TYPE_ATSR = 2,
  23.322 +	ACPI_DMAR_TYPE_RESERVED = 3	/* 3 and greater are reserved */
  23.323 +};
  23.324 +
  23.325 +struct acpi_dmar_device_scope {
  23.326 +	u8 entry_type;
  23.327 +	u8 length;
  23.328 +	u16 reserved;
  23.329 +	u8 enumeration_id;
  23.330 +	u8 bus;
  23.331 +};
  23.332 +
  23.333 +/* Values for entry_type in struct acpi_dmar_device_scope */
  23.334 +
  23.335 +enum acpi_dmar_scope_type {
  23.336 +	ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
  23.337 +	ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
  23.338 +	ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
  23.339 +	ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
  23.340 +	ACPI_DMAR_SCOPE_TYPE_HPET = 4,
  23.341 +	ACPI_DMAR_SCOPE_TYPE_RESERVED = 5	/* 5 and greater are reserved */
  23.342 +};
  23.343 +
  23.344 +struct acpi_dmar_pci_path {
  23.345 +	u8 dev;
  23.346 +	u8 fn;
  23.347 +};
  23.348 +
  23.349 +/*
  23.350 + * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
  23.351 + */
  23.352 +
  23.353 +/* 0: Hardware Unit Definition */
  23.354 +
  23.355 +struct acpi_dmar_hardware_unit {
  23.356 +	struct acpi_dmar_header header;
  23.357 +	u8 flags;
  23.358 +	u8 reserved;
  23.359 +	u16 segment;
  23.360 +	u64 address;		/* Register Base Address */
  23.361 +};
  23.362 +
  23.363 +/* Flags */
  23.364 +
  23.365 +#define ACPI_DMAR_INCLUDE_ALL       (1)
  23.366 +
  23.367 +/* 1: Reserved Memory Defininition */
  23.368 +
  23.369 +struct acpi_dmar_reserved_memory {
  23.370 +	struct acpi_dmar_header header;
  23.371 +	u16 reserved;
  23.372 +	u16 segment;
  23.373 +	u64 base_address;		/* 4_k aligned base address */
  23.374 +	u64 end_address;	/* 4_k aligned limit address */
  23.375 +};
  23.376 +
  23.377 +/* Flags */
  23.378 +
  23.379 +#define ACPI_DMAR_ALLOW_ALL         (1)
  23.380 +
  23.381 +/*******************************************************************************
  23.382 + *
  23.383 + * ECDT - Embedded Controller Boot Resources Table
  23.384 + *
  23.385 + ******************************************************************************/
  23.386 +
  23.387 +struct acpi_table_ecdt {
  23.388 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.389 +	struct acpi_generic_address control;	/* Address of EC command/status register */
  23.390 +	struct acpi_generic_address data;	/* Address of EC data register */
  23.391 +	u32 uid;		/* Unique ID - must be same as the EC _UID method */
  23.392 +	u8 gpe;			/* The GPE for the EC */
  23.393 +	u8 id[1];		/* Full namepath of the EC in the ACPI namespace */
  23.394 +};
  23.395 +
  23.396 +/*******************************************************************************
  23.397 + *
  23.398 + * HPET - High Precision Event Timer table
  23.399 + *
  23.400 + ******************************************************************************/
  23.401 +
  23.402 +struct acpi_table_hpet {
  23.403 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.404 +	u32 id;			/* Hardware ID of event timer block */
  23.405 +	struct acpi_generic_address address;	/* Address of event timer block */
  23.406 +	u8 sequence;		/* HPET sequence number */
  23.407 +	u16 minimum_tick;	/* Main counter min tick, periodic mode */
  23.408 +	u8 flags;
  23.409 +};
  23.410 +
  23.411 +/*! Flags */
  23.412 +
  23.413 +#define ACPI_HPET_PAGE_PROTECT      (1)	/* 00: No page protection */
  23.414 +#define ACPI_HPET_PAGE_PROTECT_4    (1<<1)	/* 01: 4KB page protected */
  23.415 +#define ACPI_HPET_PAGE_PROTECT_64   (1<<2)	/* 02: 64KB page protected */
  23.416 +
  23.417 +/*! [End] no source code translation !*/
  23.418 +
  23.419 +/*******************************************************************************
  23.420 + *
  23.421 + * MADT - Multiple APIC Description Table
  23.422 + *
  23.423 + ******************************************************************************/
  23.424 +
  23.425 +struct acpi_table_madt {
  23.426 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.427 +	u32 address;		/* Physical address of local APIC */
  23.428 +	u32 flags;
  23.429 +};
  23.430 +
  23.431 +/* Flags */
  23.432 +
  23.433 +#define ACPI_MADT_PCAT_COMPAT       (1)	/* 00:    System also has dual 8259s */
  23.434 +
  23.435 +/* Values for PCATCompat flag */
  23.436 +
  23.437 +#define ACPI_MADT_DUAL_PIC          0
  23.438 +#define ACPI_MADT_MULTIPLE_APIC     1
  23.439 +
  23.440 +/* Values for subtable type in struct acpi_subtable_header */
  23.441 +
  23.442 +enum acpi_madt_type {
  23.443 +	ACPI_MADT_TYPE_LOCAL_APIC = 0,
  23.444 +	ACPI_MADT_TYPE_IO_APIC = 1,
  23.445 +	ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  23.446 +	ACPI_MADT_TYPE_NMI_SOURCE = 3,
  23.447 +	ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  23.448 +	ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  23.449 +	ACPI_MADT_TYPE_IO_SAPIC = 6,
  23.450 +	ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  23.451 +	ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  23.452 +	ACPI_MADT_TYPE_RESERVED = 9	/* 9 and greater are reserved */
  23.453 +};
  23.454 +
  23.455 +/*
  23.456 + * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
  23.457 + */
  23.458 +
  23.459 +/* 0: Processor Local APIC */
  23.460 +
  23.461 +struct acpi_madt_local_apic {
  23.462 +	struct acpi_subtable_header header;
  23.463 +	u8 processor_id;	/* ACPI processor id */
  23.464 +	u8 id;			/* Processor's local APIC id */
  23.465 +	u32 lapic_flags;
  23.466 +};
  23.467 +
  23.468 +/* 1: IO APIC */
  23.469 +
  23.470 +struct acpi_madt_io_apic {
  23.471 +	struct acpi_subtable_header header;
  23.472 +	u8 id;			/* I/O APIC ID */
  23.473 +	u8 reserved;		/* Reserved - must be zero */
  23.474 +	u32 address;		/* APIC physical address */
  23.475 +	u32 global_irq_base;	/* Global system interrupt where INTI lines start */
  23.476 +};
  23.477 +
  23.478 +/* 2: Interrupt Override */
  23.479 +
  23.480 +struct acpi_madt_interrupt_override {
  23.481 +	struct acpi_subtable_header header;
  23.482 +	u8 bus;			/* 0 - ISA */
  23.483 +	u8 source_irq;		/* Interrupt source (IRQ) */
  23.484 +	u32 global_irq;		/* Global system interrupt */
  23.485 +	u16 inti_flags;
  23.486 +};
  23.487 +
  23.488 +/* 3: NMI Source */
  23.489 +
  23.490 +struct acpi_madt_nmi_source {
  23.491 +	struct acpi_subtable_header header;
  23.492 +	u16 inti_flags;
  23.493 +	u32 global_irq;		/* Global system interrupt */
  23.494 +};
  23.495 +
  23.496 +/* 4: Local APIC NMI */
  23.497 +
  23.498 +struct acpi_madt_local_apic_nmi {
  23.499 +	struct acpi_subtable_header header;
  23.500 +	u8 processor_id;	/* ACPI processor id */
  23.501 +	u16 inti_flags;
  23.502 +	u8 lint;		/* LINTn to which NMI is connected */
  23.503 +};
  23.504 +
  23.505 +/* 5: Address Override */
  23.506 +
  23.507 +struct acpi_madt_local_apic_override {
  23.508 +	struct acpi_subtable_header header;
  23.509 +	u16 reserved;		/* Reserved, must be zero */
  23.510 +	u64 address;		/* APIC physical address */
  23.511 +};
  23.512 +
  23.513 +/* 6: I/O Sapic */
  23.514 +
  23.515 +struct acpi_madt_io_sapic {
  23.516 +	struct acpi_subtable_header header;
  23.517 +	u8 id;			/* I/O SAPIC ID */
  23.518 +	u8 reserved;		/* Reserved, must be zero */
  23.519 +	u32 global_irq_base;	/* Global interrupt for SAPIC start */
  23.520 +	u64 address;		/* SAPIC physical address */
  23.521 +};
  23.522 +
  23.523 +/* 7: Local Sapic */
  23.524 +
  23.525 +struct acpi_madt_local_sapic {
  23.526 +	struct acpi_subtable_header header;
  23.527 +	u8 processor_id;	/* ACPI processor id */
  23.528 +	u8 id;			/* SAPIC ID */
  23.529 +	u8 eid;			/* SAPIC EID */
  23.530 +	u8 reserved[3];		/* Reserved, must be zero */
  23.531 +	u32 lapic_flags;
  23.532 +	u32 uid;		/* Numeric UID - ACPI 3.0 */
  23.533 +	char uid_string[1];	/* String UID  - ACPI 3.0 */
  23.534 +};
  23.535 +
  23.536 +/* 8: Platform Interrupt Source */
  23.537 +
  23.538 +struct acpi_madt_interrupt_source {
  23.539 +	struct acpi_subtable_header header;
  23.540 +	u16 inti_flags;
  23.541 +	u8 type;		/* 1=PMI, 2=INIT, 3=corrected */
  23.542 +	u8 id;			/* Processor ID */
  23.543 +	u8 eid;			/* Processor EID */
  23.544 +	u8 io_sapic_vector;	/* Vector value for PMI interrupts */
  23.545 +	u32 global_irq;		/* Global system interrupt */
  23.546 +	u32 flags;		/* Interrupt Source Flags */
  23.547 +};
  23.548 +
  23.549 +/* Flags field above */
  23.550 +
  23.551 +#define ACPI_MADT_CPEI_OVERRIDE     (1)
  23.552 +
  23.553 +/*
  23.554 + * Common flags fields for MADT subtables
  23.555 + */
  23.556 +
  23.557 +/* MADT Local APIC flags (lapic_flags) */
  23.558 +
  23.559 +#define ACPI_MADT_ENABLED           (1)	/* 00: Processor is usable if set */
  23.560 +
  23.561 +/* MADT MPS INTI flags (inti_flags) */
  23.562 +
  23.563 +#define ACPI_MADT_POLARITY_MASK     (3)	/* 00-01: Polarity of APIC I/O input signals */
  23.564 +#define ACPI_MADT_TRIGGER_MASK      (3<<2)	/* 02-03: Trigger mode of APIC input signals */
  23.565 +
  23.566 +/* Values for MPS INTI flags */
  23.567 +
  23.568 +#define ACPI_MADT_POLARITY_CONFORMS       0
  23.569 +#define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
  23.570 +#define ACPI_MADT_POLARITY_RESERVED       2
  23.571 +#define ACPI_MADT_POLARITY_ACTIVE_LOW     3
  23.572 +
  23.573 +#define ACPI_MADT_TRIGGER_CONFORMS        (0)
  23.574 +#define ACPI_MADT_TRIGGER_EDGE            (1<<2)
  23.575 +#define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
  23.576 +#define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
  23.577 +
  23.578 +/*******************************************************************************
  23.579 + *
  23.580 + * MCFG - PCI Memory Mapped Configuration table and sub-table
  23.581 + *
  23.582 + ******************************************************************************/
  23.583 +
  23.584 +struct acpi_table_mcfg {
  23.585 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.586 +	u8 reserved[8];
  23.587 +};
  23.588 +
  23.589 +/* Subtable */
  23.590 +
  23.591 +struct acpi_mcfg_allocation {
  23.592 +	u64 address;		/* Base address, processor-relative */
  23.593 +	u16 pci_segment;	/* PCI segment group number */
  23.594 +	u8 start_bus_number;	/* Starting PCI Bus number */
  23.595 +	u8 end_bus_number;	/* Final PCI Bus number */
  23.596 +	u32 reserved;
  23.597 +};
  23.598 +
  23.599 +/*******************************************************************************
  23.600 + *
  23.601 + * SBST - Smart Battery Specification Table
  23.602 + *
  23.603 + ******************************************************************************/
  23.604 +
  23.605 +struct acpi_table_sbst {
  23.606 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.607 +	u32 warning_level;
  23.608 +	u32 low_level;
  23.609 +	u32 critical_level;
  23.610 +};
  23.611 +
  23.612 +/*******************************************************************************
  23.613 + *
  23.614 + * SLIT - System Locality Distance Information Table
  23.615 + *
  23.616 + ******************************************************************************/
  23.617 +
  23.618 +struct acpi_table_slit {
  23.619 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.620 +	u64 locality_count;
  23.621 +	u8 entry[1];		/* Real size = localities^2 */
  23.622 +};
  23.623 +
  23.624 +/*******************************************************************************
  23.625 + *
  23.626 + * SPCR - Serial Port Console Redirection table
  23.627 + *
  23.628 + ******************************************************************************/
  23.629 +
  23.630 +struct acpi_table_spcr {
  23.631 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.632 +	u8 interface_type;	/* 0=full 16550, 1=subset of 16550 */
  23.633 +	u8 reserved[3];
  23.634 +	struct acpi_generic_address serial_port;
  23.635 +	u8 interrupt_type;
  23.636 +	u8 pc_interrupt;
  23.637 +	u32 interrupt;
  23.638 +	u8 baud_rate;
  23.639 +	u8 parity;
  23.640 +	u8 stop_bits;
  23.641 +	u8 flow_control;
  23.642 +	u8 terminal_type;
  23.643 +	u8 reserved1;
  23.644 +	u16 pci_device_id;
  23.645 +	u16 pci_vendor_id;
  23.646 +	u8 pci_bus;
  23.647 +	u8 pci_device;
  23.648 +	u8 pci_function;
  23.649 +	u32 pci_flags;
  23.650 +	u8 pci_segment;
  23.651 +	u32 reserved2;
  23.652 +};
  23.653 +
  23.654 +/*******************************************************************************
  23.655 + *
  23.656 + * SPMI - Server Platform Management Interface table
  23.657 + *
  23.658 + ******************************************************************************/
  23.659 +
  23.660 +struct acpi_table_spmi {
  23.661 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.662 +	u8 reserved;
  23.663 +	u8 interface_type;
  23.664 +	u16 spec_revision;	/* Version of IPMI */
  23.665 +	u8 interrupt_type;
  23.666 +	u8 gpe_number;		/* GPE assigned */
  23.667 +	u8 reserved1;
  23.668 +	u8 pci_device_flag;
  23.669 +	u32 interrupt;
  23.670 +	struct acpi_generic_address ipmi_register;
  23.671 +	u8 pci_segment;
  23.672 +	u8 pci_bus;
  23.673 +	u8 pci_device;
  23.674 +	u8 pci_function;
  23.675 +};
  23.676 +
  23.677 +/*******************************************************************************
  23.678 + *
  23.679 + * SRAT - System Resource Affinity Table
  23.680 + *
  23.681 + ******************************************************************************/
  23.682 +
  23.683 +struct acpi_table_srat {
  23.684 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.685 +	u32 table_revision;	/* Must be value '1' */
  23.686 +	u64 reserved;		/* Reserved, must be zero */
  23.687 +};
  23.688 +
  23.689 +/* Values for subtable type in struct acpi_subtable_header */
  23.690 +
  23.691 +enum acpi_srat_type {
  23.692 +	ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  23.693 +	ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  23.694 +	ACPI_SRAT_TYPE_RESERVED = 2
  23.695 +};
  23.696 +
  23.697 +/* SRAT sub-tables */
  23.698 +
  23.699 +struct acpi_srat_cpu_affinity {
  23.700 +	struct acpi_subtable_header header;
  23.701 +	u8 proximity_domain_lo;
  23.702 +	u8 apic_id;
  23.703 +	u32 flags;
  23.704 +	u8 local_sapic_eid;
  23.705 +	u8 proximity_domain_hi[3];
  23.706 +	u32 reserved;		/* Reserved, must be zero */
  23.707 +};
  23.708 +
  23.709 +/* Flags */
  23.710 +
  23.711 +#define ACPI_SRAT_CPU_ENABLED       (1)	/* 00: Use affinity structure */
  23.712 +
  23.713 +struct acpi_srat_mem_affinity {
  23.714 +	struct acpi_subtable_header header;
  23.715 +	u32 proximity_domain;
  23.716 +	u16 reserved;		/* Reserved, must be zero */
  23.717 +	u64 base_address;
  23.718 +	u64 length;
  23.719 +	u32 memory_type;	/* See acpi_address_range_id */
  23.720 +	u32 flags;
  23.721 +	u64 reserved1;		/* Reserved, must be zero */
  23.722 +};
  23.723 +
  23.724 +/* Flags */
  23.725 +
  23.726 +#define ACPI_SRAT_MEM_ENABLED       (1)	/* 00: Use affinity structure */
  23.727 +#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)	/* 01: Memory region is hot pluggable */
  23.728 +#define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)	/* 02: Memory region is non-volatile */
  23.729 +
  23.730 +/*******************************************************************************
  23.731 + *
  23.732 + * TCPA - Trusted Computing Platform Alliance table
  23.733 + *
  23.734 + ******************************************************************************/
  23.735 +
  23.736 +struct acpi_table_tcpa {
  23.737 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.738 +	u16 reserved;
  23.739 +	u32 max_log_length;	/* Maximum length for the event log area */
  23.740 +	u64 log_address;	/* Address of the event log area */
  23.741 +};
  23.742 +
  23.743 +/*******************************************************************************
  23.744 + *
  23.745 + * WDRT - Watchdog Resource Table
  23.746 + *
  23.747 + ******************************************************************************/
  23.748 +
  23.749 +struct acpi_table_wdrt {
  23.750 +	struct acpi_table_header header;	/* Common ACPI table header */
  23.751 +	u32 header_length;	/* Watchdog Header Length */
  23.752 +	u8 pci_segment;		/* PCI Segment number */
  23.753 +	u8 pci_bus;		/* PCI Bus number */
  23.754 +	u8 pci_device;		/* PCI Device number */
  23.755 +	u8 pci_function;	/* PCI Function number */
  23.756 +	u32 timer_period;	/* Period of one timer count (msec) */
  23.757 +	u32 max_count;		/* Maximum counter value supported */
  23.758 +	u32 min_count;		/* Minimum counter value */
  23.759 +	u8 flags;
  23.760 +	u8 reserved[3];
  23.761 +	u32 entries;		/* Number of watchdog entries that follow */
  23.762 +};
  23.763 +
  23.764 +/* Flags */
  23.765 +
  23.766 +#define ACPI_WDRT_TIMER_ENABLED     (1)	/* 00: Timer enabled */
  23.767 +
  23.768 +/* Reset to default packing */
  23.769 +
  23.770  #pragma pack()
  23.771  
  23.772 -#endif /* __ACTBL1_H__ */
  23.773 -
  23.774 -
  23.775 +#endif				/* __ACTBL1_H__ */
    24.1 --- a/xen/include/acpi/actbl2.h	Tue Mar 18 13:14:26 2008 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,232 +0,0 @@
    24.4 -/******************************************************************************
    24.5 - *
    24.6 - * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
    24.7 - *
    24.8 - *****************************************************************************/
    24.9 -
   24.10 -/*
   24.11 - * Copyright (C) 2000 - 2005, R. Byron Moore
   24.12 - * All rights reserved.
   24.13 - *
   24.14 - * Redistribution and use in source and binary forms, with or without
   24.15 - * modification, are permitted provided that the following conditions
   24.16 - * are met:
   24.17 - * 1. Redistributions of source code must retain the above copyright
   24.18 - *    notice, this list of conditions, and the following disclaimer,
   24.19 - *    without modification.
   24.20 - * 2. Redistributions in binary form must reproduce at minimum a disclaimer
   24.21 - *    substantially similar to the "NO WARRANTY" disclaimer below
   24.22 - *    ("Disclaimer") and any redistribution must be conditioned upon
   24.23 - *    including a substantially similar Disclaimer requirement for further
   24.24 - *    binary redistribution.
   24.25 - * 3. Neither the names of the above-listed copyright holders nor the names
   24.26 - *    of any contributors may be used to endorse or promote products derived
   24.27 - *    from this software without specific prior written permission.
   24.28 - *
   24.29 - * Alternatively, this software may be distributed under the terms of the
   24.30 - * GNU General Public License ("GPL") version 2 as published by the Free
   24.31 - * Software Foundation.
   24.32 - *
   24.33 - * NO WARRANTY
   24.34 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   24.35 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   24.36 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
   24.37 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   24.38 - * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   24.39 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   24.40 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   24.41 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   24.42 - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
   24.43 - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   24.44 - * POSSIBILITY OF SUCH DAMAGES.
   24.45 - */
   24.46 -
   24.47 -#ifndef __ACTBL2_H__
   24.48 -#define __ACTBL2_H__
   24.49 -
   24.50 -/*
   24.51 - * Prefered Power Management Profiles
   24.52 - */
   24.53 -#define PM_UNSPECIFIED                  0
   24.54 -#define PM_DESKTOP                      1
   24.55 -#define PM_MOBILE                       2
   24.56 -#define PM_WORKSTATION                  3
   24.57 -#define PM_ENTERPRISE_SERVER            4
   24.58 -#define PM_SOHO_SERVER                  5
   24.59 -#define PM_APPLIANCE_PC                 6
   24.60 -
   24.61 -/*
   24.62 - * ACPI Boot Arch Flags
   24.63 - */
   24.64 -#define BAF_LEGACY_DEVICES              0x0001
   24.65 -#define BAF_8042_KEYBOARD_CONTROLLER    0x0002
   24.66 -
   24.67 -#define FADT2_REVISION_ID               3
   24.68 -#define FADT2_MINUS_REVISION_ID         2
   24.69 -
   24.70 -
   24.71 -#pragma pack(1)
   24.72 -
   24.73 -/*
   24.74 - * ACPI 2.0 Root System Description Table (RSDT)
   24.75 - */
   24.76 -struct rsdt_descriptor_rev2
   24.77 -{
   24.78 -	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
   24.79 -	u32                             table_offset_entry [1]; /* Array of pointers to  */
   24.80 -			 /* ACPI table headers */
   24.81 -};
   24.82 -
   24.83 -
   24.84 -/*
   24.85 - * ACPI 2.0 Extended System Description Table (XSDT)
   24.86 - */
   24.87 -struct xsdt_descriptor_rev2
   24.88 -{
   24.89 -	ACPI_TABLE_HEADER_DEF                           /* ACPI common table header */
   24.90 -	u64                             table_offset_entry [1]; /* Array of pointers to  */
   24.91 -			 /* ACPI table headers */
   24.92 -};
   24.93 -
   24.94 -
   24.95 -/*
   24.96 - * ACPI 2.0 Firmware ACPI Control Structure (FACS)
   24.97 - */
   24.98 -struct facs_descriptor_rev2
   24.99 -{
  24.100 -	char                            signature[4];           /* ACPI signature */
  24.101 -	u32                             length;                 /* Length of structure, in bytes */
  24.102 -	u32                             hardware_signature;     /* Hardware configuration signature */
  24.103 -	u32                             firmware_waking_vector; /* 32bit physical address of the Firmware Waking Vector. */
  24.104 -	u32                             global_lock;            /* Global Lock used to synchronize access to shared hardware resources */
  24.105 -	u32                             S4bios_f        : 1;    /* S4Bios_f - Indicates if S4BIOS support is present */
  24.106 -	u32                             reserved1       : 31;   /* Must be 0 */
  24.107 -	u64                             xfirmware_waking_vector; /* 64bit physical address of the Firmware Waking Vector. */
  24.108 -	u8                              version;                /* Version of this table */
  24.109 -	u8                              reserved3 [31];         /* Reserved - must be zero */
  24.110 -};
  24.111 -
  24.112 -
  24.113 -/*
  24.114 - * ACPI 2.0 Generic Address Structure (GAS)
  24.115 - */
  24.116 -struct acpi_generic_address
  24.117 -{
  24.118 -	u8                              address_space_id;       /* Address space where struct or register exists. */
  24.119 -	u8                              register_bit_width;     /* Size in bits of given register */
  24.120 -	u8                              register_bit_offset;    /* Bit offset within the register */
  24.121 -	u8                              access_width;           /* Minimum Access size (ACPI 3.0) */
  24.122 -	u64                             address;                /* 64-bit address of struct or register */
  24.123 -};
  24.124 -
  24.125 -
  24.126 -#define FADT_REV2_COMMON \
  24.127 -	u32                             V1_firmware_ctrl;   /* 32-bit physical address of FACS */ \
  24.128 -	u32                             V1_dsdt;            /* 32-bit physical address of DSDT */ \
  24.129 -	u8                              reserved1;          /* System Interrupt Model isn't used in ACPI 2.0*/ \
  24.130 -	u8                              prefer_PM_profile;  /* Conveys preferred power management profile to OSPM. */ \
  24.131 -	u16                             sci_int;            /* System vector of SCI interrupt */ \
  24.132 -	u32                             smi_cmd;            /* Port address of SMI command port */ \
  24.133 -	u8                              acpi_enable;        /* Value to write to smi_cmd to enable ACPI */ \
  24.134 -	u8                              acpi_disable;       /* Value to write to smi_cmd to disable ACPI */ \
  24.135 -	u8                              S4bios_req;         /* Value to write to SMI CMD to enter S4BIOS state */ \
  24.136 -	u8                              pstate_cnt;         /* Processor performance state control*/ \
  24.137 -	u32                             V1_pm1a_evt_blk;    /* Port address of Power Mgt 1a acpi_event Reg Blk */ \
  24.138 -	u32                             V1_pm1b_evt_blk;    /* Port address of Power Mgt 1b acpi_event Reg Blk */ \
  24.139 -	u32                             V1_pm1a_cnt_blk;    /* Port address of Power Mgt 1a Control Reg Blk */ \
  24.140 -	u32                             V1_pm1b_cnt_blk;    /* Port address of Power Mgt 1b Control Reg Blk */ \
  24.141 -	u32                             V1_pm2_cnt_blk;     /* Port address of Power Mgt 2 Control Reg Blk */ \
  24.142 -	u32                             V1_pm_tmr_blk;      /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
  24.143 -	u32                             V1_gpe0_blk;        /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
  24.144 -	u32                             V1_gpe1_blk;        /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
  24.145 -	u8                              pm1_evt_len;        /* Byte length of ports at pm1_x_evt_blk */ \
  24.146 -	u8                              pm1_cnt_len;        /* Byte length of ports at pm1_x_cnt_blk */ \
  24.147 -	u8                              pm2_cnt_len;        /* Byte Length of ports at pm2_cnt_blk */ \
  24.148 -	u8                              pm_tm_len;          /* Byte Length of ports at pm_tm_blk */ \
  24.149 -	u8                              gpe0_blk_len;       /* Byte Length of ports at gpe0_blk */ \
  24.150 -	u8                              gpe1_blk_len;       /* Byte Length of ports at gpe1_blk */ \
  24.151 -	u8                              gpe1_base;          /* Offset in gpe model where gpe1 events start */ \
  24.152 -	u8                              cst_cnt;            /* Support for the _CST object and C States change notification.*/ \
  24.153 -	u16                             plvl2_lat;          /* Worst case HW latency to enter/exit C2 state */ \
  24.154 -	u16                             plvl3_lat;          /* Worst case HW latency to enter/exit C3 state */ \
  24.155 -	u16                             flush_size;         /* Number of flush strides that need to be read */ \
  24.156 -	u16                             flush_stride;       /* Processor's memory cache line width, in bytes */ \
  24.157 -	u8                              duty_offset;        /* Processor's duty cycle index in processor's P_CNT reg*/ \
  24.158 -	u8                              duty_width;         /* Processor's duty cycle value bit width in P_CNT register.*/ \
  24.159 -	u8                              day_alrm;           /* Index to day-of-month alarm in RTC CMOS RAM */ \
  24.160 -	u8                              mon_alrm;           /* Index to month-of-year alarm in RTC CMOS RAM */ \
  24.161 -	u8                              century;            /* Index to century in RTC CMOS RAM */ \
  24.162 -	u16                             iapc_boot_arch;     /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/
  24.163 -
  24.164 -/*
  24.165 - * ACPI 2.0 Fixed ACPI Description Table (FADT)
  24.166 - */
  24.167 -struct fadt_descriptor_rev2
  24.168 -{
  24.169 -	ACPI_TABLE_HEADER_DEF                       /* ACPI common table header */
  24.170 -	FADT_REV2_COMMON
  24.171 -	u8                              reserved2;          /* Reserved */
  24.172 -	u32                             wb_invd     : 1;    /* The wbinvd instruction works properly */
  24.173 -	u32                             wb_invd_flush : 1;  /* The wbinvd flushes but does not invalidate */
  24.174 -	u32                             proc_c1     : 1;    /* All processors support C1 state */
  24.175 -	u32                             plvl2_up    : 1;    /* C2 state works on MP system */
  24.176 -	u32                             pwr_button  : 1;    /* Power button is handled as a generic feature */
  24.177 -	u32                             sleep_button : 1;   /* Sleep button is handled as a generic feature, or not present */
  24.178 -	u32                             fixed_rTC   : 1;    /* RTC wakeup stat not in fixed register space */
  24.179 -	u32                             rtcs4       : 1;    /* RTC wakeup stat not possible from S4 */
  24.180 -	u32                             tmr_val_ext : 1;    /* Indicates tmr_val is 32 bits 0=24-bits*/
  24.181 -	u32                             dock_cap    : 1;    /* Supports Docking */
  24.182 -	u32                             reset_reg_sup : 1;  /* Indicates system supports system reset via the FADT RESET_REG*/
  24.183 -	u32                             sealed_case : 1;    /* Indicates system has no internal expansion capabilities and case is sealed. */
  24.184 -	u32                             headless    : 1;    /* Indicates system does not have local video capabilities or local input devices.*/
  24.185 -	u32                             cpu_sw_sleep : 1;   /* Indicates to OSPM that a processor native instruction */
  24.186 -			   /* Must be executed after writing the SLP_TYPx register. */
  24.187 -	u32                             reserved6   : 18;   /* Reserved - must be zero */
  24.188 -
  24.189 -	struct acpi_generic_address     reset_register;     /* Reset register address in GAS format */
  24.190 -	u8                              reset_value;        /* Value to write to the reset_register port to reset the system. */
  24.191 -	u8                              reserved7[3];       /* These three bytes must be zero */
  24.192 -	u64                             xfirmware_ctrl;     /* 64-bit physical address of FACS */
  24.193 -	u64                             Xdsdt;              /* 64-bit physical address of DSDT */
  24.194 -	struct acpi_generic_address     xpm1a_evt_blk;      /* Extended Power Mgt 1a acpi_event Reg Blk address */
  24.195 -	struct acpi_generic_address     xpm1b_evt_blk;      /* Extended Power Mgt 1b acpi_event Reg Blk address */
  24.196 -	struct acpi_generic_address     xpm1a_cnt_blk;      /* Extended Power Mgt 1a Control Reg Blk address */
  24.197 -	struct acpi_generic_address     xpm1b_cnt_blk;      /* Extended Power Mgt 1b Control Reg Blk address */
  24.198 -	struct acpi_generic_address     xpm2_cnt_blk;       /* Extended Power Mgt 2 Control Reg Blk address */
  24.199 -	struct acpi_generic_address     xpm_tmr_blk;        /* Extended Power Mgt Timer Ctrl Reg Blk address */
  24.200 -	struct acpi_generic_address     xgpe0_blk;          /* Extended General Purpose acpi_event 0 Reg Blk address */
  24.201 -	struct acpi_generic_address     xgpe1_blk;          /* Extended General Purpose acpi_event 1 Reg Blk address */
  24.202 -};
  24.203 -
  24.204 -
  24.205 -/* "Downrevved" ACPI 2.0 FADT descriptor */
  24.206 -
  24.207 -struct fadt_descriptor_rev2_minus
  24.208 -{
  24.209 -	ACPI_TABLE_HEADER_DEF                       /* ACPI common table header */
  24.210 -	FADT_REV2_COMMON
  24.211 -	u8                              reserved2;          /* Reserved */
  24.212 -	u32                             flags;
  24.213 -	struct acpi_generic_address     reset_register;     /* Reset register address in GAS format */
  24.214 -	u8                              reset_value;        /* Value to write to the reset_register port to reset the system. */
  24.215 -	u8                              reserved7[3];       /* These three bytes must be zero */
  24.216 -};
  24.217 -
  24.218 -
  24.219 -/* Embedded Controller */
  24.220 -
  24.221 -struct ec_boot_resources
  24.222 -{
  24.223 -	ACPI_TABLE_HEADER_DEF
  24.224 -	struct acpi_generic_address     ec_control;         /* Address of EC command/status register */
  24.225 -	struct acpi_generic_address     ec_data;            /* Address of EC data register */
  24.226 -	u32                             uid;                /* Unique ID - must be same as the EC _UID method */
  24.227 -	u8                              gpe_bit;            /* The GPE for the EC */
  24.228 -	u8                              ec_id[1];           /* Full namepath of the EC in the ACPI namespace */
  24.229 -};
  24.230 -
  24.231 -
  24.232 -#pragma pack()
  24.233 -
  24.234 -#endif /* __ACTBL2_H__ */
  24.235 -
    25.1 --- a/xen/include/acpi/actypes.h	Tue Mar 18 13:14:26 2008 +0000
    25.2 +++ b/xen/include/acpi/actypes.h	Tue Mar 18 14:55:36 2008 +0000
    25.3 @@ -5,7 +5,7 @@
    25.4   *****************************************************************************/
    25.5  
    25.6  /*
    25.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    25.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    25.9   * All rights reserved.
   25.10   *
   25.11   * Redistribution and use in source and binary forms, with or without
   25.12 @@ -44,9 +44,18 @@
   25.13  #ifndef __ACTYPES_H__
   25.14  #define __ACTYPES_H__
   25.15  
   25.16 -/*! [Begin] no source code translation (keep the typedefs) */
   25.17 +/* acpisrc:struct_defs -- for acpisrc conversion */
   25.18  
   25.19 +/*
   25.20 + * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
   25.21 + * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
   25.22 + * 12/2006.
   25.23 + */
   25.24 +#ifndef ACPI_MACHINE_WIDTH
   25.25 +#error ACPI_MACHINE_WIDTH not defined
   25.26 +#endif
   25.27  
   25.28 +/*! [Begin] no source code translation */
   25.29  
   25.30  /*
   25.31   * Data type ranges
   25.32 @@ -54,199 +63,223 @@
   25.33   * working around problems that some 32-bit compilers have with 64-bit
   25.34   * constants.
   25.35   */
   25.36 -#define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0)) /* 0xFF               */
   25.37 -#define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0)) /* 0xFFFF             */
   25.38 -#define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF         */
   25.39 -#define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
   25.40 +#define ACPI_UINT8_MAX                  (UINT8) (~((UINT8)  0))	/* 0xFF               */
   25.41 +#define ACPI_UINT16_MAX                 (UINT16)(~((UINT16) 0))	/* 0xFFFF             */
   25.42 +#define ACPI_UINT32_MAX                 (UINT32)(~((UINT32) 0))	/* 0xFFFFFFFF         */
   25.43 +#define ACPI_UINT64_MAX                 (UINT64)(~((UINT64) 0))	/* 0xFFFFFFFFFFFFFFFF */
   25.44  #define ACPI_ASCII_MAX                  0x7F
   25.45  
   25.46 -
   25.47 -#ifdef DEFINE_ALTERNATE_TYPES
   25.48  /*
   25.49 - * Types used only in translated source, defined here to enable
   25.50 - * cross-platform compilation only.
   25.51 - */
   25.52 -typedef int                             s32;
   25.53 -typedef unsigned char                   u8;
   25.54 -typedef unsigned short                  u16;
   25.55 -typedef unsigned int                    u32;
   25.56 -typedef COMPILER_DEPENDENT_UINT64       u64;
   25.57 -
   25.58 -#endif
   25.59 -
   25.60 -
   25.61 -/*
   25.62 - * Data types - Fixed across all compilation models (16/32/64)
   25.63 + * Architecture-specific ACPICA Subsystem Data Types
   25.64   *
   25.65 - * BOOLEAN          Logical Boolean.
   25.66 - * INT8             8-bit  (1 byte) signed value
   25.67 - * UINT8            8-bit  (1 byte) unsigned value
   25.68 - * INT16            16-bit (2 byte) signed value
   25.69 - * UINT16           16-bit (2 byte) unsigned value
   25.70 - * INT32            32-bit (4 byte) signed value
   25.71 - * UINT32           32-bit (4 byte) unsigned value
   25.72 - * INT64            64-bit (8 byte) signed value
   25.73 - * UINT64           64-bit (8 byte) unsigned value
   25.74 - * ACPI_NATIVE_INT  32-bit on IA-32, 64-bit on IA-64 signed value
   25.75 - * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
   25.76 + * The goal of these types is to provide source code portability across
   25.77 + * 16-bit, 32-bit, and 64-bit targets.
   25.78 + *
   25.79 + * 1) The following types are of fixed size for all targets (16/32/64):
   25.80 + *
   25.81 + * BOOLEAN      Logical boolean
   25.82 + *
   25.83 + * UINT8        8-bit  (1 byte) unsigned value
   25.84 + * UINT16       16-bit (2 byte) unsigned value
   25.85 + * UINT32       32-bit (4 byte) unsigned value
   25.86 + * UINT64       64-bit (8 byte) unsigned value
   25.87 + *
   25.88 + * INT16        16-bit (2 byte) signed value
   25.89 + * INT32        32-bit (4 byte) signed value
   25.90 + * INT64        64-bit (8 byte) signed value
   25.91 + *
   25.92 + * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
   25.93 + * compiler-dependent header(s) and were introduced because there is no common
   25.94 + * 64-bit integer type across the various compilation models, as shown in
   25.95 + * the table below.
   25.96 + *
   25.97 + * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
   25.98 + * char      8    8     8     8     8    8
   25.99 + * short     16   16    16    16    16   16
  25.100 + * _int32         32
  25.101 + * int       32   64    32    32    16   16
  25.102 + * long      64   64    32    32    32   32
  25.103 + * long long            64    64
  25.104 + * pointer   64   64    64    32    32   32
  25.105 + *
  25.106 + * Note: ILP64 and LP32 are currently not supported.
  25.107 + *
  25.108 + *
  25.109 + * 2) These types represent the native word size of the target mode of the
  25.110 + * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
  25.111 + * usually used for memory allocation, efficient loop counters, and array
  25.112 + * indexes. The types are similar to the size_t type in the C library and are
  25.113 + * required because there is no C type that consistently represents the native
  25.114 + * data width.
  25.115 + *
  25.116 + * ACPI_SIZE        16/32/64-bit unsigned value
  25.117 + * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
  25.118 + * ACPI_NATIVE_INT  16/32/64-bit signed value
  25.119 + *
  25.120   */
  25.121  
  25.122 -#ifndef ACPI_MACHINE_WIDTH
  25.123 -#error ACPI_MACHINE_WIDTH not defined
  25.124 -#endif
  25.125 +/*******************************************************************************
  25.126 + *
  25.127 + * Common types for all compilers, all targets
  25.128 + *
  25.129 + ******************************************************************************/
  25.130 +
  25.131 +typedef unsigned char BOOLEAN;
  25.132 +typedef unsigned char UINT8;
  25.133 +typedef unsigned short UINT16;
  25.134 +typedef COMPILER_DEPENDENT_UINT64 UINT64;
  25.135 +typedef COMPILER_DEPENDENT_INT64 INT64;
  25.136 +
  25.137 +/*! [End] no source code translation !*/
  25.138 +
  25.139 +/*******************************************************************************
  25.140 + *
  25.141 + * Types specific to 64-bit targets
  25.142 + *
  25.143 + ******************************************************************************/
  25.144  
  25.145  #if ACPI_MACHINE_WIDTH == 64
  25.146  
  25.147 -/*! [Begin] no source code translation (keep the typedefs) */
  25.148 +/*! [Begin] no source code translation (keep the typedefs as-is) */
  25.149  
  25.150 -/*
  25.151 - * 64-bit type definitions
  25.152 - */
  25.153 -typedef unsigned char                   UINT8;
  25.154 -typedef unsigned char                   BOOLEAN;
  25.155 -typedef unsigned short                  UINT16;
  25.156 -typedef int                             INT32;
  25.157 -typedef unsigned int                    UINT32;
  25.158 -typedef COMPILER_DEPENDENT_INT64        INT64;
  25.159 -typedef COMPILER_DEPENDENT_UINT64       UINT64;
  25.160 +typedef unsigned int UINT32;
  25.161 +typedef int INT32;
  25.162  
  25.163  /*! [End] no source code translation !*/
  25.164  
  25.165 -typedef s64                                     acpi_native_int;
  25.166 -typedef u64                                     acpi_native_uint;
  25.167 +typedef u64 acpi_native_uint;
  25.168 +typedef s64 acpi_native_int;
  25.169  
  25.170 -typedef u64                                     acpi_table_ptr;
  25.171 -typedef u64                                     acpi_io_address;
  25.172 -typedef u64                                     acpi_physical_address;
  25.173 -typedef u64                                     acpi_size;
  25.174 +typedef u64 acpi_io_address;
  25.175 +typedef u64 acpi_physical_address;
  25.176  
  25.177 -#define ALIGNED_ADDRESS_BOUNDARY        0x00000008      /* No hardware alignment support in IA64 */
  25.178 -#define ACPI_USE_NATIVE_DIVIDE                          /* Native 64-bit integer support */
  25.179  #define ACPI_MAX_PTR                    ACPI_UINT64_MAX
  25.180  #define ACPI_SIZE_MAX                   ACPI_UINT64_MAX
  25.181  
  25.182 -
  25.183 -#elif ACPI_MACHINE_WIDTH == 16
  25.184 -
  25.185 -/*! [Begin] no source code translation (keep the typedefs) */
  25.186 +#define ACPI_USE_NATIVE_DIVIDE	/* Has native 64-bit integer support */
  25.187  
  25.188  /*
  25.189 - * 16-bit type definitions
  25.190 + * In the case of the Itanium Processor Family (IPF), the hardware does not
  25.191 + * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
  25.192 + * to indicate that special precautions must be taken to avoid alignment faults.
  25.193 + * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
  25.194 + *
  25.195 + * Note: Em64_t and other X86-64 processors support misaligned transfers,
  25.196 + * so there is no need to define this flag.
  25.197   */
  25.198 -typedef unsigned char                   UINT8;
  25.199 -typedef unsigned char                   BOOLEAN;
  25.200 -typedef unsigned int                    UINT16;
  25.201 -typedef long                            INT32;
  25.202 -typedef int                             INT16;
  25.203 -typedef unsigned long                   UINT32;
  25.204 +#if defined (__IA64__) || defined (__ia64__)
  25.205 +#define ACPI_MISALIGNMENT_NOT_SUPPORTED
  25.206 +#endif
  25.207  
  25.208 -struct
  25.209 -{
  25.210 -	UINT32                                  Lo;
  25.211 -	UINT32                                  Hi;
  25.212 -};
  25.213 +/*******************************************************************************
  25.214 + *
  25.215 + * Types specific to 32-bit targets
  25.216 + *
  25.217 + ******************************************************************************/
  25.218 +
  25.219 +#elif ACPI_MACHINE_WIDTH == 32
  25.220 +
  25.221 +/*! [Begin] no source code translation (keep the typedefs as-is) */
  25.222 +
  25.223 +typedef unsigned int UINT32;
  25.224 +typedef int INT32;
  25.225  
  25.226  /*! [End] no source code translation !*/
  25.227  
  25.228 -typedef u16                                     acpi_native_uint;
  25.229 -typedef s16                                     acpi_native_int;
  25.230 -
  25.231 -typedef u32                                     acpi_table_ptr;
  25.232 -typedef u32                                     acpi_io_address;
  25.233 -typedef char                                    *acpi_physical_address;
  25.234 -typedef u16                                     acpi_size;
  25.235 -
  25.236 -#define ALIGNED_ADDRESS_BOUNDARY        0x00000002
  25.237 -#define ACPI_MISALIGNED_TRANSFERS
  25.238 -#define ACPI_USE_NATIVE_DIVIDE                          /* No 64-bit integers, ok to use native divide */
  25.239 -#define ACPI_MAX_PTR                    ACPI_UINT16_MAX
  25.240 -#define ACPI_SIZE_MAX                   ACPI_UINT16_MAX
  25.241 -
  25.242 -/*
  25.243 - * (16-bit only) internal integers must be 32-bits, so
  25.244 - * 64-bit integers cannot be supported
  25.245 - */
  25.246 -#define ACPI_NO_INTEGER64_SUPPORT
  25.247 -
  25.248 -
  25.249 -#elif ACPI_MACHINE_WIDTH == 32
  25.250 +typedef u32 acpi_native_uint;
  25.251 +typedef s32 acpi_native_int;
  25.252  
  25.253 -/*! [Begin] no source code translation (keep the typedefs) */
  25.254 +typedef u32 acpi_io_address;
  25.255 +typedef u32 acpi_physical_address;
  25.256  
  25.257 -/*
  25.258 - * 32-bit type definitions (default)
  25.259 - */
  25.260 -typedef unsigned char                   UINT8;
  25.261 -typedef unsigned char                   BOOLEAN;
  25.262 -typedef unsigned short                  UINT16;
  25.263 -typedef int                             INT32;
  25.264 -typedef unsigned int                    UINT32;
  25.265 -typedef COMPILER_DEPENDENT_INT64        INT64;
  25.266 -typedef COMPILER_DEPENDENT_UINT64       UINT64;
  25.267 -
  25.268 -/*! [End] no source code translation !*/
  25.269 -
  25.270 -typedef s32                                     acpi_native_int;
  25.271 -typedef u32                                     acpi_native_uint;
  25.272 -
  25.273 -typedef u64                                     acpi_table_ptr;
  25.274 -typedef u32                                     acpi_io_address;
  25.275 -typedef u64                                     acpi_physical_address;
  25.276 -typedef u32                                     acpi_size;
  25.277 -
  25.278 -#define ALIGNED_ADDRESS_BOUNDARY        0x00000004
  25.279 -#define ACPI_MISALIGNED_TRANSFERS
  25.280  #define ACPI_MAX_PTR                    ACPI_UINT32_MAX
  25.281  #define ACPI_SIZE_MAX                   ACPI_UINT32_MAX
  25.282  
  25.283  #else
  25.284 +
  25.285 +/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
  25.286 +
  25.287  #error unknown ACPI_MACHINE_WIDTH
  25.288  #endif
  25.289  
  25.290 +/* Variable-width type, used instead of clib size_t */
  25.291  
  25.292 -/*
  25.293 - * Miscellaneous common types
  25.294 - */
  25.295 -typedef u16                                     UINT16_BIT;
  25.296 -typedef u32                                     UINT32_BIT;
  25.297 -typedef acpi_native_uint                        ACPI_PTRDIFF;
  25.298 +typedef acpi_native_uint acpi_size;
  25.299 +
  25.300 +/*******************************************************************************
  25.301 + *
  25.302 + * OS-dependent and compiler-dependent types
  25.303 + *
  25.304 + * If the defaults below are not appropriate for the host system, they can
  25.305 + * be defined in the compiler-specific or OS-specific header, and this will
  25.306 + * take precedence.
  25.307 + *
  25.308 + ******************************************************************************/
  25.309 +
  25.310 +/* Value returned by acpi_os_get_thread_id */
  25.311 +
  25.312 +#ifndef acpi_thread_id
  25.313 +#define acpi_thread_id                  acpi_native_uint
  25.314 +#endif
  25.315 +
  25.316 +/* Object returned from acpi_os_create_lock */
  25.317 +
  25.318 +#ifndef acpi_spinlock
  25.319 +#define acpi_spinlock                   void *
  25.320 +#endif
  25.321 +
  25.322 +/* Flags for acpi_os_acquire_lock/acpi_os_release_lock */
  25.323 +
  25.324 +#ifndef acpi_cpu_flags
  25.325 +#define acpi_cpu_flags                  acpi_native_uint
  25.326 +#endif
  25.327 +
  25.328 +/* Object returned from acpi_os_create_cache */
  25.329 +
  25.330 +#ifndef acpi_cache_t
  25.331 +#define acpi_cache_t                    struct acpi_memory_list
  25.332 +#endif
  25.333 +
  25.334 +/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
  25.335 +
  25.336 +#ifndef acpi_uintptr_t
  25.337 +#define acpi_uintptr_t                  void *
  25.338 +#endif
  25.339  
  25.340  /*
  25.341 - * Pointer overlays to avoid lots of typecasting for
  25.342 - * code that accepts both physical and logical pointers.
  25.343 + * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
  25.344 + * some compilers can catch printf format string problems
  25.345   */
  25.346 -union acpi_pointers
  25.347 -{
  25.348 -	acpi_physical_address               physical;
  25.349 -	void                                *logical;
  25.350 -	acpi_table_ptr                      value;
  25.351 -};
  25.352 -
  25.353 -struct acpi_pointer
  25.354 -{
  25.355 -	u32                                 pointer_type;
  25.356 -	union acpi_pointers                 pointer;
  25.357 -};
  25.358 -
  25.359 -/* pointer_types for above */
  25.360 -
  25.361 -#define ACPI_PHYSICAL_POINTER           0x01
  25.362 -#define ACPI_LOGICAL_POINTER            0x02
  25.363 -
  25.364 -/* Processor mode */
  25.365 -
  25.366 -#define ACPI_PHYSICAL_ADDRESSING        0x04
  25.367 -#define ACPI_LOGICAL_ADDRESSING         0x08
  25.368 -#define ACPI_MEMORY_MODE                0x0C
  25.369 -
  25.370 -#define ACPI_PHYSMODE_PHYSPTR           ACPI_PHYSICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
  25.371 -#define ACPI_LOGMODE_PHYSPTR            ACPI_LOGICAL_ADDRESSING  | ACPI_PHYSICAL_POINTER
  25.372 -#define ACPI_LOGMODE_LOGPTR             ACPI_LOGICAL_ADDRESSING  | ACPI_LOGICAL_POINTER
  25.373 -
  25.374 +#ifndef ACPI_PRINTF_LIKE
  25.375 +#define ACPI_PRINTF_LIKE(c)
  25.376 +#endif
  25.377  
  25.378  /*
  25.379 - * Useful defines
  25.380 + * Some compilers complain about unused variables. Sometimes we don't want to
  25.381 + * use all the variables (for example, _acpi_module_name). This allows us
  25.382 + * to to tell the compiler in a per-variable manner that a variable
  25.383 + * is unused
  25.384   */
  25.385 +#ifndef ACPI_UNUSED_VAR
  25.386 +#define ACPI_UNUSED_VAR
  25.387 +#endif
  25.388 +
  25.389 +/*
  25.390 + * All ACPICA functions that are available to the rest of the kernel are
  25.391 + * tagged with this macro which can be defined as appropriate for the host.
  25.392 + */
  25.393 +#ifndef ACPI_EXPORT_SYMBOL
  25.394 +#define ACPI_EXPORT_SYMBOL(symbol)
  25.395 +#endif
  25.396 +
  25.397 +/*******************************************************************************
  25.398 + *
  25.399 + * Independent types
  25.400 + *
  25.401 + ******************************************************************************/
  25.402 +
  25.403 +/* Logical defines and NULL */
  25.404 +
  25.405  #ifdef FALSE
  25.406  #undef FALSE
  25.407  #endif
  25.408 @@ -261,33 +294,33 @@ struct acpi_pointer
  25.409  #define NULL                            (void *) 0
  25.410  #endif
  25.411  
  25.412 -
  25.413  /*
  25.414 - * Local datatypes
  25.415 + * Mescellaneous types
  25.416   */
  25.417 -typedef u32                                     acpi_status;    /* All ACPI Exceptions */
  25.418 -typedef u32                                     acpi_name;      /* 4-byte ACPI name */
  25.419 -typedef char *                                  acpi_string;    /* Null terminated ASCII string */
  25.420 -typedef void *                                  acpi_handle;    /* Actually a ptr to an Node */
  25.421 +typedef u32 acpi_status;	/* All ACPI Exceptions */
  25.422 +typedef u32 acpi_name;		/* 4-byte ACPI name */
  25.423 +typedef char *acpi_string;	/* Null terminated ASCII string */
  25.424 +typedef void *acpi_handle;	/* Actually a ptr to a NS Node */
  25.425  
  25.426 -struct uint64_struct
  25.427 -{
  25.428 -	u32                                 lo;
  25.429 -	u32                                 hi;
  25.430 +struct uint64_struct {
  25.431 +	u32 lo;
  25.432 +	u32 hi;
  25.433  };
  25.434  
  25.435 -union uint64_overlay
  25.436 -{
  25.437 -	u64                                 full;
  25.438 -	struct uint64_struct                part;
  25.439 +union uint64_overlay {
  25.440 +	u64 full;
  25.441 +	struct uint64_struct part;
  25.442  };
  25.443  
  25.444 -struct uint32_struct
  25.445 -{
  25.446 -	u32                                 lo;
  25.447 -	u32                                 hi;
  25.448 +struct uint32_struct {
  25.449 +	u32 lo;
  25.450 +	u32 hi;
  25.451  };
  25.452  
  25.453 +/* Synchronization objects */
  25.454 +
  25.455 +#define acpi_mutex                      void *
  25.456 +#define acpi_semaphore                  void *
  25.457  
  25.458  /*
  25.459   * Acpi integer width. In ACPI version 1, integers are
  25.460 @@ -300,26 +333,24 @@ struct uint32_struct
  25.461  
  25.462  /* 32-bit integers only, no 64-bit support */
  25.463  
  25.464 -typedef u32                                     acpi_integer;
  25.465 +typedef u32 acpi_integer;
  25.466  #define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
  25.467  #define ACPI_INTEGER_BIT_SIZE           32
  25.468 -#define ACPI_MAX_DECIMAL_DIGITS         10  /* 2^32 = 4,294,967,296 */
  25.469 +#define ACPI_MAX_DECIMAL_DIGITS         10	/* 2^32 = 4,294,967,296 */
  25.470  
  25.471 -#define ACPI_USE_NATIVE_DIVIDE          /* Use compiler native 32-bit divide */
  25.472 -
  25.473 +#define ACPI_USE_NATIVE_DIVIDE	/* Use compiler native 32-bit divide */
  25.474  
  25.475  #else
  25.476  
  25.477  /* 64-bit integers */
  25.478  
  25.479 -typedef u64                                     acpi_integer;
  25.480 +typedef unsigned long long acpi_integer;
  25.481  #define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
  25.482  #define ACPI_INTEGER_BIT_SIZE           64
  25.483 -#define ACPI_MAX_DECIMAL_DIGITS         20  /* 2^64 = 18,446,744,073,709,551,616 */
  25.484 -
  25.485 +#define ACPI_MAX_DECIMAL_DIGITS         20	/* 2^64 = 18,446,744,073,709,551,616 */
  25.486  
  25.487  #if ACPI_MACHINE_WIDTH == 64
  25.488 -#define ACPI_USE_NATIVE_DIVIDE          /* Use compiler native 64-bit divide */
  25.489 +#define ACPI_USE_NATIVE_DIVIDE	/* Use compiler native 64-bit divide */
  25.490  #endif
  25.491  #endif
  25.492  
  25.493 @@ -331,8 +362,7 @@ typedef u64                             
  25.494  /*
  25.495   * Constants with special meanings
  25.496   */
  25.497 -#define ACPI_ROOT_OBJECT                (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR)
  25.498 -
  25.499 +#define ACPI_ROOT_OBJECT                ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
  25.500  
  25.501  /*
  25.502   * Initialization sequence
  25.503 @@ -349,7 +379,8 @@ typedef u64                             
  25.504  /*
  25.505   * Initialization state
  25.506   */
  25.507 -#define ACPI_INITIALIZED_OK             0x01
  25.508 +#define ACPI_SUBSYSTEM_INITIALIZE       0x01
  25.509 +#define ACPI_INITIALIZED_OK             0x02
  25.510  
  25.511  /*
  25.512   * Power state values
  25.513 @@ -398,21 +429,6 @@ typedef u64                             
  25.514  #define ACPI_NOTIFY_POWER_FAULT         (u8) 7
  25.515  
  25.516  /*
  25.517 - *  Table types.  These values are passed to the table related APIs
  25.518 - */
  25.519 -typedef u32                                     acpi_table_type;
  25.520 -
  25.521 -#define ACPI_TABLE_RSDP                 (acpi_table_type) 0
  25.522 -#define ACPI_TABLE_DSDT                 (acpi_table_type) 1
  25.523 -#define ACPI_TABLE_FADT                 (acpi_table_type) 2
  25.524 -#define ACPI_TABLE_FACS                 (acpi_table_type) 3
  25.525 -#define ACPI_TABLE_PSDT                 (acpi_table_type) 4
  25.526 -#define ACPI_TABLE_SSDT                 (acpi_table_type) 5
  25.527 -#define ACPI_TABLE_XSDT                 (acpi_table_type) 6
  25.528 -#define ACPI_TABLE_MAX                  6
  25.529 -#define NUM_ACPI_TABLE_TYPES            (ACPI_TABLE_MAX+1)
  25.530 -
  25.531 -/*
  25.532   * Types associated with ACPI names and objects.  The first group of
  25.533   * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
  25.534   * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
  25.535 @@ -421,22 +437,22 @@ typedef u32                             
  25.536   * NOTE: Types must be kept in sync with the global acpi_ns_properties
  25.537   * and acpi_ns_type_names arrays.
  25.538   */
  25.539 -typedef u32                                     acpi_object_type;
  25.540 +typedef u32 acpi_object_type;
  25.541  
  25.542  #define ACPI_TYPE_ANY                   0x00
  25.543 -#define ACPI_TYPE_INTEGER               0x01  /* Byte/Word/Dword/Zero/One/Ones */
  25.544 +#define ACPI_TYPE_INTEGER               0x01	/* Byte/Word/Dword/Zero/One/Ones */
  25.545  #define ACPI_TYPE_STRING                0x02
  25.546  #define ACPI_TYPE_BUFFER                0x03
  25.547 -#define ACPI_TYPE_PACKAGE               0x04  /* byte_const, multiple data_term/Constant/super_name */
  25.548 +#define ACPI_TYPE_PACKAGE               0x04	/* byte_const, multiple data_term/Constant/super_name */
  25.549  #define ACPI_TYPE_FIELD_UNIT            0x05
  25.550 -#define ACPI_TYPE_DEVICE                0x06  /* Name, multiple Node */
  25.551 +#define ACPI_TYPE_DEVICE                0x06	/* Name, multiple Node */
  25.552  #define ACPI_TYPE_EVENT                 0x07
  25.553 -#define ACPI_TYPE_METHOD                0x08  /* Name, byte_const, multiple Code */
  25.554 +#define ACPI_TYPE_METHOD                0x08	/* Name, byte_const, multiple Code */
  25.555  #define ACPI_TYPE_MUTEX                 0x09
  25.556  #define ACPI_TYPE_REGION                0x0A
  25.557 -#define ACPI_TYPE_POWER                 0x0B  /* Name,byte_const,word_const,multi Node */
  25.558 -#define ACPI_TYPE_PROCESSOR             0x0C  /* Name,byte_const,Dword_const,byte_const,multi nm_o */
  25.559 -#define ACPI_TYPE_THERMAL               0x0D  /* Name, multiple Node */
  25.560 +#define ACPI_TYPE_POWER                 0x0B	/* Name,byte_const,word_const,multi Node */
  25.561 +#define ACPI_TYPE_PROCESSOR             0x0C	/* Name,byte_const,Dword_const,byte_const,multi nm_o */
  25.562 +#define ACPI_TYPE_THERMAL               0x0D	/* Name, multiple Node */
  25.563  #define ACPI_TYPE_BUFFER_FIELD          0x0E
  25.564  #define ACPI_TYPE_DDB_HANDLE            0x0F
  25.565  #define ACPI_TYPE_DEBUG_OBJECT          0x10
  25.566 @@ -453,16 +469,16 @@ typedef u32                             
  25.567  #define ACPI_TYPE_LOCAL_REGION_FIELD    0x11
  25.568  #define ACPI_TYPE_LOCAL_BANK_FIELD      0x12
  25.569  #define ACPI_TYPE_LOCAL_INDEX_FIELD     0x13
  25.570 -#define ACPI_TYPE_LOCAL_REFERENCE       0x14  /* Arg#, Local#, Name, Debug, ref_of, Index */
  25.571 +#define ACPI_TYPE_LOCAL_REFERENCE       0x14	/* Arg#, Local#, Name, Debug, ref_of, Index */
  25.572  #define ACPI_TYPE_LOCAL_ALIAS           0x15
  25.573  #define ACPI_TYPE_LOCAL_METHOD_ALIAS    0x16
  25.574  #define ACPI_TYPE_LOCAL_NOTIFY          0x17
  25.575  #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
  25.576  #define ACPI_TYPE_LOCAL_RESOURCE        0x19
  25.577  #define ACPI_TYPE_LOCAL_RESOURCE_FIELD  0x1A
  25.578 -#define ACPI_TYPE_LOCAL_SCOPE           0x1B  /* 1 Name, multiple object_list Nodes */
  25.579 +#define ACPI_TYPE_LOCAL_SCOPE           0x1B	/* 1 Name, multiple object_list Nodes */
  25.580  
  25.581 -#define ACPI_TYPE_NS_NODE_MAX           0x1B  /* Last typecode used within a NS Node */
  25.582 +#define ACPI_TYPE_NS_NODE_MAX           0x1B	/* Last typecode used within a NS Node */
  25.583  
  25.584  /*
  25.585   * These are special object types that never appear in
  25.586 @@ -478,38 +494,6 @@ typedef u32                             
  25.587  #define ACPI_TYPE_INVALID               0x1E
  25.588  #define ACPI_TYPE_NOT_FOUND             0xFF
  25.589  
  25.590 -
  25.591 -/*
  25.592 - * Bitmapped ACPI types.  Used internally only
  25.593 - */
  25.594 -#define ACPI_BTYPE_ANY                  0x00000000
  25.595 -#define ACPI_BTYPE_INTEGER              0x00000001
  25.596 -#define ACPI_BTYPE_STRING               0x00000002
  25.597 -#define ACPI_BTYPE_BUFFER               0x00000004
  25.598 -#define ACPI_BTYPE_PACKAGE              0x00000008
  25.599 -#define ACPI_BTYPE_FIELD_UNIT           0x00000010
  25.600 -#define ACPI_BTYPE_DEVICE               0x00000020
  25.601 -#define ACPI_BTYPE_EVENT                0x00000040
  25.602 -#define ACPI_BTYPE_METHOD               0x00000080
  25.603 -#define ACPI_BTYPE_MUTEX                0x00000100
  25.604 -#define ACPI_BTYPE_REGION               0x00000200
  25.605 -#define ACPI_BTYPE_POWER                0x00000400
  25.606 -#define ACPI_BTYPE_PROCESSOR            0x00000800
  25.607 -#define ACPI_BTYPE_THERMAL              0x00001000
  25.608 -#define ACPI_BTYPE_BUFFER_FIELD         0x00002000
  25.609 -#define ACPI_BTYPE_DDB_HANDLE           0x00004000
  25.610 -#define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
  25.611 -#define ACPI_BTYPE_REFERENCE            0x00010000
  25.612 -#define ACPI_BTYPE_RESOURCE             0x00020000
  25.613 -
  25.614 -#define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
  25.615 -
  25.616 -#define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
  25.617 -#define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
  25.618 -#define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
  25.619 -#define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
  25.620 -#define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
  25.621 -
  25.622  /*
  25.623   * All I/O
  25.624   */
  25.625 @@ -520,7 +504,7 @@ typedef u32                             
  25.626  /*
  25.627   * Event Types: Fixed & General Purpose
  25.628   */
  25.629 -typedef u32                                     acpi_event_type;
  25.630 +typedef u32 acpi_event_type;
  25.631  
  25.632  /*
  25.633   * Fixed events
  25.634 @@ -548,7 +532,7 @@ typedef u32                             
  25.635   *          |     +----- Set?
  25.636   *          +----------- <Reserved>
  25.637   */
  25.638 -typedef u32                                     acpi_event_status;
  25.639 +typedef u32 acpi_event_status;
  25.640  
  25.641  #define ACPI_EVENT_FLAG_DISABLED        (acpi_event_status) 0x00
  25.642  #define ACPI_EVENT_FLAG_ENABLED         (acpi_event_status) 0x01
  25.643 @@ -565,7 +549,6 @@ typedef u32                             
  25.644  #define ACPI_GPE_ENABLE                 0
  25.645  #define ACPI_GPE_DISABLE                1
  25.646  
  25.647 -
  25.648  /*
  25.649   * GPE info flags - Per GPE
  25.650   * +-+-+-+---+---+-+
  25.651 @@ -577,7 +560,7 @@ typedef u32                             
  25.652   *  | | |  +--- Type of dispatch -- to method, handler, or none
  25.653   *  | | +--- Enabled for runtime?
  25.654   *  | +--- Enabled for wake?
  25.655 - *  +--- System state when GPE ocurred (running/waking)
  25.656 + *  +--- Unused
  25.657   */
  25.658  #define ACPI_GPE_XRUPT_TYPE_MASK        (u8) 0x01
  25.659  #define ACPI_GPE_LEVEL_TRIGGERED        (u8) 0x01
  25.660 @@ -586,37 +569,32 @@ typedef u32                             
  25.661  #define ACPI_GPE_TYPE_MASK              (u8) 0x06
  25.662  #define ACPI_GPE_TYPE_WAKE_RUN          (u8) 0x06
  25.663  #define ACPI_GPE_TYPE_WAKE              (u8) 0x02
  25.664 -#define ACPI_GPE_TYPE_RUNTIME           (u8) 0x04    /* Default */
  25.665 +#define ACPI_GPE_TYPE_RUNTIME           (u8) 0x04	/* Default */
  25.666  
  25.667  #define ACPI_GPE_DISPATCH_MASK          (u8) 0x18
  25.668  #define ACPI_GPE_DISPATCH_HANDLER       (u8) 0x08
  25.669  #define ACPI_GPE_DISPATCH_METHOD        (u8) 0x10
  25.670 -#define ACPI_GPE_DISPATCH_NOT_USED      (u8) 0x00    /* Default */
  25.671 +#define ACPI_GPE_DISPATCH_NOT_USED      (u8) 0x00	/* Default */
  25.672  
  25.673  #define ACPI_GPE_RUN_ENABLE_MASK        (u8) 0x20
  25.674  #define ACPI_GPE_RUN_ENABLED            (u8) 0x20
  25.675 -#define ACPI_GPE_RUN_DISABLED           (u8) 0x00    /* Default */
  25.676 +#define ACPI_GPE_RUN_DISABLED           (u8) 0x00	/* Default */
  25.677  
  25.678  #define ACPI_GPE_WAKE_ENABLE_MASK       (u8) 0x40
  25.679  #define ACPI_GPE_WAKE_ENABLED           (u8) 0x40
  25.680 -#define ACPI_GPE_WAKE_DISABLED          (u8) 0x00    /* Default */
  25.681 +#define ACPI_GPE_WAKE_DISABLED          (u8) 0x00	/* Default */
  25.682  
  25.683 -#define ACPI_GPE_ENABLE_MASK            (u8) 0x60    /* Both run/wake */
  25.684 -
  25.685 -#define ACPI_GPE_SYSTEM_MASK            (u8) 0x80
  25.686 -#define ACPI_GPE_SYSTEM_RUNNING         (u8) 0x80
  25.687 -#define ACPI_GPE_SYSTEM_WAKING          (u8) 0x00
  25.688 +#define ACPI_GPE_ENABLE_MASK            (u8) 0x60	/* Both run/wake */
  25.689  
  25.690  /*
  25.691   * Flags for GPE and Lock interfaces
  25.692   */
  25.693 -#define ACPI_EVENT_WAKE_ENABLE          0x2             /* acpi_gpe_enable */
  25.694 -#define ACPI_EVENT_WAKE_DISABLE         0x2             /* acpi_gpe_disable */
  25.695 +#define ACPI_EVENT_WAKE_ENABLE          0x2	/* acpi_gpe_enable */
  25.696 +#define ACPI_EVENT_WAKE_DISABLE         0x2	/* acpi_gpe_disable */
  25.697  
  25.698  #define ACPI_NOT_ISR                    0x1
  25.699  #define ACPI_ISR                        0x0
  25.700  
  25.701 -
  25.702  /* Notify types */
  25.703  
  25.704  #define ACPI_SYSTEM_NOTIFY              0x1
  25.705 @@ -626,10 +604,9 @@ typedef u32                             
  25.706  
  25.707  #define ACPI_MAX_SYS_NOTIFY             0x7f
  25.708  
  25.709 -
  25.710  /* Address Space (Operation Region) Types */
  25.711  
  25.712 -typedef u8                                      acpi_adr_space_type;
  25.713 +typedef u8 acpi_adr_space_type;
  25.714  
  25.715  #define ACPI_ADR_SPACE_SYSTEM_MEMORY    (acpi_adr_space_type) 0
  25.716  #define ACPI_ADR_SPACE_SYSTEM_IO        (acpi_adr_space_type) 1
  25.717 @@ -641,7 +618,6 @@ typedef u8                              
  25.718  #define ACPI_ADR_SPACE_DATA_TABLE       (acpi_adr_space_type) 7
  25.719  #define ACPI_ADR_SPACE_FIXED_HARDWARE   (acpi_adr_space_type) 127
  25.720  
  25.721 -
  25.722  /*
  25.723   * bit_register IDs
  25.724   * These are bitfields defined within the full ACPI registers
  25.725 @@ -653,94 +629,84 @@ typedef u8                              
  25.726  #define ACPI_BITREG_SLEEP_BUTTON_STATUS         0x04
  25.727  #define ACPI_BITREG_RT_CLOCK_STATUS             0x05
  25.728  #define ACPI_BITREG_WAKE_STATUS                 0x06
  25.729 -
  25.730 -#define ACPI_BITREG_TIMER_ENABLE                0x07
  25.731 -#define ACPI_BITREG_GLOBAL_LOCK_ENABLE          0x08
  25.732 -#define ACPI_BITREG_POWER_BUTTON_ENABLE         0x09
  25.733 -#define ACPI_BITREG_SLEEP_BUTTON_ENABLE         0x0A
  25.734 -#define ACPI_BITREG_RT_CLOCK_ENABLE             0x0B
  25.735 -#define ACPI_BITREG_WAKE_ENABLE                 0x0C
  25.736 +#define ACPI_BITREG_PCIEXP_WAKE_STATUS          0x07
  25.737  
  25.738 -#define ACPI_BITREG_SCI_ENABLE                  0x0D
  25.739 -#define ACPI_BITREG_BUS_MASTER_RLD              0x0E
  25.740 -#define ACPI_BITREG_GLOBAL_LOCK_RELEASE         0x0F
  25.741 -#define ACPI_BITREG_SLEEP_TYPE_A                0x10
  25.742 -#define ACPI_BITREG_SLEEP_TYPE_B                0x11
  25.743 -#define ACPI_BITREG_SLEEP_ENABLE                0x12
  25.744 +#define ACPI_BITREG_TIMER_ENABLE                0x08
  25.745 +#define ACPI_BITREG_GLOBAL_LOCK_ENABLE          0x09
  25.746 +#define ACPI_BITREG_POWER_BUTTON_ENABLE         0x0A
  25.747 +#define ACPI_BITREG_SLEEP_BUTTON_ENABLE         0x0B
  25.748 +#define ACPI_BITREG_RT_CLOCK_ENABLE             0x0C
  25.749 +#define ACPI_BITREG_WAKE_ENABLE                 0x0D
  25.750 +#define ACPI_BITREG_PCIEXP_WAKE_DISABLE         0x0E
  25.751  
  25.752 -#define ACPI_BITREG_ARB_DISABLE                 0x13
  25.753 +#define ACPI_BITREG_SCI_ENABLE                  0x0F
  25.754 +#define ACPI_BITREG_BUS_MASTER_RLD              0x10
  25.755 +#define ACPI_BITREG_GLOBAL_LOCK_RELEASE         0x11
  25.756 +#define ACPI_BITREG_SLEEP_TYPE_A                0x12
  25.757 +#define ACPI_BITREG_SLEEP_TYPE_B                0x13
  25.758 +#define ACPI_BITREG_SLEEP_ENABLE                0x14
  25.759  
  25.760 -#define ACPI_BITREG_MAX                         0x13
  25.761 +#define ACPI_BITREG_ARB_DISABLE                 0x15
  25.762 +
  25.763 +#define ACPI_BITREG_MAX                         0x15
  25.764  #define ACPI_NUM_BITREG                         ACPI_BITREG_MAX + 1
  25.765  
  25.766 -
  25.767  /*
  25.768   * External ACPI object definition
  25.769   */
  25.770 -union acpi_object
  25.771 -{
  25.772 -	acpi_object_type                    type;   /* See definition of acpi_ns_type for values */
  25.773 -	struct
  25.774 -	{
  25.775 -		acpi_object_type                    type;
  25.776 -		acpi_integer                        value;      /* The actual number */
  25.777 +union acpi_object {
  25.778 +	acpi_object_type type;	/* See definition of acpi_ns_type for values */
  25.779 +	struct {
  25.780 +		acpi_object_type type;
  25.781 +		acpi_integer value;	/* The actual number */
  25.782  	} integer;
  25.783  
  25.784 -	struct
  25.785 -	{
  25.786 -		acpi_object_type                    type;
  25.787 -		u32                                 length;     /* # of bytes in string, excluding trailing null */
  25.788 -		char                                *pointer;   /* points to the string value */
  25.789 +	struct {
  25.790 +		acpi_object_type type;
  25.791 +		u32 length;	/* # of bytes in string, excluding trailing null */
  25.792 +		char *pointer;	/* points to the string value */
  25.793  	} string;
  25.794  
  25.795 -	struct
  25.796 -	{
  25.797 -		acpi_object_type                    type;
  25.798 -		u32                                 length;     /* # of bytes in buffer */
  25.799 -		u8                                  *pointer;   /* points to the buffer */
  25.800 +	struct {
  25.801 +		acpi_object_type type;
  25.802 +		u32 length;	/* # of bytes in buffer */
  25.803 +		u8 *pointer;	/* points to the buffer */
  25.804  	} buffer;
  25.805  
  25.806 -	struct
  25.807 -	{
  25.808 -		acpi_object_type                    type;
  25.809 -		u32                                 fill1;
  25.810 -		acpi_handle                         handle;     /* object reference */
  25.811 +	struct {
  25.812 +		acpi_object_type type;
  25.813 +		u32 fill1;
  25.814 +		acpi_handle handle;	/* object reference */
  25.815  	} reference;
  25.816  
  25.817 -	struct
  25.818 -	{
  25.819 -		acpi_object_type                    type;
  25.820 -		u32                                 count;      /* # of elements in package */
  25.821 -		union acpi_object                   *elements;  /* Pointer to an array of ACPI_OBJECTs */
  25.822 +	struct {
  25.823 +		acpi_object_type type;
  25.824 +		u32 count;	/* # of elements in package */
  25.825 +		union acpi_object *elements;	/* Pointer to an array of ACPI_OBJECTs */
  25.826  	} package;
  25.827  
  25.828 -	struct
  25.829 -	{
  25.830 -		acpi_object_type                    type;
  25.831 -		u32                                 proc_id;
  25.832 -		acpi_io_address                     pblk_address;
  25.833 -		u32                                 pblk_length;
  25.834 +	struct {
  25.835 +		acpi_object_type type;
  25.836 +		u32 proc_id;
  25.837 +		acpi_io_address pblk_address;
  25.838 +		u32 pblk_length;
  25.839  	} processor;
  25.840  
  25.841 -	struct
  25.842 -	{
  25.843 -		acpi_object_type                    type;
  25.844 -		u32                                 system_level;
  25.845 -		u32                                 resource_order;
  25.846 +	struct {
  25.847 +		acpi_object_type type;
  25.848 +		u32 system_level;
  25.849 +		u32 resource_order;
  25.850  	} power_resource;
  25.851  };
  25.852  
  25.853 -
  25.854  /*
  25.855   * List of objects, used as a parameter list for control method evaluation
  25.856   */
  25.857 -struct acpi_object_list
  25.858 -{
  25.859 -	u32                                 count;
  25.860 -	union acpi_object                   *pointer;
  25.861 +struct acpi_object_list {
  25.862 +	u32 count;
  25.863 +	union acpi_object *pointer;
  25.864  };
  25.865  
  25.866 -
  25.867  /*
  25.868   * Miscellaneous common Data Structures used by the interfaces
  25.869   */
  25.870 @@ -748,13 +714,11 @@ struct acpi_object_list
  25.871  #define ACPI_ALLOCATE_BUFFER        (acpi_size) (-1)
  25.872  #define ACPI_ALLOCATE_LOCAL_BUFFER  (acpi_size) (-2)
  25.873  
  25.874 -struct acpi_buffer
  25.875 -{
  25.876 -	acpi_size                           length;         /* Length in bytes of the buffer */
  25.877 -	void                                *pointer;       /* pointer to buffer */
  25.878 +struct acpi_buffer {
  25.879 +	acpi_size length;	/* Length in bytes of the buffer */
  25.880 +	void *pointer;		/* pointer to buffer */
  25.881  };
  25.882  
  25.883 -
  25.884  /*
  25.885   * name_type for acpi_get_name
  25.886   */
  25.887 @@ -762,7 +726,6 @@ struct acpi_buffer
  25.888  #define ACPI_SINGLE_NAME                1
  25.889  #define ACPI_NAME_TYPE_MAX              1
  25.890  
  25.891 -
  25.892  /*
  25.893   * Structure and flags for acpi_get_system_info
  25.894   */
  25.895 @@ -771,140 +734,97 @@ struct acpi_buffer
  25.896  #define ACPI_SYS_MODE_LEGACY            0x0002
  25.897  #define ACPI_SYS_MODES_MASK             0x0003
  25.898  
  25.899 -
  25.900 -/*
  25.901 - * ACPI Table Info.  One per ACPI table _type_
  25.902 - */
  25.903 -struct acpi_table_info
  25.904 -{
  25.905 -	u32                                 count;
  25.906 -};
  25.907 -
  25.908 -
  25.909  /*
  25.910   * System info returned by acpi_get_system_info()
  25.911   */
  25.912 -struct acpi_system_info
  25.913 -{
  25.914 -	u32                                 acpi_ca_version;
  25.915 -	u32                                 flags;
  25.916 -	u32                                 timer_resolution;
  25.917 -	u32                                 reserved1;
  25.918 -	u32                                 reserved2;
  25.919 -	u32                                 debug_level;
  25.920 -	u32                                 debug_layer;
  25.921 -	u32                                 num_table_types;
  25.922 -	struct acpi_table_info              table_info [NUM_ACPI_TABLE_TYPES];
  25.923 +struct acpi_system_info {
  25.924 +	u32 acpi_ca_version;
  25.925 +	u32 flags;
  25.926 +	u32 timer_resolution;
  25.927 +	u32 reserved1;
  25.928 +	u32 reserved2;
  25.929 +	u32 debug_level;
  25.930 +	u32 debug_layer;
  25.931  };
  25.932  
  25.933 -
  25.934  /*
  25.935   * Types specific to the OS service interfaces
  25.936   */
  25.937 -
  25.938 -typedef u32
  25.939 -(ACPI_SYSTEM_XFACE *acpi_osd_handler) (
  25.940 -	void                            *context);
  25.941 +typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context);
  25.942  
  25.943  typedef void
  25.944 -(ACPI_SYSTEM_XFACE *acpi_osd_exec_callback) (
  25.945 -	void                            *context);
  25.946 + (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context);
  25.947  
  25.948  /*
  25.949   * Various handlers and callback procedures
  25.950   */
  25.951 -typedef
  25.952 -u32 (*acpi_event_handler) (
  25.953 -	void                                *context);
  25.954 +typedef u32(*acpi_event_handler) (void *context);
  25.955  
  25.956  typedef
  25.957 -void (*acpi_notify_handler) (
  25.958 -	acpi_handle                         device,
  25.959 -	u32                                 value,
  25.960 -	void                                *context);
  25.961 +void (*acpi_notify_handler) (acpi_handle device, u32 value, void *context);
  25.962  
  25.963  typedef
  25.964 -void (*acpi_object_handler) (
  25.965 -	acpi_handle                         object,
  25.966 -	u32                                 function,
  25.967 -	void                                *data);
  25.968 +void (*acpi_object_handler) (acpi_handle object, u32 function, void *data);
  25.969  
  25.970 -typedef
  25.971 -acpi_status (*acpi_init_handler) (
  25.972 -	acpi_handle                         object,
  25.973 -	u32                                 function);
  25.974 +typedef acpi_status(*acpi_init_handler) (acpi_handle object, u32 function);
  25.975  
  25.976  #define ACPI_INIT_DEVICE_INI        1
  25.977  
  25.978  typedef
  25.979 -acpi_status (*acpi_exception_handler) (
  25.980 -	acpi_status                     aml_status,
  25.981 -	acpi_name                       name,
  25.982 -	u16                             opcode,
  25.983 -	u32                             aml_offset,
  25.984 -	void                            *context);
  25.985 -
  25.986 +acpi_status(*acpi_exception_handler) (acpi_status aml_status,
  25.987 +				      acpi_name name,
  25.988 +				      u16 opcode,
  25.989 +				      u32 aml_offset, void *context);
  25.990  
  25.991  /* Address Spaces (For Operation Regions) */
  25.992  
  25.993  typedef
  25.994 -acpi_status (*acpi_adr_space_handler) (
  25.995 -	u32                                 function,
  25.996 -	acpi_physical_address               address,
  25.997 -	u32                                 bit_width,
  25.998 -	acpi_integer                        *value,
  25.999 -	void                                *handler_context,
 25.1000 -	void                                *region_context);
 25.1001 +acpi_status(*acpi_adr_space_handler) (u32 function,
 25.1002 +				      acpi_physical_address address,
 25.1003 +				      u32 bit_width,
 25.1004 +				      acpi_integer * value,
 25.1005 +				      void *handler_context,
 25.1006 +				      void *region_context);
 25.1007  
 25.1008 -#define ACPI_DEFAULT_HANDLER        NULL
 25.1009 -
 25.1010 +#define ACPI_DEFAULT_HANDLER            NULL
 25.1011  
 25.1012  typedef
 25.1013 -acpi_status (*acpi_adr_space_setup) (
 25.1014 -	acpi_handle                         region_handle,
 25.1015 -	u32                                 function,
 25.1016 -	void                                *handler_context,
 25.1017 -	void                                **region_context);
 25.1018 +acpi_status(*acpi_adr_space_setup) (acpi_handle region_handle,
 25.1019 +				    u32 function,
 25.1020 +				    void *handler_context,
 25.1021 +				    void **region_context);
 25.1022  
 25.1023  #define ACPI_REGION_ACTIVATE    0
 25.1024  #define ACPI_REGION_DEACTIVATE  1
 25.1025  
 25.1026  typedef
 25.1027 -acpi_status (*acpi_walk_callback) (
 25.1028 -	acpi_handle                         obj_handle,
 25.1029 -	u32                                 nesting_level,
 25.1030 -	void                                *context,
 25.1031 -	void                                **return_value);
 25.1032 -
 25.1033 +acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
 25.1034 +				  u32 nesting_level,
 25.1035 +				  void *context, void **return_value);
 25.1036  
 25.1037  /* Interrupt handler return values */
 25.1038  
 25.1039  #define ACPI_INTERRUPT_NOT_HANDLED      0x00
 25.1040  #define ACPI_INTERRUPT_HANDLED          0x01
 25.1041  
 25.1042 -
 25.1043  /* Common string version of device HIDs and UIDs */
 25.1044  
 25.1045 -struct acpi_device_id
 25.1046 -{
 25.1047 -	char                            value[ACPI_DEVICE_ID_LENGTH];
 25.1048 +struct acpica_device_id {
 25.1049 +	char value[ACPI_DEVICE_ID_LENGTH];
 25.1050  };
 25.1051  
 25.1052  /* Common string version of device CIDs */
 25.1053  
 25.1054 -struct acpi_compatible_id
 25.1055 -{
 25.1056 -	char                            value[ACPI_MAX_CID_LENGTH];
 25.1057 +struct acpi_compatible_id {
 25.1058 +	char value[ACPI_MAX_CID_LENGTH];
 25.1059  };
 25.1060  
 25.1061 -struct acpi_compatible_id_list
 25.1062 -{
 25.1063 -	u32                             count;
 25.1064 -	u32                             size;
 25.1065 -	struct acpi_compatible_id       id[1];
 25.1066 +struct acpi_compatible_id_list {
 25.1067 +	u32 count;
 25.1068 +	u32 size;
 25.1069 +	struct acpi_compatible_id id[1];
 25.1070  };
 25.1071  
 25.1072 -
 25.1073  /* Structure and flags for acpi_get_object_info */
 25.1074  
 25.1075  #define ACPI_VALID_STA                  0x0001
 25.1076 @@ -914,58 +834,59 @@ struct acpi_compatible_id_list
 25.1077  #define ACPI_VALID_CID                  0x0010
 25.1078  #define ACPI_VALID_SXDS                 0x0020
 25.1079  
 25.1080 +/* Flags for _STA method */
 25.1081 +
 25.1082 +#define ACPI_STA_DEVICE_PRESENT         0x01
 25.1083 +#define ACPI_STA_DEVICE_ENABLED         0x02
 25.1084 +#define ACPI_STA_DEVICE_UI              0x04
 25.1085 +#define ACPI_STA_DEVICE_FUNCTIONING     0x08
 25.1086 +#define ACPI_STA_DEVICE_OK              0x08	/* Synonym */
 25.1087 +#define ACPI_STA_BATTERY_PRESENT        0x10
 25.1088  
 25.1089  #define ACPI_COMMON_OBJ_INFO \
 25.1090 -	acpi_object_type                    type;           /* ACPI object type */ \
 25.1091 -	acpi_name                           name            /* ACPI object Name */
 25.1092 +	acpi_object_type                type;           /* ACPI object type */ \
 25.1093 +	acpi_name                       name	/* ACPI object Name */
 25.1094  
 25.1095 -
 25.1096 -struct acpi_obj_info_header
 25.1097 -{
 25.1098 +struct acpi_obj_info_header {
 25.1099  	ACPI_COMMON_OBJ_INFO;
 25.1100  };
 25.1101  
 25.1102 -
 25.1103  /* Structure returned from Get Object Info */
 25.1104  
 25.1105 -struct acpi_device_info
 25.1106 -{
 25.1107 +struct acpi_device_info {
 25.1108  	ACPI_COMMON_OBJ_INFO;
 25.1109  
 25.1110 -	u32                                 valid;              /* Indicates which fields below are valid */
 25.1111 -	u32                                 current_status;     /* _STA value */
 25.1112 -	acpi_integer                        address;            /* _ADR value if any */
 25.1113 -	struct acpi_device_id               hardware_id;        /* _HID value if any */
 25.1114 -	struct acpi_device_id               unique_id;          /* _UID value if any */
 25.1115 -	u8                                  highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
 25.1116 -	struct acpi_compatible_id_list      compatibility_id;   /* List of _CIDs if any */
 25.1117 +	u32 valid;		/* Indicates which fields below are valid */
 25.1118 +	u32 current_status;	/* _STA value */
 25.1119 +	acpi_integer address;	/* _ADR value if any */
 25.1120 +	struct acpica_device_id hardware_id;	/* _HID value if any */
 25.1121 +	struct acpica_device_id unique_id;	/* _UID value if any */
 25.1122 +	u8 highest_dstates[4];	/* _sx_d values: 0xFF indicates not valid */
 25.1123 +	struct acpi_compatible_id_list compatibility_id;	/* List of _CIDs if any */
 25.1124  };
 25.1125  
 25.1126 -
 25.1127  /* Context structs for address space handlers */
 25.1128  
 25.1129 -struct acpi_pci_id
 25.1130 -{
 25.1131 -	u16                                 segment;
 25.1132 -	u16                                 bus;
 25.1133 -	u16                                 device;
 25.1134 -	u16                                 function;
 25.1135 +struct acpi_pci_id {
 25.1136 +	u16 segment;
 25.1137 +	u16 bus;
 25.1138 +	u16 device;
 25.1139 +	u16 function;
 25.1140  };
 25.1141  
 25.1142 -
 25.1143 -struct acpi_mem_space_context
 25.1144 -{
 25.1145 -	u32                                 length;
 25.1146 -	acpi_physical_address               address;
 25.1147 -	acpi_physical_address               mapped_physical_address;
 25.1148 -	u8                                  *mapped_logical_address;
 25.1149 -	acpi_size                           mapped_length;
 25.1150 +struct acpi_mem_space_context {
 25.1151 +	u32 length;
 25.1152 +	acpi_physical_address address;
 25.1153 +	acpi_physical_address mapped_physical_address;
 25.1154 +	u8 *mapped_logical_address;
 25.1155 +	acpi_size mapped_length;
 25.1156  };
 25.1157  
 25.1158 -
 25.1159  /*
 25.1160   * Definitions for Resource Attributes
 25.1161   */
 25.1162 +typedef u16 acpi_rs_length;	/* Resource Length field is fixed at 16 bits */
 25.1163 +typedef u32 acpi_rsdesc_size;	/* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */
 25.1164  
 25.1165  /*
 25.1166   *  Memory Attributes
 25.1167 @@ -980,26 +901,28 @@ struct acpi_mem_space_context
 25.1168  
 25.1169  /*
 25.1170   *  IO Attributes
 25.1171 - *  The ISA Io ranges are:     n000-n0_ffh, n400-n4_ffh, n800-n8_ffh, n_c00-n_cFFh.
 25.1172 - *  The non-ISA Io ranges are: n100-n3_ffh, n500-n7_ffh, n900-n_bFfh, n_cd0-n_fFFh.
 25.1173 + *  The ISA IO ranges are:     n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
 25.1174 + *  The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
 25.1175   */
 25.1176  #define ACPI_NON_ISA_ONLY_RANGES        (u8) 0x01
 25.1177  #define ACPI_ISA_ONLY_RANGES            (u8) 0x02
 25.1178  #define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
 25.1179  
 25.1180 -#define ACPI_SPARSE_TRANSLATION         (u8) 0x03
 25.1181 +/* Type of translation - 1=Sparse, 0=Dense */
 25.1182 +
 25.1183 +#define ACPI_SPARSE_TRANSLATION         (u8) 0x01
 25.1184  
 25.1185  /*
 25.1186   *  IO Port Descriptor Decode
 25.1187   */
 25.1188 -#define ACPI_DECODE_10                  (u8) 0x00    /* 10-bit IO address decode */
 25.1189 -#define ACPI_DECODE_16                  (u8) 0x01    /* 16-bit IO address decode */
 25.1190 +#define ACPI_DECODE_10                  (u8) 0x00	/* 10-bit IO address decode */
 25.1191 +#define ACPI_DECODE_16                  (u8) 0x01	/* 16-bit IO address decode */
 25.1192  
 25.1193  /*
 25.1194   *  IRQ Attributes
 25.1195   */
 25.1196 -#define ACPI_EDGE_SENSITIVE             (u8) 0x00
 25.1197 -#define ACPI_LEVEL_SENSITIVE            (u8) 0x01
 25.1198 +#define ACPI_LEVEL_SENSITIVE            (u8) 0x00
 25.1199 +#define ACPI_EDGE_SENSITIVE             (u8) 0x01
 25.1200  
 25.1201  #define ACPI_ACTIVE_HIGH                (u8) 0x00
 25.1202  #define ACPI_ACTIVE_LOW                 (u8) 0x01
 25.1203 @@ -1045,32 +968,46 @@ struct acpi_mem_space_context
 25.1204  #define ACPI_PRODUCER                   (u8) 0x00
 25.1205  #define ACPI_CONSUMER                   (u8) 0x01
 25.1206  
 25.1207 +/*
 25.1208 + * If possible, pack the following structures to byte alignment
 25.1209 + */
 25.1210 +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
 25.1211 +#pragma pack(1)
 25.1212 +#endif
 25.1213 +
 25.1214 +/* UUID data structures for use in vendor-defined resource descriptors */
 25.1215 +
 25.1216 +struct acpi_uuid {
 25.1217 +	u8 data[ACPI_UUID_LENGTH];
 25.1218 +};
 25.1219 +
 25.1220 +struct acpi_vendor_uuid {
 25.1221 +	u8 subtype;
 25.1222 +	u8 data[ACPI_UUID_LENGTH];
 25.1223 +};
 25.1224  
 25.1225  /*
 25.1226   *  Structures used to describe device resources
 25.1227   */
 25.1228 -struct acpi_resource_irq
 25.1229 -{
 25.1230 -	u32                                 edge_level;
 25.1231 -	u32                                 active_high_low;
 25.1232 -	u32                                 shared_exclusive;
 25.1233 -	u32                                 number_of_interrupts;
 25.1234 -	u32                                 interrupts[1];
 25.1235 +struct acpi_resource_irq {
 25.1236 +	u8 triggering;
 25.1237 +	u8 polarity;
 25.1238 +	u8 sharable;
 25.1239 +	u8 interrupt_count;
 25.1240 +	u8 interrupts[1];
 25.1241  };
 25.1242  
 25.1243 -struct acpi_resource_dma
 25.1244 -{
 25.1245 -	u32                                 type;
 25.1246 -	u32                                 bus_master;
 25.1247 -	u32                                 transfer;
 25.1248 -	u32                                 number_of_channels;
 25.1249 -	u32                                 channels[1];
 25.1250 +struct acpi_resource_dma {
 25.1251 +	u8 type;
 25.1252 +	u8 bus_master;
 25.1253 +	u8 transfer;
 25.1254 +	u8 channel_count;
 25.1255 +	u8 channels[1];
 25.1256  };
 25.1257  
 25.1258 -struct acpi_resource_start_dpf
 25.1259 -{
 25.1260 -	u32                                 compatibility_priority;
 25.1261 -	u32                                 performance_robustness;
 25.1262 +struct acpi_resource_start_dependent {
 25.1263 +	u8 compatibility_priority;
 25.1264 +	u8 performance_robustness;
 25.1265  };
 25.1266  
 25.1267  /*
 25.1268 @@ -1078,224 +1015,223 @@ struct acpi_resource_start_dpf
 25.1269   * needed because it has no fields
 25.1270   */
 25.1271  
 25.1272 -struct acpi_resource_io
 25.1273 -{
 25.1274 -	u32                                 io_decode;
 25.1275 -	u32                                 min_base_address;
 25.1276 -	u32                                 max_base_address;
 25.1277 -	u32                                 alignment;
 25.1278 -	u32                                 range_length;
 25.1279 -};
 25.1280 -
 25.1281 -struct acpi_resource_fixed_io
 25.1282 -{
 25.1283 -	u32                                 base_address;
 25.1284 -	u32                                 range_length;
 25.1285 -};
 25.1286 -
 25.1287 -struct acpi_resource_vendor
 25.1288 -{
 25.1289 -	u32                                 length;
 25.1290 -	u8                                  reserved[1];
 25.1291 -};
 25.1292 -
 25.1293 -struct acpi_resource_end_tag
 25.1294 -{
 25.1295 -	u8                                  checksum;
 25.1296 -};
 25.1297 -
 25.1298 -struct acpi_resource_mem24
 25.1299 -{
 25.1300 -	u32                                 read_write_attribute;
 25.1301 -	u32                                 min_base_address;
 25.1302 -	u32                                 max_base_address;
 25.1303 -	u32                                 alignment;
 25.1304 -	u32                                 range_length;
 25.1305 -};
 25.1306 -
 25.1307 -struct acpi_resource_mem32
 25.1308 -{
 25.1309 -	u32                                 read_write_attribute;
 25.1310 -	u32                                 min_base_address;
 25.1311 -	u32                                 max_base_address;
 25.1312 -	u32                                 alignment;
 25.1313 -	u32                                 range_length;
 25.1314 -};
 25.1315 -
 25.1316 -struct acpi_resource_fixed_mem32
 25.1317 -{
 25.1318 -	u32                                 read_write_attribute;
 25.1319 -	u32                                 range_base_address;
 25.1320 -	u32                                 range_length;
 25.1321 -};
 25.1322 -
 25.1323 -struct acpi_memory_attribute
 25.1324 -{
 25.1325 -	u16                                 cache_attribute;
 25.1326 -	u16                                 read_write_attribute;
 25.1327 -};
 25.1328 -
 25.1329 -struct acpi_io_attribute
 25.1330 -{
 25.1331 -	u16                                 range_attribute;
 25.1332 -	u16                                 translation_attribute;
 25.1333 -};
 25.1334 -
 25.1335 -struct acpi_bus_attribute
 25.1336 -{
 25.1337 -	u16                                 reserved1;
 25.1338 -	u16                                 reserved2;
 25.1339 +struct acpi_resource_io {
 25.1340 +	u8 io_decode;
 25.1341 +	u8 alignment;
 25.1342 +	u8 address_length;
 25.1343 +	u16 minimum;
 25.1344 +	u16 maximum;
 25.1345  };
 25.1346  
 25.1347 -union acpi_resource_attribute
 25.1348 -{
 25.1349 -	struct acpi_memory_attribute        memory;
 25.1350 -	struct acpi_io_attribute            io;
 25.1351 -	struct acpi_bus_attribute           bus;
 25.1352 -};
 25.1353 -
 25.1354 -struct acpi_resource_source
 25.1355 -{
 25.1356 -	u32                                 index;
 25.1357 -	u32                                 string_length;
 25.1358 -	char                                *string_ptr;
 25.1359 -};
 25.1360 -
 25.1361 -struct acpi_resource_address16
 25.1362 -{
 25.1363 -	u32                                 resource_type;
 25.1364 -	u32                                 producer_consumer;
 25.1365 -	u32                                 decode;
 25.1366 -	u32                                 min_address_fixed;
 25.1367 -	u32                                 max_address_fixed;
 25.1368 -	union acpi_resource_attribute       attribute;
 25.1369 -	u32                                 granularity;
 25.1370 -	u32                                 min_address_range;
 25.1371 -	u32                                 max_address_range;
 25.1372 -	u32                                 address_translation_offset;
 25.1373 -	u32                                 address_length;
 25.1374 -	struct acpi_resource_source         resource_source;
 25.1375 +struct acpi_resource_fixed_io {
 25.1376 +	u16 address;
 25.1377 +	u8 address_length;
 25.1378  };
 25.1379  
 25.1380 -struct acpi_resource_address32
 25.1381 -{
 25.1382 -	u32                                 resource_type;
 25.1383 -	u32                                 producer_consumer;
 25.1384 -	u32                                 decode;
 25.1385 -	u32                                 min_address_fixed;
 25.1386 -	u32                                 max_address_fixed;
 25.1387 -	union acpi_resource_attribute       attribute;
 25.1388 -	u32                                 granularity;
 25.1389 -	u32                                 min_address_range;
 25.1390 -	u32                                 max_address_range;
 25.1391 -	u32                                 address_translation_offset;
 25.1392 -	u32                                 address_length;
 25.1393 -	struct acpi_resource_source         resource_source;
 25.1394 +struct acpi_resource_vendor {
 25.1395 +	u16 byte_length;
 25.1396 +	u8 byte_data[1];
 25.1397  };
 25.1398  
 25.1399 -struct acpi_resource_address64
 25.1400 -{
 25.1401 -	u32                                 resource_type;
 25.1402 -	u32                                 producer_consumer;
 25.1403 -	u32                                 decode;
 25.1404 -	u32                                 min_address_fixed;
 25.1405 -	u32                                 max_address_fixed;
 25.1406 -	union acpi_resource_attribute       attribute;
 25.1407 -	u64                                 granularity;
 25.1408 -	u64                                 min_address_range;
 25.1409 -	u64                                 max_address_range;
 25.1410 -	u64                                 address_translation_offset;
 25.1411 -	u64                                 address_length;
 25.1412 -	struct acpi_resource_source         resource_source;
 25.1413 +/* Vendor resource with UUID info (introduced in ACPI 3.0) */
 25.1414 +
 25.1415 +struct acpi_resource_vendor_typed {
 25.1416 +	u16 byte_length;
 25.1417 +	u8 uuid_subtype;
 25.1418 +	u8 uuid[ACPI_UUID_LENGTH];
 25.1419 +	u8 byte_data[1];
 25.1420  };
 25.1421  
 25.1422 -struct acpi_resource_ext_irq
 25.1423 -{
 25.1424 -	u32                                 producer_consumer;
 25.1425 -	u32                                 edge_level;
 25.1426 -	u32                                 active_high_low;
 25.1427 -	u32                                 shared_exclusive;
 25.1428 -	u32                                 number_of_interrupts;
 25.1429 -	struct acpi_resource_source         resource_source;
 25.1430 -	u32                                 interrupts[1];
 25.1431 +struct acpi_resource_end_tag {
 25.1432 +	u8 checksum;
 25.1433  };
 25.1434  
 25.1435 +struct acpi_resource_memory24 {
 25.1436 +	u8 write_protect;
 25.1437 +	u16 minimum;
 25.1438 +	u16 maximum;
 25.1439 +	u16 alignment;
 25.1440 +	u16 address_length;
 25.1441 +};
 25.1442 +
 25.1443 +struct acpi_resource_memory32 {
 25.1444 +	u8 write_protect;
 25.1445 +	u32 minimum;
 25.1446 +	u32 maximum;
 25.1447 +	u32 alignment;
 25.1448 +	u32 address_length;
 25.1449 +};
 25.1450 +
 25.1451 +struct acpi_resource_fixed_memory32 {
 25.1452 +	u8 write_protect;
 25.1453 +	u32 address;
 25.1454 +	u32 address_length;
 25.1455 +};
 25.1456 +
 25.1457 +struct acpi_memory_attribute {
 25.1458 +	u8 write_protect;
 25.1459 +	u8 caching;
 25.1460 +	u8 range_type;
 25.1461 +	u8 translation;
 25.1462 +};
 25.1463 +
 25.1464 +struct acpi_io_attribute {
 25.1465 +	u8 range_type;
 25.1466 +	u8 translation;
 25.1467 +	u8 translation_type;
 25.1468 +	u8 reserved1;
 25.1469 +};
 25.1470 +
 25.1471 +union acpi_resource_attribute {
 25.1472 +	struct acpi_memory_attribute mem;
 25.1473 +	struct acpi_io_attribute io;
 25.1474 +
 25.1475 +	/* Used for the *word_space macros */
 25.1476 +
 25.1477 +	u8 type_specific;
 25.1478 +};
 25.1479 +
 25.1480 +struct acpi_resource_source {
 25.1481 +	u8 index;
 25.1482 +	u16 string_length;
 25.1483 +	char *string_ptr;
 25.1484 +};
 25.1485 +
 25.1486 +/* Fields common to all address descriptors, 16/32/64 bit */
 25.1487 +
 25.1488 +#define ACPI_RESOURCE_ADDRESS_COMMON \
 25.1489 +	u8                              resource_type; \
 25.1490 +	u8                              producer_consumer; \
 25.1491 +	u8                              decode; \
 25.1492 +	u8                              min_address_fixed; \
 25.1493 +	u8                              max_address_fixed; \
 25.1494 +	union acpi_resource_attribute   info;
 25.1495 +
 25.1496 +struct acpi_resource_address {
 25.1497 +ACPI_RESOURCE_ADDRESS_COMMON};
 25.1498 +
 25.1499 +struct acpi_resource_address16 {
 25.1500 +	ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
 25.1501 +	u16 minimum;
 25.1502 +	u16 maximum;
 25.1503 +	u16 translation_offset;
 25.1504 +	u16 address_length;
 25.1505 +	struct acpi_resource_source resource_source;
 25.1506 +};
 25.1507 +
 25.1508 +struct acpi_resource_address32 {
 25.1509 +	ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
 25.1510 +	u32 minimum;
 25.1511 +	u32 maximum;
 25.1512 +	u32 translation_offset;
 25.1513 +	u32 address_length;
 25.1514 +	struct acpi_resource_source resource_source;
 25.1515 +};
 25.1516 +
 25.1517 +struct acpi_resource_address64 {
 25.1518 +	ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
 25.1519 +	u64 minimum;
 25.1520 +	u64 maximum;
 25.1521 +	u64 translation_offset;
 25.1522 +	u64 address_length;
 25.1523 +	struct acpi_resource_source resource_source;
 25.1524 +};
 25.1525 +
 25.1526 +struct acpi_resource_extended_address64 {
 25.1527 +	ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
 25.1528 +	u64 granularity;
 25.1529 +	u64 minimum;
 25.1530 +	u64 maximum;
 25.1531 +	u64 translation_offset;
 25.1532 +	u64 address_length;
 25.1533 +	u64 type_specific;
 25.1534 +};
 25.1535 +
 25.1536 +struct acpi_resource_extended_irq {
 25.1537 +	u8 producer_consumer;
 25.1538 +	u8 triggering;
 25.1539 +	u8 polarity;
 25.1540 +	u8 sharable;
 25.1541 +	u8 interrupt_count;
 25.1542 +	struct acpi_resource_source resource_source;
 25.1543 +	u32 interrupts[1];
 25.1544 +};
 25.1545 +
 25.1546 +struct acpi_resource_generic_register {
 25.1547 +	u8 space_id;
 25.1548 +	u8 bit_width;
 25.1549 +	u8 bit_offset;
 25.1550 +	u8 access_size;
 25.1551 +	u64 address;
 25.1552 +};
 25.1553  
 25.1554  /* ACPI_RESOURCE_TYPEs */
 25.1555  
 25.1556 -#define ACPI_RSTYPE_IRQ                 0
 25.1557 -#define ACPI_RSTYPE_DMA                 1
 25.1558 -#define ACPI_RSTYPE_START_DPF           2
 25.1559 -#define ACPI_RSTYPE_END_DPF             3
 25.1560 -#define ACPI_RSTYPE_IO                  4
 25.1561 -#define ACPI_RSTYPE_FIXED_IO            5
 25.1562 -#define ACPI_RSTYPE_VENDOR              6
 25.1563 -#define ACPI_RSTYPE_END_TAG             7
 25.1564 -#define ACPI_RSTYPE_MEM24               8
 25.1565 -#define ACPI_RSTYPE_MEM32               9
 25.1566 -#define ACPI_RSTYPE_FIXED_MEM32         10
 25.1567 -#define ACPI_RSTYPE_ADDRESS16           11
 25.1568 -#define ACPI_RSTYPE_ADDRESS32           12
 25.1569 -#define ACPI_RSTYPE_ADDRESS64           13
 25.1570 -#define ACPI_RSTYPE_EXT_IRQ             14
 25.1571 +#define ACPI_RESOURCE_TYPE_IRQ                  0
 25.1572 +#define ACPI_RESOURCE_TYPE_DMA                  1
 25.1573 +#define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
 25.1574 +#define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
 25.1575 +#define ACPI_RESOURCE_TYPE_IO                   4
 25.1576 +#define ACPI_RESOURCE_TYPE_FIXED_IO             5
 25.1577 +#define ACPI_RESOURCE_TYPE_VENDOR               6
 25.1578 +#define ACPI_RESOURCE_TYPE_END_TAG              7
 25.1579 +#define ACPI_RESOURCE_TYPE_MEMORY24             8
 25.1580 +#define ACPI_RESOURCE_TYPE_MEMORY32             9
 25.1581 +#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
 25.1582 +#define ACPI_RESOURCE_TYPE_ADDRESS16            11
 25.1583 +#define ACPI_RESOURCE_TYPE_ADDRESS32            12
 25.1584 +#define ACPI_RESOURCE_TYPE_ADDRESS64            13
 25.1585 +#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14	/* ACPI 3.0 */
 25.1586 +#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
 25.1587 +#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
 25.1588 +#define ACPI_RESOURCE_TYPE_MAX                  16
 25.1589  
 25.1590 -typedef u32                                     acpi_resource_type;
 25.1591 +union acpi_resource_data {
 25.1592 +	struct acpi_resource_irq irq;
 25.1593 +	struct acpi_resource_dma dma;
 25.1594 +	struct acpi_resource_start_dependent start_dpf;
 25.1595 +	struct acpi_resource_io io;
 25.1596 +	struct acpi_resource_fixed_io fixed_io;
 25.1597 +	struct acpi_resource_vendor vendor;
 25.1598 +	struct acpi_resource_vendor_typed vendor_typed;
 25.1599 +	struct acpi_resource_end_tag end_tag;
 25.1600 +	struct acpi_resource_memory24 memory24;
 25.1601 +	struct acpi_resource_memory32 memory32;
 25.1602 +	struct acpi_resource_fixed_memory32 fixed_memory32;
 25.1603 +	struct acpi_resource_address16 address16;
 25.1604 +	struct acpi_resource_address32 address32;
 25.1605 +	struct acpi_resource_address64 address64;
 25.1606 +	struct acpi_resource_extended_address64 ext_address64;
 25.1607 +	struct acpi_resource_extended_irq extended_irq;
 25.1608 +	struct acpi_resource_generic_register generic_reg;
 25.1609  
 25.1610 -union acpi_resource_data
 25.1611 -{
 25.1612 -	struct acpi_resource_irq            irq;
 25.1613 -	struct acpi_resource_dma            dma;
 25.1614 -	struct acpi_resource_start_dpf      start_dpf;
 25.1615 -	struct acpi_resource_io             io;
 25.1616 -	struct acpi_resource_fixed_io       fixed_io;
 25.1617 -	struct acpi_resource_vendor         vendor_specific;
 25.1618 -	struct acpi_resource_end_tag        end_tag;
 25.1619 -	struct acpi_resource_mem24          memory24;
 25.1620 -	struct acpi_resource_mem32          memory32;
 25.1621 -	struct acpi_resource_fixed_mem32    fixed_memory32;
 25.1622 -	struct acpi_resource_address16      address16;
 25.1623 -	struct acpi_resource_address32      address32;
 25.1624 -	struct acpi_resource_address64      address64;
 25.1625 -	struct acpi_resource_ext_irq        extended_irq;
 25.1626 +	/* Common fields */
 25.1627 +
 25.1628 +	struct acpi_resource_address address;	/* Common 16/32/64 address fields */
 25.1629  };
 25.1630  
 25.1631 -struct acpi_resource
 25.1632 -{
 25.1633 -	acpi_resource_type                  id;
 25.1634 -	u32                                 length;
 25.1635 -	union acpi_resource_data            data;
 25.1636 +struct acpi_resource {
 25.1637 +	u32 type;
 25.1638 +	u32 length;
 25.1639 +	union acpi_resource_data data;
 25.1640  };
 25.1641  
 25.1642 -#define ACPI_RESOURCE_LENGTH                12
 25.1643 -#define ACPI_RESOURCE_LENGTH_NO_DATA        8       /* Id + Length fields */
 25.1644 +/* restore default alignment */
 25.1645  
 25.1646 -#define ACPI_SIZEOF_RESOURCE(type)          (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type))
 25.1647 +#pragma pack()
 25.1648 +
 25.1649 +#define ACPI_RS_SIZE_MIN                    12
 25.1650 +#define ACPI_RS_SIZE_NO_DATA                8	/* Id + Length fields */
 25.1651 +#define ACPI_RS_SIZE(type)                  (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
 25.1652  
 25.1653  #define ACPI_NEXT_RESOURCE(res)             (struct acpi_resource *)((u8 *) res + res->length)
 25.1654  
 25.1655 -#ifdef ACPI_MISALIGNED_TRANSFERS
 25.1656 -#define ACPI_ALIGN_RESOURCE_SIZE(length)    (length)
 25.1657 -#else
 25.1658 -#define ACPI_ALIGN_RESOURCE_SIZE(length)    ACPI_ROUND_UP_TO_NATIVE_WORD(length)
 25.1659 -#endif
 25.1660 -
 25.1661 -/*
 25.1662 - * END: of definitions for Resource Attributes
 25.1663 - */
 25.1664 -
 25.1665 -
 25.1666 -struct acpi_pci_routing_table
 25.1667 -{
 25.1668 -	u32                                 length;
 25.1669 -	u32                                 pin;
 25.1670 -	acpi_integer                        address;        /* here for 64-bit alignment */
 25.1671 -	u32                                 source_index;
 25.1672 -	char                                source[4];      /* pad to 64 bits so sizeof() works in all cases */
 25.1673 +struct acpi_pci_routing_table {
 25.1674 +	u32 length;
 25.1675 +	u32 pin;
 25.1676 +	acpi_integer address;	/* here for 64-bit alignment */
 25.1677 +	u32 source_index;
 25.1678 +	char source[4];		/* pad to 64 bits so sizeof() works in all cases */
 25.1679  };
 25.1680  
 25.1681 -/*
 25.1682 - * END: of definitions for PCI Routing tables
 25.1683 - */
 25.1684 -
 25.1685 -
 25.1686 -#endif /* __ACTYPES_H__ */
 25.1687 +#endif				/* __ACTYPES_H__ */
    26.1 --- a/xen/include/acpi/acutils.h	Tue Mar 18 13:14:26 2008 +0000
    26.2 +++ b/xen/include/acpi/acutils.h	Tue Mar 18 14:55:36 2008 +0000
    26.3 @@ -5,7 +5,7 @@
    26.4   *****************************************************************************/
    26.5  
    26.6  /*
    26.7 - * Copyright (C) 2000 - 2005, R. Byron Moore
    26.8 + * Copyright (C) 2000 - 2007, R. Byron Moore
    26.9   * All rights reserved.
   26.10   *
   26.11   * Redistribution and use in source and binary forms, with or without
   26.12 @@ -44,27 +44,56 @@
   26.13  #ifndef _ACUTILS_H
   26.14  #define _ACUTILS_H
   26.15  
   26.16 +extern const u8 acpi_gbl_resource_aml_sizes[];
   26.17 +
   26.18 +/* Strings used by the disassembler and debugger resource dump routines */
   26.19 +
   26.20 +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
   26.21 +
   26.22 +extern const char *acpi_gbl_bm_decode[];
   26.23 +extern const char *acpi_gbl_config_decode[];
   26.24 +extern const char *acpi_gbl_consume_decode[];
   26.25 +extern const char *acpi_gbl_dec_decode[];
   26.26 +extern const char *acpi_gbl_he_decode[];
   26.27 +extern const char *acpi_gbl_io_decode[];
   26.28 +extern const char *acpi_gbl_ll_decode[];
   26.29 +extern const char *acpi_gbl_max_decode[];
   26.30 +extern const char *acpi_gbl_mem_decode[];
   26.31 +extern const char *acpi_gbl_min_decode[];
   26.32 +extern const char *acpi_gbl_mtp_decode[];
   26.33 +extern const char *acpi_gbl_rng_decode[];
   26.34 +extern const char *acpi_gbl_rw_decode[];
   26.35 +extern const char *acpi_gbl_shr_decode[];
   26.36 +extern const char *acpi_gbl_siz_decode[];
   26.37 +extern const char *acpi_gbl_trs_decode[];
   26.38 +extern const char *acpi_gbl_ttp_decode[];
   26.39 +extern const char *acpi_gbl_typ_decode[];
   26.40 +#endif
   26.41 +
   26.42 +/* Types for Resource descriptor entries */
   26.43 +
   26.44 +#define ACPI_INVALID_RESOURCE           0
   26.45 +#define ACPI_FIXED_LENGTH               1
   26.46 +#define ACPI_VARIABLE_LENGTH            2
   26.47 +#define ACPI_SMALL_VARIABLE_LENGTH      3
   26.48  
   26.49  typedef
   26.50 -acpi_status (*acpi_pkg_callback) (
   26.51 -	u8                              object_type,
   26.52 -	union acpi_operand_object       *source_object,
   26.53 -	union acpi_generic_state        *state,
   26.54 -	void                            *context);
   26.55 +acpi_status(*acpi_walk_aml_callback) (u8 * aml,
   26.56 +				      u32 length,
   26.57 +				      u32 offset,
   26.58 +				      u8 resource_index, void **context);
   26.59  
   26.60 -acpi_status
   26.61 -acpi_ut_walk_package_tree (
   26.62 -	union acpi_operand_object       *source_object,
   26.63 -	void                            *target_object,
   26.64 -	acpi_pkg_callback               walk_callback,
   26.65 -	void                            *context);
   26.66 +typedef
   26.67 +acpi_status(*acpi_pkg_callback) (u8 object_type,
   26.68 +				 union acpi_operand_object * source_object,
   26.69 +				 union acpi_generic_state * state,
   26.70 +				 void *context);
   26.71  
   26.72 -struct acpi_pkg_info
   26.73 -{
   26.74 -	u8                              *free_space;
   26.75 -	acpi_size                       length;
   26.76 -	u32                             object_space;
   26.77 -	u32                             num_packages;
   26.78 +struct acpi_pkg_info {
   26.79 +	u8 *free_space;
   26.80 +	acpi_size length;
   26.81 +	u32 object_space;
   26.82 +	u32 num_packages;
   26.83  };
   26.84  
   26.85  #define REF_INCREMENT       (u16) 0
   26.86 @@ -78,176 +107,87 @@ struct acpi_pkg_info
   26.87  #define DB_DWORD_DISPLAY    4
   26.88  #define DB_QWORD_DISPLAY    8
   26.89  
   26.90 -
   26.91 -/* Global initialization interfaces */
   26.92 -
   26.93 -void
   26.94 -acpi_ut_init_globals (
   26.95 -	void);
   26.96 -
   26.97 -void
   26.98 -acpi_ut_terminate (
   26.99 -	void);
  26.100 -
  26.101 -
  26.102  /*
  26.103 - * ut_init - miscellaneous initialization and shutdown
  26.104 + * utglobal - Global data structures and procedures
  26.105   */
  26.106 -
  26.107 -acpi_status
  26.108 -acpi_ut_hardware_initialize (
  26.109 -	void);
  26.110 -
  26.111 -void
  26.112 -acpi_ut_subsystem_shutdown (
  26.113 -	void);
  26.114 -
  26.115 -acpi_status
  26.116 -acpi_ut_validate_fadt (
  26.117 -	void);
  26.118 -
  26.119 -/*
  26.120 - * ut_global - Global data structures and procedures
  26.121 - */
  26.122 +void acpi_ut_init_globals(void);
  26.123  
  26.124  #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
  26.125  
  26.126 -char *
  26.127 -acpi_ut_get_mutex_name (
  26.128 -	u32                             mutex_id);
  26.129 +char *acpi_ut_get_mutex_name(u32 mutex_id);
  26.130  
  26.131  #endif
  26.132  
  26.133 -char *
  26.134 -acpi_ut_get_type_name (
  26.135 -	acpi_object_type                type);
  26.136 -
  26.137 -char *
  26.138 -acpi_ut_get_node_name (
  26.139 -	void                            *object);
  26.140 -
  26.141 -char *
  26.142 -acpi_ut_get_descriptor_name (
  26.143 -	void                            *object);
  26.144 -
  26.145 -char *
  26.146 -acpi_ut_get_object_type_name (
  26.147 -	union acpi_operand_object       *obj_desc);
  26.148 +char *acpi_ut_get_type_name(acpi_object_type type);
  26.149  
  26.150 -char *
  26.151 -acpi_ut_get_region_name (
  26.152 -	u8                              space_id);
  26.153 -
  26.154 -char *
  26.155 -acpi_ut_get_event_name (
  26.156 -	u32                             event_id);
  26.157 +char *acpi_ut_get_node_name(void *object);
  26.158  
  26.159 -char
  26.160 -acpi_ut_hex_to_ascii_char (
  26.161 -	acpi_integer                    integer,
  26.162 -	u32                             position);
  26.163 +char *acpi_ut_get_descriptor_name(void *object);
  26.164  
  26.165 -u8
  26.166 -acpi_ut_valid_object_type (
  26.167 -	acpi_object_type                type);
  26.168 +char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
  26.169  
  26.170 -acpi_owner_id
  26.171 -acpi_ut_allocate_owner_id (
  26.172 -	u32                             id_type);
  26.173 +char *acpi_ut_get_region_name(u8 space_id);
  26.174  
  26.175 +char *acpi_ut_get_event_name(u32 event_id);
  26.176 +
  26.177 +char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position);
  26.178