diff options
| author | Justin T. Gibbs <gibbs@FreeBSD.org> | 1997-09-27 19:37:31 +0000 |
|---|---|---|
| committer | Justin T. Gibbs <gibbs@FreeBSD.org> | 1997-09-27 19:37:31 +0000 |
| commit | 37507c1bd221fb20e635a1301f7a55c7aa008d21 (patch) | |
| tree | eb5d9813a8327e6725fe7e3ac42c1fe3dc509f08 /sys/dev | |
| parent | f0d4fed251afdd6bd6174984308076273944edfb (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/aic7xxx/Makefile | 9 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aic7xxx.reg | 53 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aic7xxx.seq | 15 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm/Makefile | 9 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_gram.y | 62 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_scan.l | 3 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_symbol.c | 24 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_symbol.h | 3 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm_gram.y | 62 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm_scan.l | 3 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm_symbol.c | 24 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/aicasm_symbol.h | 3 | ||||
| -rw-r--r-- | sys/dev/aic7xxx/sequencer.h | 3 |
13 files changed, 211 insertions, 62 deletions
diff --git a/sys/dev/aic7xxx/Makefile b/sys/dev/aic7xxx/Makefile index af75fce18aff..0a74ca9c8c47 100644 --- a/sys/dev/aic7xxx/Makefile +++ b/sys/dev/aic7xxx/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1997/04/03 05:56:00 gibbs Exp $ +# $Id: Makefile,v 1.3 1997/09/03 03:44:32 gibbs Exp $ PROG= aicasm @@ -21,4 +21,11 @@ DEPENDFILE= CFLAGS+= -I. NOMAN= noman + +.ifdef DEBUG +CFLAGS+= -DDEBUG -g +YFLAGS+= -t +LFLAGS+= -d +.endif + .include <bsd.prog.mk> diff --git a/sys/dev/aic7xxx/aic7xxx.reg b/sys/dev/aic7xxx/aic7xxx.reg index 6ecae3bcdefd..b166c3381ec9 100644 --- a/sys/dev/aic7xxx/aic7xxx.reg +++ b/sys/dev/aic7xxx/aic7xxx.reg @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.reg,v 1.4 1997/06/27 19:38:39 gibbs Exp $ + * $Id: aic7xxx.reg,v 1.5 1997/08/13 17:02:24 gibbs Exp $ */ /* @@ -956,28 +956,6 @@ scratch_ram { bit FIFOFLUSH 0x02 bit FIFORESET 0x01 } - /* - * Number of SCBs supported by - * this card. - */ - SCBCOUNT { - size 1 - } - /* - * Two's complement of SCBCOUNT - */ - COMP_SCBCOUNT { - size 1 - } - /* - * Mask of bits to test against - * when looking at the Queue Count - * registers. Works around a bug - * on aic7850 chips. - */ - QCNTMASK { - size 1 - } SEQ_FLAGS { size 1 bit RESELECTED 0x80 @@ -1017,13 +995,6 @@ scratch_ram { size 1 } /* - * The sequencer will stick the frist byte of any rejected message here - * so we can see what is getting thrown away. - */ - REJBYTE { - size 1 - } - /* * The last bus phase as seen by the sequencer. */ LASTPHASE { @@ -1087,13 +1058,6 @@ scratch_ram { CMDOUTCNT { size 1 } - /* - * Maximum number of entries allowed in - * the QOUT/INFIFO. - */ - FIFODEPTH { - size 1 - } ARG_1 { size 1 mask SEND_MSG 0x80 @@ -1133,3 +1097,18 @@ const BUS_16_BIT 0x01 const BUS_32_BIT 0x02 const MAX_OFFSET_8BIT 0x0f const MAX_OFFSET_16BIT 0x08 + +/* + * Downloaded (kernel inserted) constants + */ +const SCBCOUNT download /* The number of SCBs on this card */ +const COMP_SCBCOUNT download /* Two's complement of max SCBID */ +/* + * The maximum number of entries allowed in the QIN/OUTFIFO. + */ +const FIFODEPTH download /* Two's complement of SCBCOUNT */ +/* + * Mask of bits to test against when looking at the Queue Count + * registers. Works around a bug on aic7850 chips. + */ +const QCNTMASK download diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index d6b6a042e855..d7338a539e1d 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aic7xxx.seq,v 1.74 1997/06/27 19:38:42 gibbs Exp $ + * $Id: aic7xxx.seq,v 1.75 1997/08/13 17:02:28 gibbs Exp $ */ #include <dev/aic7xxx/aic7xxx.reg> @@ -88,8 +88,7 @@ poll_for_work: cmp WAITING_SCBH,SCB_LIST_NULL jne start_waiting; test_queue: /* Has the driver posted any work for us? */ - mov A, QCNTMASK; - test QINCNT,A jz poll_for_work; + test QINCNT,QCNTMASK jz poll_for_work; /* * We have at least one queued SCB now and we don't have any @@ -567,7 +566,6 @@ p_mesgout_done: */ p_mesgin: mvi ACCUM call inb_first; /* read the 1st message byte */ - mov REJBYTE,A; /* save it for the driver */ test A,MSG_IDENTIFYFLAG jnz mesgin_identify; cmp A,MSG_DISCONNECT je mesgin_disconnect; @@ -648,8 +646,7 @@ complete: * Spin loop until there is space * in the QOUTFIFO. */ - mov A, FIFODEPTH; - cmp CMDOUTCNT, A je .; + cmp CMDOUTCNT, FIFODEPTH je .; inc CMDOUTCNT; .endif mov QOUTFIFO,SCB_TAG; @@ -802,8 +799,7 @@ get_tag: * the complement of SCBCOUNT to the incomming tag and there is * no carry. */ - mov A,COMP_SCBCOUNT; - add SINDEX,A,ARG_1; + add SINDEX,COMP_SCBCOUNT,ARG_1; jc not_found; .if ! ( SCB_PAGING ) @@ -976,8 +972,7 @@ findSCB: test SCB_CONTROL,DISCONNECTED jnz foundSCB;/*should be disconnected*/ findSCB_loop: inc SINDEX; - mov A,SCBCOUNT; - cmp SINDEX,A jne findSCB; + cmp SINDEX,SCBCOUNT jne findSCB; /* * We didn't find it. If we're paging, pull an SCB and DMA down the * one we want. If we aren't paging or the SCB we dma down has the diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile index af75fce18aff..0a74ca9c8c47 100644 --- a/sys/dev/aic7xxx/aicasm/Makefile +++ b/sys/dev/aic7xxx/aicasm/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.2 1997/04/03 05:56:00 gibbs Exp $ +# $Id: Makefile,v 1.3 1997/09/03 03:44:32 gibbs Exp $ PROG= aicasm @@ -21,4 +21,11 @@ DEPENDFILE= CFLAGS+= -I. NOMAN= noman + +.ifdef DEBUG +CFLAGS+= -DDEBUG -g +YFLAGS+= -t +LFLAGS+= -d +.endif + .include <bsd.prog.mk> diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y index 24f8cc9b31f2..fa657c02f0c8 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_gram.y,v 1.2 1997/06/27 19:38:49 gibbs Exp $ + * $Id: aicasm_gram.y,v 1.3 1997/09/03 03:44:40 gibbs Exp $ */ #include <stdio.h> @@ -55,6 +55,7 @@ static symbol_ref_t none; static symbol_ref_t sindex; static int instruction_ptr; static int sram_or_scb_offset; +static int download_constant_count; static patch_t *cur_patch; static void process_bitmask __P((int mask_type, symbol_t *sym, int mask)); @@ -74,6 +75,7 @@ static void type_check __P((symbol_t *symbol, expression_t *expression, int and_op)); static void make_expression __P((expression_t *immed, int value)); static void add_conditional __P((symbol_t *symbol)); +static int is_download_const __P((expression_t *immed)); #define YYDEBUG 1 #define SRAM_SYMNAME "SRAM_BASE" @@ -92,6 +94,8 @@ static void add_conditional __P((symbol_t *symbol)); %token <value> T_CONST +%token T_DOWNLOAD + %token T_SCB %token T_SRAM @@ -154,6 +158,8 @@ static void add_conditional __P((symbol_t *symbol)); %type <value> ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne +%type <value> numerical_value + %left '|' %left '&' %left '+' '-' @@ -422,6 +428,7 @@ expression: case BIT: $$.value = symbol->info.minfo->mask; break; + case DOWNLOAD_CONST: case CONST: $$.value = symbol->info.cinfo->value; break; @@ -444,10 +451,10 @@ expression: ; constant: - T_CONST T_SYMBOL T_NUMBER + T_CONST T_SYMBOL numerical_value { if ($2->type != UNINITIALIZED) { - stop("Re-definition of constant variable", + stop("Re-definition of symbol as a constant", EX_DATAERR); /* NOTREACHED */ } @@ -456,6 +463,34 @@ constant: $2->info.cinfo->value = $3; $2->info.cinfo->define = $1; } +| T_CONST T_SYMBOL T_DOWNLOAD + { + if ($1) { + stop("Invalid downloaded constant declaration", + EX_DATAERR); + /* NOTREACHED */ + } + if ($2->type != UNINITIALIZED) { + stop("Re-definition of symbol as a downloaded constant", + EX_DATAERR); + /* NOTREACHED */ + } + $2->type = DOWNLOAD_CONST; + initialize_symbol($2); + $2->info.cinfo->value = download_constant_count++; + $2->info.cinfo->define = FALSE; + } +; + +numerical_value: + T_NUMBER + { + $$ = $1; + } +| '-' T_NUMBER + { + $$ = -$2; + } ; scratch_ram: @@ -997,6 +1032,7 @@ initialize_symbol(symbol) SLIST_INIT(&(symbol->info.minfo->symrefs)); break; case CONST: + case DOWNLOAD_CONST: symbol->info.cinfo = (struct const_info *)malloc(sizeof(struct const_info)); if (symbol->info.cinfo == NULL) { @@ -1088,6 +1124,10 @@ format_1_instr(opcode, dest, immed, src, ret) f1_instr->source = src->symbol->info.rinfo->address + src->offset; f1_instr->immediate = immed->value; + + if (is_download_const(immed)) + f1_instr->opcode_ret |= DOWNLOAD_CONST_IMMEDIATE; + symlist_free(&immed->referenced_syms); instruction_ptr++; } @@ -1191,6 +1231,10 @@ format_3_instr(opcode, src, immed, address) f3_instr->source = src->symbol->info.rinfo->address + src->offset; f3_instr->immediate = immed->value; + + if (is_download_const(immed)) + f3_instr->opcode_addr |= DOWNLOAD_CONST_IMMEDIATE; + symlist_free(&immed->referenced_syms); instruction_ptr++; } @@ -1230,6 +1274,7 @@ type_check(symbol, expression, opcode) and_op = FALSE; if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ || AIC_OP_JZ) and_op = TRUE; + /* * Make sure that we aren't attempting to write something * that hasn't been defined. If this is an and operation, @@ -1302,3 +1347,14 @@ yyerror(string) { stop(string, EX_DATAERR); } + +static int +is_download_const(immed) + expression_t *immed; +{ + if ((immed->referenced_syms.slh_first != NULL) + && (immed->referenced_syms.slh_first->symbol->type == DOWNLOAD_CONST)) + return (TRUE); + + return (FALSE); +} diff --git a/sys/dev/aic7xxx/aicasm/aicasm_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_scan.l index 5c354283412f..844637687363 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_scan.l +++ b/sys/dev/aic7xxx/aicasm/aicasm_scan.l @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_scan.l,v 1.3 1997/06/27 19:38:51 gibbs Exp $ + * $Id: aicasm_scan.l,v 1.4 1997/09/03 03:44:42 gibbs Exp $ */ #include <sys/types.h> @@ -66,6 +66,7 @@ SPACE [ \t]+ /* Register/SCB/SRAM definition keywords */ register { return T_REGISTER; } const { yylval.value = FALSE; return T_CONST; } +download { return T_DOWNLOAD; } address { return T_ADDRESS; } access_mode { return T_ACCESS_MODE; } RW|RO|WO { diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c index 08b0bc52ce2b..c9f645ac72e5 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_symbol.c,v 1.2 1997/06/27 19:38:54 gibbs Exp $ + * $Id: aicasm_symbol.c,v 1.3 1997/09/03 03:44:44 gibbs Exp $ */ @@ -92,6 +92,7 @@ symbol_delete(symbol) free(symbol->info.minfo); } break; + case DOWNLOAD_CONST: case CONST: if (symbol->info.cinfo != NULL) free(symbol->info.cinfo); @@ -312,11 +313,13 @@ symtable_dump(ofile) symlist_t registers; symlist_t masks; symlist_t constants; + symlist_t download_constants; symlist_t aliases; SLIST_INIT(®isters); SLIST_INIT(&masks); SLIST_INIT(&constants); + SLIST_INIT(&download_constants); SLIST_INIT(&aliases); if (symtable != NULL) { @@ -344,9 +347,14 @@ symtable_dump(ofile) SYMLIST_INSERT_HEAD); } break; + case DOWNLOAD_CONST: + symlist_add(&download_constants, cursym, + SYMLIST_INSERT_HEAD); + break; case ALIAS: symlist_add(&aliases, cursym, SYMLIST_INSERT_HEAD); + break; default: break; } @@ -446,6 +454,20 @@ symtable_dump(ofile) curnode->symbol->info.cinfo->value); free(curnode); } + + + fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); + + while (download_constants.slh_first != NULL) { + symbol_node_t *curnode; + + curnode = download_constants.slh_first; + SLIST_REMOVE_HEAD(&download_constants, links); + fprintf(ofile, "#define\t%-8s\t0x%02x\n", + curnode->symbol->name, + curnode->symbol->info.cinfo->value); + free(curnode); + } } } diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h index 485cf6c0cc0d..199e3baa779e 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.h @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: symbol.h,v 1.1 1997/03/16 07:08:19 gibbs Exp $ + * $Id: aicasm_symbol.h,v 1.2 1997/06/27 19:38:56 gibbs Exp $ */ #include <sys/queue.h> @@ -42,6 +42,7 @@ typedef enum { MASK, BIT, CONST, + DOWNLOAD_CONST, LABEL, CONDITIONAL }symtype; diff --git a/sys/dev/aic7xxx/aicasm_gram.y b/sys/dev/aic7xxx/aicasm_gram.y index 24f8cc9b31f2..fa657c02f0c8 100644 --- a/sys/dev/aic7xxx/aicasm_gram.y +++ b/sys/dev/aic7xxx/aicasm_gram.y @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_gram.y,v 1.2 1997/06/27 19:38:49 gibbs Exp $ + * $Id: aicasm_gram.y,v 1.3 1997/09/03 03:44:40 gibbs Exp $ */ #include <stdio.h> @@ -55,6 +55,7 @@ static symbol_ref_t none; static symbol_ref_t sindex; static int instruction_ptr; static int sram_or_scb_offset; +static int download_constant_count; static patch_t *cur_patch; static void process_bitmask __P((int mask_type, symbol_t *sym, int mask)); @@ -74,6 +75,7 @@ static void type_check __P((symbol_t *symbol, expression_t *expression, int and_op)); static void make_expression __P((expression_t *immed, int value)); static void add_conditional __P((symbol_t *symbol)); +static int is_download_const __P((expression_t *immed)); #define YYDEBUG 1 #define SRAM_SYMNAME "SRAM_BASE" @@ -92,6 +94,8 @@ static void add_conditional __P((symbol_t *symbol)); %token <value> T_CONST +%token T_DOWNLOAD + %token T_SCB %token T_SRAM @@ -154,6 +158,8 @@ static void add_conditional __P((symbol_t *symbol)); %type <value> ret f1_opcode f2_opcode jmp_jc_jnc_call jz_jnz je_jne +%type <value> numerical_value + %left '|' %left '&' %left '+' '-' @@ -422,6 +428,7 @@ expression: case BIT: $$.value = symbol->info.minfo->mask; break; + case DOWNLOAD_CONST: case CONST: $$.value = symbol->info.cinfo->value; break; @@ -444,10 +451,10 @@ expression: ; constant: - T_CONST T_SYMBOL T_NUMBER + T_CONST T_SYMBOL numerical_value { if ($2->type != UNINITIALIZED) { - stop("Re-definition of constant variable", + stop("Re-definition of symbol as a constant", EX_DATAERR); /* NOTREACHED */ } @@ -456,6 +463,34 @@ constant: $2->info.cinfo->value = $3; $2->info.cinfo->define = $1; } +| T_CONST T_SYMBOL T_DOWNLOAD + { + if ($1) { + stop("Invalid downloaded constant declaration", + EX_DATAERR); + /* NOTREACHED */ + } + if ($2->type != UNINITIALIZED) { + stop("Re-definition of symbol as a downloaded constant", + EX_DATAERR); + /* NOTREACHED */ + } + $2->type = DOWNLOAD_CONST; + initialize_symbol($2); + $2->info.cinfo->value = download_constant_count++; + $2->info.cinfo->define = FALSE; + } +; + +numerical_value: + T_NUMBER + { + $$ = $1; + } +| '-' T_NUMBER + { + $$ = -$2; + } ; scratch_ram: @@ -997,6 +1032,7 @@ initialize_symbol(symbol) SLIST_INIT(&(symbol->info.minfo->symrefs)); break; case CONST: + case DOWNLOAD_CONST: symbol->info.cinfo = (struct const_info *)malloc(sizeof(struct const_info)); if (symbol->info.cinfo == NULL) { @@ -1088,6 +1124,10 @@ format_1_instr(opcode, dest, immed, src, ret) f1_instr->source = src->symbol->info.rinfo->address + src->offset; f1_instr->immediate = immed->value; + + if (is_download_const(immed)) + f1_instr->opcode_ret |= DOWNLOAD_CONST_IMMEDIATE; + symlist_free(&immed->referenced_syms); instruction_ptr++; } @@ -1191,6 +1231,10 @@ format_3_instr(opcode, src, immed, address) f3_instr->source = src->symbol->info.rinfo->address + src->offset; f3_instr->immediate = immed->value; + + if (is_download_const(immed)) + f3_instr->opcode_addr |= DOWNLOAD_CONST_IMMEDIATE; + symlist_free(&immed->referenced_syms); instruction_ptr++; } @@ -1230,6 +1274,7 @@ type_check(symbol, expression, opcode) and_op = FALSE; if (opcode == AIC_OP_AND || opcode == AIC_OP_JNZ || AIC_OP_JZ) and_op = TRUE; + /* * Make sure that we aren't attempting to write something * that hasn't been defined. If this is an and operation, @@ -1302,3 +1347,14 @@ yyerror(string) { stop(string, EX_DATAERR); } + +static int +is_download_const(immed) + expression_t *immed; +{ + if ((immed->referenced_syms.slh_first != NULL) + && (immed->referenced_syms.slh_first->symbol->type == DOWNLOAD_CONST)) + return (TRUE); + + return (FALSE); +} diff --git a/sys/dev/aic7xxx/aicasm_scan.l b/sys/dev/aic7xxx/aicasm_scan.l index 5c354283412f..844637687363 100644 --- a/sys/dev/aic7xxx/aicasm_scan.l +++ b/sys/dev/aic7xxx/aicasm_scan.l @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_scan.l,v 1.3 1997/06/27 19:38:51 gibbs Exp $ + * $Id: aicasm_scan.l,v 1.4 1997/09/03 03:44:42 gibbs Exp $ */ #include <sys/types.h> @@ -66,6 +66,7 @@ SPACE [ \t]+ /* Register/SCB/SRAM definition keywords */ register { return T_REGISTER; } const { yylval.value = FALSE; return T_CONST; } +download { return T_DOWNLOAD; } address { return T_ADDRESS; } access_mode { return T_ACCESS_MODE; } RW|RO|WO { diff --git a/sys/dev/aic7xxx/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm_symbol.c index 08b0bc52ce2b..c9f645ac72e5 100644 --- a/sys/dev/aic7xxx/aicasm_symbol.c +++ b/sys/dev/aic7xxx/aicasm_symbol.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: aicasm_symbol.c,v 1.2 1997/06/27 19:38:54 gibbs Exp $ + * $Id: aicasm_symbol.c,v 1.3 1997/09/03 03:44:44 gibbs Exp $ */ @@ -92,6 +92,7 @@ symbol_delete(symbol) free(symbol->info.minfo); } break; + case DOWNLOAD_CONST: case CONST: if (symbol->info.cinfo != NULL) free(symbol->info.cinfo); @@ -312,11 +313,13 @@ symtable_dump(ofile) symlist_t registers; symlist_t masks; symlist_t constants; + symlist_t download_constants; symlist_t aliases; SLIST_INIT(®isters); SLIST_INIT(&masks); SLIST_INIT(&constants); + SLIST_INIT(&download_constants); SLIST_INIT(&aliases); if (symtable != NULL) { @@ -344,9 +347,14 @@ symtable_dump(ofile) SYMLIST_INSERT_HEAD); } break; + case DOWNLOAD_CONST: + symlist_add(&download_constants, cursym, + SYMLIST_INSERT_HEAD); + break; case ALIAS: symlist_add(&aliases, cursym, SYMLIST_INSERT_HEAD); + break; default: break; } @@ -446,6 +454,20 @@ symtable_dump(ofile) curnode->symbol->info.cinfo->value); free(curnode); } + + + fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); + + while (download_constants.slh_first != NULL) { + symbol_node_t *curnode; + + curnode = download_constants.slh_first; + SLIST_REMOVE_HEAD(&download_constants, links); + fprintf(ofile, "#define\t%-8s\t0x%02x\n", + curnode->symbol->name, + curnode->symbol->info.cinfo->value); + free(curnode); + } } } diff --git a/sys/dev/aic7xxx/aicasm_symbol.h b/sys/dev/aic7xxx/aicasm_symbol.h index 485cf6c0cc0d..199e3baa779e 100644 --- a/sys/dev/aic7xxx/aicasm_symbol.h +++ b/sys/dev/aic7xxx/aicasm_symbol.h @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: symbol.h,v 1.1 1997/03/16 07:08:19 gibbs Exp $ + * $Id: aicasm_symbol.h,v 1.2 1997/06/27 19:38:56 gibbs Exp $ */ #include <sys/queue.h> @@ -42,6 +42,7 @@ typedef enum { MASK, BIT, CONST, + DOWNLOAD_CONST, LABEL, CONDITIONAL }symtype; diff --git a/sys/dev/aic7xxx/sequencer.h b/sys/dev/aic7xxx/sequencer.h index 00d1f089e852..fd6943579928 100644 --- a/sys/dev/aic7xxx/sequencer.h +++ b/sys/dev/aic7xxx/sequencer.h @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sequencer.h,v 1.1 1997/03/16 07:08:18 gibbs Exp $ + * $Id: sequencer.h,v 1.2 1997/06/27 19:38:52 gibbs Exp $ */ struct ins_format1 { @@ -44,6 +44,7 @@ struct ins_format1 { u_int8_t source; u_int8_t destination; u_int8_t opcode_ret; +#define DOWNLOAD_CONST_IMMEDIATE 0x80 }; struct ins_format2 { |
