diff mbox

[v3,2/5] xen: Add macro ROUNDUP

Message ID 1380300997-28099-3-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall Sept. 27, 2013, 4:56 p.m. UTC
Signed-off-by: Julien Grall <julien.grall@linaro.org>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <jbeulich@suse.com>

---
    Changes in v3:
        - Move the macro in include/xen/lib.h
        - Rename in ROUNDUP to avoid collision with assembly ALIGN macro
---
 xen/include/xen/lib.h |    2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 4768b0e..5b258fd 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -63,6 +63,8 @@  do {                                                            \
 #define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
 #define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
 
+#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
+
 #define reserve_bootmem(_p,_l) ((void)0)
 
 struct domain;