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