diff options
author | Brian Behlendorf <[email protected]> | 2009-05-20 12:23:24 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-05-20 12:23:24 -0700 |
commit | 3731931529df2bff63ca3d62e387d4e602de7cb2 (patch) | |
tree | 140e94cd307ff8c439e2c257762965bb90f6445c /include/sys/sysmacros.h | |
parent | fe4573928fc73590373a074ef9b068c6286d9a26 (diff) |
Powerpc Fixes (part 1):
- Enable builds for powerpc ISA type.
- Add DIV_ROUND_UP and roundup macros if unavailable.
- Cast 64-bit values for %lld format string to (long long) to
quiet compile warning.
Diffstat (limited to 'include/sys/sysmacros.h')
-rw-r--r-- | include/sys/sysmacros.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 923cc22e7..67afbfeb0 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -149,13 +149,19 @@ extern uint32_t zone_get_hostid(void *zone); /* common macros */ #ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef MAX -#define MAX(a, b) ((a) < (b) ? (b) : (a)) +#define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif #ifndef ABS -#define ABS(a) ((a) < 0 ? -(a) : (a)) +#define ABS(a) ((a) < 0 ? -(a) : (a)) +#endif +#ifndef DIV_ROUND_UP +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#endif +#ifndef roundup +#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif /* |