Print this page
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation missing checks
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libdtrace/common/dt_decl.h
+++ new/usr/src/lib/libdtrace/common/dt_decl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 +/*
27 + * Copyright (c) 2013 by Delphix. All rights reserved.
28 + * Copyright (c) 2013 Joyent, Inc. All rights reserved.
29 + */
26 30
27 31 #ifndef _DT_DECL_H
28 32 #define _DT_DECL_H
29 33
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 34 #include <sys/types.h>
33 35 #include <libctf.h>
34 36 #include <dtrace.h>
35 37 #include <stdio.h>
36 38
37 39 #ifdef __cplusplus
38 40 extern "C" {
39 41 #endif
40 42
41 43 struct dt_node; /* forward declaration of dt_node_t */
42 44
43 45 typedef struct dt_decl {
44 46 ushort_t dd_kind; /* declaration kind (CTF_K_* kind) */
45 47 ushort_t dd_attr; /* attributes (DT_DA_* flags) */
46 48 ctf_file_t *dd_ctfp; /* CTF container for decl's type */
47 49 ctf_id_t dd_type; /* CTF identifier for decl's type */
48 50 char *dd_name; /* string name of this decl (or NULL) */
49 51 struct dt_node *dd_node; /* node for array size or parm list */
50 52 struct dt_decl *dd_next; /* next declaration in list */
51 53 } dt_decl_t;
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
52 54
53 55 #define DT_DA_SIGNED 0x0001 /* signed integer value */
54 56 #define DT_DA_UNSIGNED 0x0002 /* unsigned integer value */
55 57 #define DT_DA_SHORT 0x0004 /* short integer value */
56 58 #define DT_DA_LONG 0x0008 /* long integer or double */
57 59 #define DT_DA_LONGLONG 0x0010 /* long long integer value */
58 60 #define DT_DA_CONST 0x0020 /* qualify type as const */
59 61 #define DT_DA_RESTRICT 0x0040 /* qualify type as restrict */
60 62 #define DT_DA_VOLATILE 0x0080 /* qualify type as volatile */
61 63 #define DT_DA_PAREN 0x0100 /* parenthesis tag */
64 +#define DT_DA_USER 0x0200 /* user-land type specifier */
62 65
63 66 typedef enum dt_dclass {
64 67 DT_DC_DEFAULT, /* no storage class specified */
65 68 DT_DC_AUTO, /* automatic storage */
66 69 DT_DC_REGISTER, /* register storage */
67 70 DT_DC_STATIC, /* static storage */
68 71 DT_DC_EXTERN, /* extern storage */
69 72 DT_DC_TYPEDEF, /* type definition */
70 73 DT_DC_SELF, /* thread-local storage */
71 74 DT_DC_THIS /* clause-local storage */
72 75 } dt_dclass_t;
73 76
74 77 typedef struct dt_scope {
75 78 dt_decl_t *ds_decl; /* pointer to top of decl stack */
76 79 struct dt_scope *ds_next; /* pointer to next scope */
77 80 char *ds_ident; /* identifier for this scope (if any) */
78 81 ctf_file_t *ds_ctfp; /* CTF container for this scope */
79 82 ctf_id_t ds_type; /* CTF id of enclosing type */
80 83 dt_dclass_t ds_class; /* declaration class for this scope */
81 84 int ds_enumval; /* most recent enumerator value */
82 85 } dt_scope_t;
83 86
84 87 extern dt_decl_t *dt_decl_alloc(ushort_t, char *);
85 88 extern void dt_decl_free(dt_decl_t *);
86 89 extern void dt_decl_reset(void);
87 90 extern dt_decl_t *dt_decl_push(dt_decl_t *);
88 91 extern dt_decl_t *dt_decl_pop(void);
89 92 extern dt_decl_t *dt_decl_pop_param(char **);
90 93 extern dt_decl_t *dt_decl_top(void);
91 94
92 95 extern dt_decl_t *dt_decl_ident(char *);
93 96 extern void dt_decl_class(dt_dclass_t);
94 97
95 98 #define DT_DP_VARARGS 0x1 /* permit varargs in prototype */
96 99 #define DT_DP_DYNAMIC 0x2 /* permit dynamic type in prototype */
97 100 #define DT_DP_VOID 0x4 /* permit void type in prototype */
98 101 #define DT_DP_ANON 0x8 /* permit anonymous parameters */
99 102
100 103 extern int dt_decl_prototype(struct dt_node *, struct dt_node *,
101 104 const char *, uint_t);
102 105
103 106 extern dt_decl_t *dt_decl_spec(ushort_t, char *);
104 107 extern dt_decl_t *dt_decl_attr(ushort_t);
105 108 extern dt_decl_t *dt_decl_array(struct dt_node *);
106 109 extern dt_decl_t *dt_decl_func(dt_decl_t *, struct dt_node *);
107 110 extern dt_decl_t *dt_decl_ptr(void);
108 111
109 112 extern dt_decl_t *dt_decl_sou(uint_t, char *);
110 113 extern void dt_decl_member(struct dt_node *);
111 114
112 115 extern dt_decl_t *dt_decl_enum(char *);
113 116 extern void dt_decl_enumerator(char *, struct dt_node *);
114 117
115 118 extern int dt_decl_type(dt_decl_t *, dtrace_typeinfo_t *);
116 119
117 120 extern void dt_scope_create(dt_scope_t *);
118 121 extern void dt_scope_destroy(dt_scope_t *);
119 122 extern void dt_scope_push(ctf_file_t *, ctf_id_t);
120 123 extern dt_decl_t *dt_scope_pop(void);
121 124
122 125 #ifdef __cplusplus
123 126 }
124 127 #endif
125 128
126 129 #endif /* _DT_DECL_H */
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX