Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * Hypervisor Software File: stabs.h | |
5 | * | |
6 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
7 | * | |
8 | * - Do no alter or remove copyright notices | |
9 | * | |
10 | * - Redistribution and use of this software in source and binary forms, with | |
11 | * or without modification, are permitted provided that the following | |
12 | * conditions are met: | |
13 | * | |
14 | * - Redistribution of source code must retain the above copyright notice, | |
15 | * this list of conditions and the following disclaimer. | |
16 | * | |
17 | * - Redistribution in binary form must reproduce the above copyright notice, | |
18 | * this list of conditions and the following disclaimer in the | |
19 | * documentation and/or other materials provided with the distribution. | |
20 | * | |
21 | * Neither the name of Sun Microsystems, Inc. or the names of contributors | |
22 | * may be used to endorse or promote products derived from this software | |
23 | * without specific prior written permission. | |
24 | * | |
25 | * This software is provided "AS IS," without a warranty of any kind. | |
26 | * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
27 | * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
28 | * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
29 | * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
30 | * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
31 | * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
32 | * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
33 | * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
34 | * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
35 | * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
36 | * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
37 | * | |
38 | * You acknowledge that this software is not designed, licensed or | |
39 | * intended for use in the design, construction, operation or maintenance of | |
40 | * any nuclear facility. | |
41 | * | |
42 | * ========== Copyright Header End ============================================ | |
43 | */ | |
44 | /* | |
45 | * CDDL HEADER START | |
46 | * | |
47 | * The contents of this file are subject to the terms of the | |
48 | * Common Development and Distribution License (the "License"). | |
49 | * You may not use this file except in compliance with the License. | |
50 | * | |
51 | * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | |
52 | * or http://www.opensolaris.org/os/licensing. | |
53 | * See the License for the specific language governing permissions | |
54 | * and limitations under the License. | |
55 | * | |
56 | * When distributing Covered Code, include this CDDL HEADER in each | |
57 | * file and include the License file at usr/src/OPENSOLARIS.LICENSE. | |
58 | * If applicable, add the following below this CDDL HEADER, with the | |
59 | * fields enclosed by brackets "[]" replaced with your own identifying | |
60 | * information: Portions Copyright [yyyy] [name of copyright owner] | |
61 | * | |
62 | * CDDL HEADER END | |
63 | */ | |
64 | ||
65 | /* | |
66 | * Copyright 2006 Sun Microsystems, Inc. All rights reserved. | |
67 | * Use is subject to license terms. | |
68 | */ | |
69 | ||
70 | #ifndef _SYS_STABS_H | |
71 | #define _SYS_STABS_H | |
72 | ||
73 | #pragma ident "@(#)stabs.h 1.1 06/10/26 SMI" | |
74 | ||
75 | #include <stdio.h> | |
76 | #include <setjmp.h> | |
77 | #include <string.h> | |
78 | #include <ctype.h> | |
79 | #include <stdlib.h> | |
80 | #include <unistd.h> | |
81 | ||
82 | #ifdef __cplusplus | |
83 | extern "C" { | |
84 | #endif | |
85 | ||
86 | #define MAXLINE 8192 | |
87 | ||
88 | #define BUCKETS 128 | |
89 | ||
90 | struct node { | |
91 | char *name; | |
92 | char *format; | |
93 | char *format2; | |
94 | struct child *child; | |
95 | }; | |
96 | ||
97 | struct child { | |
98 | char *name; | |
99 | char *format; | |
100 | struct child *next; | |
101 | }; | |
102 | ||
103 | #define HASH(NUM) ((int)(NUM & (BUCKETS - 1))) | |
104 | ||
105 | enum type { | |
106 | INTRINSIC, | |
107 | POINTER, | |
108 | ARRAY, | |
109 | FUNCTION, | |
110 | STRUCT, | |
111 | UNION, | |
112 | ENUM, | |
113 | FORWARD, | |
114 | TYPEOF, | |
115 | VOLATILE, | |
116 | CONST | |
117 | }; | |
118 | ||
119 | /* Flags are ored together */ | |
120 | typedef enum { | |
121 | Intr_unknown = 0x0, | |
122 | Intr_unsigned = 0x1, | |
123 | Intr_signed = 0x2, | |
124 | Intr_char = 0x4 | |
125 | } intr_flags_t; | |
126 | ||
127 | struct tdesc { | |
128 | char *name; | |
129 | struct tdesc *next; | |
130 | enum type type; | |
131 | int size; | |
132 | union { | |
133 | intr_flags_t flags; /* signed / unsigned / [u]char */ | |
134 | struct tdesc *tdesc; /* *, f , to */ | |
135 | struct ardef *ardef; /* ar */ | |
136 | struct members { /* s, u */ | |
137 | struct mlist *forw; | |
138 | struct mlist *back; | |
139 | } members; | |
140 | struct elist *emem; /* e */ | |
141 | } data; | |
142 | int id; | |
143 | struct tdesc *hash; | |
144 | }; | |
145 | ||
146 | struct elist { | |
147 | char *name; | |
148 | int number; | |
149 | struct elist *next; | |
150 | }; | |
151 | ||
152 | struct element { | |
153 | struct tdesc *index_type; | |
154 | int range_start; | |
155 | int range_end; | |
156 | }; | |
157 | ||
158 | struct ardef { | |
159 | struct tdesc *contents; | |
160 | struct element *indices; | |
161 | }; | |
162 | ||
163 | struct mlist { | |
164 | int offset; | |
165 | int size; | |
166 | char *name; | |
167 | struct mlist *next; | |
168 | struct mlist *prev; | |
169 | struct tdesc *fdesc; /* s, u */ | |
170 | }; | |
171 | ||
172 | struct model_info { | |
173 | char *name; | |
174 | size_t pointersize; | |
175 | size_t charsize; | |
176 | size_t shortsize; | |
177 | size_t intsize; | |
178 | size_t longsize; | |
179 | }; | |
180 | ||
181 | extern struct tdesc *lookupname(char *); | |
182 | extern void parse_input(void); | |
183 | extern char *convert_format(char *format, char *dfault); | |
184 | extern struct child *find_child(struct node *np, char *w); | |
185 | extern char *uc(const char *s); | |
186 | ||
187 | extern boolean_t error; | |
188 | extern struct model_info *model; | |
189 | ||
190 | #ifdef __cplusplus | |
191 | } | |
192 | #endif | |
193 | ||
194 | #endif /* _SYS_STABS_H */ |