Deleted Added
full compact
cpufunc.h (92861) cpufunc.h (93264)
1/*-
2 * Copyright (c) 2001 Jake Burkholder.
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 unchanged lines hidden (view full) ---

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 *
1/*-
2 * Copyright (c) 2001 Jake Burkholder.
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 unchanged lines hidden (view full) ---

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: head/sys/sparc64/include/cpufunc.h 92861 2002-03-21 06:21:32Z imp $
26 * $FreeBSD: head/sys/sparc64/include/cpufunc.h 93264 2002-03-27 05:39:23Z dillon $
27 */
28
29#ifndef _MACHINE_CPUFUNC_H_
30#define _MACHINE_CPUFUNC_H_
31
32#include <machine/asi.h>
33#include <machine/pstate.h>
34
27 */
28
29#ifndef _MACHINE_CPUFUNC_H_
30#define _MACHINE_CPUFUNC_H_
31
32#include <machine/asi.h>
33#include <machine/pstate.h>
34
35struct thread;
36
35/*
36 * membar operand macros for use in other macros when # is a special
37 * character. Keep these in sync with what the hardware expects.
38 */
39#define C_Lookaside (0)
40#define C_MemIssue (1)
41#define C_Sync (2)
42#define M_LoadLoad (0)

--- 112 unchanged lines hidden (view full) ---

155 __pr; \
156})
157
158#define wrpr(name, val, xor) do { \
159 __asm __volatile("wrpr %0, %1, %%" #name \
160 : : "r" (val), "rI" (xor)); \
161} while (0)
162
37/*
38 * membar operand macros for use in other macros when # is a special
39 * character. Keep these in sync with what the hardware expects.
40 */
41#define C_Lookaside (0)
42#define C_MemIssue (1)
43#define C_Sync (2)
44#define M_LoadLoad (0)

--- 112 unchanged lines hidden (view full) ---

157 __pr; \
158})
159
160#define wrpr(name, val, xor) do { \
161 __asm __volatile("wrpr %0, %1, %%" #name \
162 : : "r" (val), "rI" (xor)); \
163} while (0)
164
163#define CRITICAL_FORK (0)
164
165static __inline void
166breakpoint(void)
167{
168 __asm __volatile("ta %%xcc, 1" : :);
169}
170
165static __inline void
166breakpoint(void)
167{
168 __asm __volatile("ta %%xcc, 1" : :);
169}
170
171static __inline critical_t
172cpu_critical_enter(void)
173{
174 critical_t pil;
175
176 pil = rdpr(pil);
177 wrpr(pil, 0, 14);
178 return (pil);
179}
180
181static __inline void
182cpu_critical_exit(critical_t pil)
183{
184 wrpr(pil, pil, 0);
185}
186
187static __inline register_t
188intr_disable(void)
189{
190 u_long s;
191
192 s = rdpr(pstate);
193 wrpr(pstate, s & ~PSTATE_IE, 0);
194 return (s);

--- 40 unchanged lines hidden (view full) ---

235 : "=r" (result), "=r" (neg), "=r" (tmp) : "r" (mask));
236 return (result);
237}
238#endif
239
240#undef LDNC_GEN
241#undef STNC_GEN
242
171static __inline register_t
172intr_disable(void)
173{
174 u_long s;
175
176 s = rdpr(pstate);
177 wrpr(pstate, s & ~PSTATE_IE, 0);
178 return (s);

--- 40 unchanged lines hidden (view full) ---

219 : "=r" (result), "=r" (neg), "=r" (tmp) : "r" (mask));
220 return (result);
221}
222#endif
223
224#undef LDNC_GEN
225#undef STNC_GEN
226
227void cpu_critical_enter(void);
228void cpu_critical_exit(void);
229void cpu_critical_fork_exit(void);
230void cpu_thread_link(struct thread *td);
231
243#endif /* !_MACHINE_CPUFUNC_H_ */
232#endif /* !_MACHINE_CPUFUNC_H_ */