aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-04-21 14:37:49 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2014-04-25 15:40:13 +0530
commitc365fe0393df8e6bddfbf60f50314b3bdac5bef7 (patch)
tree3ddc69b914aa924c327fc8f24d81c313fb3623b1 /include
parent4a53254d43f67083b3aca10c36f921361b3b97dc (diff)
downloadSLOF-c365fe0393df8e6bddfbf60f50314b3bdac5bef7.zip
SLOF-c365fe0393df8e6bddfbf60f50314b3bdac5bef7.tar.gz
SLOF-c365fe0393df8e6bddfbf60f50314b3bdac5bef7.tar.bz2
virtio-blk: support variable block size
Current code only works with 512 bytes read. Moreover, Qemu ignores the guest set features request. In the set features request SLOF indicates to qemu that it is not support VIRTIO_BLK_F_BLK_SIZE feature. Code in qemu suggests that virtio-blk is not implementing set_guest_feature. Tested-by: Bharata B Rao <bharata@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/helpers.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/helpers.h b/include/helpers.h
index 1663ea8..f6d4375 100644
--- a/include/helpers.h
+++ b/include/helpers.h
@@ -34,4 +34,9 @@ extern void SLOF_pci_config_write32(long offset, long value);
extern void SLOF_pci_config_write16(long offset, long value);
extern void *SLOF_translate_my_address(void *addr);
+#define offset_of(type, member) ((long) &((type *)0)->member)
+#define container_of(ptr, type, member) ({ \
+ const typeof(((type *)0)->member)* struct_ptr = (ptr); \
+ (type *)((char *)struct_ptr - offset_of(type, member)); })
+
#endif