mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Explicitly tag every anonymous aggregate in the public headers.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
1 parent
4bb6f7de67
commit
d1e5ff7440
9 files changed
+32
-26
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -109,7 +109,7 @@ DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct hvm_hw_ia64_vtime);
|
||||
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, struct hvm_hw_ia64_viosapic);
|
||||
* 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 */
|
||||
};
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
@@ -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) \
|
||||
|
||||
@@ -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). */
|
||||
|
||||
@@ -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 */
|
||||
};
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
|
||||
#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"
|
||||
#elif defined(__ia64__)
|
||||
|
||||