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.


9afa4833027a4bd56346f7e61a819874adffe429
[palacios.git] / palacios / include / devices / lnx_virtio.h
1 /* 
2  * This file is part of the Palacios Virtual Machine Monitor developed
3  * by the V3VEE Project with funding from the United States National 
4  * Science Foundation and the Department of Energy.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
10  * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11  * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org> 
12  * All rights reserved.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20
21 #ifndef __DEVICES_LNX_VIRTIO_H__
22 #define __DEVICES_LNX_VIRTIO_H__
23
24 #ifdef __V3VEE__
25
26
27
28 /* PCI Vendor IDs (from Qemu) */
29 #define VIRTIO_VENDOR_ID    0x1af4 // Redhat/Qumranet
30 #define VIRTIO_SUBVENDOR_ID 0x1af4 // Redhat/Qumranet
31 #define VIRTIO_SUBDEVICE_ID 0x1100 // Qemu
32
33 // PCI Device IDs
34 #define VIRTIO_NET_DEV_ID         0x1000
35 #define VIRTIO_BLOCK_DEV_ID       0x1001
36 #define VIRTIO_BALLOON_DEV_ID     0x1002
37 #define VIRTIO_CONSOLE_DEV_ID     0x1003
38
39 #define VIRTIO_BLOCK_SUBDEVICE_ID 2
40
41 /* The virtio configuration space is a hybrid io/memory mapped model 
42  * All IO is done via IO port accesses
43  * The IO ports access fields in a virtio data structure, and the base io port 
44  *    coincides with the base address of the in memory structure
45  * There is a standard virtio structure of 20 bytes, followed by a 
46  *    device specific structure of n bytes.
47  * 
48  */
49 struct virtio_config {
50     uint32_t host_features;
51     uint32_t guest_features;
52     uint32_t vring_page_num;
53     uint16_t vring_ring_size;
54     uint16_t vring_queue_selector;
55     uint16_t vring_queue_notifier;
56     uint8_t status;
57     uint8_t pci_isr;
58 } __attribute__((packed));
59
60
61
62
63
64
65 #endif
66
67 #endif