Setting up repository
[linux-libre-firmware.git] / b43-tools / assembler / util.h
1 #ifndef BCM43xx_ASM_UTIL_H_
2 #define BCM43xx_ASM_UTIL_H_
3
4 #include <stdlib.h>
5 #include <stdint.h>
6
7
8 #define ARRAY_SIZE(x)   (sizeof(x)/sizeof(x[0]))
9
10 #undef min
11 #undef max
12 #define min(x,y)        ((x) < (y) ? (x) : (y))
13 #define max(x,y)        ((x) > (y) ? (x) : (y))
14
15
16 void dump(const char *data,
17           size_t size,
18           const char *description);
19
20
21 void * xmalloc(size_t size);
22 char * xstrdup(const char *str);
23
24
25 typedef _Bool bool;
26
27 typedef uint16_t be16_t;
28 typedef uint32_t be32_t;
29
30 be16_t cpu_to_be16(uint16_t x);
31 be32_t cpu_to_be32(uint32_t x);
32
33 #endif /* BCM43xx_ASM_UTIL_H_ */