Sun Apr 7 04:11:56 2019 UTC ()
Fix ARM_ARCH_* brain fart.


(thorpej)
diff -r1.5 -r1.6 src/sys/arch/arm/arm/fusu.S

cvs diff -r1.5 -r1.6 src/sys/arch/arm/arm/fusu.S (expand / switch to unified diff)

--- src/sys/arch/arm/arm/fusu.S 2019/04/06 03:06:24 1.5
+++ src/sys/arch/arm/arm/fusu.S 2019/04/07 04:11:56 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fusu.S,v 1.5 2019/04/06 03:06:24 thorpej Exp $ */ 1/* $NetBSD: fusu.S,v 1.6 2019/04/07 04:11:56 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2019 The NetBSD Foundation, Inc. 4 * Copyright (c) 2019 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
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.
@@ -89,121 +89,118 @@ @@ -89,121 +89,118 @@
89 89
90/* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */ 90/* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
91 91
92ENTRY(_ufetch_8) 92ENTRY(_ufetch_8)
93 UFETCHSTORE_PROLOGUE 93 UFETCHSTORE_PROLOGUE
94 94
95 ldrbt r3, [r0] 95 ldrbt r3, [r0]
96 strb r3, [r1] 96 strb r3, [r1]
97 97
98 UFETCHSTORE_EPILOGUE 98 UFETCHSTORE_EPILOGUE
99 RETURN_SUCCESS 99 RETURN_SUCCESS
100END(_ufetch_8) 100END(_ufetch_8)
101 101
102#if (ARM_ARCH_2 + ARM_ARCH_3) > 0 102#if (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0
103/* LINTSTUB: int _ufetch_16_armv2(const uint16_t *uaddr, uint16_t *valp); */ 103/* LINTSTUB: int _ufetch_16_armv2(const uint16_t *uaddr, uint16_t *valp); */
104ENTRY(_ufetch_16_armv2) 104ENTRY(_ufetch_16_armv2)
105 UFETCHSTORE_PROLOGUE 105 UFETCHSTORE_PROLOGUE
106 106
107 ldrbt r3, [r0], #1 107 ldrbt r3, [r0], #1
108 strb r3, [r1], #1 108 strb r3, [r1], #1
109 109
110 ldrbt r3, [r0] 110 ldrbt r3, [r0]
111 strb r3, [r1] 111 strb r3, [r1]
112 112
113 UFETCHSTORE_EPILOGUE 113 UFETCHSTORE_EPILOGUE
114 RETURN_SUCCESS 114 RETURN_SUCCESS
115END(_ufetch_16_armv2) 115END(_ufetch_16_armv2)
116 116
 117/* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
 118STRONG_ALIAS(_ufetch_16,_ufetch_16_armv2)
 119
117#else /* XXX */ 120#else /* XXX */
118 121
119/* LINTSTUB: int _ufetch_16_armv4(const uint16_t *uaddr, uint16_t *valp); */ 122/* LINTSTUB: int _ufetch_16_armv6(const uint16_t *uaddr, uint16_t *valp); */
120ENTRY(_ufetch_16_armv4) 123ENTRY(_ufetch_16_armv6)
121 UFETCHSTORE_PROLOGUE 124 UFETCHSTORE_PROLOGUE
122 125
123 ldrht r3, [r0] 126 ldrht r3, [r0]
124 strh r3, [r1] 127 strh r3, [r1]
125 128
126 UFETCHSTORE_EPILOGUE 129 UFETCHSTORE_EPILOGUE
127 RETURN_SUCCESS 130 RETURN_SUCCESS
128END(_ufetch_16_armv4) 131END(_ufetch_16_armv6)
129#endif /* (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 + ARM_ARCH_7) > 0 */ 
130 132
131/* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */ 133/* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
132#if (ARM_ARCH_2 + ARM_ARCH_3) > 0 134STRONG_ALIAS(_ufetch_16,_ufetch_16_armv6)
133STRONG_ALIAS(_ufetch_16,_ufetch_16_armv2) 135#endif /* (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0 */
134#else 
135STRONG_ALIAS(_ufetch_16,_ufetch_16_armv4) 
136#endif /* #if (ARM_ARCH_2 + ARM_ARCH_3) > 0 */ 
137 136
138/* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */ 137/* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
139ENTRY(_ufetch_32) 138ENTRY(_ufetch_32)
140 UFETCHSTORE_PROLOGUE 139 UFETCHSTORE_PROLOGUE
141 140
142 ldrt r3, [r0] 141 ldrt r3, [r0]
143 str r3, [r1] 142 str r3, [r1]
144 143
145 UFETCHSTORE_EPILOGUE 144 UFETCHSTORE_EPILOGUE
146 RETURN_SUCCESS 145 RETURN_SUCCESS
147END(_ufetch_32) 146END(_ufetch_32)
148 147
149/* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */ 148/* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
150ENTRY(_ustore_8) 149ENTRY(_ustore_8)
151 UFETCHSTORE_PROLOGUE 150 UFETCHSTORE_PROLOGUE
152 151
153 strbt r1, [r0] 152 strbt r1, [r0]
154 153
155 UFETCHSTORE_EPILOGUE 154 UFETCHSTORE_EPILOGUE
156 RETURN_SUCCESS 155 RETURN_SUCCESS
157END(_ustore_8) 156END(_ustore_8)
158 157
159#if (ARM_ARCH_2 + ARM_ARCH_3) > 0 158#if (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0
160/* LINTSTUB: int _ustore_16_armv2(uint16_t *uaddr, uint16_t val); */ 159/* LINTSTUB: int _ustore_16_armv2(uint16_t *uaddr, uint16_t val); */
161ENTRY(_ustore_16_armv2) 160ENTRY(_ustore_16_armv2)
162 UFETCHSTORE_PROLOGUE 161 UFETCHSTORE_PROLOGUE
163 162
164#ifdef __ARMEB__ 163#ifdef __ARMEB__
165 mov r3, r1, lsr #8 164 mov r3, r1, lsr #8
166 strbt r3, [r0], #1 165 strbt r3, [r0], #1
167#else 166#else
168 strbt r1, [r0], #1 167 strbt r1, [r0], #1
169 mov r1, r1, lsr #8 168 mov r1, r1, lsr #8
170#endif 169#endif
171 strbt r1, [r0] 170 strbt r1, [r0]
172 171
173 UFETCHSTORE_EPILOGUE 172 UFETCHSTORE_EPILOGUE
174 RETURN_SUCCESS 173 RETURN_SUCCESS
175END(_ustore_16_armv2) 174END(_ustore_16_armv2)
176 175
 176/* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
 177STRONG_ALIAS(_ustore_16,_ustore_16_armv2)
 178
177#else /* XXX */ 179#else /* XXX */
178 180
179/* LINTSTUB: int _ustore_16_armv4(uint16_t *uaddr, uint16_t val); */ 181/* LINTSTUB: int _ustore_16_armv4(uint16_t *uaddr, uint16_t val); */
180ENTRY(_ustore_16_armv4) 182ENTRY(_ustore_16_armv6)
181 UFETCHSTORE_PROLOGUE 183 UFETCHSTORE_PROLOGUE
182 184
183 strht r1, [r0] 185 strht r1, [r0]
184 186
185 UFETCHSTORE_EPILOGUE 187 UFETCHSTORE_EPILOGUE
186 RETURN_SUCCESS 188 RETURN_SUCCESS
187END(_ustore_16_armv4) 189END(_ustore_16_armv6)
188#endif /* (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 + ARM_ARCH_7) > 0 */ 
189 190
190/* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */ 191/* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
191/* XXXJRT Run-time upgrade to armv4 version would be nice. */ 192STRONG_ALIAS(_ustore_16,_ustore_16_armv6)
192#if (ARM_ARCH_2 + ARM_ARCH_3) > 0 193#endif /* (ARM_ARCH_2 + ARM_ARCH_3 + ARM_ARCH_4 + ARM_ARCH_5) > 0 */
193STRONG_ALIAS(_ustore_16,_ustore_16_armv2) 
194#else 
195STRONG_ALIAS(_ustore_16,_ustore_16_armv4) 
196#endif /* #if (ARM_ARCH_2 + ARM_ARCH_3) > 0 */ 
197 194
198/* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */ 195/* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */
199ENTRY(_ustore_32) 196ENTRY(_ustore_32)
200 UFETCHSTORE_PROLOGUE 197 UFETCHSTORE_PROLOGUE
201 198
202 strt r1, [r0] 199 strt r1, [r0]
203 200
204 UFETCHSTORE_EPILOGUE 201 UFETCHSTORE_EPILOGUE
205 RETURN_SUCCESS 202 RETURN_SUCCESS
206END(_ustore_32) 203END(_ustore_32)
207 204
208ENTRY_NP(ufetchstore_fault) 205ENTRY_NP(ufetchstore_fault)
209 UFETCHSTORE_EPILOGUE 206 UFETCHSTORE_EPILOGUE