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]
22 * Portions Copyright 2012,2013 Justin Hibbits <jhibbits@freebsd.org>
27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
35 #include <sys/cpuvar_defs.h>
36 #include <sys/dtrace.h>
38 #include <machine/asm.h>
40 #include <machine/cpu.h>
50 void dtrace_membar_producer(void)
52 ASENTRY_NOPROF(dtrace_membar_producer)
55 END(dtrace_membar_producer)
58 void dtrace_membar_consumer(void)
60 ASENTRY_NOPROF(dtrace_membar_consumer)
63 END(dtrace_membar_consumer)
66 dtrace_icookie_t dtrace_interrupt_disable(void)
68 ASENTRY_NOPROF(dtrace_interrupt_disable)
70 andi. %r0,%r3,~PSL_EE@l
73 END(dtrace_interrupt_disable)
76 void dtrace_interrupt_enable(dtrace_icookie_t cookie)
78 ASENTRY_NOPROF(dtrace_interrupt_enable)
81 END(dtrace_interrupt_enable)
84 uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new)
86 ASENTRY_NOPROF(dtrace_cas32)
99 dtrace_casptr(void *target, void *cmp, void *new)
101 ASENTRY_NOPROF(dtrace_casptr)
125 dtrace_copy(uintptr_t src, uintptr_t dest, size_t size)
127 ASENTRY_NOPROF(dtrace_copy)
141 dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size,
142 volatile uint16_t *flags)
144 ASENTRY_NOPROF(dtrace_copystr)
157 andi. %r0,%r0,CPU_DTRACE_BADADDR
164 * The panic() and cmn_err() functions invoke vpanic() as a common entry point
165 * into the panic code implemented in panicsys(). vpanic() is responsible
166 * for passing through the format string and arguments, and constructing a
167 * regs structure on the stack into which it saves the current register
168 * values. If we are not dying due to a fatal trap, these registers will
169 * then be preserved in panicbuf as the current processor state. Before
170 * invoking panicsys(), vpanic() activates the first panic trigger (see
171 * common/os/panic.c) and switches to the panic_stack if successful. Note that
172 * DTrace takes a slightly different panic path if it must panic from probe
173 * context. Instead of calling panic, it calls into dtrace_vpanic(), which
174 * sets up the initial stack as vpanic does, calls dtrace_panic_trigger(), and
175 * branches back into vpanic().
180 vpanic(const char *format, va_list alist)
182 ASENTRY_NOPROF(vpanic) /* Initial stack layout: */
192 dtrace_vpanic(const char *format, va_list alist)
194 ASENTRY_NOPROF(dtrace_vpanic) /* Initial stack layout: */
197 bl dtrace_panic_trigger /* %eax = dtrace_panic_trigger() */
204 dtrace_caller(int aframes)
206 ASENTRY_NOPROF(dtrace_caller)