tests: Move benchmarks into a separate folder
[qemu/ar7.git] / include / hw / virtio / virtio-mmio.h
blobd4c4c386ab05b03a5826fbc6da99ddd23dc48121
1 /*
2 * Virtio MMIO bindings
4 * Copyright (c) 2011 Linaro Limited
6 * Author:
7 * Peter Maydell <peter.maydell@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, see <http://www.gnu.org/licenses/>.
22 #ifndef HW_VIRTIO_MMIO_H
23 #define HW_VIRTIO_MMIO_H
25 #include "hw/virtio/virtio-bus.h"
26 #include "qom/object.h"
28 /* QOM macros */
29 /* virtio-mmio-bus */
30 #define TYPE_VIRTIO_MMIO_BUS "virtio-mmio-bus"
31 /* This is reusing the VirtioBusState typedef from TYPE_VIRTIO_BUS */
32 DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass,
33 VIRTIO_MMIO_BUS, TYPE_VIRTIO_MMIO_BUS)
35 /* virtio-mmio */
36 #define TYPE_VIRTIO_MMIO "virtio-mmio"
37 OBJECT_DECLARE_SIMPLE_TYPE(VirtIOMMIOProxy, VIRTIO_MMIO)
39 #define VIRT_MAGIC 0x74726976 /* 'virt' */
40 #define VIRT_VERSION 2
41 #define VIRT_VERSION_LEGACY 1
42 #define VIRT_VENDOR 0x554D4551 /* 'QEMU' */
44 typedef struct VirtIOMMIOQueue {
45 uint16_t num;
46 bool enabled;
47 uint32_t desc[2];
48 uint32_t avail[2];
49 uint32_t used[2];
50 } VirtIOMMIOQueue;
52 struct VirtIOMMIOProxy {
53 /* Generic */
54 SysBusDevice parent_obj;
55 MemoryRegion iomem;
56 qemu_irq irq;
57 bool legacy;
58 /* Guest accessible state needing migration and reset */
59 uint32_t host_features_sel;
60 uint32_t guest_features_sel;
61 uint32_t guest_page_shift;
62 /* virtio-bus */
63 VirtioBusState bus;
64 bool format_transport_address;
65 /* Fields only used for non-legacy (v2) devices */
66 uint32_t guest_features[2];
67 VirtIOMMIOQueue vqs[VIRTIO_QUEUE_MAX];
70 #endif