Lines Matching refs:base
21 return GET_UINT32(dev->base + VIRTMMIO_REG_STATUS); in VirtioGetStatus()
26 WRITE_UINT32(VirtioGetStatus(dev) | val, dev->base + VIRTMMIO_REG_STATUS); in VirtioAddStatus()
31 WRITE_UINT32(VIRTIO_STATUS_RESET, dev->base + VIRTMMIO_REG_STATUS); in VirtioResetStatus()
36 VADDR_T base; in VirtmmioDiscover() local
39 base = IO_DEVICE_ADDR(VIRTMMIO_BASE_ADDR) + VIRTMMIO_BASE_SIZE * (NUM_VIRTIO_TRANSPORTS - 1); in VirtmmioDiscover()
41 if ((GET_UINT32(base + VIRTMMIO_REG_MAGICVALUE) == VIRTMMIO_MAGIC) && in VirtmmioDiscover()
42 (GET_UINT32(base + VIRTMMIO_REG_VERSION) == VIRTMMIO_VERSION) && in VirtmmioDiscover()
43 (GET_UINT32(base + VIRTMMIO_REG_DEVICEID) == devId)) { in VirtmmioDiscover()
44 dev->base = base; in VirtmmioDiscover()
49 base -= VIRTMMIO_BASE_SIZE; in VirtmmioDiscover()
87 WRITE_UINT32(nth, baseDev->base + VIRTMMIO_REG_DEVFEATURESEL); in Negotiate()
88 features = GET_UINT32(baseDev->base + VIRTMMIO_REG_DEVFEATURE); in Negotiate()
91 before = GET_UINT32(baseDev->base + VIRTMMIO_REG_CONFIGGENERATION); in Negotiate()
98 after = GET_UINT32(baseDev->base + VIRTMMIO_REG_CONFIGGENERATION); in Negotiate()
101 WRITE_UINT32(nth, baseDev->base + VIRTMMIO_REG_DRVFEATURESEL); in Negotiate()
102 WRITE_UINT32(supported, baseDev->base + VIRTMMIO_REG_DRVFEATURE); in Negotiate()
134 WRITE_UINT32(paddr, dev->base + regLow); in WriteQueueAddr()
136 WRITE_UINT32(paddr, dev->base + regLow + U32_BYTES); in WriteQueueAddr()
144 WRITE_UINT32(queue, dev->base + VIRTMMIO_REG_QUEUESEL); in CompleteConfigQueue()
146 num = GET_UINT32(dev->base + VIRTMMIO_REG_QUEUEREADY); in CompleteConfigQueue()
148 num = GET_UINT32(dev->base + VIRTMMIO_REG_QUEUENUMMAX); in CompleteConfigQueue()
154 WRITE_UINT32(q->qsz, dev->base + VIRTMMIO_REG_QUEUENUM); in CompleteConfigQueue()
159 WRITE_UINT32(1, dev->base + VIRTMMIO_REG_QUEUEREADY); in CompleteConfigQueue()
163 static VADDR_T CalculateQueueAddr(VADDR_T base, uint16_t qsz, struct Virtq *q) in CalculateQueueAddr() argument
165 base = ALIGN(base, VIRTQ_ALIGN_DESC); in CalculateQueueAddr()
166 q->desc = (struct VirtqDesc *)base; in CalculateQueueAddr()
168 base = ALIGN(base + sizeof(struct VirtqDesc) * qsz, VIRTQ_ALIGN_AVAIL); in CalculateQueueAddr()
169 q->avail = (struct VirtqAvail *)base; in CalculateQueueAddr()
170 base = ALIGN(base + sizeof(struct VirtqAvail) + sizeof(uint16_t) * qsz, VIRTQ_ALIGN_USED); in CalculateQueueAddr()
171 q->used = (struct VirtqUsed *)base; in CalculateQueueAddr()
173 return base + sizeof(struct VirtqUsed) + sizeof(struct VirtqUsedElem) * qsz; in CalculateQueueAddr()
176 VADDR_T VirtmmioConfigQueue(struct VirtmmioDev *dev, VADDR_T base, uint16_t qsz[], int num) in VirtmmioConfigQueue() argument
181 base = CalculateQueueAddr(base, qsz[i], &dev->vq[i]); in VirtmmioConfigQueue()
187 return base; in VirtmmioConfigQueue()