[SeaBIOS] [RFC PATCH 14/16] virtio-pci: add vp_set

Paolo Bonzini pbonzini at redhat.com
Tue Nov 15 17:01:22 CET 2011


virtio-scsi will need to write to config space, add a helper to do that.

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 src/virtio-pci.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/virtio-pci.h b/src/virtio-pci.h
index e1d972d..ea40edf 100644
--- a/src/virtio-pci.h
+++ b/src/virtio-pci.h
@@ -64,6 +64,16 @@ static inline u8 vp_get_status(unsigned int ioaddr)
    return inb(ioaddr + VIRTIO_PCI_STATUS);
 }
 
+static inline void vp_set(unsigned int ioaddr, unsigned offset,
+                     void *buf, unsigned len)
+{
+   u8 *ptr = buf;
+   unsigned i;
+
+   for (i = 0; i < len; i++)
+           outb(ioaddr + VIRTIO_PCI_CONFIG + offset + i, ptr[i]);
+}
+
 static inline void vp_set_status(unsigned int ioaddr, u8 status)
 {
    if (status == 0)        /* reset */
-- 
1.7.7.1





More information about the SeaBIOS mailing list