aboutsummaryrefslogtreecommitdiffstats
path: root/src/types.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-09-27 20:07:40 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-09-27 20:07:40 -0400
commit6aee52dd45843bbc884692a34c3a6b4e3eb392e8 (patch)
tree5cf6c7dcb3e77d2aa8ce9241bacae3b7b239ff5f /src/types.h
parentf8e800dea4aad59c83254bddd8e9ccfcd3b45774 (diff)
downloadseabios-6aee52dd45843bbc884692a34c3a6b4e3eb392e8.tar.gz
Replace clock conversion constants with defines.
Simplify and name the clock multiplier constants.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h
index 7edd8093..8b9fbb12 100644
--- a/src/types.h
+++ b/src/types.h
@@ -70,6 +70,10 @@ union u64_u32_u {
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define DIV_ROUND_CLOSEST(x, divisor)({ \
+ typeof(divisor) __divisor = divisor; \
+ (((x) + ((__divisor) / 2)) / (__divisor)); \
+ })
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
#define ALIGN_DOWN(x,a) ((x) & ~((typeof(x))(a)-1))