Add P2BOUNDARY macro

This commit is contained in:
Brian Behlendorf 2008-12-19 13:56:55 -08:00
parent 58bfe4e472
commit 545f76d526
1 changed files with 11 additions and 9 deletions

View File

@ -52,6 +52,8 @@
#define P2ROUNDUP(x, align) (-(-(x) & -(align)))
#define P2ROUNDUP_TYPED(x, align, type) \
(-(-(type)(x) & -(type)(align)))
#define P2BOUNDARY(off, len, align) \
(((off) ^ ((off) + (len) - 1)) > (align) - 1)
#define P2PHASE(x, align) ((x) & ((align) - 1))
#define P2NPHASE(x, align) (-(x) & ((align) - 1))
#define P2NPHASE_TYPED(x, align, type) \