diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-06 15:47:35 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-06 21:24:38 +0200 |
| commit | 97459def3c34d338d3ced9bd2b55f8902573aa19 (patch) | |
| tree | 08cd8ee128334c4ae40e7adfc382662ae8d4a32b /utils/imxtools | |
| parent | 8b13d2f5f100d088746a1f8dd94f8ab82acc9b5b (diff) | |
| download | rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.zip rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.tar.gz rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.tar.bz2 rockbox-97459def3c34d338d3ced9bd2b55f8902573aa19.tar.xz | |
sbtools: fix handling of NOP instructions
Change-Id: I05ab8176f368a6e2d075dfb2059692871e0c00b3
Diffstat (limited to 'utils/imxtools')
| -rw-r--r-- | utils/imxtools/sbtools/sb.c | 9 | ||||
| -rw-r--r-- | utils/imxtools/sbtools/sb.h | 8 |
2 files changed, 16 insertions, 1 deletions
diff --git a/utils/imxtools/sbtools/sb.c b/utils/imxtools/sbtools/sb.c index 05f9836..df36229 100644 --- a/utils/imxtools/sbtools/sb.c +++ b/utils/imxtools/sbtools/sb.c @@ -122,6 +122,13 @@ static void compute_sb_offsets(struct sb_file_t *sb) sb->image_size += ROUND_UP(inst->size, BLOCK_SIZE) / BLOCK_SIZE; sec->sec_size += ROUND_UP(inst->size, BLOCK_SIZE) / BLOCK_SIZE; } + else if(inst->inst == SB_INST_NOP) + { + if(g_debug) + printf(" NOOP\n"); + sb->image_size += sizeof(struct sb_instruction_nop_t) / BLOCK_SIZE; + sec->sec_size += sizeof(struct sb_instruction_nop_t) / BLOCK_SIZE; + } else { if(g_debug) @@ -445,7 +452,7 @@ enum sb_error_t sb_write_file(struct sb_file_t *sb, const char *filename) if(buf_p - buf != sb_hdr.image_size * BLOCK_SIZE) { if(g_debug) - printf("SB image buffer was not entirely filled !"); + printf("SB image buffer was not entirely filled !\n"); return SB_ERROR; } diff --git a/utils/imxtools/sbtools/sb.h b/utils/imxtools/sbtools/sb.h index 02150aa..6f2eecb 100644 --- a/utils/imxtools/sbtools/sb.h +++ b/utils/imxtools/sbtools/sb.h @@ -137,6 +137,14 @@ struct sb_instruction_mode_t uint32_t mode; } __attribute__((packed)); +struct sb_instruction_nop_t +{ + struct sb_instruction_header_t hdr; + uint32_t zero1; + uint32_t zero2; + uint32_t zero3; +} __attribute__((packed)); + struct sb_instruction_call_t { struct sb_instruction_header_t hdr; |