xref: /freebsd/sys/dev/aic7xxx/aicasm/aicasm.h (revision 7f3dea244c40159a41ab22da77a434d7c5b5e85a)
1 /*
2  * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
3  *
4  * Copyright (c) 1997 Justin T. Gibbs.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions, and the following disclaimer,
12  *    without modification, immediately at the beginning of the file.
13  * 2. The name of the author may not be used to endorse or promote products
14  *    derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  *      $Id: aicasm.h,v 1.3 1997/06/27 19:38:47 gibbs Exp $
29  */
30 
31 #include <sys/queue.h>
32 
33 #ifndef TRUE
34 #define TRUE 1
35 #endif
36 
37 #ifndef FALSE
38 #define FALSE 0
39 #endif
40 
41 typedef struct path_entry {
42 	char	*directory;
43 	int	quoted_includes_only;
44 	SLIST_ENTRY(path_entry) links;
45 } *path_entry_t;
46 
47 typedef enum {
48 	QUOTED_INCLUDE,
49 	BRACKETED_INCLUDE,
50 	SOURCE_FILE
51 } include_type;
52 
53 SLIST_HEAD(path_list, path_entry);
54 
55 extern struct path_list search_path;
56 extern struct scope_list scope_stack;
57 extern struct symlist patch_functions;
58 extern int includes_search_curdir;		/* False if we've seen -I- */
59 extern char *appname;
60 extern int yylineno;
61 extern char *yyfilename;
62 
63 void stop(const char *errstring, int err_code);
64 void include_file(char *file_name, include_type type);
65 struct instruction *seq_alloc(void);
66 struct scope *scope_alloc(void);
67 void process_scope(struct scope *);
68