From: Andrew Cooper Date: Sat, 6 Jun 2015 14:46:54 +0000 (+0100) Subject: tools/libxl: Introduce ROUNDUP() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2816 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9438f98dba2346caaf7cfc1ce18199119519124b;p=xen.git 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 --- 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); \