1 /*
2  * Copyright (C) 2018-2022 Intel Corporation.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef TYPES_H
8 #define TYPES_H
9 
10 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
11 #define __aligned(x)		__attribute__((aligned(x)))
12 #define __packed	__attribute__((packed))
13 #define	__unused	__attribute__((unused))
14 
15 #ifndef ASSEMBLER
16 
17 /* Define standard data types.  These definitions allow software components
18  * to perform in the same manner on different target platforms.
19  */
20 typedef signed char int8_t;
21 typedef unsigned char uint8_t;
22 typedef signed short int16_t;
23 typedef unsigned short uint16_t;
24 typedef signed int int32_t;
25 typedef unsigned int uint32_t;
26 typedef unsigned long uint64_t;
27 typedef signed long int64_t;
28 typedef unsigned int size_t;
29 typedef __builtin_va_list va_list;
30 
31 typedef _Bool bool;
32 
33 #ifndef NULL
34 #define         NULL                                ((void *) 0)
35 #endif
36 
37 #ifndef true
38 #define true		((_Bool) 1)
39 #define false		((_Bool) 0)
40 #endif
41 
42 #ifndef UINT64_MAX
43 #define UINT64_MAX	(0xffffffffffffffffUL)
44 #endif
45 
46 #ifndef UINT32_MAX
47 #define UINT32_MAX	(0xffffffffU)
48 #endif
49 
50 #endif /* ASSEMBLER */
51 
52 #endif /* INCLUDE_TYPES_H defined */
53