Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / powerpc / boot / types.h
blob8a4c418b7260179c98dcd66444108a938a3b513d
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TYPES_H_
3 #define _TYPES_H_
5 #include <stdbool.h>
7 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
9 typedef unsigned char u8;
10 typedef unsigned short u16;
11 typedef unsigned int u32;
12 typedef unsigned long long u64;
13 typedef signed char s8;
14 typedef short s16;
15 typedef int s32;
16 typedef long long s64;
18 /* required for opal-api.h */
19 typedef u8 uint8_t;
20 typedef u16 uint16_t;
21 typedef u32 uint32_t;
22 typedef u64 uint64_t;
23 typedef s8 int8_t;
24 typedef s16 int16_t;
25 typedef s32 int32_t;
26 typedef s64 int64_t;
28 #define min(x,y) ({ \
29 typeof(x) _x = (x); \
30 typeof(y) _y = (y); \
31 (void) (&_x == &_y); \
32 _x < _y ? _x : _y; })
34 #define max(x,y) ({ \
35 typeof(x) _x = (x); \
36 typeof(y) _y = (y); \
37 (void) (&_x == &_y); \
38 _x > _y ? _x : _y; })
40 #define min_t(type, a, b) min(((type) a), ((type) b))
41 #define max_t(type, a, b) max(((type) a), ((type) b))
43 typedef int bool;
45 #ifndef true
46 #define true 1
47 #endif
49 #ifndef false
50 #define false 0
51 #endif
52 #endif /* _TYPES_H_ */