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