From c804e50047e960fdcd92a82a5b6b9cec686681c8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 17 Oct 2013 10:31:30 +0200 Subject: Update from latest FreeBSD version --- rtemsbsd/include/rtems/bsd/sys/param.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rtemsbsd/include/rtems/bsd/sys') diff --git a/rtemsbsd/include/rtems/bsd/sys/param.h b/rtemsbsd/include/rtems/bsd/sys/param.h index 93e2ef44..1479d8e3 100644 --- a/rtemsbsd/include/rtems/bsd/sys/param.h +++ b/rtemsbsd/include/rtems/bsd/sys/param.h @@ -269,7 +269,9 @@ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #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) -- cgit v1.2.3