2 * Aic7xxx SCSI host adapter firmware asssembler symbol table definitions
4 * Copyright (c) 1997 Justin T. Gibbs.
5 * Copyright (c) 2002 Adaptec Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions, and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * substantially similar to the "NO WARRANTY" disclaimer below
16 * ("Disclaimer") and any redistribution must be conditioned upon
17 * including a substantially similar Disclaimer requirement for further
18 * binary redistribution.
19 * 3. Neither the names of the above-listed copyright holders nor the names
20 * of any contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * Alternatively, this software may be distributed under the terms of the
24 * GNU General Public License ("GPL") version 2 as published by the Free
25 * Software Foundation.
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGES.
40 * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.h#17 $
45 #include <sys/queue.h>
70 typedef SLIST_HEAD(symlist, symbol_node) symlist_t;
77 uint8_t valid_bitmask;
94 struct symbol *parent;
107 STAILQ_ENTRY(macro_arg) links;
109 char *replacement_text;
111 STAILQ_HEAD(macro_arg_list, macro_arg) args;
114 struct macro_arg_list args;
119 typedef struct expression_info {
120 symlist_t referenced_syms;
124 typedef struct symbol {
128 struct reg_info *rinfo;
129 struct field_info *finfo;
130 struct const_info *cinfo;
131 struct alias_info *ainfo;
132 struct label_info *linfo;
133 struct cond_info *condinfo;
134 struct macro_info *macroinfo;
138 typedef struct symbol_ref {
143 typedef struct symbol_node {
144 SLIST_ENTRY(symbol_node) links;
148 typedef struct critical_section {
149 TAILQ_ENTRY(critical_section) links;
152 } critical_section_t;
161 typedef struct patch_info {
166 typedef struct scope {
167 SLIST_ENTRY(scope) scope_stack_links;
168 TAILQ_ENTRY(scope) scope_links;
169 TAILQ_HEAD(, scope) inner_scope;
171 int inner_scope_patches;
174 patch_info_t patches[2];
178 TAILQ_HEAD(cs_tailq, critical_section);
179 SLIST_HEAD(scope_list, scope);
180 TAILQ_HEAD(scope_tailq, scope);
182 void symbol_delete(symbol_t *symbol);
184 void symtable_open(void);
186 void symtable_close(void);
189 symtable_get(const char *name);
192 symlist_search(symlist_t *symlist, char *symname);
195 symlist_add(symlist_t *symlist, symbol_t *symbol, int how);
196 #define SYMLIST_INSERT_HEAD 0x00
197 #define SYMLIST_SORT 0x01
199 void symlist_free(symlist_t *symlist);
201 void symlist_merge(symlist_t *symlist_dest, symlist_t *symlist_src1,
202 symlist_t *symlist_src2);
203 void symtable_dump(FILE *ofile, FILE *dfile);