From: Michael Buesch Date: Sun, 19 Sep 2010 18:17:05 +0000 (+0200) Subject: Assembler: Better error message for %arch X-Git-Tag: b43-fwcutter-014~35 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=4366b5ddfc844ad72d9fd8e62418307c70407154;p=b43-tools.git Assembler: Better error message for %arch Signed-off-by: Michael Buesch --- 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);