[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Explicitly tag every anonymous aggregate in the public headers.
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1206526490 0 # Node ID 5d25187bac941611a8a836b668a398a72df0afb0 # Parent 966c04d42e94546287a1145c82e13073f28ef116 Explicitly tag every anonymous aggregate in the public headers. Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx> --- tools/include/xen-foreign/mkchecker.py | 3 +++ tools/include/xen-foreign/mkheader.py | 2 +- xen/include/public/arch-ia64.h | 16 +++++++--------- xen/include/public/arch-ia64/hvm/save.h | 6 +++--- xen/include/public/arch-x86/hvm/save.h | 8 ++++---- xen/include/public/arch-x86/xen-x86_32.h | 8 ++++---- xen/include/public/arch-x86/xen-x86_64.h | 6 +++--- xen/include/public/arch-x86/xen.h | 4 ++-- xen/include/public/xen.h | 5 +++++ 9 files changed, 32 insertions(+), 26 deletions(-) diff -r 966c04d42e94 -r 5d25187bac94 tools/include/xen-foreign/mkchecker.py --- a/tools/include/xen-foreign/mkchecker.py Wed Mar 26 09:12:57 2008 +0000 +++ b/tools/include/xen-foreign/mkchecker.py Wed Mar 26 10:14:50 2008 +0000 @@ -19,6 +19,9 @@ f.write(''' #include <stdlib.h> #include <stddef.h> #include <inttypes.h> + +#define __anonymous_struct __extension__ struct +#define __anonymous_union __extension__ union '''); for a in archs: diff -r 966c04d42e94 -r 5d25187bac94 tools/include/xen-foreign/mkheader.py --- a/tools/include/xen-foreign/mkheader.py Wed Mar 26 09:12:57 2008 +0000 +++ b/tools/include/xen-foreign/mkheader.py Wed Mar 26 10:14:50 2008 +0000 @@ -38,7 +38,7 @@ inttypes["x86_64"] = { }; header["x86_64"] = """ #ifdef __GNUC__ -# define __DECL_REG(name) __extension__ union { uint64_t r ## name, e ## name; } +# define __DECL_REG(name) __anonymous_union { uint64_t r ## name, e ## name; } # define __align8__ __attribute__((aligned (8))) #else # define __DECL_REG(name) uint64_t r ## name diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-ia64.h --- a/xen/include/public/arch-ia64.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-ia64.h Wed Mar 26 10:14:50 2008 +0000 @@ -64,8 +64,6 @@ typedef unsigned long xen_pfn_t; #ifndef __ASSEMBLY__ -#define __anonymous_union __extension__ union - typedef unsigned long xen_ulong_t; #ifdef __XEN_TOOLS__ @@ -133,7 +131,7 @@ struct pt_fpreg { union vac { unsigned long value; - struct { + __anonymous_struct { int a_int:1; int a_from_int_cr:1; int a_to_int_cr:1; @@ -148,7 +146,7 @@ typedef union vac vac_t; union vdc { unsigned long value; - struct { + __anonymous_struct { int d_vmsw:1; int d_extint:1; int d_ibr_dbr:1; @@ -184,7 +182,7 @@ struct mapped_regs { unsigned long reserved4[76]; __anonymous_union { unsigned long vcr[128]; - struct { + __anonymous_struct { unsigned long dcr; // CR0 unsigned long itm; unsigned long iva; @@ -218,7 +216,7 @@ struct mapped_regs { }; __anonymous_union { unsigned long reserved5[128]; - struct { + __anonymous_struct { unsigned long precover_ifs; unsigned long unat; // not sure if this is needed until NaT arch is done int interrupt_collection_enabled; // virtual psr.ic @@ -304,7 +302,7 @@ struct vcpu_tr_regs { union vcpu_ar_regs { unsigned long ar[128]; - struct { + __anonymous_struct { unsigned long kr[8]; unsigned long rsv1[8]; unsigned long rsc; @@ -341,7 +339,7 @@ union vcpu_ar_regs { union vcpu_cr_regs { unsigned long cr[128]; - struct { + __anonymous_struct { unsigned long dcr; // CR0 unsigned long itm; unsigned long iva; @@ -611,7 +609,7 @@ struct xen_ia64_opt_feature { unsigned long cmd; /* Which feature */ unsigned char on; /* Switch feature on/off */ __anonymous_union { - struct { + __anonymous_struct { /* The page protection bit mask of the pte. * This will be or'ed with the pte. */ unsigned long pgprot; diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-ia64/hvm/save.h --- a/xen/include/public/arch-ia64/hvm/save.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-ia64/hvm/save.h Wed Mar 26 10:14:50 2008 +0000 @@ -109,7 +109,7 @@ union viosapic_rte union viosapic_rte { uint64_t bits; - struct { + __anonymous_struct { uint8_t vector; uint8_t delivery_mode : 3; @@ -143,8 +143,8 @@ DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struc * PM timer */ struct vacpi_regs { - union { - struct { + __anonymous_union { + __anonymous_struct { uint32_t pm1a_sts:16;/* PM1a_EVT_BLK.PM1a_STS: status register */ uint32_t pm1a_en:16; /* PM1a_EVT_BLK.PM1a_EN: enable register */ }; diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-x86/hvm/save.h --- a/xen/include/public/arch-x86/hvm/save.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-x86/hvm/save.h Wed Mar 26 10:14:50 2008 +0000 @@ -144,9 +144,9 @@ struct hvm_hw_cpu { uint64_t tsc; /* pending event, if any */ - union { + __anonymous_union { uint32_t pending_event; - struct { + __anonymous_struct { uint8_t pending_vector:8; uint8_t pending_type:3; uint8_t pending_error_valid:1; @@ -286,7 +286,7 @@ struct hvm_hw_pci_irqs { * Virtual interrupt wires for a single PCI bus. * Indexed by: device*4 + INTx#. */ - union { + __anonymous_union { DECLARE_BITMAP(i, 32*4); uint64_t pad[2]; }; @@ -299,7 +299,7 @@ struct hvm_hw_isa_irqs { * Virtual interrupt wires for ISA devices. * Indexed by ISA IRQ (assumes no ISA-device IRQ sharing). */ - union { + __anonymous_union { DECLARE_BITMAP(i, 16); uint64_t pad[1]; }; diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-x86/xen-x86_32.h --- a/xen/include/public/arch-x86/xen-x86_32.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-x86/xen-x86_32.h Wed Mar 26 10:14:50 2008 +0000 @@ -108,10 +108,10 @@ /* 32-/64-bit invariability for control interfaces (domctl/sysctl). */ #if defined(__XEN__) || defined(__XEN_TOOLS__) #undef ___DEFINE_XEN_GUEST_HANDLE -#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ - typedef struct { type *p; } \ - __guest_handle_ ## name; \ - typedef struct { union { type *p; uint64_aligned_t q; }; } \ +#define ___DEFINE_XEN_GUEST_HANDLE(name, type) \ + typedef struct { type *p; } \ + __guest_handle_ ## name; \ + typedef struct { __anonymous_union { type *p; uint64_aligned_t q; }; } \ __guest_handle_64_ ## name #undef set_xen_guest_handle #define set_xen_guest_handle(hnd, val) \ diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-x86/xen-x86_64.h --- a/xen/include/public/arch-x86/xen-x86_64.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-x86/xen-x86_64.h Wed Mar 26 10:14:50 2008 +0000 @@ -142,9 +142,9 @@ struct iret_context { #ifdef __GNUC__ /* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */ -#define __DECL_REG(name) __extension__ union { \ - uint64_t r ## name, e ## name; \ - uint32_t _e ## name; \ +#define __DECL_REG(name) __anonymous_union { \ + uint64_t r ## name, e ## name; \ + uint32_t _e ## name; \ } #else /* Non-gcc sources must always use the proper 64-bit name (e.g., rax). */ diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/arch-x86/xen.h --- a/xen/include/public/arch-x86/xen.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/arch-x86/xen.h Wed Mar 26 10:14:50 2008 +0000 @@ -140,9 +140,9 @@ struct vcpu_guest_context { unsigned long event_callback_eip; unsigned long failsafe_callback_eip; #ifdef __XEN__ - union { + __anonymous_union { unsigned long syscall_callback_eip; - struct { + __anonymous_struct { unsigned int event_callback_cs; /* compat CS of event cb */ unsigned int failsafe_callback_cs; /* compat CS of failsafe cb */ }; diff -r 966c04d42e94 -r 5d25187bac94 xen/include/public/xen.h --- a/xen/include/public/xen.h Wed Mar 26 09:12:57 2008 +0000 +++ b/xen/include/public/xen.h Wed Mar 26 10:14:50 2008 +0000 @@ -28,6 +28,11 @@ #define __XEN_PUBLIC_XEN_H__ #include "xen-compat.h" + +#ifdef __GNUC__ +#define __anonymous_union __extension__ union +#define __anonymous_struct __extension__ union +#endif #if defined(__i386__) || defined(__x86_64__) #include "arch-x86/xen.h" _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |