From b45d63b62f0c05eb54bba0fafaf29b9b3f4dd99a Mon Sep 17 00:00:00 2001 From: Ben Herrenschmidt Date: Fri, 1 Apr 2011 15:15:30 +1100 Subject: Implement PAPR CRQ hypercalls This patch implements the infrastructure and hypercalls necessary for the PAPR specified CRQ (Command Request Queue) mechanism. This general request queueing system is used by many of the PAPR virtual IO devices, including the virtual scsi adapter. Signed-off-by: Ben Herrenschmidt Signed-off-by: David Gibson Signed-off-by: Alexander Graf --- hw/spapr_vio.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/spapr_vio.h') diff --git a/hw/spapr_vio.h b/hw/spapr_vio.h index 4cfaf55bd8..ba16795c37 100644 --- a/hw/spapr_vio.h +++ b/hw/spapr_vio.h @@ -32,10 +32,19 @@ enum VIOsPAPR_TCEAccess { SPAPR_TCE_RW = 3, }; +struct VIOsPAPRDevice; + typedef struct VIOsPAPR_RTCE { uint64_t tce; } VIOsPAPR_RTCE; +typedef struct VIOsPAPR_CRQ { + uint64_t qladdr; + uint32_t qsize; + uint32_t qnext; + int(*SendFunc)(struct VIOsPAPRDevice *vdev, uint8_t *crq); +} VIOsPAPR_CRQ; + typedef struct VIOsPAPRDevice { DeviceState qdev; uint32_t reg; @@ -44,6 +53,7 @@ typedef struct VIOsPAPRDevice { target_ulong signal_state; uint32_t rtce_window_size; VIOsPAPR_RTCE *rtce_table; + VIOsPAPR_CRQ crq; } VIOsPAPRDevice; typedef struct VIOsPAPRBus { @@ -81,6 +91,8 @@ void stw_tce(VIOsPAPRDevice *dev, uint64_t taddr, uint32_t val); void stq_tce(VIOsPAPRDevice *dev, uint64_t taddr, uint64_t val); uint64_t ldq_tce(VIOsPAPRDevice *dev, uint64_t taddr); +int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq); + void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len); void spapr_vty_create(VIOsPAPRBus *bus, uint32_t reg, CharDriverState *chardev, -- cgit v1.2.3