xref: /freebsd/sys/dev/aic7xxx/aicasm/aicasm.h (revision f0cfa1b168014f56c02b83e5f28412cc5f78d117)
1 /*-
2  * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  * Copyright (c) 1997 Justin T. Gibbs.
7  * Copyright (c) 2001, 2002 Adaptec Inc.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
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.
24  *
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.
28  *
29  * NO WARRANTY
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.
41  *
42  * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#14 $
43  *
44  * $FreeBSD$
45  */
46 
47 #include <sys/queue.h>
48 
49 #ifndef TRUE
50 #define TRUE 1
51 #endif
52 
53 #ifndef FALSE
54 #define FALSE 0
55 #endif
56 
57 typedef struct path_entry {
58 	char	*directory;
59 	int	quoted_includes_only;
60 	SLIST_ENTRY(path_entry) links;
61 } *path_entry_t;
62 
63 typedef enum {
64 	QUOTED_INCLUDE,
65 	BRACKETED_INCLUDE,
66 	SOURCE_FILE
67 } include_type;
68 
69 SLIST_HEAD(path_list, path_entry);
70 
71 extern struct path_list search_path;
72 extern struct cs_tailq cs_tailq;
73 extern struct scope_list scope_stack;
74 extern struct symlist patch_functions;
75 extern int includes_search_curdir;		/* False if we've seen -I- */
76 extern char *appname;
77 extern char *stock_include_file;
78 extern int yylineno;
79 extern char *yyfilename;
80 extern char *prefix;
81 extern char *patch_arg_list;
82 extern char *versions;
83 extern int   src_mode;
84 extern int   dst_mode;
85 struct symbol;
86 
87 void stop(const char *errstring, int err_code);
88 void include_file(char *file_name, include_type type);
89 void expand_macro(struct symbol *macro_symbol);
90 struct instruction *seq_alloc(void);
91 struct critical_section *cs_alloc(void);
92 struct scope *scope_alloc(void);
93 void process_scope(struct scope *);
94