From 37e626cedae08288f73f2356530a0bd5f045c8b9 Mon Sep 17 00:00:00 2001 From: Yuval Shaia Date: Sun, 14 Jan 2018 11:01:43 +0200 Subject: pci/shpc: Move function to generic header file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function should be declared in generic header file so we can utilize it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yuval Shaia Signed-off-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/qemu/host-utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/qemu/host-utils.h') 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. -- cgit 1.4.1