summaryrefslogtreecommitdiffstats
path: root/include/sys/sysmacros.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-01-06 09:23:13 -0800
committerBrian Behlendorf <[email protected]>2009-01-06 09:23:13 -0800
commit160c63ab763f620592fbdc8271a3f7b66e080b74 (patch)
tree0643a50021c91e5b65e4c4ba07fb264e3b3b6aec /include/sys/sysmacros.h
parent7adbea4141d9ac2df0a1fc622747090d6ea91c32 (diff)
Add P2BOUNDARY macro
Diffstat (limited to 'include/sys/sysmacros.h')
-rw-r--r--include/sys/sysmacros.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index 9507de0ac..94ff3f84e 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -165,6 +165,8 @@ extern int ddi_strtoul(const char *str, char **nptr,
(-(type)(x) & ((type)(align) - 1))
#define ISP2(x) (((x) & ((x) - 1)) == 0)
#define IS_P2ALIGNED(v, a) ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
+#define P2BOUNDARY(off, len, align) \
+ (((off) ^ ((off) + (len) - 1)) > (align) - 1)
/*
* Typed version of the P2* macros. These macros should be used to ensure