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