xref: /openbmc/u-boot/arch/sandbox/include/asm/types.h (revision 78a88f79)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2011 The Chromium OS Authors.
4  */
5 
6 #ifndef __ASM_SANDBOX_TYPES_H
7 #define __ASM_SANDBOX_TYPES_H
8 
9 typedef unsigned short umode_t;
10 
11 /*
12  * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
13  * header files exported to user space
14  */
15 
16 typedef __signed__ char __s8;
17 typedef unsigned char __u8;
18 
19 typedef __signed__ short __s16;
20 typedef unsigned short __u16;
21 
22 typedef __signed__ int __s32;
23 typedef unsigned int __u32;
24 
25 #if defined(__GNUC__)
26 __extension__ typedef __signed__ long long __s64;
27 __extension__ typedef unsigned long long __u64;
28 #endif
29 
30 /*
31  * These aren't exported outside the kernel to avoid name space clashes
32  */
33 #ifdef __KERNEL__
34 
35 typedef signed char s8;
36 typedef unsigned char u8;
37 
38 typedef signed short s16;
39 typedef unsigned short u16;
40 
41 typedef signed int s32;
42 typedef unsigned int u32;
43 
44 #if !defined(CONFIG_USE_STDINT) || !defined(__INT64_TYPE__)
45 typedef signed long long s64;
46 typedef unsigned long long u64;
47 #else
48 typedef __INT64_TYPE__ s64;
49 typedef __UINT64_TYPE__ u64;
50 #endif
51 
52 /*
53  * Number of bits in a C 'long' on this architecture.
54  */
55 #ifdef	CONFIG_PHYS64
56 #define BITS_PER_LONG 64
57 #else	/* CONFIG_PHYS64 */
58 #define BITS_PER_LONG 32
59 #endif	/* CONFIG_PHYS64 */
60 
61 #ifdef	CONFIG_PHYS64
62 typedef unsigned long long dma_addr_t;
63 typedef u64 phys_addr_t;
64 typedef u64 phys_size_t;
65 #else	/* CONFIG_PHYS64 */
66 typedef unsigned long dma_addr_t;
67 typedef u32 phys_addr_t;
68 typedef u32 phys_size_t;
69 #endif	/* CONFIG_PHYS64 */
70 
71 #endif /* __KERNEL__ */
72 
73 #endif
74