From 7ebb73022cd781d8b3686ece97684d4d13d0bf73 Mon Sep 17 00:00:00 2001 From: gibbs Date: Fri, 27 Jun 1997 19:38:56 +0000 Subject: Modify my copyright notice to allow the sequencer to be used with GPLed software (aka Linux). Fix a few bugs in the sequencer assembler. Make it easy to compiler the assembler with debugging turned on. --- sys/dev/aic7xxx/aic7xxx.reg | 15 +++++-- sys/dev/aic7xxx/aic7xxx.seq | 71 ++++++++++++++++------------------ sys/dev/aic7xxx/aic7xxx_asm.c | 41 +++++++++++++++----- sys/dev/aic7xxx/aic7xxx_asm.h | 6 +-- sys/dev/aic7xxx/aicasm.c | 41 +++++++++++++++----- sys/dev/aic7xxx/aicasm.h | 6 +-- sys/dev/aic7xxx/aicasm/aicasm.c | 41 +++++++++++++++----- sys/dev/aic7xxx/aicasm/aicasm.h | 6 +-- sys/dev/aic7xxx/aicasm/aicasm_gram.y | 6 +-- sys/dev/aic7xxx/aicasm/aicasm_scan.l | 27 +++++++------ sys/dev/aic7xxx/aicasm/aicasm_symbol.c | 6 +-- sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 6 +-- sys/dev/aic7xxx/aicasm_gram.y | 6 +-- sys/dev/aic7xxx/aicasm_scan.l | 27 +++++++------ sys/dev/aic7xxx/aicasm_symbol.c | 6 +-- sys/dev/aic7xxx/aicasm_symbol.h | 6 +-- sys/dev/aic7xxx/gram.y | 6 +-- sys/dev/aic7xxx/scan.l | 27 +++++++------ sys/dev/aic7xxx/sequencer.h | 13 +++++-- sys/dev/aic7xxx/symbol.c | 6 +-- sys/dev/aic7xxx/symbol.h | 6 +-- 21 files changed, 235 insertions(+), 140 deletions(-) (limited to 'sys') diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg index 2bb3184..fabef19 100644 --- a/sys/dev/aic7xxx/aic7xxx.reg +++ b/sys/dev/aic7xxx/aic7xxx.reg @@ -1,21 +1,28 @@ /* * Aic7xxx register and scratch ram definitions. * - * Copyright (c) 1994, 1995, 1996, 1997 Justin T. Gibbs. + * Copyright (c) 1994-1997 Justin Gibbs. * 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 - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * + * Where this Software is combined with software released under the terms of + * the GNU Public License ("GPL") and the terms of the GPL would require the + * combined work to also be released under the terms of the GPL, the terms + * and conditions of this License will apply in addition to those of the + * GPL with the exception of any terms or conditions of this License that + * conflict with, or are expressly prohibited by, the GPL. + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -28,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.reg,v 1.2 1997/04/14 02:26:56 gibbs Exp $ + * $Id: aic7xxx.reg,v 1.3 1997/04/24 16:52:16 gibbs Exp $ */ /* diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index f6cfe81..3c2d89c 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -1,45 +1,42 @@ -/*+M*********************************************************************** - *Adaptec 274x/284x/294x device driver for Linux and FreeBSD. - * - *Copyright (c) 1994 John Aycock - * The University of Calgary Department of Computer Science. - * All rights reserved. +/* + * Adaptec 274x/284x/294x device driver firmware for Linux and FreeBSD. * - *FreeBSD, Twin, Wide, 2 command per target support, tagged queuing, - *SCB paging and other optimizations: - *Copyright (c) 1994, 1995, 1996, 1997 Justin Gibbs. All rights reserved. + * Copyright (c) 1994-1997 Justin Gibbs. + * 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 - * notice, this list of conditions, and the following disclaimer. - *2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - *3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of Calgary - * Department of Computer Science and its contributors. - *4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 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 + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. * - *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - *ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - *ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - *OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - *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 DAMAGE. + * Where this Software is combined with software released under the terms of + * the GNU Public License ("GPL") and the terms of the GPL would require the + * combined work to also be released under the terms of the GPL, the terms + * and conditions of this License will apply in addition to those of the + * GPL with the exception of any terms or conditions of this License that + * conflict with, or are expressly prohibited by, the GPL. * - * $Id: aic7xxx.seq,v 1.72 1997/04/18 16:31:55 gibbs Exp $ + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * 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 DAMAGE. * - *-M************************************************************************/ + * $Id: aic7xxx.seq,v 1.73 1997/04/24 16:52:18 gibbs Exp $ + */ #include #include diff --git a/sys/dev/aic7xxx/aic7xxx_asm.c b/sys/dev/aic7xxx/aic7xxx_asm.c index 9e3e4e1..63908ce 100644 --- a/sys/dev/aic7xxx/aic7xxx_asm.c +++ b/sys/dev/aic7xxx/aic7xxx_asm.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.c,v 1.16 1997/03/18 19:18:39 gibbs Exp $ + * $Id: aic7xxx_asm.c,v 1.17 1997/04/10 19:13:07 gibbs Exp $ */ #include #include @@ -56,6 +56,10 @@ int includes_search_curdir; char *appname; FILE *ofile; char *ofilename; +char *regfilename; +FILE *regfile; +char *listfilename; +FILE *listfile; static STAILQ_HEAD(,instruction) seq_program; static STAILQ_HEAD(, patch) patch_list; @@ -78,10 +82,6 @@ main(argc, argv) int ch; int retval; char *inputfilename; - char *regfilename; - FILE *regfile; - char *listfilename; - FILE *listfile; char *options; SLIST_INIT(&search_path); @@ -100,10 +100,15 @@ main(argc, argv) switch(ch) { case 'd': #if DEBUG - if (strcmp(optarg, "s") == 0) + if (strcmp(optarg, "s") == 0) { yy_flex_debug = 1; - else if (strcmp(optarg, "p") == 0) + } else if (strcmp(optarg, "p") == 0) { yydebug = 1; + } else { + fprintf(stderr, "%s: -d Requires either an " + "'s' or 'p' argument\n", appname); + usage(); + } #else stop("-d: Assembler not built with debugging " "information", EX_SOFTWARE); @@ -448,6 +453,24 @@ stop(string, err_code) } } + if (regfile != NULL) { + fclose(regfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, regfilename); + unlink(regfilename); + } + } + + if (listfile != NULL) { + fclose(listfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, listfilename); + unlink(listfilename); + } + } + symlist_free(&patch_options); symtable_close(); diff --git a/sys/dev/aic7xxx/aic7xxx_asm.h b/sys/dev/aic7xxx/aic7xxx_asm.h index f92fc77..a81afc1 100644 --- a/sys/dev/aic7xxx/aic7xxx_asm.h +++ b/sys/dev/aic7xxx/aic7xxx_asm.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.h,v 1.1.2.1 1997/03/16 07:21:32 gibbs Exp $ + * $Id: aic7xxx_asm.h,v 1.2 1997/03/16 07:28:30 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm.c b/sys/dev/aic7xxx/aicasm.c index 9e3e4e1..63908ce 100644 --- a/sys/dev/aic7xxx/aicasm.c +++ b/sys/dev/aic7xxx/aicasm.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.c,v 1.16 1997/03/18 19:18:39 gibbs Exp $ + * $Id: aic7xxx_asm.c,v 1.17 1997/04/10 19:13:07 gibbs Exp $ */ #include #include @@ -56,6 +56,10 @@ int includes_search_curdir; char *appname; FILE *ofile; char *ofilename; +char *regfilename; +FILE *regfile; +char *listfilename; +FILE *listfile; static STAILQ_HEAD(,instruction) seq_program; static STAILQ_HEAD(, patch) patch_list; @@ -78,10 +82,6 @@ main(argc, argv) int ch; int retval; char *inputfilename; - char *regfilename; - FILE *regfile; - char *listfilename; - FILE *listfile; char *options; SLIST_INIT(&search_path); @@ -100,10 +100,15 @@ main(argc, argv) switch(ch) { case 'd': #if DEBUG - if (strcmp(optarg, "s") == 0) + if (strcmp(optarg, "s") == 0) { yy_flex_debug = 1; - else if (strcmp(optarg, "p") == 0) + } else if (strcmp(optarg, "p") == 0) { yydebug = 1; + } else { + fprintf(stderr, "%s: -d Requires either an " + "'s' or 'p' argument\n", appname); + usage(); + } #else stop("-d: Assembler not built with debugging " "information", EX_SOFTWARE); @@ -448,6 +453,24 @@ stop(string, err_code) } } + if (regfile != NULL) { + fclose(regfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, regfilename); + unlink(regfilename); + } + } + + if (listfile != NULL) { + fclose(listfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, listfilename); + unlink(listfilename); + } + } + symlist_free(&patch_options); symtable_close(); diff --git a/sys/dev/aic7xxx/aicasm.h b/sys/dev/aic7xxx/aicasm.h index f92fc77..a81afc1 100644 --- a/sys/dev/aic7xxx/aicasm.h +++ b/sys/dev/aic7xxx/aicasm.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.h,v 1.1.2.1 1997/03/16 07:21:32 gibbs Exp $ + * $Id: aic7xxx_asm.h,v 1.2 1997/03/16 07:28:30 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 9e3e4e1..63908ce 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.c,v 1.16 1997/03/18 19:18:39 gibbs Exp $ + * $Id: aic7xxx_asm.c,v 1.17 1997/04/10 19:13:07 gibbs Exp $ */ #include #include @@ -56,6 +56,10 @@ int includes_search_curdir; char *appname; FILE *ofile; char *ofilename; +char *regfilename; +FILE *regfile; +char *listfilename; +FILE *listfile; static STAILQ_HEAD(,instruction) seq_program; static STAILQ_HEAD(, patch) patch_list; @@ -78,10 +82,6 @@ main(argc, argv) int ch; int retval; char *inputfilename; - char *regfilename; - FILE *regfile; - char *listfilename; - FILE *listfile; char *options; SLIST_INIT(&search_path); @@ -100,10 +100,15 @@ main(argc, argv) switch(ch) { case 'd': #if DEBUG - if (strcmp(optarg, "s") == 0) + if (strcmp(optarg, "s") == 0) { yy_flex_debug = 1; - else if (strcmp(optarg, "p") == 0) + } else if (strcmp(optarg, "p") == 0) { yydebug = 1; + } else { + fprintf(stderr, "%s: -d Requires either an " + "'s' or 'p' argument\n", appname); + usage(); + } #else stop("-d: Assembler not built with debugging " "information", EX_SOFTWARE); @@ -448,6 +453,24 @@ stop(string, err_code) } } + if (regfile != NULL) { + fclose(regfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, regfilename); + unlink(regfilename); + } + } + + if (listfile != NULL) { + fclose(listfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, listfilename); + unlink(listfilename); + } + } + symlist_free(&patch_options); symtable_close(); diff --git a/sys/dev/aic7xxx/aicasm/aicasm.h b/sys/dev/aic7xxx/aicasm/aicasm.h index f92fc77..a81afc1 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.h +++ b/sys/dev/aic7xxx/aicasm/aicasm.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx_asm.h,v 1.1.2.1 1997/03/16 07:21:32 gibbs Exp $ + * $Id: aic7xxx_asm.h,v 1.2 1997/03/16 07:28:30 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index 0c75edc..6f9b4e2 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: gram.y,v 1.1 1997/03/16 07:08:16 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm/aicasm_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_scan.l index ec4535c..dcd7d88 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_scan.l +++ b/sys/dev/aic7xxx/aicasm/aicasm_scan.l @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scan.l,v 1.1 1997/03/16 07:08:17 gibbs Exp $ + * $Id: scan.l,v 1.2 1997/03/16 17:31:59 bde Exp $ */ #include @@ -208,15 +208,19 @@ include_file(file_name, type) stop("Unable to open input file", EX_SOFTWARE); /* NOTREACHED */ } - include = (include_t *)malloc(sizeof(include_t)); - if (include == NULL) { - stop("Unable to allocate include stack entry", EX_SOFTWARE); - /* NOTREACHED */ + + if (type != SOURCE_FILE) { + include = (include_t *)malloc(sizeof(include_t)); + if (include == NULL) { + stop("Unable to allocate include stack entry", + EX_SOFTWARE); + /* NOTREACHED */ + } + include->buffer = YY_CURRENT_BUFFER; + include->lineno = yylineno; + include->filename = yyfilename; + SLIST_INSERT_HEAD(&include_stack, include, links); } - include->buffer = YY_CURRENT_BUFFER; - include->lineno = yylineno; - include->filename = yyfilename; - SLIST_INSERT_HEAD(&include_stack, include, links); yy_switch_to_buffer(yy_create_buffer(newfile, YY_BUF_SIZE)); yylineno = 1; yyfilename = strdup(file_name); @@ -231,6 +235,7 @@ yywrap() (void)fclose(yyin); if (yyfilename != NULL) free(yyfilename); + yyfilename = NULL; include = include_stack.slh_first; if (include != NULL) { yy_switch_to_buffer(include->buffer); diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c index e2b93ef..d6b194e 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.c,v 1.1 1997/03/16 07:08:18 gibbs Exp $ */ diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h index cf8fa00..485cf6c 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.h,v 1.1 1997/03/16 07:08:19 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm_gram.y b/sys/dev/aic7xxx/aicasm_gram.y index 0c75edc..6f9b4e2 100644 --- a/sys/dev/aic7xxx/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm_gram.y @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: gram.y,v 1.1 1997/03/16 07:08:16 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/aicasm_scan.l b/sys/dev/aic7xxx/aicasm_scan.l index ec4535c..dcd7d88 100644 --- a/sys/dev/aic7xxx/aicasm_scan.l +++ b/sys/dev/aic7xxx/aicasm_scan.l @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scan.l,v 1.1 1997/03/16 07:08:17 gibbs Exp $ + * $Id: scan.l,v 1.2 1997/03/16 17:31:59 bde Exp $ */ #include @@ -208,15 +208,19 @@ include_file(file_name, type) stop("Unable to open input file", EX_SOFTWARE); /* NOTREACHED */ } - include = (include_t *)malloc(sizeof(include_t)); - if (include == NULL) { - stop("Unable to allocate include stack entry", EX_SOFTWARE); - /* NOTREACHED */ + + if (type != SOURCE_FILE) { + include = (include_t *)malloc(sizeof(include_t)); + if (include == NULL) { + stop("Unable to allocate include stack entry", + EX_SOFTWARE); + /* NOTREACHED */ + } + include->buffer = YY_CURRENT_BUFFER; + include->lineno = yylineno; + include->filename = yyfilename; + SLIST_INSERT_HEAD(&include_stack, include, links); } - include->buffer = YY_CURRENT_BUFFER; - include->lineno = yylineno; - include->filename = yyfilename; - SLIST_INSERT_HEAD(&include_stack, include, links); yy_switch_to_buffer(yy_create_buffer(newfile, YY_BUF_SIZE)); yylineno = 1; yyfilename = strdup(file_name); @@ -231,6 +235,7 @@ yywrap() (void)fclose(yyin); if (yyfilename != NULL) free(yyfilename); + yyfilename = NULL; include = include_stack.slh_first; if (include != NULL) { yy_switch_to_buffer(include->buffer); diff --git a/sys/dev/aic7xxx/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm_symbol.c index e2b93ef..d6b194e 100644 --- a/sys/dev/aic7xxx/aicasm_symbol.c +++ b/sys/dev/aic7xxx/aicasm_symbol.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.c,v 1.1 1997/03/16 07:08:18 gibbs Exp $ */ diff --git a/sys/dev/aic7xxx/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm_symbol.h index cf8fa00..485cf6c 100644 --- a/sys/dev/aic7xxx/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm_symbol.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.h,v 1.1 1997/03/16 07:08:19 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/gram.y b/sys/dev/aic7xxx/gram.y index 0c75edc..6f9b4e2 100644 --- a/sys/dev/aic7xxx/gram.y +++ b/sys/dev/aic7xxx/gram.y @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: gram.y,v 1.1 1997/03/16 07:08:16 gibbs Exp $ */ #include diff --git a/sys/dev/aic7xxx/scan.l b/sys/dev/aic7xxx/scan.l index ec4535c..dcd7d88 100644 --- a/sys/dev/aic7xxx/scan.l +++ b/sys/dev/aic7xxx/scan.l @@ -9,8 +9,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: scan.l,v 1.1 1997/03/16 07:08:17 gibbs Exp $ + * $Id: scan.l,v 1.2 1997/03/16 17:31:59 bde Exp $ */ #include @@ -208,15 +208,19 @@ include_file(file_name, type) stop("Unable to open input file", EX_SOFTWARE); /* NOTREACHED */ } - include = (include_t *)malloc(sizeof(include_t)); - if (include == NULL) { - stop("Unable to allocate include stack entry", EX_SOFTWARE); - /* NOTREACHED */ + + if (type != SOURCE_FILE) { + include = (include_t *)malloc(sizeof(include_t)); + if (include == NULL) { + stop("Unable to allocate include stack entry", + EX_SOFTWARE); + /* NOTREACHED */ + } + include->buffer = YY_CURRENT_BUFFER; + include->lineno = yylineno; + include->filename = yyfilename; + SLIST_INSERT_HEAD(&include_stack, include, links); } - include->buffer = YY_CURRENT_BUFFER; - include->lineno = yylineno; - include->filename = yyfilename; - SLIST_INSERT_HEAD(&include_stack, include, links); yy_switch_to_buffer(yy_create_buffer(newfile, YY_BUF_SIZE)); yylineno = 1; yyfilename = strdup(file_name); @@ -231,6 +235,7 @@ yywrap() (void)fclose(yyin); if (yyfilename != NULL) free(yyfilename); + yyfilename = NULL; include = include_stack.slh_first; if (include != NULL) { yy_switch_to_buffer(include->buffer); diff --git a/sys/dev/aic7xxx/sequencer.h b/sys/dev/aic7xxx/sequencer.h index ed22715..00d1f08 100644 --- a/sys/dev/aic7xxx/sequencer.h +++ b/sys/dev/aic7xxx/sequencer.h @@ -9,14 +9,21 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * + * Where this Software is combined with software released under the terms of + * the GNU Public License ("GPL") and the terms of the GPL would require the + * combined work to also be released under the terms of the GPL, the terms + * and conditions of this License will apply in addition to those of the + * GPL with the exception of any terms or conditions of this License that + * conflict with, or are expressly prohibited by, the GPL. + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -29,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: sequencer.h,v 1.1 1997/03/16 07:08:18 gibbs Exp $ */ struct ins_format1 { diff --git a/sys/dev/aic7xxx/symbol.c b/sys/dev/aic7xxx/symbol.c index e2b93ef..d6b194e 100644 --- a/sys/dev/aic7xxx/symbol.c +++ b/sys/dev/aic7xxx/symbol.c @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.c,v 1.1 1997/03/16 07:08:18 gibbs Exp $ */ diff --git a/sys/dev/aic7xxx/symbol.h b/sys/dev/aic7xxx/symbol.h index cf8fa00..485cf6c 100644 --- a/sys/dev/aic7xxx/symbol.h +++ b/sys/dev/aic7xxx/symbol.h @@ -8,8 +8,8 @@ * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. + * notice, this list of conditions, and the following disclaimer, + * without modification, immediately at the beginning of the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: symbol.h,v 1.1 1997/03/16 07:08:19 gibbs Exp $ */ #include -- cgit v1.1