From 9438f98dba2346caaf7cfc1ce18199119519124b Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Sat, 6 Jun 2015 15:46:54 +0100 Subject: [PATCH] tools/libxl: Introduce ROUNDUP() This is the same as is used by libxc. Signed-off-by: Andrew Cooper Acked-by: Ian Campbell CC: Ian Jackson CC: Wei Liu --- tools/libxl/libxl_internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 5235d2593d..19fc425668 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -110,6 +110,9 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define ROUNDUP(_val, _order) \ + (((unsigned long)(_val)+(1UL<<(_order))-1) & ~((1UL<<(_order))-1)) + #define min(X, Y) ({ \ const typeof (X) _x = (X); \ const typeof (Y) _y = (Y); \ -- 2.30.2