summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2000-10-05 04:25:42 +0000
committergibbs <gibbs@FreeBSD.org>2000-10-05 04:25:42 +0000
commiteb2e3ded126c7b9de316f1bf4612522d8deb9ba3 (patch)
treea78716b5f984387b5bca7d5022c9f0b27f2cf684
parent53b245ea4d63e5de1d1046e01869c44196fa5e7d (diff)
downloadFreeBSD-src-eb2e3ded126c7b9de316f1bf4612522d8deb9ba3.zip
FreeBSD-src-eb2e3ded126c7b9de316f1bf4612522d8deb9ba3.tar.gz
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.
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c
index 361d7e8..930d397 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);
}
OpenPOWER on IntegriCloud