From 4366b5ddfc844ad72d9fd8e62418307c70407154 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Sun, 19 Sep 2010 20:17:05 +0200 Subject: [PATCH] Assembler: Better error message for %arch Signed-off-by: Michael Buesch --- assembler/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assembler/main.c b/assembler/main.c index 10e5cd3..461b0d8 100644 --- a/assembler/main.c +++ b/assembler/main.c @@ -117,6 +117,7 @@ static void eval_directives(struct assembler_context *ctx) struct label *l; int have_start_label = 0; int have_arch = 0; + unsigned int arch_fallback = 0; for_each_statement(ctx, s) { if (s->type == STMT_ASMDIR) { @@ -126,6 +127,17 @@ static void eval_directives(struct assembler_context *ctx) if (have_arch) asm_error(ctx, "Multiple %%arch definitions"); ctx->arch = ad->u.arch; + if (ctx->arch > 5 && ctx->arch < 15) + arch_fallback = 5; + if (ctx->arch > 15) + arch_fallback = 15; + if (arch_fallback) { + asm_warn(ctx, "Using %%arch %d is incorrect. " + "The wireless core revision %d uses the " + "firmware architecture %d. So use %%arch %d", + ctx->arch, ctx->arch, arch_fallback, arch_fallback); + ctx->arch = arch_fallback; + } if (ctx->arch != 5 && ctx->arch != 15) { asm_error(ctx, "Architecture version %u unsupported", ctx->arch); -- 2.31.1