ia64/xen-unstable

changeset 17839:0089fe3d209d

[IA64] compilation fix caused by 17814:9af7a535225f

ia64 compliation fix caused by 17814:9af7a535225f.
- generate_acpi_checksum() is replaced by acpi_tb_checksum()
- move dump_execution_state() definitions from asm-ia64/xenprocessor.h
to asm-ia64/bug.h

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 12 15:42:09 2008 +0100 (2008-06-12)
parents e5c9c8e6e726
children 4ebd8f377426
files tools/libxc/ia64/dom_fw_acpi.c xen/arch/ia64/xen/dom_fw_common.c xen/arch/ia64/xen/dom_fw_dom0.c xen/include/asm-ia64/bug.h xen/include/asm-ia64/xenprocessor.h xen/include/xen/acpi.h
line diff
     1.1 --- a/tools/libxc/ia64/dom_fw_acpi.c	Thu Jun 12 15:41:15 2008 +0100
     1.2 +++ b/tools/libxc/ia64/dom_fw_acpi.c	Thu Jun 12 15:42:09 2008 +0100
     1.3 @@ -1,14 +1,31 @@
     1.4  #include <inttypes.h>
     1.5  #include "xc_dom_ia64_util.h"
     1.6  #include <xen/acpi.h>
     1.7 +#include <acpi/actables.h>
     1.8  
     1.9 -uint8_t
    1.10 -generate_acpi_checksum(void *tbl, unsigned long len)
    1.11 -{
    1.12 -    uint8_t *ptr, sum = 0;
    1.13 +/* stolen from xen/drivers/acpi/tables/tbutils.c */
    1.14  
    1.15 -    for ( ptr = tbl; len > 0 ; len--, ptr++ )
    1.16 -        sum += *ptr;
    1.17 +/*******************************************************************************
    1.18 + *
    1.19 + * FUNCTION:    acpi_tb_checksum
    1.20 + *
    1.21 + * PARAMETERS:  Buffer          - Pointer to memory region to be checked
    1.22 + *              Length          - Length of this memory region
    1.23 + *
    1.24 + * RETURN:      Checksum (u8)
    1.25 + *
    1.26 + * DESCRIPTION: Calculates circular checksum of memory region.
    1.27 + *
    1.28 + ******************************************************************************/
    1.29  
    1.30 -    return 0 - sum;
    1.31 +u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length)
    1.32 +{
    1.33 +	u8 sum = 0;
    1.34 +	u8 *end = buffer + length;
    1.35 +
    1.36 +	while (buffer < end) {
    1.37 +		sum = (u8) (sum + *(buffer++));
    1.38 +	}
    1.39 +
    1.40 +	return sum;
    1.41  }
     2.1 --- a/xen/arch/ia64/xen/dom_fw_common.c	Thu Jun 12 15:41:15 2008 +0100
     2.2 +++ b/xen/arch/ia64/xen/dom_fw_common.c	Thu Jun 12 15:42:09 2008 +0100
     2.3 @@ -31,6 +31,7 @@
     2.4  #endif /* __XEN__ */
     2.5  
     2.6  #include <xen/acpi.h>
     2.7 +#include <acpi/actables.h>
     2.8  #include <asm/dom_fw.h>
     2.9  #include <asm/dom_fw_domu.h>
    2.10  
    2.11 @@ -258,8 +259,8 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.12  	xsdt->table_offset_entry[0] = ACPI_TABLE_MPA(fadt);
    2.13  	tables->madt_ptr = ACPI_TABLE_MPA(madt);
    2.14  
    2.15 -	xsdt->header.checksum = generate_acpi_checksum(xsdt,
    2.16 -	                                               xsdt->header.length);
    2.17 +	xsdt->header.checksum = -acpi_tb_checksum((u8*)xsdt,
    2.18 +						  xsdt->header.length);
    2.19  
    2.20  	/* setup FADT */
    2.21  	memcpy(fadt->header.signature, ACPI_SIG_FADT,
    2.22 @@ -296,8 +297,8 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.23  	fadt->xpm_timer_block.bit_width = 8;
    2.24  	fadt->xpm_timer_block.address = ACPI_TABLE_MPA(pm_timer_block);
    2.25  
    2.26 -	fadt->header.checksum = generate_acpi_checksum(fadt,
    2.27 -	                                               fadt->header.length);
    2.28 +	fadt->header.checksum = -acpi_tb_checksum((u8*)fadt,
    2.29 +						  fadt->header.length);
    2.30  
    2.31  	/* setup RSDP */
    2.32  	memcpy(rsdp->signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP));
    2.33 @@ -306,9 +307,9 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.34  	rsdp->length = sizeof(struct acpi_table_rsdp);
    2.35  	rsdp->xsdt_physical_address = ACPI_TABLE_MPA(xsdt);
    2.36  
    2.37 -	rsdp->checksum = generate_acpi_checksum(rsdp,
    2.38 -	                                        ACPI_RSDP_CHECKSUM_LENGTH);
    2.39 -	rsdp->extended_checksum = generate_acpi_checksum(rsdp, rsdp->length);
    2.40 +	rsdp->checksum = -acpi_tb_checksum((u8*)rsdp,
    2.41 +					   ACPI_RSDP_CHECKSUM_LENGTH);
    2.42 +	rsdp->extended_checksum = -acpi_tb_checksum((u8*)rsdp, rsdp->length);
    2.43  
    2.44  	/* setup DSDT with trivial namespace. */ 
    2.45  	memcpy(dsdt->signature, ACPI_SIG_DSDT, strlen(ACPI_SIG_DSDT));
    2.46 @@ -347,7 +348,7 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.47  	tables->aml[1] = 0x40 + ((aml_len - 1) & 0x0f);
    2.48  	tables->aml[2] = (aml_len - 1) >> 4;
    2.49  	dsdt->length = sizeof(struct acpi_table_header) + aml_len;
    2.50 -	dsdt->checksum = generate_acpi_checksum(dsdt, dsdt->length);
    2.51 +	dsdt->checksum = -acpi_tb_checksum((u8*)dsdt, dsdt->length);
    2.52  
    2.53  	/* setup MADT */
    2.54  	memcpy(madt->header.signature, ACPI_SIG_MADT,
    2.55 @@ -373,8 +374,8 @@ dom_fw_fake_acpi(domain_t *d, struct fak
    2.56  	}
    2.57  	madt->header.length = sizeof(struct acpi_table_madt) +
    2.58  	                      nbr_cpus * sizeof(struct acpi_table_lsapic);
    2.59 -	madt->header.checksum = generate_acpi_checksum(madt,
    2.60 -	                                               madt->header.length);
    2.61 +	madt->header.checksum = -acpi_tb_checksum((u8*)madt,
    2.62 +						  madt->header.length);
    2.63  	return;
    2.64  }
    2.65  
     3.1 --- a/xen/arch/ia64/xen/dom_fw_dom0.c	Thu Jun 12 15:41:15 2008 +0100
     3.2 +++ b/xen/arch/ia64/xen/dom_fw_dom0.c	Thu Jun 12 15:42:09 2008 +0100
     3.3 @@ -25,10 +25,11 @@
     3.4   */
     3.5  
     3.6  #include <xen/config.h>
     3.7 -#include <xen/acpi.h>
     3.8  #include <xen/errno.h>
     3.9  #include <xen/sched.h>
    3.10  #include <xen/list.h>
    3.11 +#include <xen/acpi.h>
    3.12 +#include <acpi/actables.h>
    3.13  
    3.14  #include <asm/dom_fw.h>
    3.15  #include <asm/dom_fw_common.h>
    3.16 @@ -102,7 +103,8 @@ acpi_update_madt_checksum(struct acpi_ta
    3.17  
    3.18  	acpi_madt = (struct acpi_table_madt *)table;
    3.19  	acpi_madt->header.checksum = 0;
    3.20 -	acpi_madt->header.checksum = generate_acpi_checksum(acpi_madt, size);
    3.21 +	acpi_madt->header.checksum = -acpi_tb_checksum((u8*)acpi_madt,
    3.22 +						       table->length);
    3.23  
    3.24  	return 0;
    3.25  }
    3.26 @@ -154,7 +156,9 @@ static int __init __acpi_table_disable(s
    3.27  	memcpy(header->oem_table_id, "Xen     ", 8);
    3.28  	memcpy(header->signature, "OEMx", 4);
    3.29  	header->checksum = 0;
    3.30 -	header->checksum = generate_acpi_checksum(header, header->length);
    3.31 +	header->checksum = -acpi_tb_checksum((u8*)header, header->length);
    3.32 +
    3.33 +	printk("Successfully Disabling %s\n", header->signature);
    3.34  	return 0;
    3.35  }
    3.36  
    3.37 @@ -166,7 +170,6 @@ static void __init acpi_table_disable(ch
    3.38  /* base is physical address of acpi table */
    3.39  static void __init touch_acpi_table(void)
    3.40  {
    3.41 -	int result;
    3.42  	lsapic_nbr = 0;
    3.43  
    3.44  	/*
    3.45 @@ -196,18 +199,8 @@ static void __init touch_acpi_table(void
    3.46  	acpi_table_parse(ACPI_SIG_SRAT, acpi_backup_table);
    3.47  	acpi_table_parse(ACPI_SIG_SLIT, acpi_backup_table);
    3.48  
    3.49 -	result = acpi_table_disable(ACPI_SIG_SRAT);
    3.50 -	if ( result == 0 )
    3.51 -		printk("Success Disabling SRAT\n");
    3.52 -	else if ( result != -ENOENT )
    3.53 -		printk("ERROR: Failed Disabling SRAT\n");
    3.54 -
    3.55 -	result = acpi_table_disable(ACPI_SIG_SLIT);
    3.56 -	if ( result == 0 )
    3.57 -		printk("Success Disabling SLIT\n");
    3.58 -	else if ( result != -ENOENT )
    3.59 -		printk("ERROR: Failed Disabling SLIT\n");
    3.60 -
    3.61 +	acpi_table_disable(ACPI_SIG_SRAT);
    3.62 +	acpi_table_disable(ACPI_SIG_SLIT);
    3.63  	return;
    3.64  }
    3.65  
     4.1 --- a/xen/include/asm-ia64/bug.h	Thu Jun 12 15:41:15 2008 +0100
     4.2 +++ b/xen/include/asm-ia64/bug.h	Thu Jun 12 15:42:09 2008 +0100
     4.3 @@ -4,4 +4,6 @@
     4.4  #define BUG() __bug(__FILE__, __LINE__)
     4.5  #define WARN() __warn(__FILE__, __LINE__)
     4.6  
     4.7 +#define dump_execution_state() printk("FIXME: implement ia64 dump_execution_state()\n");
     4.8 +
     4.9  #endif /* __IA64_BUG_H__ */
     5.1 --- a/xen/include/asm-ia64/xenprocessor.h	Thu Jun 12 15:41:15 2008 +0100
     5.2 +++ b/xen/include/asm-ia64/xenprocessor.h	Thu Jun 12 15:42:09 2008 +0100
     5.3 @@ -250,6 +250,4 @@ typedef union {
     5.4  	};
     5.5  } ia64_pkr_t;
     5.6  
     5.7 -#define dump_execution_state() printk("FIXME: implement ia64 dump_execution_state()\n");
     5.8 -
     5.9  #endif // _ASM_IA64_XENPROCESSOR_H
     6.1 --- a/xen/include/xen/acpi.h	Thu Jun 12 15:41:15 2008 +0100
     6.2 +++ b/xen/include/xen/acpi.h	Thu Jun 12 15:42:09 2008 +0100
     6.3 @@ -295,7 +295,6 @@ int acpi_table_parse_madt(enum acpi_madt
     6.4  void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
     6.5  void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
     6.6  void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
     6.7 -uint8_t generate_acpi_checksum(void *tbl, unsigned long len);
     6.8  
     6.9  /* the following four functions are architecture-dependent */
    6.10  void acpi_numa_slit_init (struct acpi_table_slit *slit);