ia64/xen-unstable

changeset 17257:df89656a4b94

ia64: Fix build after ACPI header churn.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 19:28:09 2008 +0000 (2008-03-18)
parents 6ac99b961bff
children c40a5ae3e18b
files xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/xen/acpi.c xen/arch/ia64/xen/dom_fw_common.c xen/arch/ia64/xen/pcdp.c xen/include/acpi/platform/aclinux.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/setup.c	Tue Mar 18 16:15:24 2008 +0000
     1.2 +++ b/xen/arch/ia64/linux-xen/setup.c	Tue Mar 18 19:28:09 2008 +0000
     1.3 @@ -358,7 +358,7 @@ acpi_oem_console_setup(void)
     1.4  	extern struct ns16550_defaults ns16550_com1;
     1.5  	efi_system_table_t *systab;
     1.6  	efi_config_table_t *tables;
     1.7 -	struct acpi20_table_rsdp *rsdp = NULL;
     1.8 +	struct acpi_table_rsdp *rsdp = NULL;
     1.9  	struct acpi_table_xsdt *xsdt;
    1.10  	struct acpi_table_header *hdr;
    1.11  	int i;
    1.12 @@ -378,16 +378,17 @@ acpi_oem_console_setup(void)
    1.13  	for (i = 0 ; i < (int)systab->nr_tables && !rsdp ; i++) {
    1.14  		if (efi_guidcmp(tables[i].guid, ACPI_20_TABLE_GUID) == 0)
    1.15  			rsdp =
    1.16 -			     (struct acpi20_table_rsdp *)__va(tables[i].table);
    1.17 +			     (struct acpi_table_rsdp *)__va(tables[i].table);
    1.18  	}
    1.19  
    1.20 -	if (!rsdp || strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1))
    1.21 +	if (!rsdp ||
    1.22 +	    strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1))
    1.23  		return -ENODEV;
    1.24  
    1.25 -	xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
    1.26 +	xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);
    1.27  	hdr = &xsdt->header;
    1.28  
    1.29 -	if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1))
    1.30 +	if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1))
    1.31  		return -ENODEV;
    1.32  
    1.33  	/* Looking for Fujitsu PRIMEQUEST systems */
     2.1 --- a/xen/arch/ia64/xen/acpi.c	Tue Mar 18 16:15:24 2008 +0000
     2.2 +++ b/xen/arch/ia64/xen/acpi.c	Tue Mar 18 19:28:09 2008 +0000
     2.3 @@ -74,7 +74,7 @@ acpi_get_sysname (void)
     2.4  {
     2.5  /* #ifdef CONFIG_IA64_GENERIC */
     2.6  	unsigned long rsdp_phys;
     2.7 -	struct acpi20_table_rsdp *rsdp;
     2.8 +	struct acpi_table_rsdp *rsdp;
     2.9  	struct acpi_table_xsdt *xsdt;
    2.10  	struct acpi_table_header *hdr;
    2.11  
    2.12 @@ -84,15 +84,15 @@ acpi_get_sysname (void)
    2.13  		return "dig";
    2.14  	}
    2.15  
    2.16 -	rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys);
    2.17 -	if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
    2.18 +	rsdp = (struct acpi_table_rsdp *) __va(rsdp_phys);
    2.19 +	if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {
    2.20  		printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
    2.21  		return "dig";
    2.22  	}
    2.23  
    2.24 -	xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address);
    2.25 +	xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_physical_address);
    2.26  	hdr = &xsdt->header;
    2.27 -	if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
    2.28 +	if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {
    2.29  		printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
    2.30  		return "dig";
    2.31  	}
    2.32 @@ -356,14 +356,14 @@ acpi_parse_madt (unsigned long phys_addr
    2.33  #ifdef CONFIG_ITANIUM
    2.34  	has_8259 = 1; /* Firmware on old Itanium systems is broken */
    2.35  #else
    2.36 -	has_8259 = acpi_madt->flags.pcat_compat;
    2.37 +	has_8259 = acpi_madt->flags & ACPI_MADT_PCAT_COMPAT;
    2.38  #endif
    2.39  	iosapic_system_init(has_8259);
    2.40  
    2.41  	/* Get base address of IPI Message Block */
    2.42  
    2.43 -	if (acpi_madt->lapic_address)
    2.44 -		ipi_base_addr = (void __iomem *) ioremap(acpi_madt->lapic_address, 0);
    2.45 +	if (acpi_madt->address)
    2.46 +		ipi_base_addr = (void __iomem *)ioremap(acpi_madt->address, 0);
    2.47  
    2.48  	printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
    2.49  
    2.50 @@ -416,7 +416,7 @@ acpi_numa_slit_init (struct acpi_table_s
    2.51  	u32 len;
    2.52  
    2.53  	len = sizeof(struct acpi_table_header) + 8
    2.54 -		+ slit->localities * slit->localities;
    2.55 +		+ slit->locality_count * slit->locality_count;
    2.56  	if (slit->header.length != len) {
    2.57  		printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
    2.58  		       len, slit->header.length);
    2.59 @@ -519,21 +519,24 @@ acpi_numa_arch_fixup (void)
    2.60  	for (i = 0; i < srat_num_cpus; i++)
    2.61  		node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
    2.62  
    2.63 -	printk(KERN_INFO "Number of logical nodes in system = %d\n", numnodes);
    2.64 -	printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
    2.65 +	printk(KERN_INFO "Number of logical nodes in system = %d\n",
    2.66 +	       numnodes);
    2.67 +	printk(KERN_INFO "Number of memory chunks in system = %d\n",
    2.68 +	       num_node_memblks);
    2.69  
    2.70 -	if (!slit_table) return;
    2.71 +	if (!slit_table)
    2.72 +		return;
    2.73  	memset(numa_slit, -1, sizeof(numa_slit));
    2.74 -	for (i=0; i<slit_table->localities; i++) {
    2.75 +	for (i = 0; i < slit_table->locality_count; i++) {
    2.76  		if (!pxm_bit_test(i))
    2.77  			continue;
    2.78  		node_from = pxm_to_nid_map[i];
    2.79 -		for (j=0; j<slit_table->localities; j++) {
    2.80 +		for (j=0; j < slit_table->locality_count; j++) {
    2.81  			if (!pxm_bit_test(j))
    2.82  				continue;
    2.83  			node_to = pxm_to_nid_map[j];
    2.84  			node_distance(node_from, node_to) =
    2.85 -				slit_table->entry[i*slit_table->localities + j];
    2.86 +			    slit_table->entry[i * slit_table->locality_count + j];
    2.87  		}
    2.88  	}
    2.89  
     3.1 --- a/xen/arch/ia64/xen/dom_fw_common.c	Tue Mar 18 16:15:24 2008 +0000
     3.2 +++ b/xen/arch/ia64/xen/dom_fw_common.c	Tue Mar 18 19:28:09 2008 +0000
     3.3 @@ -208,7 +208,7 @@ print_md(efi_memory_desc_t *md)
     3.4  }
     3.5  
     3.6  struct fake_acpi_tables {
     3.7 -	struct acpi20_table_rsdp rsdp;
     3.8 +	struct acpi_table_rsdp rsdp;
     3.9  	struct acpi_table_xsdt xsdt;
    3.10  	uint64_t madt_ptr;
    3.11  	struct acpi_table_fadt fadt;
    3.12 @@ -217,9 +217,9 @@ struct fake_acpi_tables {
    3.13  	uint8_t aml[8 + 11 * MAX_VIRT_CPUS];
    3.14  	struct acpi_table_madt madt;
    3.15  	struct acpi_table_lsapic lsapic[MAX_VIRT_CPUS];
    3.16 -	uint8_t pm1a_evt_blk[4];
    3.17 -	uint8_t pm1a_cnt_blk[1];
    3.18 -	uint8_t pm_tmr_blk[4];
    3.19 +	uint8_t pm1a_event_block[4];
    3.20 +	uint8_t pm1a_control_block[1];
    3.21 +	uint8_t pm_timer_block[4];
    3.22  };
    3.23  #define ACPI_TABLE_MPA(field)                                       \
    3.24      FW_ACPI_BASE_PADDR + offsetof(struct fake_acpi_tables, field);
    3.25 @@ -228,7 +228,7 @@ struct fake_acpi_tables {
    3.26  void
    3.27  dom_fw_fake_acpi(domain_t *d, struct fake_acpi_tables *tables)
    3.28  {
    3.29 -	struct acpi20_table_rsdp *rsdp = &tables->rsdp;
    3.30 +	struct acpi_table_rsdp *rsdp = &tables->rsdp;
    3.31  	struct acpi_table_xsdt *xsdt = &tables->xsdt;
    3.32  	struct acpi_table_fadt *fadt = &tables->fadt;
    3.33  	struct acpi_table_facs *facs = &tables->facs;
    3.34 @@ -245,34 +245,37 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    3.35  	memset(tables, 0, sizeof(struct fake_acpi_tables));
    3.36  
    3.37  	/* setup XSDT (64bit version of RSDT) */
    3.38 -	memcpy(xsdt->signature, XSDT_SIG, sizeof(xsdt->signature));
    3.39 +	memcpy(xsdt->header.signature, ACPI_SIG_XSDT,
    3.40 +	       sizeof(xsdt->header.signature));
    3.41  	/* XSDT points to both the FADT and the MADT, so add one entry */
    3.42 -	xsdt->length = sizeof(struct acpi_table_xsdt) + sizeof(uint64_t);
    3.43 -	xsdt->revision = 1;
    3.44 -	memcpy(xsdt->oem_id, "XEN", 3);
    3.45 -	memcpy(xsdt->oem_table_id, "Xen/ia64", 8);
    3.46 -	memcpy(xsdt->asl_compiler_id, "XEN", 3);
    3.47 -	xsdt->asl_compiler_revision = xen_ia64_version(d);
    3.48 +	xsdt->header.length = sizeof(struct acpi_table_xsdt) + sizeof(uint64_t);
    3.49 +	xsdt->header.revision = 1;
    3.50 +	memcpy(xsdt->header.oem_id, "XEN", 3);
    3.51 +	memcpy(xsdt->header.oem_table_id, "Xen/ia64", 8);
    3.52 +	memcpy(xsdt->header.asl_compiler_id, "XEN", 3);
    3.53 +	xsdt->header.asl_compiler_revision = xen_ia64_version(d);
    3.54  
    3.55  	xsdt->table_offset_entry[0] = ACPI_TABLE_MPA(fadt);
    3.56  	tables->madt_ptr = ACPI_TABLE_MPA(madt);
    3.57  
    3.58 -	xsdt->checksum = generate_acpi_checksum(xsdt, xsdt->length);
    3.59 +	xsdt->header.checksum = generate_acpi_checksum(xsdt,
    3.60 +	                                               xsdt->header.length);
    3.61  
    3.62  	/* setup FADT */
    3.63 -	memcpy(fadt->signature, FADT_SIG, sizeof(fadt->signature));
    3.64 -	fadt->length = sizeof(struct acpi_table_fadt);
    3.65 -	fadt->revision = FADT2_REVISION_ID;
    3.66 -	memcpy(fadt->oem_id, "XEN", 3);
    3.67 -	memcpy(fadt->oem_table_id, "Xen/ia64", 8);
    3.68 -	memcpy(fadt->asl_compiler_id, "XEN", 3);
    3.69 -	fadt->asl_compiler_revision = xen_ia64_version(d);
    3.70 +	memcpy(fadt->header.signature, ACPI_SIG_FADT,
    3.71 +	       sizeof(fadt->header.signature));
    3.72 +	fadt->header.length = sizeof(struct acpi_table_fadt);
    3.73 +	fadt->header.revision = FADT2_REVISION_ID;
    3.74 +	memcpy(fadt->header.oem_id, "XEN", 3);
    3.75 +	memcpy(fadt->header.oem_table_id, "Xen/ia64", 8);
    3.76 +	memcpy(fadt->header.asl_compiler_id, "XEN", 3);
    3.77 +	fadt->header.asl_compiler_revision = xen_ia64_version(d);
    3.78  
    3.79 -	memcpy(facs->signature, FACS_SIG, sizeof(facs->signature));
    3.80 +	memcpy(facs->signature, ACPI_SIG_FACS, sizeof(facs->signature));
    3.81  	facs->version = 1;
    3.82  	facs->length = sizeof(struct acpi_table_facs);
    3.83  
    3.84 -	fadt->xfirmware_ctrl = ACPI_TABLE_MPA(facs);
    3.85 +	fadt->Xfacs = ACPI_TABLE_MPA(facs);
    3.86  	fadt->Xdsdt = ACPI_TABLE_MPA(dsdt);
    3.87  
    3.88  	/*
    3.89 @@ -280,34 +283,35 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    3.90  	 * from sanity checks in the ACPI CA.  Emulate required ACPI hardware
    3.91  	 * registers in system memory.
    3.92  	 */
    3.93 -	fadt->pm1_evt_len = 4;
    3.94 -	fadt->xpm1a_evt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
    3.95 -	fadt->xpm1a_evt_blk.register_bit_width = 8;
    3.96 -	fadt->xpm1a_evt_blk.address = ACPI_TABLE_MPA(pm1a_evt_blk);
    3.97 -	fadt->pm1_cnt_len = 1;
    3.98 -	fadt->xpm1a_cnt_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
    3.99 -	fadt->xpm1a_cnt_blk.register_bit_width = 8;
   3.100 -	fadt->xpm1a_cnt_blk.address = ACPI_TABLE_MPA(pm1a_cnt_blk);
   3.101 -	fadt->pm_tm_len = 4;
   3.102 -	fadt->xpm_tmr_blk.address_space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
   3.103 -	fadt->xpm_tmr_blk.register_bit_width = 8;
   3.104 -	fadt->xpm_tmr_blk.address = ACPI_TABLE_MPA(pm_tmr_blk);
   3.105 +	fadt->pm1_event_length = 4;
   3.106 +	fadt->xpm1a_event_block.space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
   3.107 +	fadt->xpm1a_event_block.bit_width = 8;
   3.108 +	fadt->xpm1a_event_block.address = ACPI_TABLE_MPA(pm1a_event_block);
   3.109 +	fadt->pm1_control_length = 1;
   3.110 +	fadt->xpm1a_control_block.space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
   3.111 +	fadt->xpm1a_control_block.bit_width = 8;
   3.112 +	fadt->xpm1a_control_block.address = ACPI_TABLE_MPA(pm1a_control_block);
   3.113 +	fadt->pm_timer_length = 4;
   3.114 +	fadt->xpm_timer_block.space_id = ACPI_ADR_SPACE_SYSTEM_MEMORY;
   3.115 +	fadt->xpm_timer_block.bit_width = 8;
   3.116 +	fadt->xpm_timer_block.address = ACPI_TABLE_MPA(pm_timer_block);
   3.117  
   3.118 -	fadt->checksum = generate_acpi_checksum(fadt, fadt->length);
   3.119 +	fadt->header.checksum = generate_acpi_checksum(fadt,
   3.120 +	                                               fadt->header.length);
   3.121  
   3.122  	/* setup RSDP */
   3.123 -	memcpy(rsdp->signature, RSDP_SIG, strlen(RSDP_SIG));
   3.124 +	memcpy(rsdp->signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP));
   3.125  	memcpy(rsdp->oem_id, "XEN", 3);
   3.126  	rsdp->revision = 2; /* ACPI 2.0 includes XSDT */
   3.127 -	rsdp->length = sizeof(struct acpi20_table_rsdp);
   3.128 -	rsdp->xsdt_address = ACPI_TABLE_MPA(xsdt);
   3.129 +	rsdp->length = sizeof(struct acpi_table_rsdp);
   3.130 +	rsdp->xsdt_physical_address = ACPI_TABLE_MPA(xsdt);
   3.131  
   3.132  	rsdp->checksum = generate_acpi_checksum(rsdp,
   3.133  	                                        ACPI_RSDP_CHECKSUM_LENGTH);
   3.134 -	rsdp->ext_checksum = generate_acpi_checksum(rsdp, rsdp->length);
   3.135 +	rsdp->extended_checksum = generate_acpi_checksum(rsdp, rsdp->length);
   3.136  
   3.137  	/* setup DSDT with trivial namespace. */ 
   3.138 -	memcpy(dsdt->signature, DSDT_SIG, strlen(DSDT_SIG));
   3.139 +	memcpy(dsdt->signature, ACPI_SIG_DSDT, strlen(ACPI_SIG_DSDT));
   3.140  	dsdt->revision = 1;
   3.141  	memcpy(dsdt->oem_id, "XEN", 3);
   3.142  	memcpy(dsdt->oem_table_id, "Xen/ia64", 8);
   3.143 @@ -346,7 +350,8 @@ dom_fw_fake_acpi(domain_t *d, struct fak
   3.144  	dsdt->checksum = generate_acpi_checksum(dsdt, dsdt->length);
   3.145  
   3.146  	/* setup MADT */
   3.147 -	memcpy(madt->header.signature, APIC_SIG, sizeof(madt->header.signature));
   3.148 +	memcpy(madt->header.signature, ACPI_SIG_MADT,
   3.149 +	       sizeof(madt->header.signature));
   3.150  	madt->header.revision = 2;
   3.151  	memcpy(madt->header.oem_id, "XEN", 3);
   3.152  	memcpy(madt->header.oem_table_id, "Xen/ia64", 8);
     4.1 --- a/xen/arch/ia64/xen/pcdp.c	Tue Mar 18 16:15:24 2008 +0000
     4.2 +++ b/xen/arch/ia64/xen/pcdp.c	Tue Mar 18 19:28:09 2008 +0000
     4.3 @@ -43,7 +43,7 @@ pcdp_hp_irq_fixup(struct pcdp *pcdp, str
     4.4  {
     4.5  	efi_system_table_t *systab;
     4.6  	efi_config_table_t *tables;
     4.7 -	struct acpi20_table_rsdp *rsdp = NULL;
     4.8 +	struct acpi_table_rsdp *rsdp = NULL;
     4.9  	struct acpi_table_xsdt *xsdt;
    4.10  	struct acpi_table_header *hdr;
    4.11  	int i;
    4.12 @@ -66,16 +66,17 @@ pcdp_hp_irq_fixup(struct pcdp *pcdp, str
    4.13  	for (i = 0 ; i < (int)systab->nr_tables && !rsdp ; i++) {
    4.14  		if (efi_guidcmp(tables[i].guid, ACPI_20_TABLE_GUID) == 0)
    4.15  			rsdp =
    4.16 -			     (struct acpi20_table_rsdp *)__va(tables[i].table);
    4.17 +			     (struct acpi_table_rsdp *)__va(tables[i].table);
    4.18  	}
    4.19  
    4.20 -	if (!rsdp || strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1))
    4.21 +	if (!rsdp ||
    4.22 +	    strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1))
    4.23  		return;
    4.24  
    4.25 -	xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
    4.26 +	xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);
    4.27  	hdr = &xsdt->header;
    4.28  
    4.29 -	if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1))
    4.30 +	if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1))
    4.31  		return;
    4.32  
    4.33  	/* Sanity check; are we still looking at HP firmware tables? */
     5.1 --- a/xen/include/acpi/platform/aclinux.h	Tue Mar 18 16:15:24 2008 +0000
     5.2 +++ b/xen/include/acpi/platform/aclinux.h	Tue Mar 18 19:28:09 2008 +0000
     5.3 @@ -47,7 +47,7 @@
     5.4  #define ACPI_USE_SYSTEM_CLIBRARY
     5.5  #define ACPI_USE_DO_WHILE_0
     5.6  
     5.7 -#if 1/*def __KERNEL__*/
     5.8 +#ifdef __XEN__
     5.9  
    5.10  #include <xen/config.h>
    5.11  #include <xen/string.h>
    5.12 @@ -71,7 +71,7 @@
    5.13  /* Full namespace pathname length limit - arbitrary */
    5.14  #define ACPI_PATHNAME_MAX              256
    5.15  
    5.16 -#else				/* !__KERNEL__ */
    5.17 +#else				/* !__XEN__ */
    5.18  
    5.19  #include <stdarg.h>
    5.20  #include <string.h>
    5.21 @@ -95,7 +95,7 @@
    5.22  #endif
    5.23  
    5.24  #define ACPI_FLUSH_CPU_CACHE()
    5.25 -#endif				/* __KERNEL__ */
    5.26 +#endif				/* __XEN__ */
    5.27  
    5.28  /* Linux uses GCC */
    5.29