From 160c63ab763f620592fbdc8271a3f7b66e080b74 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 6 Jan 2009 09:23:13 -0800 Subject: [PATCH] Add P2BOUNDARY macro --- include/sys/sysmacros.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 9507de0ac1..94ff3f84ed 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