summaryrefslogtreecommitdiff
path: root/include/qemu/host-utils.h
diff options
context:
space:
mode:
authorYuval Shaia <yuval.shaia@oracle.com>2018-01-14 11:01:43 +0200
committerMichael S. Tsirkin <mst@redhat.com>2018-01-18 21:52:38 +0200
commit37e626cedae08288f73f2356530a0bd5f045c8b9 (patch)
tree6251558d9624fccabf852b4eab9a44be5bf49528 /include/qemu/host-utils.h
parent6f0bb230722931d17fb284eee8efd40b9d653822 (diff)
downloadqemu-37e626cedae08288f73f2356530a0bd5f045c8b9.tar.gz
pci/shpc: Move function to generic header file
This function should be declared in generic header file so we can utilize it. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/qemu/host-utils.h')
-rw-r--r--include/qemu/host-utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h
index 5ac621cf1f..38da849be9 100644
--- a/include/qemu/host-utils.h
+++ b/include/qemu/host-utils.h
@@ -400,6 +400,16 @@ static inline uint64_t pow2ceil(uint64_t value)
return 0x8000000000000000ull >> (n - 1);
}
+static inline uint32_t pow2roundup32(uint32_t x)
+{
+ x |= (x >> 1);
+ x |= (x >> 2);
+ x |= (x >> 4);
+ x |= (x >> 8);
+ x |= (x >> 16);
+ return x + 1;
+}
+
/**
* urshift - 128-bit Unsigned Right Shift.
* @plow: in/out - lower 64-bit integer.