From b1721cfbfda88d18d92ffcca384de150eed672a5 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Thu, 5 Oct 2000 04:25:42 +0000 Subject: [PATCH] Correct pedantic errors in arrays generated by the assembler (trailing comma in array declarations). Output a constant indicating the number of critical section entries in the firmware. --- sys/dev/aic7xxx/aicasm/aicasm.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 361d7e83301..930d3976ddf 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: //depot/src/aic7xxx/aicasm/aicasm.c#4 $ + * $Id: //depot/src/aic7xxx/aicasm/aicasm.c#5 $ * * $FreeBSD$ */ @@ -320,7 +320,8 @@ output_code() cur_instr != NULL; cur_instr = cur_instr->links.stqe_next) { - fprintf(ofile, "\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n", + fprintf(ofile, "%s\t0x%02x, 0x%02x, 0x%02x, 0x%02x", + cur_instr == seq_program.stqh_first ? "" : ",\n", #if BYTE_ORDER == LITTLE_ENDIAN cur_instr->format.bytes[0], cur_instr->format.bytes[1], @@ -334,7 +335,7 @@ output_code() #endif instrcount++; } - fprintf(ofile, "};\n\n"); + fprintf(ofile, "\n};\n\n"); /* * Output patch information. Patch functions first. @@ -367,7 +368,8 @@ struct patch { for(cur_patch = STAILQ_FIRST(&patches); cur_patch != NULL; cur_patch = STAILQ_NEXT(cur_patch,links)) { - fprintf(ofile, "\t{ ahc_patch%d_func, %d, %d, %d },\n", + fprintf(ofile, "%s\t{ ahc_patch%d_func, %d, %d, %d }", + cur_patch == STAILQ_FIRST(&patches) ? "" : ",\n", cur_patch->patch_func, cur_patch->begin, cur_patch->skip_instr, cur_patch->skip_patch); } @@ -383,12 +385,17 @@ struct patch { for(cs = TAILQ_FIRST(&cs_tailq); cs != NULL; cs = TAILQ_NEXT(cs, links)) { - fprintf(ofile, "\t{ %d, %d },\n", + fprintf(ofile, "%s\t{ %d, %d }", + cs == TAILQ_FIRST(&cs_tailq) ? "" : ",\n", cs->begin_addr, cs->end_addr); } fprintf(ofile, "\n};\n"); + fprintf(ofile, +"const int num_critical_sections = sizeof(critical_sections) + / sizeof(*critical_sections);\n"); + fprintf(stderr, "%s: %d instructions used\n", appname, instrcount); }