1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2014, STMicroelectronics International N.V.
4  */
5 #ifndef __TYPES_EXT_H
6 #define __TYPES_EXT_H
7 
8 #include <limits.h>
9 #include <stddef.h>
10 #include <inttypes.h>
11 #include <stdbool.h>
12 #include <unistd.h>
13 
14 typedef uintptr_t uaddr_t;
15 #define PRIxUA	PRIxPTR
16 
17 typedef uintptr_t vaddr_t;
18 #define PRIxVA	PRIxPTR
19 
20 #if defined(__ILP32__) && defined(CFG_CORE_LARGE_PHYS_ADDR)
21 typedef uint64_t paddr_t;
22 typedef uint64_t paddr_size_t;
23 #define PRIxPA			PRIx64
24 #define PRIxPASZ		PRIx64
25 #define __SIZEOF_PADDR__	8
26 #else
27 typedef uintptr_t paddr_t;
28 typedef uintptr_t paddr_size_t;
29 #define PRIxPA			PRIxPTR
30 #define PRIxPASZ		PRIxPTR
31 #define __SIZEOF_PADDR__	__SIZEOF_POINTER__
32 #endif
33 
34 #define PRIxVA_WIDTH	((int)(sizeof(vaddr_t) * 2))
35 #define PRIxPA_WIDTH	((int)(sizeof(paddr_t) * 2))
36 
37 #endif /* __TYPES_EXT_H */
38