cpufunc.h revision 1.80 1 1.45 matt /* cpufunc.h,v 1.40.22.4 2007/11/08 10:59:33 matt Exp */
2 1.1 reinoud
3 1.1 reinoud /*
4 1.1 reinoud * Copyright (c) 1997 Mark Brinicombe.
5 1.1 reinoud * Copyright (c) 1997 Causality Limited
6 1.1 reinoud * All rights reserved.
7 1.1 reinoud *
8 1.1 reinoud * Redistribution and use in source and binary forms, with or without
9 1.1 reinoud * modification, are permitted provided that the following conditions
10 1.1 reinoud * are met:
11 1.1 reinoud * 1. Redistributions of source code must retain the above copyright
12 1.1 reinoud * notice, this list of conditions and the following disclaimer.
13 1.1 reinoud * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 reinoud * notice, this list of conditions and the following disclaimer in the
15 1.1 reinoud * documentation and/or other materials provided with the distribution.
16 1.1 reinoud * 3. All advertising materials mentioning features or use of this software
17 1.1 reinoud * must display the following acknowledgement:
18 1.1 reinoud * This product includes software developed by Causality Limited.
19 1.1 reinoud * 4. The name of Causality Limited may not be used to endorse or promote
20 1.1 reinoud * products derived from this software without specific prior written
21 1.1 reinoud * permission.
22 1.1 reinoud *
23 1.1 reinoud * THIS SOFTWARE IS PROVIDED BY CAUSALITY LIMITED ``AS IS'' AND ANY EXPRESS
24 1.1 reinoud * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 1.1 reinoud * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 1.1 reinoud * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED BE LIABLE FOR ANY DIRECT,
27 1.1 reinoud * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 1.1 reinoud * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 1.1 reinoud * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.1 reinoud * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.1 reinoud * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.1 reinoud * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.1 reinoud * SUCH DAMAGE.
34 1.1 reinoud *
35 1.1 reinoud * RiscBSD kernel project
36 1.1 reinoud *
37 1.1 reinoud * cpufunc.h
38 1.1 reinoud *
39 1.1 reinoud * Prototypes for cpu, mmu and tlb related functions.
40 1.1 reinoud */
41 1.1 reinoud
42 1.65 matt #ifndef _ARM_CPUFUNC_H_
43 1.65 matt #define _ARM_CPUFUNC_H_
44 1.1 reinoud
45 1.79 ryo #ifdef __arm__
46 1.79 ryo
47 1.21 thorpej #ifdef _KERNEL
48 1.21 thorpej
49 1.79 ryo #if !defined(_RUMPKERNEL)
50 1.79 ryo
51 1.1 reinoud #include <sys/types.h>
52 1.79 ryo
53 1.45 matt #include <arm/armreg.h>
54 1.21 thorpej #include <arm/cpuconf.h>
55 1.74 christos #include <arm/cpufunc_proto.h>
56 1.1 reinoud
57 1.1 reinoud struct cpu_functions {
58 1.1 reinoud
59 1.1 reinoud /* CPU functions */
60 1.32 uwe
61 1.39 bjh21 u_int (*cf_id) (void);
62 1.39 bjh21 void (*cf_cpwait) (void);
63 1.1 reinoud
64 1.1 reinoud /* MMU functions */
65 1.1 reinoud
66 1.39 bjh21 u_int (*cf_control) (u_int, u_int);
67 1.39 bjh21 void (*cf_domains) (u_int);
68 1.69 matt #if defined(ARM_MMU_EXTENDED)
69 1.69 matt void (*cf_setttb) (u_int, tlb_asid_t);
70 1.69 matt #else
71 1.60 matt void (*cf_setttb) (u_int, bool);
72 1.69 matt #endif
73 1.39 bjh21 u_int (*cf_faultstatus) (void);
74 1.39 bjh21 u_int (*cf_faultaddress) (void);
75 1.1 reinoud
76 1.1 reinoud /* TLB functions */
77 1.1 reinoud
78 1.39 bjh21 void (*cf_tlb_flushID) (void);
79 1.66 matt void (*cf_tlb_flushID_SE) (vaddr_t);
80 1.39 bjh21 void (*cf_tlb_flushI) (void);
81 1.66 matt void (*cf_tlb_flushI_SE) (vaddr_t);
82 1.39 bjh21 void (*cf_tlb_flushD) (void);
83 1.66 matt void (*cf_tlb_flushD_SE) (vaddr_t);
84 1.1 reinoud
85 1.17 thorpej /*
86 1.17 thorpej * Cache operations:
87 1.17 thorpej *
88 1.17 thorpej * We define the following primitives:
89 1.17 thorpej *
90 1.17 thorpej * icache_sync_all Synchronize I-cache
91 1.17 thorpej * icache_sync_range Synchronize I-cache range
92 1.17 thorpej *
93 1.17 thorpej * dcache_wbinv_all Write-back and Invalidate D-cache
94 1.17 thorpej * dcache_wbinv_range Write-back and Invalidate D-cache range
95 1.17 thorpej * dcache_inv_range Invalidate D-cache range
96 1.17 thorpej * dcache_wb_range Write-back D-cache range
97 1.17 thorpej *
98 1.17 thorpej * idcache_wbinv_all Write-back and Invalidate D-cache,
99 1.17 thorpej * Invalidate I-cache
100 1.17 thorpej * idcache_wbinv_range Write-back and Invalidate D-cache,
101 1.17 thorpej * Invalidate I-cache range
102 1.17 thorpej *
103 1.17 thorpej * Note that the ARM term for "write-back" is "clean". We use
104 1.17 thorpej * the term "write-back" since it's a more common way to describe
105 1.17 thorpej * the operation.
106 1.17 thorpej *
107 1.17 thorpej * There are some rules that must be followed:
108 1.17 thorpej *
109 1.17 thorpej * I-cache Synch (all or range):
110 1.17 thorpej * The goal is to synchronize the instruction stream,
111 1.17 thorpej * so you may beed to write-back dirty D-cache blocks
112 1.17 thorpej * first. If a range is requested, and you can't
113 1.17 thorpej * synchronize just a range, you have to hit the whole
114 1.17 thorpej * thing.
115 1.17 thorpej *
116 1.17 thorpej * D-cache Write-Back and Invalidate range:
117 1.17 thorpej * If you can't WB-Inv a range, you must WB-Inv the
118 1.17 thorpej * entire D-cache.
119 1.17 thorpej *
120 1.17 thorpej * D-cache Invalidate:
121 1.17 thorpej * If you can't Inv the D-cache, you must Write-Back
122 1.17 thorpej * and Invalidate. Code that uses this operation
123 1.17 thorpej * MUST NOT assume that the D-cache will not be written
124 1.17 thorpej * back to memory.
125 1.17 thorpej *
126 1.17 thorpej * D-cache Write-Back:
127 1.17 thorpej * If you can't Write-back without doing an Inv,
128 1.17 thorpej * that's fine. Then treat this as a WB-Inv.
129 1.17 thorpej * Skipping the invalidate is merely an optimization.
130 1.17 thorpej *
131 1.17 thorpej * All operations:
132 1.17 thorpej * Valid virtual addresses must be passed to each
133 1.17 thorpej * cache operation.
134 1.17 thorpej */
135 1.39 bjh21 void (*cf_icache_sync_all) (void);
136 1.39 bjh21 void (*cf_icache_sync_range) (vaddr_t, vsize_t);
137 1.17 thorpej
138 1.39 bjh21 void (*cf_dcache_wbinv_all) (void);
139 1.39 bjh21 void (*cf_dcache_wbinv_range)(vaddr_t, vsize_t);
140 1.39 bjh21 void (*cf_dcache_inv_range) (vaddr_t, vsize_t);
141 1.39 bjh21 void (*cf_dcache_wb_range) (vaddr_t, vsize_t);
142 1.1 reinoud
143 1.59 matt void (*cf_sdcache_wbinv_range)(vaddr_t, paddr_t, psize_t);
144 1.59 matt void (*cf_sdcache_inv_range) (vaddr_t, paddr_t, psize_t);
145 1.59 matt void (*cf_sdcache_wb_range) (vaddr_t, paddr_t, psize_t);
146 1.59 matt
147 1.39 bjh21 void (*cf_idcache_wbinv_all) (void);
148 1.39 bjh21 void (*cf_idcache_wbinv_range)(vaddr_t, vsize_t);
149 1.1 reinoud
150 1.1 reinoud /* Other functions */
151 1.1 reinoud
152 1.39 bjh21 void (*cf_flush_prefetchbuf) (void);
153 1.39 bjh21 void (*cf_drain_writebuf) (void);
154 1.39 bjh21 void (*cf_flush_brnchtgt_C) (void);
155 1.39 bjh21 void (*cf_flush_brnchtgt_E) (u_int);
156 1.1 reinoud
157 1.39 bjh21 void (*cf_sleep) (int mode);
158 1.1 reinoud
159 1.1 reinoud /* Soft functions */
160 1.1 reinoud
161 1.39 bjh21 int (*cf_dataabt_fixup) (void *);
162 1.39 bjh21 int (*cf_prefetchabt_fixup) (void *);
163 1.1 reinoud
164 1.69 matt #if defined(ARM_MMU_EXTENDED)
165 1.69 matt void (*cf_context_switch) (u_int, tlb_asid_t);
166 1.69 matt #else
167 1.41 scw void (*cf_context_switch) (u_int);
168 1.69 matt #endif
169 1.1 reinoud
170 1.39 bjh21 void (*cf_setup) (char *);
171 1.1 reinoud };
172 1.1 reinoud
173 1.1 reinoud extern struct cpu_functions cpufuncs;
174 1.1 reinoud extern u_int cputype;
175 1.1 reinoud
176 1.76 christos #define cpu_idnum() cpufuncs.cf_id()
177 1.1 reinoud
178 1.1 reinoud #define cpu_control(c, e) cpufuncs.cf_control(c, e)
179 1.1 reinoud #define cpu_domains(d) cpufuncs.cf_domains(d)
180 1.60 matt #define cpu_setttb(t, f) cpufuncs.cf_setttb(t, f)
181 1.1 reinoud #define cpu_faultstatus() cpufuncs.cf_faultstatus()
182 1.1 reinoud #define cpu_faultaddress() cpufuncs.cf_faultaddress()
183 1.1 reinoud
184 1.1 reinoud #define cpu_tlb_flushID() cpufuncs.cf_tlb_flushID()
185 1.1 reinoud #define cpu_tlb_flushID_SE(e) cpufuncs.cf_tlb_flushID_SE(e)
186 1.1 reinoud #define cpu_tlb_flushI() cpufuncs.cf_tlb_flushI()
187 1.1 reinoud #define cpu_tlb_flushI_SE(e) cpufuncs.cf_tlb_flushI_SE(e)
188 1.1 reinoud #define cpu_tlb_flushD() cpufuncs.cf_tlb_flushD()
189 1.1 reinoud #define cpu_tlb_flushD_SE(e) cpufuncs.cf_tlb_flushD_SE(e)
190 1.1 reinoud
191 1.17 thorpej #define cpu_icache_sync_all() cpufuncs.cf_icache_sync_all()
192 1.17 thorpej #define cpu_icache_sync_range(a, s) cpufuncs.cf_icache_sync_range((a), (s))
193 1.17 thorpej
194 1.17 thorpej #define cpu_dcache_wbinv_all() cpufuncs.cf_dcache_wbinv_all()
195 1.17 thorpej #define cpu_dcache_wbinv_range(a, s) cpufuncs.cf_dcache_wbinv_range((a), (s))
196 1.17 thorpej #define cpu_dcache_inv_range(a, s) cpufuncs.cf_dcache_inv_range((a), (s))
197 1.17 thorpej #define cpu_dcache_wb_range(a, s) cpufuncs.cf_dcache_wb_range((a), (s))
198 1.17 thorpej
199 1.59 matt #define cpu_sdcache_wbinv_range(a, b, s) cpufuncs.cf_sdcache_wbinv_range((a), (b), (s))
200 1.59 matt #define cpu_sdcache_inv_range(a, b, s) cpufuncs.cf_sdcache_inv_range((a), (b), (s))
201 1.59 matt #define cpu_sdcache_wb_range(a, b, s) cpufuncs.cf_sdcache_wb_range((a), (b), (s))
202 1.59 matt
203 1.17 thorpej #define cpu_idcache_wbinv_all() cpufuncs.cf_idcache_wbinv_all()
204 1.17 thorpej #define cpu_idcache_wbinv_range(a, s) cpufuncs.cf_idcache_wbinv_range((a), (s))
205 1.1 reinoud
206 1.1 reinoud #define cpu_flush_prefetchbuf() cpufuncs.cf_flush_prefetchbuf()
207 1.1 reinoud #define cpu_drain_writebuf() cpufuncs.cf_drain_writebuf()
208 1.1 reinoud #define cpu_flush_brnchtgt_C() cpufuncs.cf_flush_brnchtgt_C()
209 1.1 reinoud #define cpu_flush_brnchtgt_E(e) cpufuncs.cf_flush_brnchtgt_E(e)
210 1.1 reinoud
211 1.1 reinoud #define cpu_sleep(m) cpufuncs.cf_sleep(m)
212 1.1 reinoud
213 1.1 reinoud #define cpu_dataabt_fixup(a) cpufuncs.cf_dataabt_fixup(a)
214 1.1 reinoud #define cpu_prefetchabt_fixup(a) cpufuncs.cf_prefetchabt_fixup(a)
215 1.7 wiz #define ABORT_FIXUP_OK 0 /* fixup succeeded */
216 1.1 reinoud #define ABORT_FIXUP_FAILED 1 /* fixup failed */
217 1.1 reinoud #define ABORT_FIXUP_RETURN 2 /* abort handler should return */
218 1.1 reinoud
219 1.41 scw #define cpu_context_switch(a) cpufuncs.cf_context_switch(a)
220 1.1 reinoud #define cpu_setup(a) cpufuncs.cf_setup(a)
221 1.1 reinoud
222 1.39 bjh21 int set_cpufuncs (void);
223 1.40 bjh21 int set_cpufuncs_id (u_int);
224 1.1 reinoud #define ARCHITECTURE_NOT_PRESENT 1 /* known but not configured */
225 1.1 reinoud #define ARCHITECTURE_NOT_SUPPORTED 2 /* not known */
226 1.1 reinoud
227 1.39 bjh21 void cpufunc_nullop (void);
228 1.39 bjh21 int cpufunc_null_fixup (void *);
229 1.39 bjh21 int early_abort_fixup (void *);
230 1.39 bjh21 int late_abort_fixup (void *);
231 1.39 bjh21 u_int cpufunc_id (void);
232 1.39 bjh21 u_int cpufunc_control (u_int, u_int);
233 1.39 bjh21 void cpufunc_domains (u_int);
234 1.39 bjh21 u_int cpufunc_faultstatus (void);
235 1.39 bjh21 u_int cpufunc_faultaddress (void);
236 1.3 bjh21
237 1.1 reinoud #define setttb cpu_setttb
238 1.1 reinoud #define drain_writebuf cpu_drain_writebuf
239 1.1 reinoud
240 1.73 matt
241 1.73 matt #if defined(CPU_XSCALE)
242 1.73 matt #define cpu_cpwait() cpufuncs.cf_cpwait()
243 1.73 matt #endif
244 1.73 matt
245 1.43 chris #ifndef cpu_cpwait
246 1.43 chris #define cpu_cpwait()
247 1.43 chris #endif
248 1.43 chris
249 1.1 reinoud /*
250 1.1 reinoud * Macros for manipulating CPU interrupts
251 1.1 reinoud */
252 1.62 skrll static __inline uint32_t __set_cpsr_c(uint32_t bic, uint32_t eor) __attribute__((__unused__));
253 1.62 skrll static __inline uint32_t disable_interrupts(uint32_t mask) __attribute__((__unused__));
254 1.62 skrll static __inline uint32_t enable_interrupts(uint32_t mask) __attribute__((__unused__));
255 1.25 briggs
256 1.43 chris static __inline uint32_t
257 1.43 chris __set_cpsr_c(uint32_t bic, uint32_t eor)
258 1.25 briggs {
259 1.43 chris uint32_t tmp, ret;
260 1.25 briggs
261 1.36 perry __asm volatile(
262 1.25 briggs "mrs %0, cpsr\n" /* Get the CPSR */
263 1.25 briggs "bic %1, %0, %2\n" /* Clear bits */
264 1.25 briggs "eor %1, %1, %3\n" /* XOR bits */
265 1.25 briggs "msr cpsr_c, %1\n" /* Set the control field of CPSR */
266 1.25 briggs : "=&r" (ret), "=&r" (tmp)
267 1.31 rearnsha : "r" (bic), "r" (eor) : "memory");
268 1.25 briggs
269 1.25 briggs return ret;
270 1.25 briggs }
271 1.25 briggs
272 1.43 chris static __inline uint32_t
273 1.43 chris disable_interrupts(uint32_t mask)
274 1.43 chris {
275 1.43 chris uint32_t tmp, ret;
276 1.43 chris mask &= (I32_bit | F32_bit);
277 1.43 chris
278 1.43 chris __asm volatile(
279 1.43 chris "mrs %0, cpsr\n" /* Get the CPSR */
280 1.43 chris "orr %1, %0, %2\n" /* set bits */
281 1.43 chris "msr cpsr_c, %1\n" /* Set the control field of CPSR */
282 1.43 chris : "=&r" (ret), "=&r" (tmp)
283 1.43 chris : "r" (mask)
284 1.43 chris : "memory");
285 1.43 chris
286 1.43 chris return ret;
287 1.43 chris }
288 1.43 chris
289 1.43 chris static __inline uint32_t
290 1.43 chris enable_interrupts(uint32_t mask)
291 1.43 chris {
292 1.69 matt uint32_t ret;
293 1.43 chris mask &= (I32_bit | F32_bit);
294 1.43 chris
295 1.69 matt /* Get the CPSR */
296 1.69 matt __asm __volatile("mrs\t%0, cpsr\n" : "=r"(ret));
297 1.69 matt #ifdef _ARM_ARCH_6
298 1.69 matt if (__builtin_constant_p(mask)) {
299 1.69 matt switch (mask) {
300 1.69 matt case I32_bit | F32_bit:
301 1.69 matt __asm __volatile("cpsie\tif");
302 1.69 matt break;
303 1.69 matt case I32_bit:
304 1.69 matt __asm __volatile("cpsie\ti");
305 1.69 matt break;
306 1.69 matt case F32_bit:
307 1.69 matt __asm __volatile("cpsie\tf");
308 1.69 matt break;
309 1.69 matt default:
310 1.69 matt break;
311 1.69 matt }
312 1.69 matt return ret;
313 1.69 matt }
314 1.69 matt #endif /* _ARM_ARCH_6 */
315 1.69 matt
316 1.69 matt /* Set the control field of CPSR */
317 1.69 matt __asm volatile("msr\tcpsr_c, %0" :: "r"(ret & ~mask));
318 1.1 reinoud
319 1.43 chris return ret;
320 1.43 chris }
321 1.1 reinoud
322 1.15 thorpej #define restore_interrupts(old_cpsr) \
323 1.25 briggs (__set_cpsr_c((I32_bit | F32_bit), (old_cpsr) & (I32_bit | F32_bit)))
324 1.45 matt
325 1.45 matt static inline void cpsie(register_t psw) __attribute__((__unused__));
326 1.45 matt static inline register_t cpsid(register_t psw) __attribute__((__unused__));
327 1.45 matt
328 1.45 matt static inline void
329 1.45 matt cpsie(register_t psw)
330 1.45 matt {
331 1.49 matt #ifdef _ARM_ARCH_6
332 1.45 matt if (!__builtin_constant_p(psw)) {
333 1.45 matt enable_interrupts(psw);
334 1.45 matt return;
335 1.45 matt }
336 1.45 matt switch (psw & (I32_bit|F32_bit)) {
337 1.45 matt case I32_bit: __asm("cpsie\ti"); break;
338 1.45 matt case F32_bit: __asm("cpsie\tf"); break;
339 1.45 matt case I32_bit|F32_bit: __asm("cpsie\tif"); break;
340 1.45 matt }
341 1.48 cliff #else
342 1.48 cliff enable_interrupts(psw);
343 1.48 cliff #endif
344 1.45 matt }
345 1.45 matt
346 1.45 matt static inline register_t
347 1.45 matt cpsid(register_t psw)
348 1.45 matt {
349 1.49 matt #ifdef _ARM_ARCH_6
350 1.45 matt register_t oldpsw;
351 1.45 matt if (!__builtin_constant_p(psw))
352 1.45 matt return disable_interrupts(psw);
353 1.45 matt
354 1.45 matt __asm("mrs %0, cpsr" : "=r"(oldpsw));
355 1.45 matt switch (psw & (I32_bit|F32_bit)) {
356 1.45 matt case I32_bit: __asm("cpsid\ti"); break;
357 1.45 matt case F32_bit: __asm("cpsid\tf"); break;
358 1.45 matt case I32_bit|F32_bit: __asm("cpsid\tif"); break;
359 1.45 matt }
360 1.45 matt return oldpsw;
361 1.80 skrll #else
362 1.48 cliff return disable_interrupts(psw);
363 1.48 cliff #endif
364 1.45 matt }
365 1.45 matt
366 1.15 thorpej
367 1.15 thorpej /* Functions to manipulate the CPSR. */
368 1.32 uwe u_int SetCPSR(u_int, u_int);
369 1.15 thorpej u_int GetCPSR(void);
370 1.1 reinoud
371 1.1 reinoud
372 1.1 reinoud /*
373 1.1 reinoud * CPU functions from locore.S
374 1.1 reinoud */
375 1.1 reinoud
376 1.58 matt void cpu_reset (void) __dead;
377 1.14 thorpej
378 1.14 thorpej /*
379 1.14 thorpej * Cache info variables.
380 1.14 thorpej */
381 1.67 matt #define CACHE_TYPE_VIVT 0
382 1.67 matt #define CACHE_TYPE_xxPT 1
383 1.67 matt #define CACHE_TYPE_VIPT 1
384 1.67 matt #define CACHE_TYPE_PIxx 2
385 1.67 matt #define CACHE_TYPE_PIPT 3
386 1.14 thorpej
387 1.14 thorpej /* PRIMARY CACHE VARIABLES */
388 1.58 matt struct arm_cache_info {
389 1.58 matt u_int icache_size;
390 1.58 matt u_int icache_line_size;
391 1.58 matt u_int icache_ways;
392 1.68 matt u_int icache_way_size;
393 1.58 matt u_int icache_sets;
394 1.58 matt
395 1.58 matt u_int dcache_size;
396 1.58 matt u_int dcache_line_size;
397 1.58 matt u_int dcache_ways;
398 1.68 matt u_int dcache_way_size;
399 1.58 matt u_int dcache_sets;
400 1.58 matt
401 1.69 matt uint8_t cache_type;
402 1.58 matt bool cache_unified;
403 1.67 matt uint8_t icache_type;
404 1.67 matt uint8_t dcache_type;
405 1.58 matt };
406 1.58 matt
407 1.77 mrg #if (ARM_MMU_V6 + ARM_MMU_V7) != 0
408 1.58 matt extern u_int arm_cache_prefer_mask;
409 1.77 mrg #endif
410 1.58 matt extern u_int arm_dcache_align;
411 1.58 matt extern u_int arm_dcache_align_mask;
412 1.1 reinoud
413 1.58 matt extern struct arm_cache_info arm_pcache;
414 1.58 matt extern struct arm_cache_info arm_scache;
415 1.79 ryo
416 1.79 ryo #endif /* _GRRRRUMP */
417 1.79 ryo
418 1.1 reinoud #endif /* _KERNEL */
419 1.55 christos
420 1.55 christos #if defined(_KERNEL) || defined(_KMEMUSER)
421 1.55 christos /*
422 1.55 christos * Miscellany
423 1.55 christos */
424 1.55 christos
425 1.55 christos int get_pc_str_offset (void);
426 1.55 christos
427 1.79 ryo bool cpu_gtmr_exists_p(void);
428 1.79 ryo u_int cpu_clusterid(void);
429 1.79 ryo bool cpu_earlydevice_va_p(void);
430 1.79 ryo
431 1.55 christos /*
432 1.55 christos * Functions to manipulate cpu r13
433 1.55 christos * (in arm/arm32/setstack.S)
434 1.55 christos */
435 1.55 christos
436 1.55 christos void set_stackptr (u_int, u_int);
437 1.55 christos u_int get_stackptr (u_int);
438 1.55 christos
439 1.55 christos #endif /* _KERNEL || _KMEMUSER */
440 1.55 christos
441 1.79 ryo #elif defined(__aarch64__)
442 1.79 ryo
443 1.79 ryo #include <aarch64/cpufunc.h>
444 1.79 ryo
445 1.79 ryo #endif /* __arm__/__aarch64__ */
446 1.79 ryo
447 1.65 matt #endif /* _ARM_CPUFUNC_H_ */
448 1.1 reinoud
449 1.1 reinoud /* End of cpufunc.h */
450