xref: /freebsd/sys/dev/aic7xxx/aicasm/aicasm.h (revision 95ee2897)
1098ca2bdSWarner Losh /*-
265c303b1SJustin T. Gibbs  * Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
365c303b1SJustin T. Gibbs  *
4718cf2ccSPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
5718cf2ccSPedro F. Giffuni  *
665c303b1SJustin T. Gibbs  * Copyright (c) 1997 Justin T. Gibbs.
763183d8cSJustin T. Gibbs  * Copyright (c) 2001, 2002 Adaptec Inc.
865c303b1SJustin T. Gibbs  * All rights reserved.
965c303b1SJustin T. Gibbs  *
1065c303b1SJustin T. Gibbs  * Redistribution and use in source and binary forms, with or without
1165c303b1SJustin T. Gibbs  * modification, are permitted provided that the following conditions
1265c303b1SJustin T. Gibbs  * are met:
1365c303b1SJustin T. Gibbs  * 1. Redistributions of source code must retain the above copyright
14f68f348bSJustin T. Gibbs  *    notice, this list of conditions, and the following disclaimer,
1541c47eeeSJustin T. Gibbs  *    without modification.
167ce72dbaSJustin T. Gibbs  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
177ce72dbaSJustin T. Gibbs  *    substantially similar to the "NO WARRANTY" disclaimer below
187ce72dbaSJustin T. Gibbs  *    ("Disclaimer") and any redistribution must be conditioned upon
197ce72dbaSJustin T. Gibbs  *    including a substantially similar Disclaimer requirement for further
207ce72dbaSJustin T. Gibbs  *    binary redistribution.
217ce72dbaSJustin T. Gibbs  * 3. Neither the names of the above-listed copyright holders nor the names
227ce72dbaSJustin T. Gibbs  *    of any contributors may be used to endorse or promote products derived
237ce72dbaSJustin T. Gibbs  *    from this software without specific prior written permission.
2465c303b1SJustin T. Gibbs  *
25aa6dfd9dSJustin T. Gibbs  * Alternatively, this software may be distributed under the terms of the
267ce72dbaSJustin T. Gibbs  * GNU General Public License ("GPL") version 2 as published by the Free
277ce72dbaSJustin T. Gibbs  * Software Foundation.
28aa6dfd9dSJustin T. Gibbs  *
297ce72dbaSJustin T. Gibbs  * NO WARRANTY
307ce72dbaSJustin T. Gibbs  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
317ce72dbaSJustin T. Gibbs  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
327ce72dbaSJustin T. Gibbs  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
337ce72dbaSJustin T. Gibbs  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
347ce72dbaSJustin T. Gibbs  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3565c303b1SJustin T. Gibbs  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3665c303b1SJustin T. Gibbs  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
377ce72dbaSJustin T. Gibbs  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
387ce72dbaSJustin T. Gibbs  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
397ce72dbaSJustin T. Gibbs  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
407ce72dbaSJustin T. Gibbs  * POSSIBILITY OF SUCH DAMAGES.
4165c303b1SJustin T. Gibbs  *
4263183d8cSJustin T. Gibbs  * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#14 $
4365c303b1SJustin T. Gibbs  */
4465c303b1SJustin T. Gibbs 
4565c303b1SJustin T. Gibbs #include <sys/queue.h>
4665c303b1SJustin T. Gibbs 
4765c303b1SJustin T. Gibbs #ifndef TRUE
4865c303b1SJustin T. Gibbs #define TRUE 1
4965c303b1SJustin T. Gibbs #endif
5065c303b1SJustin T. Gibbs 
5165c303b1SJustin T. Gibbs #ifndef FALSE
5265c303b1SJustin T. Gibbs #define FALSE 0
5365c303b1SJustin T. Gibbs #endif
5465c303b1SJustin T. Gibbs 
5565c303b1SJustin T. Gibbs typedef struct path_entry {
5665c303b1SJustin T. Gibbs 	char	*directory;
5765c303b1SJustin T. Gibbs 	int	quoted_includes_only;
58e3975643SJake Burkholder 	SLIST_ENTRY(path_entry) links;
5965c303b1SJustin T. Gibbs } *path_entry_t;
6065c303b1SJustin T. Gibbs 
6165c303b1SJustin T. Gibbs typedef enum {
6265c303b1SJustin T. Gibbs 	QUOTED_INCLUDE,
6365c303b1SJustin T. Gibbs 	BRACKETED_INCLUDE,
6465c303b1SJustin T. Gibbs 	SOURCE_FILE
6565c303b1SJustin T. Gibbs } include_type;
6665c303b1SJustin T. Gibbs 
67e3975643SJake Burkholder SLIST_HEAD(path_list, path_entry);
6865c303b1SJustin T. Gibbs 
6965c303b1SJustin T. Gibbs extern struct path_list search_path;
70083d01f2SJustin T. Gibbs extern struct cs_tailq cs_tailq;
713bafc9d4SJustin T. Gibbs extern struct scope_list scope_stack;
723bafc9d4SJustin T. Gibbs extern struct symlist patch_functions;
7365c303b1SJustin T. Gibbs extern int includes_search_curdir;		/* False if we've seen -I- */
7465c303b1SJustin T. Gibbs extern char *appname;
7563183d8cSJustin T. Gibbs extern char *stock_include_file;
7665c303b1SJustin T. Gibbs extern int yylineno;
7765c303b1SJustin T. Gibbs extern char *yyfilename;
7863183d8cSJustin T. Gibbs extern char *prefix;
797ce72dbaSJustin T. Gibbs extern char *patch_arg_list;
802d0fbde8SJustin T. Gibbs extern char *versions;
817ce72dbaSJustin T. Gibbs extern int   src_mode;
827ce72dbaSJustin T. Gibbs extern int   dst_mode;
837ce72dbaSJustin T. Gibbs struct symbol;
8465c303b1SJustin T. Gibbs 
853bafc9d4SJustin T. Gibbs void stop(const char *errstring, int err_code);
863bafc9d4SJustin T. Gibbs void include_file(char *file_name, include_type type);
877ce72dbaSJustin T. Gibbs void expand_macro(struct symbol *macro_symbol);
883bafc9d4SJustin T. Gibbs struct instruction *seq_alloc(void);
89083d01f2SJustin T. Gibbs struct critical_section *cs_alloc(void);
903bafc9d4SJustin T. Gibbs struct scope *scope_alloc(void);
913bafc9d4SJustin T. Gibbs void process_scope(struct scope *);
92