summaryrefslogtreecommitdiff
path: root/kern/macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/macros.h')
-rw-r--r--kern/macros.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/kern/macros.h b/kern/macros.h
index 012dd15b..8e04d72b 100644
--- a/kern/macros.h
+++ b/kern/macros.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010 Richard Braun.
+ * Copyright (c) 2009, 2010, 2013 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,6 +44,8 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define DIV_CEIL(n, d) (((n) + (d) - 1) / (d))
+
#define P2ALIGNED(x, a) (((x) & ((a) - 1)) == 0)
#define ISP2(x) P2ALIGNED(x, x)
#define P2ALIGN(x, a) ((x) & -(a))