diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-01-13 17:25:00 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-01-19 17:17:50 +1100 |
commit | 44e8d9a57d2e67e5e05d6ae1902eec90db77f752 (patch) | |
tree | fe7c574147648842e89e60cf2cc0e9f61d350a41 /lib/libvirtio/virtio.c | |
parent | ca610c931e2b0004c44f748cb813580b09c60489 (diff) | |
download | SLOF-44e8d9a57d2e67e5e05d6ae1902eec90db77f752.zip SLOF-44e8d9a57d2e67e5e05d6ae1902eec90db77f752.tar.gz SLOF-44e8d9a57d2e67e5e05d6ae1902eec90db77f752.tar.bz2 |
Add virtfs support
Code originally written by Timothy Rule and reworked &
bug fixed by myself
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'lib/libvirtio/virtio.c')
-rw-r--r-- | lib/libvirtio/virtio.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/libvirtio/virtio.c b/lib/libvirtio/virtio.c index 4e70053..29d5dd3 100644 --- a/lib/libvirtio/virtio.c +++ b/lib/libvirtio/virtio.c @@ -189,3 +189,25 @@ uint64_t virtio_get_config(struct virtio_device *dev, int offset, int size) return val; } + +/** + * Get config blob + */ +int __virtio_read_config(struct virtio_device *dev, void *dst, + int offset, int len) +{ + void *confbase; + unsigned char *buf = dst; + int i; + + switch (dev->type) { + case VIRTIO_TYPE_PCI: + confbase = dev->base+VIRTIOHDR_DEVICE_CONFIG; + break; + default: + return 0; + } + for (i = 0; i < len; i++) + buf[i] = ci_read_8(confbase + offset + i); + return len; +} |