/* SPDX-License-Identifier: MIT */1/*2* ioreq.h: I/O request definitions for device models3* Copyright (c) 2004, Intel Corporation.4*/56#ifndef __XEN_PUBLIC_HVM_IOREQ_H__7#define __XEN_PUBLIC_HVM_IOREQ_H__89#define IOREQ_READ 110#define IOREQ_WRITE 01112#define STATE_IOREQ_NONE 013#define STATE_IOREQ_READY 114#define STATE_IOREQ_INPROCESS 215#define STATE_IORESP_READY 31617#define IOREQ_TYPE_PIO 0 /* pio */18#define IOREQ_TYPE_COPY 1 /* mmio ops */19#define IOREQ_TYPE_PCI_CONFIG 220#define IOREQ_TYPE_TIMEOFFSET 721#define IOREQ_TYPE_INVALIDATE 8 /* mapcache */2223/*24* VMExit dispatcher should cooperate with instruction decoder to25* prepare this structure and notify service OS and DM by sending26* virq.27*28* For I/O type IOREQ_TYPE_PCI_CONFIG, the physical address is formatted29* as follows:30*31* 63....48|47..40|39..35|34..32|31........032* SEGMENT |BUS |DEV |FN |OFFSET33*/34struct ioreq {35uint64_t addr; /* physical address */36uint64_t data; /* data (or paddr of data) */37uint32_t count; /* for rep prefixes */38uint32_t size; /* size in bytes */39uint32_t vp_eport; /* evtchn for notifications to/from device model */40uint16_t _pad0;41uint8_t state:4;42uint8_t data_is_ptr:1; /* if 1, data above is the guest paddr43* of the real data to use. */44uint8_t dir:1; /* 1=read, 0=write */45uint8_t df:1;46uint8_t _pad1:1;47uint8_t type; /* I/O type */48};4950#endif /* __XEN_PUBLIC_HVM_IOREQ_H__ */515253