2 * Copyright (c) 2006 Kip Macy
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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
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);
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);
41 static __inline void *
45 otba = (char *)rdpr(tba);
53 set_wstate(u_long nwstate)
55 wrpr(wstate, nwstate, 0);
58 void invlpg(uint16_t ctx, vm_offset_t va);
60 void invlctx(uint16_t ctx);
65 store_real(vm_paddr_t ra, uint64_t val)
67 stxa(ra, ASI_REAL, val);
71 store_real_sync(vm_paddr_t ra, uint64_t val)
73 stxa_sync(ra, ASI_REAL, val);
76 static __inline uint64_t
77 load_real(vm_paddr_t ra)
80 val = ldxa(ra, ASI_REAL);
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);
91 #endif /* !_MACHINE_CPUFUNC_H_ */