ia64/xen-unstable

changeset 10103:093f8d333568

Place typedefs on their own separate lines in the Xen public headers.
Makes it easier to share with Linux tree.

Signed-off-by: Chris Wright <chrisw@sous-sol.org>
author kaf24@firebug.cl.cam.ac.uk
date Fri May 19 15:51:06 2006 +0100 (2006-05-19)
parents b736d3335641
children a5ef851c217b
files xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/io/netif.h xen/include/public/xen.h
line diff
     1.1 --- a/xen/include/public/arch-x86_32.h	Fri May 19 15:35:19 2006 +0100
     1.2 +++ b/xen/include/public/arch-x86_32.h	Fri May 19 15:51:06 2006 +0100
     1.3 @@ -95,15 +95,16 @@ DEFINE_XEN_GUEST_HANDLE(void);
     1.4  #define TI_GET_IF(_ti)       ((_ti)->flags & 4)
     1.5  #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
     1.6  #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
     1.7 -typedef struct trap_info {
     1.8 +struct trap_info {
     1.9      uint8_t       vector;  /* exception vector                              */
    1.10      uint8_t       flags;   /* 0-3: privilege level; 4: clear event enable?  */
    1.11      uint16_t      cs;      /* code selector                                 */
    1.12      unsigned long address; /* code offset                                   */
    1.13 -} trap_info_t;
    1.14 +};
    1.15 +typedef struct trap_info trap_info_t;
    1.16  DEFINE_XEN_GUEST_HANDLE(trap_info_t);
    1.17  
    1.18 -typedef struct cpu_user_regs {
    1.19 +struct cpu_user_regs {
    1.20      uint32_t ebx;
    1.21      uint32_t ecx;
    1.22      uint32_t edx;
    1.23 @@ -124,7 +125,8 @@ typedef struct cpu_user_regs {
    1.24      uint16_t ds, _pad3;
    1.25      uint16_t fs, _pad4;
    1.26      uint16_t gs, _pad5;
    1.27 -} cpu_user_regs_t;
    1.28 +};
    1.29 +typedef struct cpu_user_regs cpu_user_regs_t;
    1.30  DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
    1.31  
    1.32  typedef uint64_t tsc_timestamp_t; /* RDTSC timestamp */
    1.33 @@ -133,14 +135,14 @@ typedef uint64_t tsc_timestamp_t; /* RDT
    1.34   * The following is all CPU context. Note that the fpu_ctxt block is filled 
    1.35   * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
    1.36   */
    1.37 -typedef struct vcpu_guest_context {
    1.38 +struct vcpu_guest_context {
    1.39      /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
    1.40      struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
    1.41  #define VGCF_I387_VALID (1<<0)
    1.42  #define VGCF_HVM_GUEST  (1<<1)
    1.43  #define VGCF_IN_KERNEL  (1<<2)
    1.44      unsigned long flags;                    /* VGCF_* flags                 */
    1.45 -    cpu_user_regs_t user_regs;              /* User-level CPU registers     */
    1.46 +    struct cpu_user_regs user_regs;         /* User-level CPU registers     */
    1.47      struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
    1.48      unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
    1.49      unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
    1.50 @@ -152,25 +154,29 @@ typedef struct vcpu_guest_context {
    1.51      unsigned long failsafe_callback_cs;     /* CS:EIP of failsafe callback  */
    1.52      unsigned long failsafe_callback_eip;
    1.53      unsigned long vm_assist;                /* VMASST_TYPE_* bitmap */
    1.54 -} vcpu_guest_context_t;
    1.55 +};
    1.56 +typedef struct vcpu_guest_context vcpu_guest_context_t;
    1.57  DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
    1.58  
    1.59 -typedef struct arch_shared_info {
    1.60 +struct arch_shared_info {
    1.61      unsigned long max_pfn;                  /* max pfn that appears in table */
    1.62      /* Frame containing list of mfns containing list of mfns containing p2m. */
    1.63      unsigned long pfn_to_mfn_frame_list_list;
    1.64      unsigned long nmi_reason;
    1.65 -} arch_shared_info_t;
    1.66 +};
    1.67 +typedef struct arch_shared_info arch_shared_info_t;
    1.68  
    1.69 -typedef struct {
    1.70 +struct arch_vcpu_info {
    1.71      unsigned long cr2;
    1.72      unsigned long pad[5]; /* sizeof(vcpu_info_t) == 64 */
    1.73 -} arch_vcpu_info_t;
    1.74 +};
    1.75 +typedef struct arch_vcpu_info arch_vcpu_info_t;
    1.76  
    1.77 -typedef struct {
    1.78 +struct xen_callback {
    1.79      unsigned long cs;
    1.80      unsigned long eip;
    1.81 -} xen_callback_t;
    1.82 +};
    1.83 +typedef struct xen_callback xen_callback_t;
    1.84  
    1.85  #endif /* !__ASSEMBLY__ */
    1.86  
     2.1 --- a/xen/include/public/arch-x86_64.h	Fri May 19 15:35:19 2006 +0100
     2.2 +++ b/xen/include/public/arch-x86_64.h	Fri May 19 15:51:06 2006 +0100
     2.3 @@ -150,12 +150,13 @@ struct iret_context {
     2.4  #define TI_GET_IF(_ti)       ((_ti)->flags & 4)
     2.5  #define TI_SET_DPL(_ti,_dpl) ((_ti)->flags |= (_dpl))
     2.6  #define TI_SET_IF(_ti,_if)   ((_ti)->flags |= ((!!(_if))<<2))
     2.7 -typedef struct trap_info {
     2.8 +struct trap_info {
     2.9      uint8_t       vector;  /* exception vector                              */
    2.10      uint8_t       flags;   /* 0-3: privilege level; 4: clear event enable?  */
    2.11      uint16_t      cs;      /* code selector                                 */
    2.12      unsigned long address; /* code offset                                   */
    2.13 -} trap_info_t;
    2.14 +};
    2.15 +typedef struct trap_info trap_info_t;
    2.16  DEFINE_XEN_GUEST_HANDLE(trap_info_t);
    2.17  
    2.18  #ifdef __GNUC__
    2.19 @@ -166,7 +167,7 @@ DEFINE_XEN_GUEST_HANDLE(trap_info_t);
    2.20  #define __DECL_REG(name) uint64_t r ## name
    2.21  #endif
    2.22  
    2.23 -typedef struct cpu_user_regs {
    2.24 +struct cpu_user_regs {
    2.25      uint64_t r15;
    2.26      uint64_t r14;
    2.27      uint64_t r13;
    2.28 @@ -195,7 +196,8 @@ typedef struct cpu_user_regs {
    2.29      uint16_t ds, _pad4[3];
    2.30      uint16_t fs, _pad5[3]; /* Non-zero => takes precedence over fs_base.     */
    2.31      uint16_t gs, _pad6[3]; /* Non-zero => takes precedence over gs_base_usr. */
    2.32 -} cpu_user_regs_t;
    2.33 +};
    2.34 +typedef struct cpu_user_regs cpu_user_regs_t;
    2.35  DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
    2.36  
    2.37  #undef __DECL_REG
    2.38 @@ -206,14 +208,14 @@ typedef uint64_t tsc_timestamp_t; /* RDT
    2.39   * The following is all CPU context. Note that the fpu_ctxt block is filled 
    2.40   * in by FXSAVE if the CPU has feature FXSR; otherwise FSAVE is used.
    2.41   */
    2.42 -typedef struct vcpu_guest_context {
    2.43 +struct vcpu_guest_context {
    2.44      /* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
    2.45      struct { char x[512]; } fpu_ctxt;       /* User-level FPU registers     */
    2.46  #define VGCF_I387_VALID (1<<0)
    2.47  #define VGCF_HVM_GUEST  (1<<1)
    2.48  #define VGCF_IN_KERNEL  (1<<2)
    2.49      unsigned long flags;                    /* VGCF_* flags                 */
    2.50 -    cpu_user_regs_t user_regs;              /* User-level CPU registers     */
    2.51 +    struct cpu_user_regs user_regs;         /* User-level CPU registers     */
    2.52      struct trap_info trap_ctxt[256];        /* Virtual IDT                  */
    2.53      unsigned long ldt_base, ldt_ents;       /* LDT (linear address, # ents) */
    2.54      unsigned long gdt_frames[16], gdt_ents; /* GDT (machine frames, # ents) */
    2.55 @@ -228,20 +230,23 @@ typedef struct vcpu_guest_context {
    2.56      uint64_t      fs_base;
    2.57      uint64_t      gs_base_kernel;
    2.58      uint64_t      gs_base_user;
    2.59 -} vcpu_guest_context_t;
    2.60 +};
    2.61 +typedef struct vcpu_guest_context vcpu_guest_context_t;
    2.62  DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
    2.63  
    2.64 -typedef struct arch_shared_info {
    2.65 +struct arch_shared_info {
    2.66      unsigned long max_pfn;                  /* max pfn that appears in table */
    2.67      /* Frame containing list of mfns containing list of mfns containing p2m. */
    2.68      unsigned long pfn_to_mfn_frame_list_list;
    2.69      unsigned long nmi_reason;
    2.70 -} arch_shared_info_t;
    2.71 +};
    2.72 +typedef struct arch_shared_info arch_shared_info_t;
    2.73  
    2.74 -typedef struct {
    2.75 +struct arch_vcpu_info {
    2.76      unsigned long cr2;
    2.77      unsigned long pad; /* sizeof(vcpu_info_t) == 64 */
    2.78 -} arch_vcpu_info_t;
    2.79 +};
    2.80 +typedef struct arch_vcpu_info  arch_vcpu_info_t;
    2.81  
    2.82  typedef unsigned long xen_callback_t;
    2.83  
     3.1 --- a/xen/include/public/io/netif.h	Fri May 19 15:35:19 2006 +0100
     3.2 +++ b/xen/include/public/io/netif.h	Fri May 19 15:51:06 2006 +0100
     3.3 @@ -13,10 +13,10 @@
     3.4  #include "../grant_table.h"
     3.5  
     3.6  /*
     3.7 - * Note that there is *never* any need to notify the backend when enqueuing
     3.8 - * receive requests (netif_rx_request_t). Notifications after enqueuing any
     3.9 - * other type of message should be conditional on the appropriate req_event
    3.10 - * or rsp_event field in the shared ring.
    3.11 + * Note that there is *never* any need to notify the backend when
    3.12 + * enqueuing receive requests (struct netif_rx_request). Notifications
    3.13 + * after enqueuing any other type of message should be conditional on
    3.14 + * the appropriate req_event or rsp_event field in the shared ring.
    3.15   */
    3.16  
    3.17  /* Protocol checksum field is blank in the packet (hardware offload)? */
    3.18 @@ -27,23 +27,26 @@
    3.19  #define _NETTXF_data_validated (1)
    3.20  #define  NETTXF_data_validated (1U<<_NETTXF_data_validated)
    3.21  
    3.22 -typedef struct netif_tx_request {
    3.23 +struct netif_tx_request {
    3.24      grant_ref_t gref;      /* Reference to buffer page */
    3.25      uint16_t offset;       /* Offset within buffer page */
    3.26      uint16_t flags;        /* NETTXF_* */
    3.27      uint16_t id;           /* Echoed in response message. */
    3.28      uint16_t size;         /* Packet size in bytes.       */
    3.29 -} netif_tx_request_t;
    3.30 +};
    3.31 +typedef struct netif_tx_request netif_tx_request_t;
    3.32  
    3.33 -typedef struct netif_tx_response {
    3.34 +struct netif_tx_response {
    3.35      uint16_t id;
    3.36      int16_t  status;       /* NETIF_RSP_* */
    3.37 -} netif_tx_response_t;
    3.38 +};
    3.39 +typedef struct netif_tx_response netif_tx_response_t;
    3.40  
    3.41 -typedef struct {
    3.42 +struct netif_rx_request {
    3.43      uint16_t    id;        /* Echoed in response message.        */
    3.44      grant_ref_t gref;      /* Reference to incoming granted frame */
    3.45 -} netif_rx_request_t;
    3.46 +};
    3.47 +typedef struct netif_rx_request netif_rx_request_t;
    3.48  
    3.49  /* Packet data has been validated against protocol checksum. */
    3.50  #define _NETRXF_data_validated (0)
    3.51 @@ -53,19 +56,20 @@ typedef struct {
    3.52  #define _NETRXF_csum_blank     (1)
    3.53  #define  NETRXF_csum_blank     (1U<<_NETRXF_csum_blank)
    3.54  
    3.55 -typedef struct {
    3.56 +struct netif_rx_response {
    3.57      uint16_t id;
    3.58      uint16_t offset;       /* Offset in page of start of received packet  */
    3.59      uint16_t flags;        /* NETRXF_* */
    3.60      int16_t  status;       /* -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
    3.61 -} netif_rx_response_t;
    3.62 +};
    3.63 +typedef struct netif_rx_response netif_rx_response_t;
    3.64  
    3.65  /*
    3.66   * Generate netif ring structures and types.
    3.67   */
    3.68  
    3.69 -DEFINE_RING_TYPES(netif_tx, netif_tx_request_t, netif_tx_response_t);
    3.70 -DEFINE_RING_TYPES(netif_rx, netif_rx_request_t, netif_rx_response_t);
    3.71 +DEFINE_RING_TYPES(netif_tx, struct netif_tx_request, struct netif_tx_response);
    3.72 +DEFINE_RING_TYPES(netif_rx, struct netif_rx_request, struct netif_rx_response);
    3.73  
    3.74  #define NETIF_RSP_DROPPED         -2
    3.75  #define NETIF_RSP_ERROR           -1
     4.1 --- a/xen/include/public/xen.h	Fri May 19 15:35:19 2006 +0100
     4.2 +++ b/xen/include/public/xen.h	Fri May 19 15:51:06 2006 +0100
     4.3 @@ -193,7 +193,7 @@
     4.4  #define MMUEXT_NEW_USER_BASEPTR 15
     4.5  
     4.6  #ifndef __ASSEMBLY__
     4.7 -typedef struct mmuext_op {
     4.8 +struct mmuext_op {
     4.9      unsigned int cmd;
    4.10      union {
    4.11          /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
    4.12 @@ -207,7 +207,8 @@ typedef struct mmuext_op {
    4.13          /* TLB_FLUSH_MULTI, INVLPG_MULTI */
    4.14          void *vcpumask;
    4.15      } arg2;
    4.16 -} mmuext_op_t;
    4.17 +};
    4.18 +typedef struct mmuext_op mmuext_op_t;
    4.19  DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
    4.20  #endif
    4.21  
    4.22 @@ -271,20 +272,22 @@ typedef uint16_t domid_t;
    4.23   * Send an array of these to HYPERVISOR_mmu_update().
    4.24   * NB. The fields are natural pointer/address size for this architecture.
    4.25   */
    4.26 -typedef struct mmu_update {
    4.27 +struct mmu_update {
    4.28      uint64_t ptr;       /* Machine address of PTE. */
    4.29      uint64_t val;       /* New contents of PTE.    */
    4.30 -} mmu_update_t;
    4.31 +};
    4.32 +typedef struct mmu_update mmu_update_t;
    4.33  DEFINE_XEN_GUEST_HANDLE(mmu_update_t);
    4.34  
    4.35  /*
    4.36   * Send an array of these to HYPERVISOR_multicall().
    4.37   * NB. The fields are natural register size for this architecture.
    4.38   */
    4.39 -typedef struct multicall_entry {
    4.40 +struct multicall_entry {
    4.41      unsigned long op, result;
    4.42      unsigned long args[6];
    4.43 -} multicall_entry_t;
    4.44 +};
    4.45 +typedef struct multicall_entry multicall_entry_t;
    4.46  DEFINE_XEN_GUEST_HANDLE(multicall_entry_t);
    4.47  
    4.48  /*
    4.49 @@ -293,7 +296,7 @@ DEFINE_XEN_GUEST_HANDLE(multicall_entry_
    4.50   */
    4.51  #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
    4.52  
    4.53 -typedef struct vcpu_time_info {
    4.54 +struct vcpu_time_info {
    4.55      /*
    4.56       * Updates to the following values are preceded and followed by an
    4.57       * increment of 'version'. The guest can therefore detect updates by
    4.58 @@ -317,9 +320,10 @@ typedef struct vcpu_time_info {
    4.59      uint32_t tsc_to_system_mul;
    4.60      int8_t   tsc_shift;
    4.61      int8_t   pad1[3];
    4.62 -} vcpu_time_info_t; /* 32 bytes */
    4.63 +}; /* 32 bytes */
    4.64 +typedef struct vcpu_time_info vcpu_time_info_t;
    4.65  
    4.66 -typedef struct vcpu_info {
    4.67 +struct vcpu_info {
    4.68      /*
    4.69       * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
    4.70       * a pending notification for a particular VCPU. It is then cleared 
    4.71 @@ -348,16 +352,17 @@ typedef struct vcpu_info {
    4.72      uint8_t evtchn_upcall_pending;
    4.73      uint8_t evtchn_upcall_mask;
    4.74      unsigned long evtchn_pending_sel;
    4.75 -    arch_vcpu_info_t arch;
    4.76 -    vcpu_time_info_t time;
    4.77 -} vcpu_info_t; /* 64 bytes (x86) */
    4.78 +    struct arch_vcpu_info arch;
    4.79 +    struct vcpu_time_info time;
    4.80 +}; /* 64 bytes (x86) */
    4.81 +typedef struct vcpu_info vcpu_info_t;
    4.82  
    4.83  /*
    4.84   * Xen/kernel shared data -- pointer provided in start_info.
    4.85   * NB. We expect that this struct is smaller than a page.
    4.86   */
    4.87 -typedef struct shared_info {
    4.88 -    vcpu_info_t vcpu_info[MAX_VIRT_CPUS];
    4.89 +struct shared_info {
    4.90 +    struct vcpu_info vcpu_info[MAX_VIRT_CPUS];
    4.91  
    4.92      /*
    4.93       * A domain can create "event channels" on which it can send and receive
    4.94 @@ -401,9 +406,10 @@ typedef struct shared_info {
    4.95      uint32_t wc_sec;          /* Secs  00:00:00 UTC, Jan 1, 1970.  */
    4.96      uint32_t wc_nsec;         /* Nsecs 00:00:00 UTC, Jan 1, 1970.  */
    4.97  
    4.98 -    arch_shared_info_t arch;
    4.99 +    struct arch_shared_info arch;
   4.100  
   4.101 -} shared_info_t;
   4.102 +};
   4.103 +typedef struct shared_info shared_info_t;
   4.104  
   4.105  /*
   4.106   * Start-of-day memory layout for the initial domain (DOM0):
   4.107 @@ -431,7 +437,7 @@ typedef struct shared_info {
   4.108   */
   4.109  
   4.110  #define MAX_GUEST_CMDLINE 1024
   4.111 -typedef struct start_info {
   4.112 +struct start_info {
   4.113      /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.    */
   4.114      char magic[32];             /* "xen-<version>-<platform>".            */
   4.115      unsigned long nr_pages;     /* Total pages allocated to this domain.  */
   4.116 @@ -448,7 +454,8 @@ typedef struct start_info {
   4.117      unsigned long mod_start;    /* VIRTUAL address of pre-loaded module.  */
   4.118      unsigned long mod_len;      /* Size (bytes) of pre-loaded module.     */
   4.119      int8_t cmd_line[MAX_GUEST_CMDLINE];
   4.120 -} start_info_t;
   4.121 +};
   4.122 +typedef struct start_info start_info_t;
   4.123  
   4.124  /* These flags are passed in the 'flags' field of start_info_t. */
   4.125  #define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */