From 50be1a8c4ce38d97b7ae76cb4dccf961065f9d94 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Mon, 13 Jun 2011 21:46:29 +0000 Subject: [PATCH] sbtools: add support for the mode command (rarely used) and explicit env variable to skip version check git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30003 a1c6a512-1295-4272-9138-f99709370657 --- utils/sbtools/sb.h | 8 ++++++++ utils/sbtools/sbtoelf.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/utils/sbtools/sb.h b/utils/sbtools/sb.h index fe9ee3f4db..9ffdba9191 100644 --- a/utils/sbtools/sb.h +++ b/utils/sbtools/sb.h @@ -123,6 +123,14 @@ struct sb_instruction_fill_t uint32_t pattern; } __attribute__((packed)); +struct sb_instruction_mode_t +{ + struct sb_instruction_header_t hdr; + uint32_t zero1; + uint32_t zero2; + uint32_t mode; +} __attribute__((packed)); + struct sb_instruction_call_t { struct sb_instruction_header_t hdr; diff --git a/utils/sbtools/sbtoelf.c b/utils/sbtools/sbtoelf.c index 854af2851e..7e6b77055b 100644 --- a/utils/sbtools/sbtoelf.c +++ b/utils/sbtools/sbtoelf.c @@ -307,6 +307,17 @@ static void extract_section(int data_sec, char name[5], byte *buf, int size, con // fixme: useless as pos is a multiple of 16 and call struct is 4-bytes wide ? pos = ROUND_UP(pos, 16); } + else if(hdr->opcode == SB_INST_MODE) + { + struct sb_instruction_mode_t *mode = (struct sb_instruction_mode_t *)hdr; + color(RED); + printf("MODE"); + color(OFF);printf(" | "); + color(BLUE); + printf("mod=0x%08x\n", mode->mode); + color(OFF); + pos += sizeof(struct sb_instruction_mode_t); + } else { color(RED); @@ -705,6 +716,7 @@ int main(int argc, const char **argv) { printf("Usage: %s []\n",*argv); printf("To use raw command mode, set environment variable SB_RAW_CMD to YES\n"); + printf("To ignore the file version check, set environment variable SB_IGNORE_VER to YES\n"); return 1; }