xref: /nrf52832-nimble/rt-thread/libcpu/mips/common/mips_types.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2  * File      : mips_types.h
3  * This file is part of RT-Thread RTOS
4  * COPYRIGHT (C) 2008 - 2012, RT-Thread Development Team
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License along
17  *  with this program; if not, write to the Free Software Foundation, Inc.,
18  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  * Change Logs:
21  * Date           Author       Notes
22  * 2016��9��7��     Urey         the first version
23  */
24 
25 #ifndef _MIPS_TYPES_H_
26 #define _MIPS_TYPES_H_
27 
28 #ifndef __ASSEMBLY__
29 
30 typedef unsigned short umode_t;
31 
32 /*
33  * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
34  * header files exported to user space
35  */
36 
37 typedef __signed__ char     __s8;
38 typedef unsigned char       __u8;
39 
40 typedef __signed__ short    __s16;
41 typedef unsigned short      __u16;
42 
43 typedef __signed__ int      __s32;
44 typedef unsigned int        __u32;
45 
46 #if (_MIPS_SZLONG == 64)
47 
48 typedef __signed__ long     __s64;
49 typedef unsigned long       __u64;
50 
51 #else
52 
53 #if defined(__GNUC__)
54 __extension__ typedef __signed__ long long __s64;
55 __extension__ typedef unsigned long long __u64;
56 #endif
57 
58 #endif
59 
60 /*
61  * These aren't exported outside the kernel to avoid name space clashes
62  */
63 
64 #define BITS_PER_LONG _MIPS_SZLONG
65 
66 
67 typedef __signed char s8;
68 typedef unsigned char u8;
69 
70 typedef __signed short s16;
71 typedef unsigned short u16;
72 
73 typedef __signed int s32;
74 typedef unsigned int u32;
75 
76 #if (_MIPS_SZLONG == 64)
77 
78 typedef __signed__ long s64;
79 typedef unsigned long u64;
80 
81 #else
82 
83 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
84 typedef __signed__ long long s64;
85 typedef unsigned long long u64;
86 #endif
87 
88 #endif
89 
90 #if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
91     || defined(CONFIG_64BIT)
92 typedef u64 dma_addr_t;
93 
94 typedef u64 phys_addr_t;
95 typedef u64 phys_size_t;
96 
97 #else
98 typedef u32 dma_addr_t;
99 
100 typedef u32 phys_addr_t;
101 typedef u32 phys_size_t;
102 
103 #endif
104 typedef u64 dma64_addr_t;
105 
106 /*
107  * Don't use phys_t.  You've been warned.
108  */
109 #ifdef CONFIG_64BIT_PHYS_ADDR
110 typedef unsigned long long phys_t;
111 #else
112 typedef unsigned long phys_t;
113 #endif
114 
115 #endif /* __ASSEMBLY__ */
116 
117 
118 #endif /* _MIPS_TYPES_H_ */
119