Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
util.h
Go to the documentation of this file.
1 
4 #ifndef __UTIL_H__
5 #define __UTIL_H__
6 
7 #include <stdint.h>
8 
9 #define CEILING(x, y) (((x) + (y) -1) / (y))
10 
11 #define BITMAP_SIZE(x) CEILING(x, 32) /* Bitmap type should be uint32_t */
12 
13 #define ALIGN_MASK(x, mask) ((x) & ~(mask))
14 #define ALIGN(x, a) ALIGN_MASK(x, (__typeof__(x)) ((a) -1))
15 
16 #endif