Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
%{
|
2005-01-06 01:43:34 +00:00
|
|
|
/*-
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
* Lexical Analyzer for the Aic7xxx SCSI Host adapter sequencer assembler.
|
|
|
|
*
|
2002-04-24 16:24:43 +00:00
|
|
|
* Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.
|
2002-08-31 06:39:41 +00:00
|
|
|
* Copyright (c) 2001, 2002 Adaptec Inc.
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +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.
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +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
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +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.
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
*
|
2003-12-16 23:54:07 +00:00
|
|
|
* $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#19 $
|
2000-09-16 20:02:39 +00:00
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
*/
|
|
|
|
|
1997-03-16 17:31:59 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2002-09-27 03:23:02 +00:00
|
|
|
#include <inttypes.h>
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
#include <limits.h>
|
2002-04-24 16:24:43 +00:00
|
|
|
#include <regex.h>
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sysexits.h>
|
|
|
|
#include <sys/queue.h>
|
|
|
|
|
1997-09-03 03:44:58 +00:00
|
|
|
#include "aicasm.h"
|
|
|
|
#include "aicasm_symbol.h"
|
2002-04-24 16:24:43 +00:00
|
|
|
#include "aicasm_gram.h"
|
|
|
|
|
|
|
|
/* This is used for macro body capture too, so err on the large size. */
|
|
|
|
#define MAX_STR_CONST 4096
|
|
|
|
static char string_buf[MAX_STR_CONST];
|
|
|
|
static char *string_buf_ptr;
|
|
|
|
static int parren_count;
|
|
|
|
static int quote_count;
|
2009-06-01 18:42:16 +00:00
|
|
|
static char msgbuf[255];
|
|
|
|
|
|
|
|
extern int yylex(void);
|
|
|
|
extern int mmlex(void);
|
|
|
|
extern int mmparse(void);
|
|
|
|
extern void mm_switch_to_buffer(YY_BUFFER_STATE);
|
|
|
|
extern void mm_delete_buffer(YY_BUFFER_STATE);
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
%}
|
|
|
|
|
2011-12-16 00:04:28 +00:00
|
|
|
%option noinput
|
|
|
|
|
2002-04-24 16:24:43 +00:00
|
|
|
PATH ([/]*[-A-Za-z0-9_.])+
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
WORD [A-Za-z_][-A-Za-z_0-9]*
|
|
|
|
SPACE [ \t]+
|
2002-04-24 16:24:43 +00:00
|
|
|
MCARG [^(), \t]+
|
|
|
|
MBODY ((\\[^\n])*[^\n\\]*)+
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
%x COMMENT
|
1998-09-15 07:24:17 +00:00
|
|
|
%x CEXPR
|
|
|
|
%x INCLUDE
|
2001-07-18 21:03:32 +00:00
|
|
|
%x STRING
|
2002-04-24 16:24:43 +00:00
|
|
|
%x MACRODEF
|
|
|
|
%x MACROARGLIST
|
|
|
|
%x MACROCALLARGS
|
|
|
|
%x MACROBODY
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
%%
|
|
|
|
\n { ++yylineno; }
|
2003-12-16 23:54:07 +00:00
|
|
|
\r ;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
"/*" { BEGIN COMMENT; /* Enter comment eating state */ }
|
|
|
|
<COMMENT>"/*" { fprintf(stderr, "Warning! Comment within comment."); }
|
|
|
|
<COMMENT>\n { ++yylineno; }
|
|
|
|
<COMMENT>[^*/\n]* ;
|
|
|
|
<COMMENT>"*"+[^*/\n]* ;
|
|
|
|
<COMMENT>"/"+[^*/\n]* ;
|
|
|
|
<COMMENT>"*"+"/" { BEGIN INITIAL; }
|
1998-09-15 07:24:17 +00:00
|
|
|
if[ \t]*\( {
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
parren_count = 1;
|
|
|
|
BEGIN CEXPR;
|
|
|
|
return T_IF;
|
|
|
|
}
|
|
|
|
<CEXPR>\( { *string_buf_ptr++ = '('; parren_count++; }
|
|
|
|
<CEXPR>\) {
|
|
|
|
parren_count--;
|
|
|
|
if (parren_count == 0) {
|
|
|
|
/* All done */
|
|
|
|
BEGIN INITIAL;
|
|
|
|
*string_buf_ptr = '\0';
|
|
|
|
yylval.sym = symtable_get(string_buf);
|
|
|
|
return T_CEXPR;
|
|
|
|
} else {
|
|
|
|
*string_buf_ptr++ = ')';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
<CEXPR>\n { ++yylineno; }
|
2003-12-16 23:54:07 +00:00
|
|
|
<CEXPR>\r ;
|
2000-09-16 20:02:39 +00:00
|
|
|
<CEXPR>[^()\n]+ {
|
2001-07-18 21:03:32 +00:00
|
|
|
char *yptr;
|
1998-09-15 07:24:17 +00:00
|
|
|
|
2001-07-18 21:03:32 +00:00
|
|
|
yptr = yytext;
|
2000-09-16 20:02:39 +00:00
|
|
|
while (*yptr != '\0') {
|
|
|
|
/* Remove duplicate spaces */
|
|
|
|
if (*yptr == '\t')
|
|
|
|
*yptr = ' ';
|
|
|
|
if (*yptr == ' '
|
|
|
|
&& string_buf_ptr != string_buf
|
|
|
|
&& string_buf_ptr[-1] == ' ')
|
|
|
|
yptr++;
|
|
|
|
else
|
|
|
|
*string_buf_ptr++ = *yptr++;
|
|
|
|
}
|
1998-09-15 07:24:17 +00:00
|
|
|
}
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
2001-07-18 21:03:32 +00:00
|
|
|
VERSION { return T_VERSION; }
|
2002-08-31 06:39:41 +00:00
|
|
|
PREFIX { return T_PREFIX; }
|
2002-04-24 16:24:43 +00:00
|
|
|
PATCH_ARG_LIST { return T_PATCH_ARG_LIST; }
|
2001-07-18 21:03:32 +00:00
|
|
|
\" {
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
BEGIN STRING;
|
|
|
|
}
|
|
|
|
<STRING>[^"]+ {
|
|
|
|
char *yptr;
|
|
|
|
|
|
|
|
yptr = yytext;
|
|
|
|
while (*yptr)
|
|
|
|
*string_buf_ptr++ = *yptr++;
|
|
|
|
}
|
|
|
|
<STRING>\" {
|
|
|
|
/* All done */
|
|
|
|
BEGIN INITIAL;
|
|
|
|
*string_buf_ptr = '\0';
|
|
|
|
yylval.str = string_buf;
|
|
|
|
return T_STRING;
|
|
|
|
}
|
2002-04-24 16:24:43 +00:00
|
|
|
{SPACE} ;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
/* Register/SCB/SRAM definition keywords */
|
2002-04-24 16:24:43 +00:00
|
|
|
export { return T_EXPORT; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
register { return T_REGISTER; }
|
|
|
|
const { yylval.value = FALSE; return T_CONST; }
|
1997-09-27 19:37:31 +00:00
|
|
|
download { return T_DOWNLOAD; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
address { return T_ADDRESS; }
|
|
|
|
access_mode { return T_ACCESS_MODE; }
|
2002-04-24 16:24:43 +00:00
|
|
|
modes { return T_MODES; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
RW|RO|WO {
|
|
|
|
if (strcmp(yytext, "RW") == 0)
|
|
|
|
yylval.value = RW;
|
|
|
|
else if (strcmp(yytext, "RO") == 0)
|
|
|
|
yylval.value = RO;
|
|
|
|
else
|
|
|
|
yylval.value = WO;
|
|
|
|
return T_MODE;
|
|
|
|
}
|
2000-09-22 22:19:55 +00:00
|
|
|
BEGIN_CRITICAL { return T_BEGIN_CS; }
|
|
|
|
END_CRITICAL { return T_END_CS; }
|
2002-04-24 16:24:43 +00:00
|
|
|
SET_SRC_MODE { return T_SET_SRC_MODE; }
|
|
|
|
SET_DST_MODE { return T_SET_DST_MODE; }
|
2002-08-31 06:39:41 +00:00
|
|
|
field { return T_FIELD; }
|
|
|
|
enum { return T_ENUM; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
mask { return T_MASK; }
|
|
|
|
alias { return T_ALIAS; }
|
|
|
|
size { return T_SIZE; }
|
|
|
|
scb { return T_SCB; }
|
|
|
|
scratch_ram { return T_SRAM; }
|
|
|
|
accumulator { return T_ACCUM; }
|
2002-04-24 16:24:43 +00:00
|
|
|
mode_pointer { return T_MODE_PTR; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
allones { return T_ALLONES; }
|
|
|
|
allzeros { return T_ALLZEROS; }
|
|
|
|
none { return T_NONE; }
|
|
|
|
sindex { return T_SINDEX; }
|
|
|
|
A { return T_A; }
|
|
|
|
|
|
|
|
/* Opcodes */
|
|
|
|
shl { return T_SHL; }
|
|
|
|
shr { return T_SHR; }
|
|
|
|
ror { return T_ROR; }
|
|
|
|
rol { return T_ROL; }
|
|
|
|
mvi { return T_MVI; }
|
|
|
|
mov { return T_MOV; }
|
|
|
|
clr { return T_CLR; }
|
|
|
|
jmp { return T_JMP; }
|
|
|
|
jc { return T_JC; }
|
|
|
|
jnc { return T_JNC; }
|
|
|
|
je { return T_JE; }
|
|
|
|
jne { return T_JNE; }
|
|
|
|
jz { return T_JZ; }
|
|
|
|
jnz { return T_JNZ; }
|
|
|
|
call { return T_CALL; }
|
|
|
|
add { return T_ADD; }
|
|
|
|
adc { return T_ADC; }
|
1998-09-15 07:24:17 +00:00
|
|
|
bmov { return T_BMOV; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
inc { return T_INC; }
|
|
|
|
dec { return T_DEC; }
|
|
|
|
stc { return T_STC; }
|
|
|
|
clc { return T_CLC; }
|
|
|
|
cmp { return T_CMP; }
|
2000-07-18 20:12:14 +00:00
|
|
|
not { return T_NOT; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
xor { return T_XOR; }
|
|
|
|
test { return T_TEST;}
|
|
|
|
and { return T_AND; }
|
|
|
|
or { return T_OR; }
|
|
|
|
ret { return T_RET; }
|
|
|
|
nop { return T_NOP; }
|
1998-09-15 07:24:17 +00:00
|
|
|
else { return T_ELSE; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
/* Allowed Symbols */
|
2002-04-24 16:24:43 +00:00
|
|
|
\<\< { return T_EXPR_LSHIFT; }
|
|
|
|
\>\> { return T_EXPR_RSHIFT; }
|
|
|
|
[-+,:()~|&."{};<>[\]/*!=] { return yytext[0]; }
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
/* Number processing */
|
|
|
|
0[0-7]* {
|
|
|
|
yylval.value = strtol(yytext, NULL, 8);
|
|
|
|
return T_NUMBER;
|
|
|
|
}
|
|
|
|
|
|
|
|
0[xX][0-9a-fA-F]+ {
|
|
|
|
yylval.value = strtoul(yytext + 2, NULL, 16);
|
|
|
|
return T_NUMBER;
|
|
|
|
}
|
|
|
|
|
|
|
|
[1-9][0-9]* {
|
|
|
|
yylval.value = strtol(yytext, NULL, 10);
|
|
|
|
return T_NUMBER;
|
|
|
|
}
|
|
|
|
/* Include Files */
|
2001-07-18 21:03:32 +00:00
|
|
|
#include{SPACE} {
|
|
|
|
BEGIN INCLUDE;
|
|
|
|
quote_count = 0;
|
|
|
|
return T_INCLUDE;
|
|
|
|
}
|
|
|
|
<INCLUDE>[<] { return yytext[0]; }
|
|
|
|
<INCLUDE>[>] { BEGIN INITIAL; return yytext[0]; }
|
|
|
|
<INCLUDE>[\"] {
|
|
|
|
if (quote_count != 0)
|
|
|
|
BEGIN INITIAL;
|
|
|
|
quote_count++;
|
|
|
|
return yytext[0];
|
|
|
|
}
|
2002-04-24 16:24:43 +00:00
|
|
|
<INCLUDE>{PATH} {
|
2001-07-18 21:03:32 +00:00
|
|
|
char *yptr;
|
|
|
|
|
|
|
|
yptr = yytext;
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
while (*yptr)
|
|
|
|
*string_buf_ptr++ = *yptr++;
|
|
|
|
yylval.str = string_buf;
|
|
|
|
*string_buf_ptr = '\0';
|
|
|
|
return T_PATH;
|
|
|
|
}
|
2002-04-24 16:24:43 +00:00
|
|
|
<INCLUDE>. { stop("Invalid include line", EX_DATAERR); }
|
|
|
|
#define{SPACE} {
|
|
|
|
BEGIN MACRODEF;
|
|
|
|
return T_DEFINE;
|
|
|
|
}
|
|
|
|
<MACRODEF>{WORD}{SPACE} {
|
|
|
|
char *yptr;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
2002-04-24 16:24:43 +00:00
|
|
|
/* Strip space and return as a normal symbol */
|
|
|
|
yptr = yytext;
|
|
|
|
while (*yptr != ' ' && *yptr != '\t')
|
|
|
|
yptr++;
|
|
|
|
*yptr = '\0';
|
|
|
|
yylval.sym = symtable_get(yytext);
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
BEGIN MACROBODY;
|
|
|
|
return T_SYMBOL;
|
|
|
|
}
|
|
|
|
<MACRODEF>{WORD}\( {
|
|
|
|
/*
|
|
|
|
* We store the symbol with its opening
|
|
|
|
* parren so we can differentiate macros
|
|
|
|
* that take args from macros with the
|
|
|
|
* same name that do not take args as
|
|
|
|
* is allowed in C.
|
|
|
|
*/
|
|
|
|
BEGIN MACROARGLIST;
|
|
|
|
yylval.sym = symtable_get(yytext);
|
|
|
|
unput('(');
|
|
|
|
return T_SYMBOL;
|
|
|
|
}
|
|
|
|
<MACROARGLIST>{WORD} {
|
|
|
|
yylval.str = yytext;
|
|
|
|
return T_ARG;
|
|
|
|
}
|
|
|
|
<MACROARGLIST>{SPACE} ;
|
|
|
|
<MACROARGLIST>[(,] {
|
|
|
|
return yytext[0];
|
|
|
|
}
|
|
|
|
<MACROARGLIST>[)] {
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
BEGIN MACROBODY;
|
|
|
|
return ')';
|
|
|
|
}
|
|
|
|
<MACROARGLIST>. {
|
2009-06-01 18:42:16 +00:00
|
|
|
snprintf(msgbuf, sizeof(msgbuf), "Invalid character "
|
2002-04-24 16:24:43 +00:00
|
|
|
"'%c' in macro argument list",
|
|
|
|
yytext[0]);
|
2009-06-01 18:42:16 +00:00
|
|
|
stop(msgbuf, EX_DATAERR);
|
2002-04-24 16:24:43 +00:00
|
|
|
}
|
|
|
|
<MACROCALLARGS>{SPACE} ;
|
|
|
|
<MACROCALLARGS>\( {
|
|
|
|
parren_count++;
|
|
|
|
if (parren_count == 1)
|
|
|
|
return ('(');
|
|
|
|
*string_buf_ptr++ = '(';
|
|
|
|
}
|
|
|
|
<MACROCALLARGS>\) {
|
|
|
|
parren_count--;
|
|
|
|
if (parren_count == 0) {
|
|
|
|
BEGIN INITIAL;
|
|
|
|
return (')');
|
|
|
|
}
|
|
|
|
*string_buf_ptr++ = ')';
|
|
|
|
}
|
|
|
|
<MACROCALLARGS>{MCARG} {
|
|
|
|
char *yptr;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
2002-04-24 16:24:43 +00:00
|
|
|
yptr = yytext;
|
|
|
|
while (*yptr)
|
|
|
|
*string_buf_ptr++ = *yptr++;
|
|
|
|
}
|
|
|
|
<MACROCALLARGS>\, {
|
|
|
|
if (string_buf_ptr != string_buf) {
|
|
|
|
/*
|
|
|
|
* Return an argument and
|
|
|
|
* rescan this comma so we
|
|
|
|
* can return it as well.
|
|
|
|
*/
|
|
|
|
*string_buf_ptr = '\0';
|
|
|
|
yylval.str = string_buf;
|
|
|
|
string_buf_ptr = string_buf;
|
|
|
|
unput(',');
|
|
|
|
return T_ARG;
|
|
|
|
}
|
|
|
|
return ',';
|
|
|
|
}
|
|
|
|
<MACROBODY>\\\n {
|
|
|
|
/* Eat escaped newlines. */
|
|
|
|
++yylineno;
|
|
|
|
}
|
2003-12-16 23:54:07 +00:00
|
|
|
<MACROBODY>\r ;
|
2002-04-24 16:24:43 +00:00
|
|
|
<MACROBODY>\n {
|
|
|
|
/* Macros end on the first unescaped newline. */
|
|
|
|
BEGIN INITIAL;
|
|
|
|
*string_buf_ptr = '\0';
|
|
|
|
yylval.str = string_buf;
|
|
|
|
++yylineno;
|
|
|
|
return T_MACROBODY;
|
|
|
|
}
|
|
|
|
<MACROBODY>{MBODY} {
|
|
|
|
char *yptr;
|
2003-12-16 23:54:07 +00:00
|
|
|
char c;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
2002-04-24 16:24:43 +00:00
|
|
|
yptr = yytext;
|
2009-06-01 18:42:16 +00:00
|
|
|
while ((c = *yptr++)) {
|
2003-12-16 23:54:07 +00:00
|
|
|
/*
|
|
|
|
* Strip carriage returns.
|
|
|
|
*/
|
|
|
|
if (c == '\r')
|
|
|
|
continue;
|
|
|
|
*string_buf_ptr++ = c;
|
|
|
|
}
|
2002-04-24 16:24:43 +00:00
|
|
|
}
|
|
|
|
{WORD}\( {
|
|
|
|
char *yptr;
|
|
|
|
char *ycopy;
|
|
|
|
|
|
|
|
/* May be a symbol or a macro invocation. */
|
|
|
|
yylval.sym = symtable_get(yytext);
|
|
|
|
if (yylval.sym->type == MACRO) {
|
|
|
|
YY_BUFFER_STATE old_state;
|
|
|
|
YY_BUFFER_STATE temp_state;
|
|
|
|
|
|
|
|
ycopy = strdup(yytext);
|
|
|
|
yptr = ycopy + yyleng;
|
|
|
|
while (yptr > ycopy)
|
|
|
|
unput(*--yptr);
|
|
|
|
old_state = YY_CURRENT_BUFFER;
|
|
|
|
temp_state =
|
|
|
|
yy_create_buffer(stdin,
|
|
|
|
YY_BUF_SIZE);
|
|
|
|
yy_switch_to_buffer(temp_state);
|
|
|
|
mm_switch_to_buffer(old_state);
|
|
|
|
mmparse();
|
|
|
|
mm_switch_to_buffer(temp_state);
|
|
|
|
yy_switch_to_buffer(old_state);
|
|
|
|
mm_delete_buffer(temp_state);
|
|
|
|
expand_macro(yylval.sym);
|
|
|
|
} else {
|
|
|
|
if (yylval.sym->type == UNINITIALIZED) {
|
|
|
|
/* Try without the '(' */
|
|
|
|
symbol_delete(yylval.sym);
|
|
|
|
yytext[yyleng-1] = '\0';
|
|
|
|
yylval.sym =
|
|
|
|
symtable_get(yytext);
|
|
|
|
}
|
|
|
|
unput('(');
|
|
|
|
return T_SYMBOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{WORD} {
|
|
|
|
yylval.sym = symtable_get(yytext);
|
|
|
|
if (yylval.sym->type == MACRO) {
|
|
|
|
expand_macro(yylval.sym);
|
|
|
|
} else {
|
|
|
|
return T_SYMBOL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
. {
|
2009-06-01 18:42:16 +00:00
|
|
|
snprintf(msgbuf, sizeof(msgbuf), "Invalid character "
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
"'%c'", yytext[0]);
|
2009-06-01 18:42:16 +00:00
|
|
|
stop(msgbuf, EX_DATAERR);
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
}
|
|
|
|
%%
|
|
|
|
|
|
|
|
typedef struct include {
|
|
|
|
YY_BUFFER_STATE buffer;
|
|
|
|
int lineno;
|
|
|
|
char *filename;
|
2000-05-26 02:09:24 +00:00
|
|
|
SLIST_ENTRY(include) links;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
}include_t;
|
|
|
|
|
2000-05-26 02:09:24 +00:00
|
|
|
SLIST_HEAD(, include) include_stack;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
|
|
|
|
void
|
2000-09-16 20:02:39 +00:00
|
|
|
include_file(char *file_name, include_type type)
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
{
|
|
|
|
FILE *newfile;
|
|
|
|
include_t *include;
|
|
|
|
|
|
|
|
newfile = NULL;
|
|
|
|
/* Try the current directory first */
|
|
|
|
if (includes_search_curdir != 0 || type == SOURCE_FILE)
|
|
|
|
newfile = fopen(file_name, "r");
|
|
|
|
|
|
|
|
if (newfile == NULL && type != SOURCE_FILE) {
|
|
|
|
path_entry_t include_dir;
|
|
|
|
for (include_dir = search_path.slh_first;
|
|
|
|
include_dir != NULL;
|
|
|
|
include_dir = include_dir->links.sle_next) {
|
|
|
|
char fullname[PATH_MAX];
|
|
|
|
|
|
|
|
if ((include_dir->quoted_includes_only == TRUE)
|
|
|
|
&& (type != QUOTED_INCLUDE))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
snprintf(fullname, sizeof(fullname),
|
|
|
|
"%s/%s", include_dir->directory, file_name);
|
|
|
|
|
|
|
|
if ((newfile = fopen(fullname, "r")) != NULL)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (newfile == NULL) {
|
|
|
|
perror(file_name);
|
|
|
|
stop("Unable to open input file", EX_SOFTWARE);
|
|
|
|
/* NOTREACHED */
|
|
|
|
}
|
1997-06-27 19:38:56 +00:00
|
|
|
|
|
|
|
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);
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
}
|
|
|
|
yy_switch_to_buffer(yy_create_buffer(newfile, YY_BUF_SIZE));
|
|
|
|
yylineno = 1;
|
|
|
|
yyfilename = strdup(file_name);
|
|
|
|
}
|
|
|
|
|
2002-04-24 16:24:43 +00:00
|
|
|
static void next_substitution(struct symbol *mac_symbol, const char *body_pos,
|
|
|
|
const char **next_match,
|
|
|
|
struct macro_arg **match_marg, regmatch_t *match);
|
|
|
|
|
|
|
|
void
|
|
|
|
expand_macro(struct symbol *macro_symbol)
|
|
|
|
{
|
|
|
|
struct macro_arg *marg;
|
|
|
|
struct macro_arg *match_marg;
|
|
|
|
const char *body_head;
|
|
|
|
const char *body_pos;
|
|
|
|
const char *next_match;
|
2009-06-01 21:07:54 +00:00
|
|
|
regmatch_t match = { .rm_so = 0, .rm_eo = 0 };
|
2002-04-24 16:24:43 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Due to the nature of unput, we must work
|
|
|
|
* backwards through the macro body performing
|
|
|
|
* any expansions.
|
|
|
|
*/
|
|
|
|
body_head = macro_symbol->info.macroinfo->body;
|
|
|
|
body_pos = body_head + strlen(body_head);
|
|
|
|
while (body_pos > body_head) {
|
|
|
|
next_match = body_head;
|
|
|
|
match_marg = NULL;
|
|
|
|
next_substitution(macro_symbol, body_pos, &next_match,
|
|
|
|
&match_marg, &match);
|
|
|
|
|
|
|
|
/* Put back everything up until the replacement. */
|
|
|
|
while (body_pos > next_match)
|
|
|
|
unput(*--body_pos);
|
|
|
|
|
|
|
|
/* Perform the replacement. */
|
|
|
|
if (match_marg != NULL) {
|
|
|
|
const char *strp;
|
|
|
|
|
|
|
|
next_match = match_marg->replacement_text;
|
|
|
|
strp = next_match + strlen(next_match);
|
|
|
|
while (strp > next_match)
|
|
|
|
unput(*--strp);
|
|
|
|
|
|
|
|
/* Skip past the unexpanded macro arg. */
|
|
|
|
body_pos -= match.rm_eo - match.rm_so;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Cleanup replacement text. */
|
|
|
|
STAILQ_FOREACH(marg, ¯o_symbol->info.macroinfo->args, links) {
|
|
|
|
free(marg->replacement_text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Find the next substitution in the macro working backwards from
|
|
|
|
* body_pos until the beginning of the macro buffer. next_match
|
|
|
|
* should be initialized to the beginning of the macro buffer prior
|
|
|
|
* to calling this routine.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
next_substitution(struct symbol *mac_symbol, const char *body_pos,
|
|
|
|
const char **next_match, struct macro_arg **match_marg,
|
|
|
|
regmatch_t *match)
|
|
|
|
{
|
|
|
|
regmatch_t matches[2];
|
|
|
|
struct macro_arg *marg;
|
|
|
|
const char *search_pos;
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
do {
|
|
|
|
search_pos = *next_match;
|
|
|
|
|
|
|
|
STAILQ_FOREACH(marg, &mac_symbol->info.macroinfo->args, links) {
|
|
|
|
|
|
|
|
retval = regexec(&marg->arg_regex, search_pos, 2,
|
|
|
|
matches, 0);
|
|
|
|
if (retval == 0
|
|
|
|
&& (matches[1].rm_eo + search_pos) <= body_pos
|
|
|
|
&& (matches[1].rm_eo + search_pos) > *next_match) {
|
|
|
|
*match = matches[1];
|
|
|
|
*next_match = match->rm_eo + search_pos;
|
|
|
|
*match_marg = marg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (search_pos != *next_match);
|
|
|
|
}
|
|
|
|
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
int
|
2009-12-30 16:56:50 +00:00
|
|
|
yywrap(void)
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
{
|
|
|
|
include_t *include;
|
|
|
|
|
|
|
|
yy_delete_buffer(YY_CURRENT_BUFFER);
|
|
|
|
(void)fclose(yyin);
|
|
|
|
if (yyfilename != NULL)
|
|
|
|
free(yyfilename);
|
1997-06-27 19:38:56 +00:00
|
|
|
yyfilename = NULL;
|
Makefile gram.y scan.l sequencer.h symbol.c symbol.h aic7xxx_asm.c:
New sequencer assembler for the aic7xxx adapters. This assembler
performs some amount of register type checking, allows bit
manipulation of symbolic constants, and generates "patch tables"
for conditionalized downloading of portions of the program.
This makes it easier to take full advantage of the different
features of the aic7xxx cards without imposing run time penalies
or being bound to the small memory footprints of the low end
cards for features like target mode.
aic7xxx.reg:
New, assembler parsed, register definitions fo the aic7xxx cards.
This was done primarily in anticipation of 7810 support which
will have a different register layout, but should be able to use
the same assembler. The kernel aic7xxx driver consumes a generated
file in the compile directory to get the definitions of the register
locations.
aic7xxx.seq:
Convert to the slighly different syntax of the new assembler.
Conditionalize SCB_PAGING, ultra, and twin features which shaves
quite a bit of space once the program is downloaded.
Add code to leave the selection hardware enabled during reconnects
that win bus arbitration. This ensures that we will rearbitrate
as soon as the bus goes free instead of delaying for a bit.
When we expect the bus to go free, perform all of the cleanup
associated with that event "up front" and enter a loop awaiting
bus free. If we see a REQ first, complain, but attempt to
continue. This will hopefully address, or at least help diagnose,
the "target didn't send identify" messages that have been reported.
Spelling corrections obtained from NetBSD.
1997-03-16 07:08:19 +00:00
|
|
|
include = include_stack.slh_first;
|
|
|
|
if (include != NULL) {
|
|
|
|
yy_switch_to_buffer(include->buffer);
|
|
|
|
yylineno = include->lineno;
|
|
|
|
yyfilename = include->filename;
|
|
|
|
SLIST_REMOVE_HEAD(&include_stack, links);
|
|
|
|
free(include);
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
return (1);
|
|
|
|
}
|