]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - sys/sun4v/include/sun4v_cpufunc.h
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / sys / sun4v / include / sun4v_cpufunc.h
1 /*-
2  * Copyright (c) 2006 Kip Macy
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28
29 #ifndef _MACHINE_SUN4V_CPUFUNC_H_
30 #define _MACHINE_SUN4V_CPUFUNC_H_
31 #include <machine/hv_api.h>
32 void set_mmfsa_scratchpad(vm_paddr_t mmfsa);
33
34 void set_hash_user_scratchpad(uint64_t);
35 void set_tsb_user_scratchpad(uint64_t);
36 void set_hash_kernel_scratchpad(uint64_t);
37 void set_tsb_kernel_scratchpad(uint64_t);
38 void init_mondo(uint64_t func, uint64_t arg1, uint64_t arg2, uint64_t arg3);
39 void init_mondo_queue(void);
40
41 static __inline void * 
42 set_tba(void *ntba)
43 {
44         void *otba;
45         otba = (char *)rdpr(tba);
46         wrpr(tba, ntba, 0);
47         return otba;
48 }
49
50
51
52 static __inline void 
53 set_wstate(u_long nwstate)
54 {
55         wrpr(wstate, nwstate, 0);
56 }
57
58 void invlpg(uint16_t ctx, vm_offset_t va);
59
60 void invlctx(uint16_t ctx);
61
62 void invltlb(void);
63
64 static __inline void 
65 store_real(vm_paddr_t ra, uint64_t val)
66 {
67         stxa(ra, ASI_REAL, val);
68 }
69
70 static __inline void 
71 store_real_sync(vm_paddr_t ra, uint64_t val)
72 {
73         stxa_sync(ra, ASI_REAL, val);
74 }
75
76 static __inline uint64_t 
77 load_real(vm_paddr_t ra)
78 {
79         uint64_t val;
80         val = ldxa(ra, ASI_REAL);
81         return val;
82 }
83
84
85 void load_real_dw(vm_paddr_t ra, uint64_t *lo, uint64_t *hi);
86 void bzerophyspage(vm_paddr_t ra, uint64_t size);
87 int hwblkclr(void *p, uint64_t size);
88 int novbcopy(void *src, void *dst, uint64_t size);
89
90
91 #endif /* !_MACHINE_CPUFUNC_H_ */