projects
/
b43-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
b43-asm: Change the filenames of the binaries.
[b43-tools.git]
/
assembler
/
main.c
diff --git
a/assembler/main.c
b/assembler/main.c
index 3562a048ca0d19b58beaaed36f0482ff23926d44..ab79f7eaaa74f13f51c32f33f41d3a8504b53983 100644
(file)
--- a/
assembler/main.c
+++ b/
assembler/main.c
@@
-1026,21
+1026,17
@@
does_not_exist:
static void emit_code(struct assembler_context *ctx)
{
FILE *fd;
static void emit_code(struct assembler_context *ctx)
{
FILE *fd;
- char *fn;
- size_t fn_len;
+ const char *fn;
struct code_output *c;
uint64_t code;
unsigned char outbuf[8];
unsigned int insn_count = 0;
struct fw_header hdr;
struct code_output *c;
uint64_t code;
unsigned char outbuf[8];
unsigned int insn_count = 0;
struct fw_header hdr;
- fn_len = strlen(outfile_name) + 20;
- fn = xmalloc(fn_len);
- snprintf(fn, fn_len, "%s.ucode", outfile_name);
+ fn = outfile_name;
fd = fopen(fn, "w+");
if (!fd) {
fprintf(stderr, "Could not open microcode output file \"%s\"\n", fn);
fd = fopen(fn, "w+");
if (!fd) {
fprintf(stderr, "Could not open microcode output file \"%s\"\n", fn);
- free(fn);
exit(1);
}
if (IS_VERBOSE_DEBUG)
exit(1);
}
if (IS_VERBOSE_DEBUG)
@@
-1125,8
+1121,13
@@
static void emit_code(struct assembler_context *ctx)
break;
}
}
break;
}
}
+
+ if (arg_print_sizes) {
+ printf("%s: text = %u instructions (%u bytes)\n",
+ fn, insn_count, insn_count * sizeof(uint64_t));
+ }
+
fclose(fd);
fclose(fd);
- free(fn);
}
static void assemble(void)
}
static void assemble(void)