]>
Commit | Line | Data |
---|---|---|
0a6ed700 MM |
1 | /* |
2 | * libqos virtio MMIO definitions | |
3 | * | |
4 | * Copyright (c) 2014 Marc Marí | |
5 | * | |
6 | * This work is licensed under the terms of the GNU GPL, version 2 or later. | |
7 | * See the COPYING file in the top-level directory. | |
8 | */ | |
9 | ||
10 | #ifndef LIBQOS_VIRTIO_MMIO_H | |
11 | #define LIBQOS_VIRTIO_MMIO_H | |
12 | ||
13 | #include "libqos/virtio.h" | |
57ed038a | 14 | #include "libqos/qgraph.h" |
0a6ed700 MM |
15 | |
16 | #define QVIRTIO_MMIO_MAGIC_VALUE 0x000 | |
17 | #define QVIRTIO_MMIO_VERSION 0x004 | |
18 | #define QVIRTIO_MMIO_DEVICE_ID 0x008 | |
19 | #define QVIRTIO_MMIO_VENDOR_ID 0x00C | |
20 | #define QVIRTIO_MMIO_HOST_FEATURES 0x010 | |
21 | #define QVIRTIO_MMIO_HOST_FEATURES_SEL 0x014 | |
22 | #define QVIRTIO_MMIO_GUEST_FEATURES 0x020 | |
23 | #define QVIRTIO_MMIO_GUEST_FEATURES_SEL 0x024 | |
24 | #define QVIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 | |
25 | #define QVIRTIO_MMIO_QUEUE_SEL 0x030 | |
26 | #define QVIRTIO_MMIO_QUEUE_NUM_MAX 0x034 | |
27 | #define QVIRTIO_MMIO_QUEUE_NUM 0x038 | |
28 | #define QVIRTIO_MMIO_QUEUE_ALIGN 0x03C | |
29 | #define QVIRTIO_MMIO_QUEUE_PFN 0x040 | |
30 | #define QVIRTIO_MMIO_QUEUE_NOTIFY 0x050 | |
31 | #define QVIRTIO_MMIO_INTERRUPT_STATUS 0x060 | |
32 | #define QVIRTIO_MMIO_INTERRUPT_ACK 0x064 | |
33 | #define QVIRTIO_MMIO_DEVICE_STATUS 0x070 | |
34 | #define QVIRTIO_MMIO_DEVICE_SPECIFIC 0x100 | |
35 | ||
36 | typedef struct QVirtioMMIODevice { | |
57ed038a | 37 | QOSGraphObject obj; |
0a6ed700 | 38 | QVirtioDevice vdev; |
57ed038a | 39 | QTestState *qts; |
0a6ed700 MM |
40 | uint64_t addr; |
41 | uint32_t page_size; | |
42 | uint32_t features; /* As it cannot be read later, save it */ | |
43 | } QVirtioMMIODevice; | |
44 | ||
45 | extern const QVirtioBus qvirtio_mmio; | |
46 | ||
57ed038a EGE |
47 | void qvirtio_mmio_init_device(QVirtioMMIODevice *dev, QTestState *qts, |
48 | uint64_t addr, uint32_t page_size); | |
0a6ed700 MM |
49 | |
50 | #endif |