| @@ -1,173 +1,172 @@ | | | @@ -1,173 +1,172 @@ |
1 | /* $NetBSD: types.h,v 1.65 2017/01/26 15:55:10 christos Exp $ */ | | 1 | /* $NetBSD: types.h,v 1.66 2017/01/27 17:22:16 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1992, 1993 | | 4 | * Copyright (c) 1992, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to Berkeley by | | 7 | * This code is derived from software contributed to Berkeley by |
8 | * Ralph Campbell. | | 8 | * Ralph Campbell. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
15 | * 2. Redistributions in binary form must reproduce the above copyright | | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
16 | * notice, this list of conditions and the following disclaimer in the | | 16 | * notice, this list of conditions and the following disclaimer in the |
17 | * documentation and/or other materials provided with the distribution. | | 17 | * documentation and/or other materials provided with the distribution. |
18 | * 3. Neither the name of the University nor the names of its contributors | | 18 | * 3. Neither the name of the University nor the names of its contributors |
19 | * may be used to endorse or promote products derived from this software | | 19 | * may be used to endorse or promote products derived from this software |
20 | * without specific prior written permission. | | 20 | * without specific prior written permission. |
21 | * | | 21 | * |
22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | | 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | * SUCH DAMAGE. | | 32 | * SUCH DAMAGE. |
33 | * | | 33 | * |
34 | * @(#)types.h 8.3 (Berkeley) 1/5/94 | | 34 | * @(#)types.h 8.3 (Berkeley) 1/5/94 |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | #ifndef _MIPS_TYPES_H_ | | 37 | #ifndef _MIPS_TYPES_H_ |
38 | #define _MIPS_TYPES_H_ | | 38 | #define _MIPS_TYPES_H_ |
39 | | | 39 | |
40 | #include <sys/cdefs.h> | | 40 | #include <sys/cdefs.h> |
41 | #include <sys/featuretest.h> | | 41 | #include <sys/featuretest.h> |
42 | #include <mips/int_types.h> | | 42 | #include <mips/int_types.h> |
43 | | | 43 | |
44 | typedef unsigned int __cpu_simple_lock_nv_t; | | 44 | typedef unsigned int __cpu_simple_lock_nv_t; |
45 | #if defined(__mips_o32) | | 45 | #if defined(__mips_o32) |
46 | typedef __int32_t __register_t; | | 46 | typedef __int32_t __register_t; |
47 | #else | | 47 | #else |
48 | typedef __int64_t __register_t; | | 48 | typedef __int64_t __register_t; |
49 | #endif | | 49 | #endif |
50 | #if defined(__mips_o64) || defined(__mips_o32) | | 50 | #if defined(__mips_o64) || defined(__mips_o32) |
51 | typedef __uint32_t __fpregister_t; | | 51 | typedef __uint32_t __fpregister_t; |
52 | #else | | 52 | #else |
53 | typedef __uint64_t __fpregister_t; | | 53 | typedef __uint64_t __fpregister_t; |
54 | #endif | | 54 | #endif |
55 | | | 55 | |
56 | /* | | 56 | /* |
57 | * Note that mips_reg_t is distinct from the register_t defined | | 57 | * Note that mips_reg_t is distinct from the register_t defined |
58 | * in <types.h> to allow these structures to be as hidden from | | 58 | * in <types.h> to allow these structures to be as hidden from |
59 | * the rest of the operating system as possible. | | 59 | * the rest of the operating system as possible. |
60 | */ | | 60 | */ |
61 | | | 61 | |
62 | | | 62 | |
63 | #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) || defined(_STANDALONE) | | 63 | #if defined(_KERNEL) || defined(_KMEMUSER) || defined(_KERNTYPES) || defined(_STANDALONE) |
64 | #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64) | | 64 | #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64) |
65 | typedef __uint64_t paddr_t; | | 65 | typedef __uint64_t paddr_t; |
66 | typedef __uint64_t psize_t; | | 66 | typedef __uint64_t psize_t; |
67 | #define PRIxPADDR PRIx64 | | 67 | #define PRIxPADDR PRIx64 |
68 | #define PRIxPSIZE PRIx64 | | 68 | #define PRIxPSIZE PRIx64 |
69 | #define PRIdPSIZE PRId64 | | 69 | #define PRIdPSIZE PRId64 |
70 | #else | | 70 | #else |
71 | typedef __uint32_t paddr_t; | | 71 | typedef __uint32_t paddr_t; |
72 | typedef __uint32_t psize_t; | | 72 | typedef __uint32_t psize_t; |
73 | #define PRIxPADDR PRIx32 | | 73 | #define PRIxPADDR PRIx32 |
74 | #define PRIxPSIZE PRIx32 | | 74 | #define PRIxPSIZE PRIx32 |
75 | #define PRIdPSIZE PRId32 | | 75 | #define PRIdPSIZE PRId32 |
76 | #endif | | 76 | #endif |
77 | #ifdef _LP64 | | 77 | #ifdef _LP64 |
78 | typedef __uint64_t vaddr_t; | | 78 | typedef __uint64_t vaddr_t; |
79 | typedef __uint64_t vsize_t; | | 79 | typedef __uint64_t vsize_t; |
80 | #define PRIxVADDR PRIx64 | | 80 | #define PRIxVADDR PRIx64 |
81 | #define PRIxVSIZE PRIx64 | | 81 | #define PRIxVSIZE PRIx64 |
82 | #define PRIdVSIZE PRId64 | | 82 | #define PRIdVSIZE PRId64 |
83 | #else | | 83 | #else |
84 | typedef __uint32_t vaddr_t; | | 84 | typedef __uint32_t vaddr_t; |
85 | typedef __uint32_t vsize_t; | | 85 | typedef __uint32_t vsize_t; |
86 | #define PRIxVADDR PRIx32 | | 86 | #define PRIxVADDR PRIx32 |
87 | #define PRIxVSIZE PRIx32 | | 87 | #define PRIxVSIZE PRIx32 |
88 | #define PRIdVSIZE PRId32 | | 88 | #define PRIdVSIZE PRId32 |
89 | #endif | | 89 | #endif |
90 | | | 90 | |
91 | | | 91 | |
92 | typedef int mips_prid_t; | | 92 | typedef int mips_prid_t; |
93 | /* Make sure this is signed; we need pointers to be sign-extended. */ | | 93 | /* Make sure this is signed; we need pointers to be sign-extended. */ |
94 | typedef __fpregister_t fpregister_t; | | 94 | typedef __fpregister_t fpregister_t; |
95 | typedef __fpregister_t mips_fpreg_t; /* do not use */ | | 95 | typedef __fpregister_t mips_fpreg_t; /* do not use */ |
96 | typedef __register_t register_t; | | 96 | typedef __register_t register_t; |
97 | typedef __register_t mips_reg_t; | | 97 | typedef __register_t mips_reg_t; |
98 | | | 98 | |
99 | #if defined(__mips_o32) | | 99 | #if defined(__mips_o32) |
100 | typedef __uint32_t uregister_t; | | 100 | typedef __uint32_t uregister_t; |
101 | typedef __uint32_t mips_ureg_t; /* do not use */ | | 101 | typedef __uint32_t mips_ureg_t; /* do not use */ |
102 | #define PRIxREGISTER PRIx32 | | 102 | #define PRIxREGISTER PRIx32 |
103 | #define PRIxUREGISTER PRIx32 | | 103 | #define PRIxUREGISTER PRIx32 |
104 | #else | | 104 | #else |
105 | typedef __uint64_t uregister_t; | | 105 | typedef __uint64_t uregister_t; |
106 | typedef __uint64_t mips_ureg_t; /* do not use */ | | 106 | typedef __uint64_t mips_ureg_t; /* do not use */ |
107 | typedef __int64_t register32_t; | | 107 | typedef __int64_t register32_t; |
108 | typedef __uint64_t uregister32_t; | | 108 | typedef __uint64_t uregister32_t; |
109 | #define PRIxREGISTER PRIx64 | | 109 | #define PRIxREGISTER PRIx64 |
110 | #define PRIxUREGISTER PRIx64 | | 110 | #define PRIxUREGISTER PRIx64 |
111 | #endif /* __mips_o32 */ | | 111 | #endif /* __mips_o32 */ |
112 | | | 112 | |
113 | typedef struct label_t { | | 113 | typedef struct label_t { |
114 | register_t val[14]; | | 114 | register_t val[14]; |
115 | } label_t; | | 115 | } label_t; |
116 | #define _L_S0 0 | | 116 | #define _L_S0 0 |
117 | #define _L_S1 1 | | 117 | #define _L_S1 1 |
118 | #define _L_S2 2 | | 118 | #define _L_S2 2 |
119 | #define _L_S3 3 | | 119 | #define _L_S3 3 |
120 | #define _L_S4 4 | | 120 | #define _L_S4 4 |
121 | #define _L_S5 5 | | 121 | #define _L_S5 5 |
122 | #define _L_S6 6 | | 122 | #define _L_S6 6 |
123 | #define _L_S7 7 | | 123 | #define _L_S7 7 |
124 | #define _L_T8 8 | | 124 | #define _L_T8 8 |
125 | #define _L_GP 9 | | 125 | #define _L_GP 9 |
126 | #define _L_SP 10 | | 126 | #define _L_SP 10 |
127 | #define _L_S8 11 | | 127 | #define _L_S8 11 |
128 | #define _L_RA 12 | | 128 | #define _L_RA 12 |
129 | #define _L_SR 13 | | 129 | #define _L_SR 13 |
130 | | | 130 | |
131 | typedef __uint32_t tlb_asid_t; | | 131 | typedef __uint32_t tlb_asid_t; |
132 | #endif /* _KERNEL */ | | 132 | #endif /* _KERNEL */ |
133 | | | 133 | |
134 | #if defined(_KERNEL) || defined(_KMEMUSER) | | 134 | #if defined(_KERNEL) || defined(_KMEMUSER) |
135 | #define PCU_FPU 0 | | 135 | #define PCU_FPU 0 |
136 | #define PCU_DSP 1 | | 136 | #define PCU_DSP 1 |
137 | #define PCU_UNIT_COUNT 2 | | 137 | #define PCU_UNIT_COUNT 2 |
138 | #endif | | 138 | #endif |
139 | | | 139 | |
140 | | | 140 | |
141 | #define __SIMPLELOCK_LOCKED 1 | | 141 | #define __SIMPLELOCK_LOCKED 1 |
142 | #define __SIMPLELOCK_UNLOCKED 0 | | 142 | #define __SIMPLELOCK_UNLOCKED 0 |
143 | | | 143 | |
144 | #define __HAVE_FAST_SOFTINTS | | 144 | #define __HAVE_FAST_SOFTINTS |
145 | #define __HAVE_AST_PERPROC | | 145 | #define __HAVE_AST_PERPROC |
146 | #define __HAVE_SYSCALL_INTERN | | 146 | #define __HAVE_SYSCALL_INTERN |
147 | #define __HAVE_CPU_LWP_SETPRIVATE | | 147 | #define __HAVE_CPU_LWP_SETPRIVATE |
148 | #define __HAVE_CPU_DATA_FIRST | | 148 | #define __HAVE_CPU_DATA_FIRST |
149 | #define __HAVE_MD_CPU_OFFLINE | | 149 | #define __HAVE_MD_CPU_OFFLINE |
150 | #define __HAVE_CPU_COUNTER | | 150 | #define __HAVE_CPU_COUNTER |
151 | #define __HAVE_CPU_UAREA_ROUTINES | | 151 | #define __HAVE_CPU_UAREA_ROUTINES |
152 | #define __HAVE_COMMON___TLS_GET_ADDR | | 152 | #define __HAVE_COMMON___TLS_GET_ADDR |
153 | #define __HAVE___LWP_GETTCB_FAST | | 153 | #define __HAVE___LWP_GETTCB_FAST |
154 | #define __HAVE___LWP_SETTCB | | 154 | #define __HAVE___LWP_SETTCB |
155 | #define __HAVE_TLS_VARIANT_I | | 155 | #define __HAVE_TLS_VARIANT_I |
156 | | | 156 | |
157 | #if !defined(__mips_o32) | | 157 | #if !defined(__mips_o32) |
158 | #define __HAVE_ATOMIC64_OPS | | 158 | #define __HAVE_ATOMIC64_OPS |
159 | #endif | | 159 | #endif |
160 | | | 160 | |
161 | #if defined(_KERNEL) | | 161 | #if defined(_KERNEL) |
162 | #define __HAVE_RAS | | 162 | #define __HAVE_RAS |
163 | #if defined(_LP64) | | 163 | #if defined(_LP64) |
164 | #define __HAVE_CPU_VMSPACE_EXEC | | 164 | #define __HAVE_CPU_VMSPACE_EXEC |
165 | #endif | | 165 | #endif |
166 | #endif /* _KERNEL */ | | 166 | #endif /* _KERNEL */ |
167 | | | 167 | |
168 | #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS | | 168 | #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS |
169 | #define __HAVE_MM_MD_KERNACC | | 169 | #define __HAVE_MM_MD_KERNACC |
170 | #define __HAVE_MM_MD_CACHE_ALIASING | | 170 | #define __HAVE_MM_MD_CACHE_ALIASING |
171 | #define __HAVE_COMPAT_NETBSD32 | | | |
172 | | | 171 | |
173 | #endif /* _MIPS_TYPES_H_ */ | | 172 | #endif /* _MIPS_TYPES_H_ */ |