1139749Simp/*- 223934Sgibbs * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters 323934Sgibbs * 423934Sgibbs * Copyright (c) 1997 Justin T. Gibbs. 5102668Sgibbs * Copyright (c) 2001, 2002 Adaptec Inc. 623934Sgibbs * All rights reserved. 723934Sgibbs * 823934Sgibbs * Redistribution and use in source and binary forms, with or without 923934Sgibbs * modification, are permitted provided that the following conditions 1023934Sgibbs * are met: 1123934Sgibbs * 1. Redistributions of source code must retain the above copyright 1226997Sgibbs * notice, this list of conditions, and the following disclaimer, 1354211Sgibbs * without modification. 1495376Sgibbs * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1595376Sgibbs * substantially similar to the "NO WARRANTY" disclaimer below 1695376Sgibbs * ("Disclaimer") and any redistribution must be conditioned upon 1795376Sgibbs * including a substantially similar Disclaimer requirement for further 1895376Sgibbs * binary redistribution. 1995376Sgibbs * 3. Neither the names of the above-listed copyright holders nor the names 2095376Sgibbs * of any contributors may be used to endorse or promote products derived 2195376Sgibbs * from this software without specific prior written permission. 2223934Sgibbs * 2363457Sgibbs * Alternatively, this software may be distributed under the terms of the 2495376Sgibbs * GNU General Public License ("GPL") version 2 as published by the Free 2595376Sgibbs * Software Foundation. 2663457Sgibbs * 2795376Sgibbs * NO WARRANTY 2895376Sgibbs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2995376Sgibbs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3095376Sgibbs * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3195376Sgibbs * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3295376Sgibbs * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3323934Sgibbs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3423934Sgibbs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3595376Sgibbs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3695376Sgibbs * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 3795376Sgibbs * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3895376Sgibbs * POSSIBILITY OF SUCH DAMAGES. 3923934Sgibbs * 40102668Sgibbs * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#14 $ 4165943Sgibbs * 4250477Speter * $FreeBSD$ 4323934Sgibbs */ 4423934Sgibbs 4523934Sgibbs#include <sys/queue.h> 4623934Sgibbs 4723934Sgibbs#ifndef TRUE 4823934Sgibbs#define TRUE 1 4923934Sgibbs#endif 5023934Sgibbs 5123934Sgibbs#ifndef FALSE 5223934Sgibbs#define FALSE 0 5323934Sgibbs#endif 5423934Sgibbs 5523934Sgibbstypedef struct path_entry { 5623934Sgibbs char *directory; 5723934Sgibbs int quoted_includes_only; 5860938Sjake SLIST_ENTRY(path_entry) links; 5923934Sgibbs} *path_entry_t; 6023934Sgibbs 6123934Sgibbstypedef enum { 6223934Sgibbs QUOTED_INCLUDE, 6323934Sgibbs BRACKETED_INCLUDE, 6423934Sgibbs SOURCE_FILE 6523934Sgibbs} include_type; 6623934Sgibbs 6760938SjakeSLIST_HEAD(path_list, path_entry); 6823934Sgibbs 6923934Sgibbsextern struct path_list search_path; 7066270Sgibbsextern struct cs_tailq cs_tailq; 7139220Sgibbsextern struct scope_list scope_stack; 7239220Sgibbsextern struct symlist patch_functions; 7323934Sgibbsextern int includes_search_curdir; /* False if we've seen -I- */ 7423934Sgibbsextern char *appname; 75102668Sgibbsextern char *stock_include_file; 7623934Sgibbsextern int yylineno; 7723934Sgibbsextern char *yyfilename; 78102668Sgibbsextern char *prefix; 7995376Sgibbsextern char *patch_arg_list; 8079873Sgibbsextern char *versions; 8195376Sgibbsextern int src_mode; 8295376Sgibbsextern int dst_mode; 8395376Sgibbsstruct symbol; 8423934Sgibbs 8539220Sgibbsvoid stop(const char *errstring, int err_code); 8639220Sgibbsvoid include_file(char *file_name, include_type type); 8795376Sgibbsvoid expand_macro(struct symbol *macro_symbol); 8839220Sgibbsstruct instruction *seq_alloc(void); 8966270Sgibbsstruct critical_section *cs_alloc(void); 9039220Sgibbsstruct scope *scope_alloc(void); 9139220Sgibbsvoid process_scope(struct scope *); 92