xref: /openbsd/sys/dev/microcode/aic7xxx/aicasm.h (revision 404b540a)
1 /* $OpenBSD: aicasm.h,v 1.6 2003/12/24 23:27:55 krw Exp $ */
2 /*	$NetBSD: aicasm.h,v 1.2 2003/04/19 19:26:10 fvdl Exp $	*/
3 
4 /*
5  * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
6  *
7  * Copyright (c) 1997 Justin T. Gibbs.
8  * Copyright (c) 2001, 2002 Adaptec Inc.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  *
43  * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.h,v 1.16 2002/08/31 06:39:40 gibbs Exp $
44  */
45 
46 #ifdef __linux__
47 #include "../queue.h"
48 #else
49 #include <sys/queue.h>
50 #endif
51 
52 #ifndef TRUE
53 #define TRUE 1
54 #endif
55 
56 #ifndef FALSE
57 #define FALSE 0
58 #endif
59 
60 typedef struct path_entry {
61 	char	*directory;
62 	int	quoted_includes_only;
63 	SLIST_ENTRY(path_entry) links;
64 } *path_entry_t;
65 
66 typedef enum {
67 	QUOTED_INCLUDE,
68 	BRACKETED_INCLUDE,
69 	SOURCE_FILE
70 } include_type;
71 
72 SLIST_HEAD(path_list, path_entry);
73 
74 extern struct path_list search_path;
75 extern struct cs_tailq cs_tailq;
76 extern struct scope_list scope_stack;
77 extern struct symlist patch_functions;
78 extern int includes_search_curdir;		/* False if we've seen -I- */
79 extern char *appname;
80 extern char *stock_include_file;
81 extern int yylineno;
82 extern char *yyfilename;
83 extern char *prefix;
84 extern char *patch_arg_list;
85 extern char *versions;
86 extern int   src_mode;
87 extern int   dst_mode;
88 struct symbol;
89 
90 void stop(const char *errstring, int err_code);
91 void include_file(char *file_name, include_type type);
92 void expand_macro(struct symbol *macro_symbol);
93 struct instruction *seq_alloc(void);
94 struct critical_section *cs_alloc(void);
95 struct scope *scope_alloc(void);
96 void process_scope(struct scope *);
97