xref: /netbsd/sys/dev/microcode/aic7xxx/aicasm.h (revision bf9ec67e)
1 /*	$NetBSD: aicasm.h,v 1.1 2000/03/15 02:09:13 fvdl Exp $	*/
2 
3 /*
4  * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
5  *
6  * Copyright (c) 1997 Justin T. Gibbs.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions, and the following disclaimer,
14  *    without modification.
15  * 2. The name of the author may not be used to endorse or promote products
16  *    derived from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
22  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD: src/sys/dev/aic7xxx/aicasm.h,v 1.6 1999/12/06 18:23:30 gibbs Exp $
31  */
32 
33 #include <sys/queue.h>
34 
35 #ifdef __NetBSD__
36 
37 #define STAILQ_EMPTY		SIMPLEQ_EMPTY
38 #define STAILQ_FIRST		SIMPLEQ_FIRST
39 #define STAILQ_NEXT		SIMPLEQ_NEXT
40 #define STAILQ_ENTRY		SIMPLEQ_ENTRY
41 #define STAILQ_INIT		SIMPLEQ_INIT
42 #define STAILQ_HEAD		SIMPLEQ_HEAD
43 #define STAILQ_INSERT_AFTER	SIMPLEQ_INSERT_AFTER
44 #define STAILQ_INSERT_HEAD	SIMPLEQ_INSERT_HEAD
45 #define STAILQ_INSERT_TAIL	SIMPLEQ_INSERT_TAIL
46 
47 #endif
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 scope_list scope_stack;
73 extern struct symlist patch_functions;
74 extern int includes_search_curdir;		/* False if we've seen -I- */
75 extern char *appname;
76 extern int yylineno;
77 extern char *yyfilename;
78 
79 void stop(const char *errstring, int err_code);
80 void include_file(char *file_name, include_type type);
81 struct instruction *seq_alloc(void);
82 struct scope *scope_alloc(void);
83 void process_scope(struct scope *);
84