14b31995imp/*-
28c166fcgibbs * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
38c166fcgibbs *
41537078pfg * SPDX-License-Identifier: BSD-3-Clause
51537078pfg *
68c166fcgibbs * Copyright (c) 1997 Justin T. Gibbs.
79dc8c71gibbs * Copyright (c) 2001, 2002 Adaptec Inc.
88c166fcgibbs * All rights reserved.
98c166fcgibbs *
108c166fcgibbs * Redistribution and use in source and binary forms, with or without
118c166fcgibbs * modification, are permitted provided that the following conditions
128c166fcgibbs * are met:
138c166fcgibbs * 1. Redistributions of source code must retain the above copyright
147ebb730gibbs *    notice, this list of conditions, and the following disclaimer,
1509d56a3gibbs *    without modification.
160d50104gibbs * 2. Redistributions in binary form must reproduce at minimum a disclaimer
170d50104gibbs *    substantially similar to the "NO WARRANTY" disclaimer below
180d50104gibbs *    ("Disclaimer") and any redistribution must be conditioned upon
190d50104gibbs *    including a substantially similar Disclaimer requirement for further
200d50104gibbs *    binary redistribution.
210d50104gibbs * 3. Neither the names of the above-listed copyright holders nor the names
220d50104gibbs *    of any contributors may be used to endorse or promote products derived
230d50104gibbs *    from this software without specific prior written permission.
248c166fcgibbs *
253c29757gibbs * Alternatively, this software may be distributed under the terms of the
260d50104gibbs * GNU General Public License ("GPL") version 2 as published by the Free
270d50104gibbs * Software Foundation.
283c29757gibbs *
290d50104gibbs * NO WARRANTY
300d50104gibbs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
310d50104gibbs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
320d50104gibbs * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
330d50104gibbs * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
340d50104gibbs * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
358c166fcgibbs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
368c166fcgibbs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
370d50104gibbs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
380d50104gibbs * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
390d50104gibbs * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
400d50104gibbs * POSSIBILITY OF SUCH DAMAGES.
418c166fcgibbs *
429dc8c71gibbs * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#14 $
430352a10gibbs *
443b842d3peter * $FreeBSD$
458c166fcgibbs */
468c166fcgibbs
478c166fcgibbs#include <sys/queue.h>
488c166fcgibbs
498c166fcgibbs#ifndef TRUE
508c166fcgibbs#define TRUE 1
518c166fcgibbs#endif
528c166fcgibbs
538c166fcgibbs#ifndef FALSE
548c166fcgibbs#define FALSE 0
558c166fcgibbs#endif
568c166fcgibbs
578c166fcgibbstypedef struct path_entry {
588c166fcgibbs	char	*directory;
598c166fcgibbs	int	quoted_includes_only;
60961b97djake	SLIST_ENTRY(path_entry) links;
618c166fcgibbs} *path_entry_t;
628c166fcgibbs
638c166fcgibbstypedef enum {
648c166fcgibbs	QUOTED_INCLUDE,
658c166fcgibbs	BRACKETED_INCLUDE,
668c166fcgibbs	SOURCE_FILE
678c166fcgibbs} include_type;
688c166fcgibbs
69961b97djakeSLIST_HEAD(path_list, path_entry);
708c166fcgibbs
718c166fcgibbsextern struct path_list search_path;
72d98dfabgibbsextern struct cs_tailq cs_tailq;
73b845ffegibbsextern struct scope_list scope_stack;
74b845ffegibbsextern struct symlist patch_functions;
758c166fcgibbsextern int includes_search_curdir;		/* False if we've seen -I- */
768c166fcgibbsextern char *appname;
779dc8c71gibbsextern char *stock_include_file;
788c166fcgibbsextern int yylineno;
798c166fcgibbsextern char *yyfilename;
809dc8c71gibbsextern char *prefix;
810d50104gibbsextern char *patch_arg_list;
8242ab5fcgibbsextern char *versions;
830d50104gibbsextern int   src_mode;
840d50104gibbsextern int   dst_mode;
850d50104gibbsstruct symbol;
868c166fcgibbs
87b845ffegibbsvoid stop(const char *errstring, int err_code);
88b845ffegibbsvoid include_file(char *file_name, include_type type);
890d50104gibbsvoid expand_macro(struct symbol *macro_symbol);
90b845ffegibbsstruct instruction *seq_alloc(void);
91d98dfabgibbsstruct critical_section *cs_alloc(void);
92b845ffegibbsstruct scope *scope_alloc(void);
93b845ffegibbsvoid process_scope(struct scope *);
94