Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


updates to virtio device framework
[palacios.git] / palacios / include / devices / lnx_virtio_pci.h
similarity index 70%
rename from palacios/include/devices/lnx_virtio.h
rename to palacios/include/devices/lnx_virtio_pci.h
index 9afa483..d60f05d 100644 (file)
  */
 
 
-#ifndef __DEVICES_LNX_VIRTIO_H__
-#define __DEVICES_LNX_VIRTIO_H__
+#ifndef __DEVICES_LNX_VIRTIO_PCI_H__
+#define __DEVICES_LNX_VIRTIO_PCI_H__
 
 #ifdef __V3VEE__
 
 
-
 /* PCI Vendor IDs (from Qemu) */
 #define VIRTIO_VENDOR_ID    0x1af4 // Redhat/Qumranet
 #define VIRTIO_SUBVENDOR_ID 0x1af4 // Redhat/Qumranet
 
 #define VIRTIO_BLOCK_SUBDEVICE_ID 2
 
+
+
+#define HOST_FEATURES_PORT 0
+#define GUEST_FEATURES_PORT 4
+#define VRING_PG_NUM_PORT 8
+#define VRING_SIZE_PORT 12
+#define VRING_Q_SEL_PORT 14
+#define VRING_Q_NOTIFY_PORT 16
+#define VIRTIO_STATUS_PORT 18
+#define VIRTIO_ISR_PORT 19
+
+
+
 /* The virtio configuration space is a hybrid io/memory mapped model 
  * All IO is done via IO port accesses
  * The IO ports access fields in a virtio data structure, and the base io port 
@@ -58,6 +70,31 @@ struct virtio_config {
 } __attribute__((packed));
 
 
+struct vring_desc {
+    uint64_t addr_gpa;
+    uint32_t length;
+    uint16_t flags;
+    uint16_t next;
+} __attribute__((packed));
+
+struct vring_avail {
+    uint16_t flags;
+    uint16_t index;
+    uint16_t ring[0];
+} __attribute__((packed));
+
+
+struct vring_used_elem {
+    uint32_t id;
+    uint32_t length;
+} __attribute__((packed));
+
+struct vring_used {
+    uint16_t flags;
+    uint16_t index;
+    struct vring_used_elem ring[0];
+} __attribute__((packed));
+