mirror of https://gitee.com/openkylin/qemu.git
s390: use standard headers
Drop duplicated macros in favor of values from standard headers. Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
9abd373c64
commit
ad67a0f278
|
@ -19,6 +19,10 @@
|
|||
#ifndef HW_S390_VIRTIO_BUS_H
|
||||
#define HW_S390_VIRTIO_BUS_H 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "standard-headers/asm-s390/kvm_virtio.h"
|
||||
#include "standard-headers/linux/virtio_ring.h"
|
||||
#include "hw/virtio/virtio-blk.h"
|
||||
#include "hw/virtio/virtio-net.h"
|
||||
#include "hw/virtio/virtio-rng.h"
|
||||
|
@ -29,28 +33,26 @@
|
|||
#include "hw/virtio/vhost-scsi.h"
|
||||
#endif
|
||||
|
||||
#define VIRTIO_DEV_OFFS_TYPE 0 /* 8 bits */
|
||||
#define VIRTIO_DEV_OFFS_NUM_VQ 1 /* 8 bits */
|
||||
#define VIRTIO_DEV_OFFS_FEATURE_LEN 2 /* 8 bits */
|
||||
#define VIRTIO_DEV_OFFS_CONFIG_LEN 3 /* 8 bits */
|
||||
#define VIRTIO_DEV_OFFS_STATUS 4 /* 8 bits */
|
||||
#define VIRTIO_DEV_OFFS_CONFIG 5 /* dynamic */
|
||||
typedef struct kvm_device_desc KvmDeviceDesc;
|
||||
|
||||
#define VIRTIO_VQCONFIG_OFFS_TOKEN 0 /* 64 bits */
|
||||
#define VIRTIO_VQCONFIG_OFFS_ADDRESS 8 /* 64 bits */
|
||||
#define VIRTIO_VQCONFIG_OFFS_NUM 16 /* 16 bits */
|
||||
#define VIRTIO_VQCONFIG_LEN 24
|
||||
#define VIRTIO_DEV_OFFS_TYPE offsetof(KvmDeviceDesc, type)
|
||||
#define VIRTIO_DEV_OFFS_NUM_VQ offsetof(KvmDeviceDesc, num_vq)
|
||||
#define VIRTIO_DEV_OFFS_FEATURE_LEN offsetof(KvmDeviceDesc, feature_len)
|
||||
#define VIRTIO_DEV_OFFS_CONFIG_LEN offsetof(KvmDeviceDesc, config_len)
|
||||
#define VIRTIO_DEV_OFFS_STATUS offsetof(KvmDeviceDesc, status)
|
||||
#define VIRTIO_DEV_OFFS_CONFIG offsetof(KvmDeviceDesc, config)
|
||||
|
||||
typedef struct kvm_vqconfig KvmVqConfig;
|
||||
#define VIRTIO_VQCONFIG_OFFS_TOKEN offsetof(KvmVqConfig,token) /* 64 bit */
|
||||
#define VIRTIO_VQCONFIG_OFFS_ADDRESS offsetof(KvmVqConfig, address) /* 64 bit */
|
||||
#define VIRTIO_VQCONFIG_OFFS_NUM offsetof(KvmVqConfig, num) /* 16 bit */
|
||||
#define VIRTIO_VQCONFIG_LEN sizeof(KvmVqConfig)
|
||||
|
||||
#define VIRTIO_RING_LEN (TARGET_PAGE_SIZE * 3)
|
||||
#define VIRTIO_VRING_AVAIL_IDX_OFFS 2
|
||||
#define VIRTIO_VRING_USED_IDX_OFFS 2
|
||||
#define VIRTIO_VRING_AVAIL_IDX_OFFS offsetof(struct vring_avail, idx)
|
||||
#define VIRTIO_VRING_USED_IDX_OFFS offsetof(struct vring_used, idx)
|
||||
#define S390_DEVICE_PAGES 512
|
||||
|
||||
#define VIRTIO_PARAM_MASK 0xff
|
||||
#define VIRTIO_PARAM_VRING_INTERRUPT 0x0
|
||||
#define VIRTIO_PARAM_CONFIG_CHANGED 0x1
|
||||
#define VIRTIO_PARAM_DEV_ADD 0x2
|
||||
|
||||
#define TYPE_VIRTIO_S390_DEVICE "virtio-s390-device"
|
||||
#define VIRTIO_S390_DEVICE(obj) \
|
||||
OBJECT_CHECK(VirtIOS390Device, (obj), TYPE_VIRTIO_S390_DEVICE)
|
||||
|
|
|
@ -13,11 +13,8 @@
|
|||
#define HW_S390_VIRTIO_H 1
|
||||
|
||||
#include "hw/nmi.h"
|
||||
|
||||
#define KVM_S390_VIRTIO_NOTIFY 0
|
||||
#define KVM_S390_VIRTIO_RESET 1
|
||||
#define KVM_S390_VIRTIO_SET_STATUS 2
|
||||
#define KVM_S390_VIRTIO_CCW_NOTIFY 3
|
||||
#include "standard-headers/asm-s390/kvm_virtio.h"
|
||||
#include "standard-headers/asm-s390/virtio-ccw.h"
|
||||
|
||||
typedef int (*s390_virtio_fn)(const uint64_t *args);
|
||||
void s390_register_virtio_hypercall(uint64_t code, s390_virtio_fn fn);
|
||||
|
|
Loading…
Reference in New Issue