4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_FASTTRAP_H
28 #define _SYS_FASTTRAP_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <sys/fasttrap_isa.h>
33 #include <sys/dtrace.h>
34 #include <sys/types.h>
41 #define FASTTRAPIOC (('m' << 24) | ('r' << 16) | ('f' << 8))
42 #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1)
43 #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2)
45 #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t)
46 #define FASTTRAPIOC_MAKEPROBE _IO('f', 3)
49 typedef enum fasttrap_probe_type {
56 } fasttrap_probe_type_t;
58 typedef struct fasttrap_probe_spec {
60 fasttrap_probe_type_t ftps_type;
62 char ftps_func[DTRACE_FUNCNAMELEN];
63 char ftps_mod[DTRACE_MODNAMELEN];
68 uint64_t ftps_offs[1];
69 } fasttrap_probe_spec_t;
71 typedef struct fasttrap_instr_query {
74 fasttrap_instr_t ftiq_instr;
75 } fasttrap_instr_query_t;
78 * To support the fasttrap provider from very early in a process's life,
79 * the run-time linker, ld.so.1, has a program header of type PT_SUNWDTRACE
80 * which points to a data object which must be PT_SUNWDTRACE_SIZE bytes.
81 * This structure mimics the fasttrap provider section of the ulwp_t structure.
82 * When the fasttrap provider is changed to require new or different
83 * instructions, the data object in ld.so.1 and the thread initializers in libc
84 * (libc_init() and _thrp_create()) need to be updated to include the new
85 * instructions, and PT_SUNWDTRACE needs to be changed to a new unique number
86 * (while the old value gets assigned something like PT_SUNWDTRACE_1). Since the
87 * linker must be backward compatible with old Solaris releases, it must have
88 * program headers for each of the PT_SUNWDTRACE versions. The kernel's
89 * elfexec() function only has to look for the latest version of the
90 * PT_SUNWDTRACE program header.
92 #define PT_SUNWDTRACE_SIZE FASTTRAP_SUNWDTRACE_SIZE
98 #endif /* _SYS_FASTTRAP_H */