#include <stdlib.h>
#include <stddef.h>
#include <inttypes.h>
+
+#define __anonymous_struct __extension__ struct
+#define __anonymous_union __extension__ union
''');
for a in archs:
};
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
#ifndef __ASSEMBLY__
-#define __anonymous_union __extension__ union
-
typedef unsigned long xen_ulong_t;
#ifdef __XEN_TOOLS__
union vac {
unsigned long value;
- struct {
+ __anonymous_struct {
int a_int:1;
int a_from_int_cr:1;
int a_to_int_cr:1;
union vdc {
unsigned long value;
- struct {
+ __anonymous_struct {
int d_vmsw:1;
int d_extint:1;
int d_ibr_dbr:1;
unsigned long reserved4[76];
__anonymous_union {
unsigned long vcr[128];
- struct {
+ __anonymous_struct {
unsigned long dcr; // CR0
unsigned long itm;
unsigned long iva;
};
__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
union vcpu_ar_regs {
unsigned long ar[128];
- struct {
+ __anonymous_struct {
unsigned long kr[8];
unsigned long rsv1[8];
unsigned long rsc;
union vcpu_cr_regs {
unsigned long cr[128];
- struct {
+ __anonymous_struct {
unsigned long dcr; // CR0
unsigned long itm;
unsigned long iva;
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;
union viosapic_rte
{
uint64_t bits;
- struct {
+ __anonymous_struct {
uint8_t vector;
uint8_t delivery_mode : 3;
* 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 */
};
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;
* 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];
};
* 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];
};
/* 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) \
#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). */
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 */
};
#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__)