diff options
author | gibbs <gibbs@FreeBSD.org> | 1995-03-17 23:54:17 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1995-03-17 23:54:17 +0000 |
commit | 0be8d9c7f65ec73db22ba12b714bb9a1025102e5 (patch) | |
tree | b33a64bd00f9abd6c8b80fecdbc8031f18c051be | |
parent | d06f6b4e4f95f2bf7ae63d7be7e08d3a01d02e40 (diff) | |
download | FreeBSD-src-0be8d9c7f65ec73db22ba12b714bb9a1025102e5.zip FreeBSD-src-0be8d9c7f65ec73db22ba12b714bb9a1025102e5.tar.gz |
Make the aic7xxx assembler take quoted strings as a single token.
Make $Id the version variable which required the quoted string "feature".
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx.seq | 9 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aic7xxx_asm.c | 26 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aicasm.c | 26 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm.c | 26 | ||||
-rw-r--r-- | sys/gnu/misc/aic7xxx/aic7xxx.c | 26 | ||||
-rw-r--r-- | sys/gnu/misc/aic7xxx/aic7xxx.seq | 9 |
6 files changed, 96 insertions, 26 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq index b735961..d328693 100644 --- a/sys/dev/aic7xxx/aic7xxx.seq +++ b/sys/dev/aic7xxx/aic7xxx.seq @@ -21,9 +21,8 @@ # FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other # optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org) # -# $Id: aic7xxx.seq,v 1.8 1995/02/22 01:37:52 gibbs Exp $ -VERSION AIC7XXX_SEQ_VERSION 1.8 +VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.9 1995/03/07 09:00:44 gibbs Exp $" SCBMASK = 0x1f @@ -726,7 +725,7 @@ p_mesgin5: test A,0x78 jnz p_mesginN # !DiscPriv|!LUNTAR|!Reserved - and A,0x7 # lun in lower three bits + and A,0x07 # lun in lower three bits or SAVED_TCL,A,SELID and SAVED_TCL,0xf7 and A,0x08,SBLKCTL # B Channel?? @@ -737,8 +736,8 @@ p_mesgin5: # If we get one, we use the tag returned to switch to the proper # SCB. Otherwise, we just use the findSCB method. p_mesgin5_loop: - test SSTAT1,0x8 jnz use_findSCB # BUSFREE - test SSTAT1,0x1 jz p_mesgin5_loop # REQINIT + test SSTAT1,0x08 jnz use_findSCB # BUSFREE + test SSTAT1,0x01 jz p_mesgin5_loop # REQINIT and A,0xe0,SCSISIGI # CDI|IOI|MSGI cmp A,0xe0 jne use_findSCB # Still p_mesgin? mvi A call inb_first diff --git a/sys/dev/aic7xxx/aic7xxx_asm.c b/sys/dev/aic7xxx/aic7xxx_asm.c index 15fbb7f..9eb9630 100644 --- a/sys/dev/aic7xxx/aic7xxx_asm.c +++ b/sys/dev/aic7xxx/aic7xxx_asm.c @@ -26,7 +26,7 @@ * A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas * are token separators. * - * $Id: aic7xxx.c,v 1.4 1995/01/16 16:31:20 gibbs Exp $ + * $Id: aic7xxx.c,v 1.5 1995/01/22 00:46:52 gibbs Exp $ */ /* #define _POSIX_SOURCE 1 */ @@ -199,7 +199,7 @@ void output(FILE *fp) char **getl(int *n) { int i; - char *p; + char *p, *quote; static char buf[MAXLINE]; static char *a[MAXTOKEN]; @@ -215,12 +215,30 @@ char **getl(int *n) p = strchr(buf, '#'); if (p) *p = '\0'; - - for (p = strtok(buf, ", \t\n"); p; p = strtok(NULL, ", \t\n")) + p = buf; +rescan: + quote = strchr(p, '\"'); + if (quote) + *quote = '\0'; + for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n")) if (i < MAXTOKEN-1) a[i++] = p; else error("too many tokens"); + if (quote) { + quote++; + p = strchr(quote, '\"'); + if (!p) + error("unterminated string constant"); + else if (i < MAXTOKEN-1) { + a[i++] = quote; + *p = '\0'; + p++; + } + else + error("too many tokens"); + goto rescan; + } if (i) { *n = i; return(a); diff --git a/sys/dev/aic7xxx/aicasm.c b/sys/dev/aic7xxx/aicasm.c index 15fbb7f..9eb9630 100644 --- a/sys/dev/aic7xxx/aicasm.c +++ b/sys/dev/aic7xxx/aicasm.c @@ -26,7 +26,7 @@ * A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas * are token separators. * - * $Id: aic7xxx.c,v 1.4 1995/01/16 16:31:20 gibbs Exp $ + * $Id: aic7xxx.c,v 1.5 1995/01/22 00:46:52 gibbs Exp $ */ /* #define _POSIX_SOURCE 1 */ @@ -199,7 +199,7 @@ void output(FILE *fp) char **getl(int *n) { int i; - char *p; + char *p, *quote; static char buf[MAXLINE]; static char *a[MAXTOKEN]; @@ -215,12 +215,30 @@ char **getl(int *n) p = strchr(buf, '#'); if (p) *p = '\0'; - - for (p = strtok(buf, ", \t\n"); p; p = strtok(NULL, ", \t\n")) + p = buf; +rescan: + quote = strchr(p, '\"'); + if (quote) + *quote = '\0'; + for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n")) if (i < MAXTOKEN-1) a[i++] = p; else error("too many tokens"); + if (quote) { + quote++; + p = strchr(quote, '\"'); + if (!p) + error("unterminated string constant"); + else if (i < MAXTOKEN-1) { + a[i++] = quote; + *p = '\0'; + p++; + } + else + error("too many tokens"); + goto rescan; + } if (i) { *n = i; return(a); diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 15fbb7f..9eb9630 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -26,7 +26,7 @@ * A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas * are token separators. * - * $Id: aic7xxx.c,v 1.4 1995/01/16 16:31:20 gibbs Exp $ + * $Id: aic7xxx.c,v 1.5 1995/01/22 00:46:52 gibbs Exp $ */ /* #define _POSIX_SOURCE 1 */ @@ -199,7 +199,7 @@ void output(FILE *fp) char **getl(int *n) { int i; - char *p; + char *p, *quote; static char buf[MAXLINE]; static char *a[MAXTOKEN]; @@ -215,12 +215,30 @@ char **getl(int *n) p = strchr(buf, '#'); if (p) *p = '\0'; - - for (p = strtok(buf, ", \t\n"); p; p = strtok(NULL, ", \t\n")) + p = buf; +rescan: + quote = strchr(p, '\"'); + if (quote) + *quote = '\0'; + for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n")) if (i < MAXTOKEN-1) a[i++] = p; else error("too many tokens"); + if (quote) { + quote++; + p = strchr(quote, '\"'); + if (!p) + error("unterminated string constant"); + else if (i < MAXTOKEN-1) { + a[i++] = quote; + *p = '\0'; + p++; + } + else + error("too many tokens"); + goto rescan; + } if (i) { *n = i; return(a); diff --git a/sys/gnu/misc/aic7xxx/aic7xxx.c b/sys/gnu/misc/aic7xxx/aic7xxx.c index 15fbb7f..9eb9630 100644 --- a/sys/gnu/misc/aic7xxx/aic7xxx.c +++ b/sys/gnu/misc/aic7xxx/aic7xxx.c @@ -26,7 +26,7 @@ * A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas * are token separators. * - * $Id: aic7xxx.c,v 1.4 1995/01/16 16:31:20 gibbs Exp $ + * $Id: aic7xxx.c,v 1.5 1995/01/22 00:46:52 gibbs Exp $ */ /* #define _POSIX_SOURCE 1 */ @@ -199,7 +199,7 @@ void output(FILE *fp) char **getl(int *n) { int i; - char *p; + char *p, *quote; static char buf[MAXLINE]; static char *a[MAXTOKEN]; @@ -215,12 +215,30 @@ char **getl(int *n) p = strchr(buf, '#'); if (p) *p = '\0'; - - for (p = strtok(buf, ", \t\n"); p; p = strtok(NULL, ", \t\n")) + p = buf; +rescan: + quote = strchr(p, '\"'); + if (quote) + *quote = '\0'; + for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n")) if (i < MAXTOKEN-1) a[i++] = p; else error("too many tokens"); + if (quote) { + quote++; + p = strchr(quote, '\"'); + if (!p) + error("unterminated string constant"); + else if (i < MAXTOKEN-1) { + a[i++] = quote; + *p = '\0'; + p++; + } + else + error("too many tokens"); + goto rescan; + } if (i) { *n = i; return(a); diff --git a/sys/gnu/misc/aic7xxx/aic7xxx.seq b/sys/gnu/misc/aic7xxx/aic7xxx.seq index b735961..d328693 100644 --- a/sys/gnu/misc/aic7xxx/aic7xxx.seq +++ b/sys/gnu/misc/aic7xxx/aic7xxx.seq @@ -21,9 +21,8 @@ # FreeBSD, Twin, Wide, 2 command per target support, tagged queuing and other # optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org) # -# $Id: aic7xxx.seq,v 1.8 1995/02/22 01:37:52 gibbs Exp $ -VERSION AIC7XXX_SEQ_VERSION 1.8 +VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 1.9 1995/03/07 09:00:44 gibbs Exp $" SCBMASK = 0x1f @@ -726,7 +725,7 @@ p_mesgin5: test A,0x78 jnz p_mesginN # !DiscPriv|!LUNTAR|!Reserved - and A,0x7 # lun in lower three bits + and A,0x07 # lun in lower three bits or SAVED_TCL,A,SELID and SAVED_TCL,0xf7 and A,0x08,SBLKCTL # B Channel?? @@ -737,8 +736,8 @@ p_mesgin5: # If we get one, we use the tag returned to switch to the proper # SCB. Otherwise, we just use the findSCB method. p_mesgin5_loop: - test SSTAT1,0x8 jnz use_findSCB # BUSFREE - test SSTAT1,0x1 jz p_mesgin5_loop # REQINIT + test SSTAT1,0x08 jnz use_findSCB # BUSFREE + test SSTAT1,0x01 jz p_mesgin5_loop # REQINIT and A,0xe0,SCSISIGI # CDI|IOI|MSGI cmp A,0xe0 jne use_findSCB # Still p_mesgin? mvi A call inb_first |