diff options
| author | christos <christos@NetBSD.org> | 2014-04-01 15:33:22 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2014-04-01 15:33:22 +0000 |
| commit | f34f930bd6dc463d796caf2c06a1ca8cbd611dc2 (patch) | |
| tree | b602246bbc43df1237698a7f4e1aed433b9853c1 /sys/dev/microcode | |
| parent | 5c8644a8ca5502985b9dee17965cbd42b9524896 (diff) | |
- print ascii if debug
- fold to 8 columns
- don't exit with random values
- change sccs magic in the generated header file
Diffstat (limited to 'sys/dev/microcode')
| -rw-r--r-- | sys/dev/microcode/cyclades-z/cyzfirm2h.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/microcode/cyclades-z/cyzfirm2h.c b/sys/dev/microcode/cyclades-z/cyzfirm2h.c index dff413f5171..a938f78100f 100644 --- a/sys/dev/microcode/cyclades-z/cyzfirm2h.c +++ b/sys/dev/microcode/cyclades-z/cyzfirm2h.c @@ -1,4 +1,4 @@ -/* $NetBSD: cyzfirm2h.c,v 1.11 2012/03/08 16:45:10 jakllsch Exp $ */ +/* $NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: cyzfirm2h.c,v 1.11 2012/03/08 16:45:10 jakllsch Exp $"); +__RCSID("$NetBSD: cyzfirm2h.c,v 1.12 2014/04/01 15:33:22 christos Exp $"); #include <sys/types.h> #include <sys/mman.h> @@ -51,7 +51,6 @@ __RCSID("$NetBSD: cyzfirm2h.c,v 1.11 2012/03/08 16:45:10 jakllsch Exp $"); #include <stdlib.h> #include <unistd.h> -int main(int argc, char *argv[]); static void usage(void) __dead; int @@ -116,11 +115,24 @@ main(int argc, char *argv[]) while (in_len != 0) { if (i == 0) fprintf(out_file, "\t"); - fprintf(out_file, "0x%02x,", *in_ptr); + if (*in_ptr == '@' && in_len > 4 && + memcmp(in_ptr, "@(#)", 4) == 0) + fprintf(out_file, "0x%02x,", '_'); + else + fprintf(out_file, "0x%02x,", *in_ptr); in_ptr++; in_len--; i++; - if (i == 10) { + if (i == 8) { +#ifdef DEBUG + size_t j; + fprintf(out_file, "\t/* "); + for (j = 0; j < 8; j++) { + unsigned char c = (in_ptr - 8)[j]; + fputc(isprint(c) ? c : '.', out_file); + } + fprintf(out_file, " */"); +#endif fprintf(out_file, "\n"); i = 0; } else if (in_len != 0) { @@ -130,6 +142,7 @@ main(int argc, char *argv[]) fprintf(out_file, "\n};\n\n"); fprintf(out_file, "#endif /* _%s_ */\n", include_name); + return 0; } __dead static void |
