1997-03-16 07:28:30 +00:00
|
|
|
/*
|
|
|
|
* Assembler for the sequencer program downloaded to Aic7xxx SCSI host adapters
|
|
|
|
*
|
|
|
|
* Copyright (c) 1997 Justin T. Gibbs.
|
2002-04-24 16:24:43 +00:00
|
|
|
* Copyright (c) 2001 Adaptec Inc.
|
1997-03-16 07:28:30 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
1997-06-27 19:38:56 +00:00
|
|
|
* notice, this list of conditions, and the following disclaimer,
|
1999-12-06 18:23:31 +00:00
|
|
|
* without modification.
|
2002-04-24 16:24:43 +00:00
|
|
|
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
|
|
|
* substantially similar to the "NO WARRANTY" disclaimer below
|
|
|
|
* ("Disclaimer") and any redistribution must be conditioned upon
|
|
|
|
* including a substantially similar Disclaimer requirement for further
|
|
|
|
* binary redistribution.
|
|
|
|
* 3. Neither the names of the above-listed copyright holders nor the names
|
|
|
|
* of any contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
1997-03-16 07:28:30 +00:00
|
|
|
*
|
2000-07-18 20:12:14 +00:00
|
|
|
* Alternatively, this software may be distributed under the terms of the
|
2002-04-24 16:24:43 +00:00
|
|
|
* GNU General Public License ("GPL") version 2 as published by the Free
|
|
|
|
* Software Foundation.
|
2000-07-18 20:12:14 +00:00
|
|
|
*
|
2002-04-24 16:24:43 +00:00
|
|
|
* NO WARRANTY
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
1997-03-16 07:28:30 +00:00
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
2002-04-24 16:24:43 +00:00
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGES.
|
1997-03-16 07:28:30 +00:00
|
|
|
*
|
2002-04-24 16:24:43 +00:00
|
|
|
* $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm.h#9 $
|
2000-09-16 20:02:39 +00:00
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
1997-03-16 07:28:30 +00:00
|
|
|
*/
|
|
|
|
|
2000-09-16 20:02:39 +00:00
|
|
|
#ifdef __linux__
|
|
|
|
#include "../queue.h"
|
|
|
|
#else
|
1997-03-16 07:28:30 +00:00
|
|
|
#include <sys/queue.h>
|
2000-09-16 20:02:39 +00:00
|
|
|
#endif
|
1997-03-16 07:28:30 +00:00
|
|
|
|
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct path_entry {
|
|
|
|
char *directory;
|
|
|
|
int quoted_includes_only;
|
2000-05-26 02:09:24 +00:00
|
|
|
SLIST_ENTRY(path_entry) links;
|
1997-03-16 07:28:30 +00:00
|
|
|
} *path_entry_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
QUOTED_INCLUDE,
|
|
|
|
BRACKETED_INCLUDE,
|
|
|
|
SOURCE_FILE
|
|
|
|
} include_type;
|
|
|
|
|
2000-05-26 02:09:24 +00:00
|
|
|
SLIST_HEAD(path_list, path_entry);
|
1997-03-16 07:28:30 +00:00
|
|
|
|
|
|
|
extern struct path_list search_path;
|
2000-09-22 22:19:55 +00:00
|
|
|
extern struct cs_tailq cs_tailq;
|
1998-09-15 07:24:17 +00:00
|
|
|
extern struct scope_list scope_stack;
|
|
|
|
extern struct symlist patch_functions;
|
1997-03-16 07:28:30 +00:00
|
|
|
extern int includes_search_curdir; /* False if we've seen -I- */
|
|
|
|
extern char *appname;
|
|
|
|
extern int yylineno;
|
|
|
|
extern char *yyfilename;
|
2002-04-24 16:24:43 +00:00
|
|
|
extern char *patch_arg_list;
|
2001-07-18 21:03:32 +00:00
|
|
|
extern char *versions;
|
2002-04-24 16:24:43 +00:00
|
|
|
extern int src_mode;
|
|
|
|
extern int dst_mode;
|
|
|
|
struct symbol;
|
1997-03-16 07:28:30 +00:00
|
|
|
|
1998-09-15 07:24:17 +00:00
|
|
|
void stop(const char *errstring, int err_code);
|
|
|
|
void include_file(char *file_name, include_type type);
|
2002-04-24 16:24:43 +00:00
|
|
|
void expand_macro(struct symbol *macro_symbol);
|
1998-09-15 07:24:17 +00:00
|
|
|
struct instruction *seq_alloc(void);
|
2000-09-22 22:19:55 +00:00
|
|
|
struct critical_section *cs_alloc(void);
|
1998-09-15 07:24:17 +00:00
|
|
|
struct scope *scope_alloc(void);
|
|
|
|
void process_scope(struct scope *);
|