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