4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
25 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
33 #include <sys/cpuvar_defs.h>
34 #include <sys/dtrace.h>
36 #include <machine/asm.h>
37 #include <machine/cpu.h>
38 #include <machine/cpuregs.h>
39 #include <machine/regnum.h>
43 .set noreorder # Noreorder is default style!
52 void dtrace_membar_producer(void)
54 LEAF(dtrace_membar_producer)
57 END(dtrace_membar_producer)
60 void dtrace_membar_consumer(void)
62 LEAF(dtrace_membar_consumer)
65 END(dtrace_membar_consumer)
68 dtrace_icookie_t dtrace_interrupt_disable(void)
70 LEAF(dtrace_interrupt_disable)
71 mfc0 t0, MIPS_COP_0_STATUS
73 and v0, v0, MIPS_SR_INT_IE
74 and t0, t0, ~MIPS_SR_INT_IE
75 mtc0 t0, MIPS_COP_0_STATUS
78 END(dtrace_interrupt_disable)
81 void dtrace_interrupt_enable(dtrace_icookie_t cookie)
83 LEAF(dtrace_interrupt_enable)
84 mfc0 t0, MIPS_COP_0_STATUS
86 or t0, t0, MIPS_SR_INT_IE
87 mtc0 t0, MIPS_COP_0_STATUS
91 END(dtrace_interrupt_enable)
94 uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
112 dtrace_casptr(void *target, void *cmp, void *new)
131 dtrace_fulword(void *addr)
138 dtrace_fuword8_nocheck(void *addr)
140 LEAF(dtrace_fuword8_nocheck)
144 END(dtrace_fuword8_nocheck)
148 dtrace_fuword16_nocheck(void *addr)
150 LEAF(dtrace_fuword16_nocheck)
154 END(dtrace_fuword16_nocheck)
158 dtrace_fuword32_nocheck(void *addr)
160 LEAF(dtrace_fuword32_nocheck)
164 END(dtrace_fuword32_nocheck)
168 dtrace_fuword64_nocheck(void *addr)
170 LEAF(dtrace_fuword64_nocheck)
171 #if defined(__mips_n64) || defined(__mips_n32)
179 END(dtrace_fuword64_nocheck)
184 dtrace_copy(uintptr_t src, uintptr_t dest, size_t size)
203 XXX: Unoptimized. Check for flags on page boundaries only(?)
205 dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
206 volatile uint16_t *flags)
218 and t1, t1, CPU_DTRACE_BADADDR
230 void dtrace_invop_init(void)
232 LEAF(dtrace_invop_init)
233 /* XXX: impement it properly */
234 PTR_LA t0, dtrace_invop_jump_addr
235 /* dla t1, dtrace_invop_start */
239 END(dtrace_invop_init)
242 void dtrace_invop_uninit(void)
244 LEAF(dtrace_invop_uninit)
245 PTR_LA t0, dtrace_invop_jump_addr
249 END(dtrace_invop_uninit)
253 dtrace_caller(int aframes)