xref: /openbmc/u-boot/arch/mips/include/asm/types.h (revision ea743e65)
1 /*
2  * Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
3  * Copyright (C) 1999 Silicon Graphics, Inc.
4  *
5  * SPDX-License-Identifier:	GPL-2.0
6  */
7 #ifndef _ASM_TYPES_H
8 #define _ASM_TYPES_H
9 
10 #ifndef __ASSEMBLY__
11 
12 typedef unsigned short umode_t;
13 
14 /*
15  * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
16  * header files exported to user space
17  */
18 
19 typedef __signed__ char __s8;
20 typedef unsigned char __u8;
21 
22 typedef __signed__ short __s16;
23 typedef unsigned short __u16;
24 
25 typedef __signed__ int __s32;
26 typedef unsigned int __u32;
27 
28 #if defined(__GNUC__)
29 __extension__ typedef __signed__ long long __s64;
30 __extension__ typedef unsigned long long __u64;
31 #else
32 typedef __signed__ long long __s64;
33 typedef unsigned long long __u64;
34 #endif
35 
36 #endif /* __ASSEMBLY__ */
37 
38 /*
39  * These aren't exported outside the kernel to avoid name space clashes
40  */
41 #ifdef __KERNEL__
42 
43 #define BITS_PER_LONG _MIPS_SZLONG
44 
45 #ifndef __ASSEMBLY__
46 
47 typedef __signed char s8;
48 typedef unsigned char u8;
49 
50 typedef __signed short s16;
51 typedef unsigned short u16;
52 
53 typedef __signed int s32;
54 typedef unsigned int u32;
55 
56 typedef __signed__ long long s64;
57 typedef unsigned long long u64;
58 
59 #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
60     || defined(CONFIG_64BIT)
61 typedef u64 dma_addr_t;
62 
63 typedef u64 phys_addr_t;
64 typedef u64 phys_size_t;
65 
66 #else
67 typedef u32 dma_addr_t;
68 
69 typedef u32 phys_addr_t;
70 typedef u32 phys_size_t;
71 
72 #endif
73 typedef u64 dma64_addr_t;
74 
75 /*
76  * Don't use phys_t.  You've been warned.
77  */
78 #ifdef CONFIG_64BIT_PHYS_ADDR
79 typedef unsigned long long phys_t;
80 #else
81 typedef unsigned long phys_t;
82 #endif
83 
84 #endif /* __ASSEMBLY__ */
85 
86 #endif /* __KERNEL__ */
87 
88 #endif /* _ASM_TYPES_H */
89