ia64/xen-unstable

changeset 15781:58d131f1fb35

hvmloader: Clarify relationship between xen_domain_handle_t and SMBIOS uuid field.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Aug 24 16:32:56 2007 +0100 (2007-08-24)
parents f279d776fcb0
children b1c3b9df7d9a
files tools/firmware/hvmloader/smbios.c tools/firmware/hvmloader/util.h
line diff
     1.1 --- a/tools/firmware/hvmloader/smbios.c	Fri Aug 24 16:19:14 2007 +0100
     1.2 +++ b/tools/firmware/hvmloader/smbios.c	Fri Aug 24 16:32:56 2007 +0100
     1.3 @@ -159,8 +159,7 @@ get_memsize(void)
     1.4  int
     1.5  hvm_write_smbios_tables(void)
     1.6  {
     1.7 -    uint8_t uuid[16]; /* ** This will break if xen_domain_handle_t is
     1.8 -                         not uint8_t[16]. ** */
     1.9 +    xen_domain_handle_t uuid;
    1.10      uint16_t xen_major_version, xen_minor_version;
    1.11      uint32_t xen_version;
    1.12      char xen_extra_version[XEN_EXTRAVERSION_LEN];
    1.13 @@ -173,6 +172,7 @@ hvm_write_smbios_tables(void)
    1.14      unsigned tmp_len; /* length of next string to add */
    1.15  
    1.16      hypercall_xen_version(XENVER_guest_handle, uuid);
    1.17 +    BUILD_BUG_ON(sizeof(xen_domain_handle_t) != 16);
    1.18  
    1.19      /* xen_version major and minor */
    1.20      xen_version = hypercall_xen_version(XENVER_version, NULL);
     2.1 --- a/tools/firmware/hvmloader/util.h	Fri Aug 24 16:19:14 2007 +0100
     2.2 +++ b/tools/firmware/hvmloader/util.h	Fri Aug 24 16:32:56 2007 +0100
     2.3 @@ -17,6 +17,7 @@ extern void __assert_failed(char *assert
     2.4  extern void __bug(char *file, int line) __attribute__((noreturn));
     2.5  #define BUG() __bug(__FILE__, __LINE__)
     2.6  #define BUG_ON(p) do { if (p) BUG(); } while (0)
     2.7 +#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)]))
     2.8  
     2.9  /* I/O output */
    2.10  void outb(uint16_t addr, uint8_t  val);