summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/sys/param.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/param.h b/sys/sys/param.h
index b8ac444..d1bb660 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -275,6 +275,7 @@
#endif
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
#define rounddown(x, y) (((x)/(y))*(y))
+#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */
#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */
#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
#define powerof2(x) ((((x)-1)&(x))==0)
OpenPOWER on IntegriCloud