From patchwork Sun Jul 15 02:44:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 1198321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id C516B3FC4C for ; Sun, 15 Jul 2012 02:53:43 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SqEsw-00008H-TI; Sun, 15 Jul 2012 02:48:38 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SqEqd-0008VL-15 for linux-arm-kernel@lists.infradead.org; Sun, 15 Jul 2012 02:46:27 +0000 Received: by wgbez12 with SMTP id ez12so2630983wgb.18 for ; Sat, 14 Jul 2012 19:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=r7GsdHtFs/rM4ml3Q/eE3w2exkeV4TNI7qA3USatxiw=; b=0ioZIja5AbFUSxG1THaKN1GiUuSgMI8oyL4P9XgpYQfd6U0mu8F18eCXDb+3GuSIB2 Q2s4dXMrAAvOVbrpIhQ1pjkvU+xpInwc85nlBbD2SGanqw5Di81kcqVJBTZxdGyQTPBt UDB7Z+Jh4sW/hUA2rf0dUSNNK70/4/4ntPRzgWOXYdL6SJFXnYZ+GkpBdeu+RfuYYs7w sHxA5SEwCvDma1cqzN/QI7f8nRPtMrlmOL7XF0wFBb/4PQUxGrBdyP+z/uu8y2NAQFlM YvgxEeu9AeR14ttrOfmtDCvw/qQnpumMpvuRSTkDft8yyBZMj0ujmdgojS3hH4ejwXpf YSpg== Received: by 10.216.240.196 with SMTP id e46mr1440201wer.224.1342320369937; Sat, 14 Jul 2012 19:46:09 -0700 (PDT) Received: from raptus.dandreoli.com (178-85-163-250.dynamic.upc.nl. [178.85.163.250]) by mx.google.com with ESMTPS id t8sm13058728wiy.3.2012.07.14.19.46.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jul 2012 19:46:09 -0700 (PDT) Received: by raptus.dandreoli.com (Postfix, from userid 1000) id 2CD3D37BA00; Sun, 15 Jul 2012 04:46:09 +0200 (CEST) Message-Id: <20120715024608.900969405@gmail.com> User-Agent: quilt/0.60-1 Date: Sun, 15 Jul 2012 04:44:11 +0200 From: Domenico Andreoli To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 03/12] ARM: Add indirection around arch_decomp_setup()/arch_error() References: <20120715024408.747946928@gmail.com> Content-Disposition: inline; filename=decomp-arch-fallbacks.patch X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cavokz[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Domenico Andreoli , Russell King - ARM Linux , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Domenico Andreoli Adding an indirection level to call the legacy functions arch_decomp_setup() and arch_error() defined in the various mach/uncompress.h headers. These so called fallback functions will be used in case no other option is available to get a better console for the decompressor. This is the case of boards not using the new interface introduced by this patch (we don't want to break existing code). Side note: multiplatform kernels will receive nice empty stubs as fallbacks so that if no console is selected none is used. Signed-off-by: Domenico Andreoli --- arch/arm/boot/compressed/misc.c | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) Index: b/arch/arm/boot/compressed/misc.c =================================================================== --- a/arch/arm/boot/compressed/misc.c +++ b/arch/arm/boot/compressed/misc.c @@ -23,9 +23,11 @@ unsigned int __machine_arch_type; #include static void putstr(const char *ptr); -extern void error(char *x); +void error(char *x); +#ifndef CONFIG_ARCH_MULTIPLATFORM #include +#endif #ifdef CONFIG_DEBUG_ICEDCC @@ -83,6 +85,34 @@ static void icedcc_putc(int ch) #define putc(ch) icedcc_putc(ch) #endif +#ifdef CONFIG_ARCH_MULTIPLATFORM + +void fallback_arch_setup(void) +{ +} + +void fallback_arch_error(char *x) +{ +} + +#else + +#ifndef arch_error +#define arch_error(x) +#endif + +void fallback_arch_setup(void) +{ + arch_decomp_setup(); +} + +void fallback_arch_error(char *x) +{ + arch_error(x); +} + +#endif /* CONFIG_ARCH_MULTIPLATFORM */ + static void putstr(const char *ptr) { char c; @@ -107,13 +137,9 @@ unsigned char *output_data; unsigned long free_mem_ptr; unsigned long free_mem_end_ptr; -#ifndef arch_error -#define arch_error(x) -#endif - void error(char *x) { - arch_error(x); + fallback_arch_error(x); putstr("\n\n"); putstr(x); @@ -142,7 +168,7 @@ decompress_kernel(unsigned long output_s free_mem_end_ptr = free_mem_ptr_end_p; __machine_arch_type = arch_id; - arch_decomp_setup(); + fallback_arch_setup(); putstr("Uncompressing Linux..."); ret = do_decompress(input_data, input_data_end - input_data,