VMM: Converted virtio headers to rely on types from stdint
[akaros.git] / user / vmm / include / vmm / virtio_pci.h
index 4e4cf8a..ce44ed8 100644 (file)
@@ -38,6 +38,8 @@
 
 #pragma once
 
+#include <stdint.h>
+
 #ifndef VIRTIO_PCI_NO_LEGACY
 
 /* A 32-bit r/o bitmask of the features supported by the host */
 
 /* This is the PCI capability header: */
 struct virtio_pci_cap {
-       __u8 cap_vndr;          /* Generic PCI field: PCI_CAP_ID_VNDR */
-       __u8 cap_next;          /* Generic PCI field: next ptr. */
-       __u8 cap_len;           /* Generic PCI field: capability length */
-       __u8 cfg_type;          /* Identifies the structure. */
-       __u8 bar;               /* Where to find it. */
-       __u8 padding[3];        /* Pad to full dword. */
-       __le32 offset;          /* Offset within bar. */
-       __le32 length;          /* Length of the structure, in bytes. */
+       uint8_t cap_vndr;               /* Generic PCI field: PCI_CAP_ID_VNDR */
+       uint8_t cap_next;               /* Generic PCI field: next ptr. */
+       uint8_t cap_len;                /* Generic PCI field: capability length */
+       uint8_t cfg_type;               /* Identifies the structure. */
+       uint8_t bar;            /* Where to find it. */
+       uint8_t padding[3];     /* Pad to full dword. */
+       uint32_t offset;                /* Offset within bar. */
+       uint32_t length;                /* Length of the structure, in bytes. */
 };
 
 struct virtio_pci_notify_cap {
        struct virtio_pci_cap cap;
-       __le32 notify_off_multiplier;   /* Multiplier for queue_notify_off. */
+       uint32_t notify_off_multiplier; /* Multiplier for queue_notify_off. */
 };
 
 /* Fields in VIRTIO_PCI_CAP_COMMON_CFG: */
 struct virtio_pci_common_cfg {
        /* About the whole device. */
-       __le32 device_feature_select;   /* read-write */
-       __le32 device_feature;          /* read-only */
-       __le32 guest_feature_select;    /* read-write */
-       __le32 guest_feature;           /* read-write */
-       __le16 msix_config;             /* read-write */
-       __le16 num_queues;              /* read-only */
-       __u8 device_status;             /* read-write */
-       __u8 config_generation;         /* read-only */
+       uint32_t device_feature_select; /* read-write */
+       uint32_t device_feature;                /* read-only */
+       uint32_t guest_feature_select;  /* read-write */
+       uint32_t guest_feature;         /* read-write */
+       uint16_t msix_config;           /* read-write */
+       uint16_t num_queues;            /* read-only */
+       uint8_t device_status;          /* read-write */
+       uint8_t config_generation;              /* read-only */
 
        /* About a specific virtqueue. */
-       __le16 queue_select;            /* read-write */
-       __le16 queue_size;              /* read-write, power of 2. */
-       __le16 queue_msix_vector;       /* read-write */
-       __le16 queue_enable;            /* read-write */
-       __le16 queue_notify_off;        /* read-only */
-       __le32 queue_desc_lo;           /* read-write */
-       __le32 queue_desc_hi;           /* read-write */
-       __le32 queue_avail_lo;          /* read-write */
-       __le32 queue_avail_hi;          /* read-write */
-       __le32 queue_used_lo;           /* read-write */
-       __le32 queue_used_hi;           /* read-write */
+       uint16_t queue_select;          /* read-write */
+       uint16_t queue_size;            /* read-write, power of 2. */
+       uint16_t queue_msix_vector;     /* read-write */
+       uint16_t queue_enable;          /* read-write */
+       uint16_t queue_notify_off;      /* read-only */
+       uint32_t queue_desc_lo;         /* read-write */
+       uint32_t queue_desc_hi;         /* read-write */
+       uint32_t queue_avail_lo;                /* read-write */
+       uint32_t queue_avail_hi;                /* read-write */
+       uint32_t queue_used_lo;         /* read-write */
+       uint32_t queue_used_hi;         /* read-write */
 };
 
 /* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
 struct virtio_pci_cfg_cap {
        struct virtio_pci_cap cap;
-       __u8 pci_cfg_data[4]; /* Data for BAR access. */
+       uint8_t pci_cfg_data[4]; /* Data for BAR access. */
 };
 
 /* Macro versions of offsets for the Old Timers! */
@@ -192,5 +194,3 @@ struct virtio_pci_cfg_cap {
 #define VIRTIO_PCI_COMMON_Q_USEDHI     52
 
 #endif /* VIRTIO_PCI_NO_MODERN */
-
-