diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-09-27 20:07:40 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-09-27 20:07:40 -0400 |
commit | 6aee52dd45843bbc884692a34c3a6b4e3eb392e8 (patch) | |
tree | 5cf6c7dcb3e77d2aa8ce9241bacae3b7b239ff5f /src/types.h | |
parent | f8e800dea4aad59c83254bddd8e9ccfcd3b45774 (diff) | |
download | seabios-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.h | 4 |
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)) |