Lines Matching refs:base
26 return GET_UINT32(dev->base + VIRTMMIO_REG_STATUS); in VirtioGetStatus()
31 FENCE_WRITE_UINT32(VirtioGetStatus(dev) | val, dev->base + VIRTMMIO_REG_STATUS); in VirtioAddStatus()
36 FENCE_WRITE_UINT32(VIRTIO_STATUS_RESET, dev->base + VIRTMMIO_REG_STATUS); in VirtioResetStatus()
41 VADDR_T base; in VirtmmioDiscover() local
44 base = IO_DEVICE_ADDR(VIRTMMIO_BASE_ADDR) + VIRTMMIO_BASE_SIZE * (NUM_VIRTIO_TRANSPORTS - 1); in VirtmmioDiscover()
46 if ((GET_UINT32(base + VIRTMMIO_REG_MAGICVALUE) == VIRTMMIO_MAGIC) && in VirtmmioDiscover()
47 (GET_UINT32(base + VIRTMMIO_REG_VERSION) == VIRTMMIO_VERSION) && in VirtmmioDiscover()
48 (GET_UINT32(base + VIRTMMIO_REG_DEVICEID) == devId)) { in VirtmmioDiscover()
49 dev->base = base; in VirtmmioDiscover()
54 base -= VIRTMMIO_BASE_SIZE; in VirtmmioDiscover()
92 FENCE_WRITE_UINT32(nth, baseDev->base + VIRTMMIO_REG_DEVFEATURESEL); in Negotiate()
93 features = GET_UINT32(baseDev->base + VIRTMMIO_REG_DEVFEATURE); in Negotiate()
96 before = GET_UINT32(baseDev->base + VIRTMMIO_REG_CONFIGGENERATION); in Negotiate()
103 after = GET_UINT32(baseDev->base + VIRTMMIO_REG_CONFIGGENERATION); in Negotiate()
106 FENCE_WRITE_UINT32(nth, baseDev->base + VIRTMMIO_REG_DRVFEATURESEL); in Negotiate()
107 FENCE_WRITE_UINT32(supported, baseDev->base + VIRTMMIO_REG_DRVFEATURE); in Negotiate()
142 FENCE_WRITE_UINT32(paddr, dev->base + regLow); in WriteQueueAddr()
144 FENCE_WRITE_UINT32(paddr, dev->base + regLow + U32_BYTES); in WriteQueueAddr()
152 FENCE_WRITE_UINT32(queue, dev->base + VIRTMMIO_REG_QUEUESEL); in CompleteConfigQueue()
154 num = GET_UINT32(dev->base + VIRTMMIO_REG_QUEUEREADY); in CompleteConfigQueue()
156 num = GET_UINT32(dev->base + VIRTMMIO_REG_QUEUENUMMAX); in CompleteConfigQueue()
162 FENCE_WRITE_UINT32(q->qsz, dev->base + VIRTMMIO_REG_QUEUENUM); in CompleteConfigQueue()
167 FENCE_WRITE_UINT32(1, dev->base + VIRTMMIO_REG_QUEUEREADY); in CompleteConfigQueue()
171 static VADDR_T CalculateQueueAddr(VADDR_T base, uint16_t qsz, struct Virtq *q) in CalculateQueueAddr() argument
173 base = ALIGN(base, VIRTQ_ALIGN_DESC); in CalculateQueueAddr()
174 q->desc = (struct VirtqDesc *)base; in CalculateQueueAddr()
176 base = ALIGN(base + sizeof(struct VirtqDesc) * qsz, VIRTQ_ALIGN_AVAIL); in CalculateQueueAddr()
177 q->avail = (struct VirtqAvail *)base; in CalculateQueueAddr()
178 base = ALIGN(base + sizeof(struct VirtqAvail) + sizeof(uint16_t) * qsz, VIRTQ_ALIGN_USED); in CalculateQueueAddr()
179 q->used = (struct VirtqUsed *)base; in CalculateQueueAddr()
181 return base + sizeof(struct VirtqUsed) + sizeof(struct VirtqUsedElem) * qsz; in CalculateQueueAddr()
184 VADDR_T VirtmmioConfigQueue(struct VirtmmioDev *dev, VADDR_T base, uint16_t qsz[], int num) in VirtmmioConfigQueue() argument
189 base = CalculateQueueAddr(base, qsz[i], &dev->vq[i]); in VirtmmioConfigQueue()
195 return base; in VirtmmioConfigQueue()