ia64/xen-unstable

changeset 17321:5d25187bac94

Explicitly tag every anonymous aggregate in the public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 26 10:14:50 2008 +0000 (2008-03-26)
parents 966c04d42e94
children ced23158093a
files tools/include/xen-foreign/mkchecker.py tools/include/xen-foreign/mkheader.py xen/include/public/arch-ia64.h xen/include/public/arch-ia64/hvm/save.h xen/include/public/arch-x86/hvm/save.h xen/include/public/arch-x86/xen-x86_32.h xen/include/public/arch-x86/xen-x86_64.h xen/include/public/arch-x86/xen.h xen/include/public/xen.h
line diff
     1.1 --- a/tools/include/xen-foreign/mkchecker.py	Wed Mar 26 09:12:57 2008 +0000
     1.2 +++ b/tools/include/xen-foreign/mkchecker.py	Wed Mar 26 10:14:50 2008 +0000
     1.3 @@ -19,6 +19,9 @@ f.write('''
     1.4  #include <stdlib.h>
     1.5  #include <stddef.h>
     1.6  #include <inttypes.h>
     1.7 +
     1.8 +#define __anonymous_struct __extension__ struct
     1.9 +#define __anonymous_union __extension__ union
    1.10  ''');
    1.11  
    1.12  for a in archs:
     2.1 --- a/tools/include/xen-foreign/mkheader.py	Wed Mar 26 09:12:57 2008 +0000
     2.2 +++ b/tools/include/xen-foreign/mkheader.py	Wed Mar 26 10:14:50 2008 +0000
     2.3 @@ -38,7 +38,7 @@ inttypes["x86_64"] = {
     2.4  };
     2.5  header["x86_64"] = """
     2.6  #ifdef __GNUC__
     2.7 -# define __DECL_REG(name) __extension__ union { uint64_t r ## name, e ## name; }
     2.8 +# define __DECL_REG(name) __anonymous_union { uint64_t r ## name, e ## name; }
     2.9  # define __align8__ __attribute__((aligned (8)))
    2.10  #else
    2.11  # define __DECL_REG(name) uint64_t r ## name
     3.1 --- a/xen/include/public/arch-ia64.h	Wed Mar 26 09:12:57 2008 +0000
     3.2 +++ b/xen/include/public/arch-ia64.h	Wed Mar 26 10:14:50 2008 +0000
     3.3 @@ -64,8 +64,6 @@ typedef unsigned long xen_pfn_t;
     3.4  
     3.5  #ifndef __ASSEMBLY__
     3.6  
     3.7 -#define __anonymous_union __extension__ union
     3.8 -
     3.9  typedef unsigned long xen_ulong_t;
    3.10  
    3.11  #ifdef __XEN_TOOLS__
    3.12 @@ -133,7 +131,7 @@ struct pt_fpreg {
    3.13  
    3.14  union vac {
    3.15      unsigned long value;
    3.16 -    struct {
    3.17 +    __anonymous_struct {
    3.18          int a_int:1;
    3.19          int a_from_int_cr:1;
    3.20          int a_to_int_cr:1;
    3.21 @@ -148,7 +146,7 @@ typedef union vac vac_t;
    3.22  
    3.23  union vdc {
    3.24      unsigned long value;
    3.25 -    struct {
    3.26 +    __anonymous_struct {
    3.27          int d_vmsw:1;
    3.28          int d_extint:1;
    3.29          int d_ibr_dbr:1;
    3.30 @@ -184,7 +182,7 @@ struct mapped_regs {
    3.31      unsigned long  reserved4[76];
    3.32      __anonymous_union {
    3.33          unsigned long  vcr[128];
    3.34 -        struct {
    3.35 +        __anonymous_struct {
    3.36              unsigned long dcr;  // CR0
    3.37              unsigned long itm;
    3.38              unsigned long iva;
    3.39 @@ -218,7 +216,7 @@ struct mapped_regs {
    3.40      };
    3.41      __anonymous_union {
    3.42          unsigned long  reserved5[128];
    3.43 -        struct {
    3.44 +        __anonymous_struct {
    3.45              unsigned long precover_ifs;
    3.46              unsigned long unat;  // not sure if this is needed until NaT arch is done
    3.47              int interrupt_collection_enabled; // virtual psr.ic
    3.48 @@ -304,7 +302,7 @@ struct vcpu_tr_regs {
    3.49  
    3.50  union vcpu_ar_regs {
    3.51      unsigned long ar[128];
    3.52 -    struct {
    3.53 +    __anonymous_struct {
    3.54          unsigned long kr[8];
    3.55          unsigned long rsv1[8];
    3.56          unsigned long rsc;
    3.57 @@ -341,7 +339,7 @@ union vcpu_ar_regs {
    3.58  
    3.59  union vcpu_cr_regs {
    3.60      unsigned long cr[128];
    3.61 -    struct {
    3.62 +    __anonymous_struct {
    3.63          unsigned long dcr;  // CR0
    3.64          unsigned long itm;
    3.65          unsigned long iva;
    3.66 @@ -611,7 +609,7 @@ struct xen_ia64_opt_feature {
    3.67  	unsigned long cmd;		/* Which feature */
    3.68  	unsigned char on;		/* Switch feature on/off */
    3.69  	__anonymous_union {
    3.70 -		struct {
    3.71 +		__anonymous_struct {
    3.72  				/* The page protection bit mask of the pte.
    3.73  			 	 * This will be or'ed with the pte. */
    3.74  			unsigned long pgprot;
     4.1 --- a/xen/include/public/arch-ia64/hvm/save.h	Wed Mar 26 09:12:57 2008 +0000
     4.2 +++ b/xen/include/public/arch-ia64/hvm/save.h	Wed Mar 26 10:14:50 2008 +0000
     4.3 @@ -109,7 +109,7 @@ DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct h
     4.4  union viosapic_rte
     4.5  {
     4.6      uint64_t bits;
     4.7 -    struct {
     4.8 +    __anonymous_struct {
     4.9          uint8_t vector;
    4.10  
    4.11          uint8_t delivery_mode  : 3;
    4.12 @@ -143,8 +143,8 @@ DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struc
    4.13   * PM timer
    4.14   */
    4.15  struct vacpi_regs {
    4.16 -    union {
    4.17 -        struct {
    4.18 +    __anonymous_union {
    4.19 +        __anonymous_struct {
    4.20              uint32_t pm1a_sts:16;/* PM1a_EVT_BLK.PM1a_STS: status register */
    4.21              uint32_t pm1a_en:16; /* PM1a_EVT_BLK.PM1a_EN: enable register */
    4.22          };
     5.1 --- a/xen/include/public/arch-x86/hvm/save.h	Wed Mar 26 09:12:57 2008 +0000
     5.2 +++ b/xen/include/public/arch-x86/hvm/save.h	Wed Mar 26 10:14:50 2008 +0000
     5.3 @@ -144,9 +144,9 @@ struct hvm_hw_cpu {
     5.4      uint64_t tsc;
     5.5  
     5.6      /* pending event, if any */
     5.7 -    union {
     5.8 +    __anonymous_union {
     5.9          uint32_t pending_event;
    5.10 -        struct {
    5.11 +        __anonymous_struct {
    5.12              uint8_t  pending_vector:8;
    5.13              uint8_t  pending_type:3;
    5.14              uint8_t  pending_error_valid:1;
    5.15 @@ -286,7 +286,7 @@ struct hvm_hw_pci_irqs {
    5.16       * Virtual interrupt wires for a single PCI bus.
    5.17       * Indexed by: device*4 + INTx#.
    5.18       */
    5.19 -    union {
    5.20 +    __anonymous_union {
    5.21          DECLARE_BITMAP(i, 32*4);
    5.22          uint64_t pad[2];
    5.23      };
    5.24 @@ -299,7 +299,7 @@ struct hvm_hw_isa_irqs {
    5.25       * Virtual interrupt wires for ISA devices.
    5.26       * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing).
    5.27       */
    5.28 -    union {
    5.29 +    __anonymous_union {
    5.30          DECLARE_BITMAP(i, 16);
    5.31          uint64_t pad[1];
    5.32      };
     6.1 --- a/xen/include/public/arch-x86/xen-x86_32.h	Wed Mar 26 09:12:57 2008 +0000
     6.2 +++ b/xen/include/public/arch-x86/xen-x86_32.h	Wed Mar 26 10:14:50 2008 +0000
     6.3 @@ -108,10 +108,10 @@
     6.4  /* 32-/64-bit invariability for control interfaces (domctl/sysctl). */
     6.5  #if defined(__XEN__) || defined(__XEN_TOOLS__)
     6.6  #undef ___DEFINE_XEN_GUEST_HANDLE
     6.7 -#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
     6.8 -    typedef struct { type *p; }                                 \
     6.9 -        __guest_handle_ ## name;                                \
    6.10 -    typedef struct { union { type *p; uint64_aligned_t q; }; }  \
    6.11 +#define ___DEFINE_XEN_GUEST_HANDLE(name, type)                              \
    6.12 +    typedef struct { type *p; }                                             \
    6.13 +        __guest_handle_ ## name;                                            \
    6.14 +    typedef struct { __anonymous_union { type *p; uint64_aligned_t q; }; }  \
    6.15          __guest_handle_64_ ## name
    6.16  #undef set_xen_guest_handle
    6.17  #define set_xen_guest_handle(hnd, val)                      \
     7.1 --- a/xen/include/public/arch-x86/xen-x86_64.h	Wed Mar 26 09:12:57 2008 +0000
     7.2 +++ b/xen/include/public/arch-x86/xen-x86_64.h	Wed Mar 26 10:14:50 2008 +0000
     7.3 @@ -142,9 +142,9 @@ struct iret_context {
     7.4  
     7.5  #ifdef __GNUC__
     7.6  /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
     7.7 -#define __DECL_REG(name) __extension__ union { \
     7.8 -    uint64_t r ## name, e ## name; \
     7.9 -    uint32_t _e ## name; \
    7.10 +#define __DECL_REG(name) __anonymous_union {    \
    7.11 +    uint64_t r ## name, e ## name;              \
    7.12 +    uint32_t _e ## name;                        \
    7.13  }
    7.14  #else
    7.15  /* Non-gcc sources must always use the proper 64-bit name (e.g., rax). */
     8.1 --- a/xen/include/public/arch-x86/xen.h	Wed Mar 26 09:12:57 2008 +0000
     8.2 +++ b/xen/include/public/arch-x86/xen.h	Wed Mar 26 10:14:50 2008 +0000
     8.3 @@ -140,9 +140,9 @@ struct vcpu_guest_context {
     8.4      unsigned long event_callback_eip;
     8.5      unsigned long failsafe_callback_eip;
     8.6  #ifdef __XEN__
     8.7 -    union {
     8.8 +    __anonymous_union {
     8.9          unsigned long syscall_callback_eip;
    8.10 -        struct {
    8.11 +        __anonymous_struct {
    8.12              unsigned int event_callback_cs;    /* compat CS of event cb     */
    8.13              unsigned int failsafe_callback_cs; /* compat CS of failsafe cb  */
    8.14          };
     9.1 --- a/xen/include/public/xen.h	Wed Mar 26 09:12:57 2008 +0000
     9.2 +++ b/xen/include/public/xen.h	Wed Mar 26 10:14:50 2008 +0000
     9.3 @@ -29,6 +29,11 @@
     9.4  
     9.5  #include "xen-compat.h"
     9.6  
     9.7 +#ifdef __GNUC__
     9.8 +#define __anonymous_union __extension__ union
     9.9 +#define __anonymous_struct __extension__ union
    9.10 +#endif
    9.11 +
    9.12  #if defined(__i386__) || defined(__x86_64__)
    9.13  #include "arch-x86/xen.h"
    9.14  #elif defined(__ia64__)