Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934117AbbFWVvU (ORCPT ); Tue, 23 Jun 2015 17:51:20 -0400 Received: from fish.king.net.pl ([79.190.246.46]:36991 "EHLO king.net.pl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934002AbbFWVtx (ORCPT ); Tue, 23 Jun 2015 17:49:53 -0400 From: Paul Osmialowski To: Andrew Morton , Anson Huang , Ard Biesheuvel , Arnd Bergmann , Bhupesh Sharma , Daniel Lezcano , Frank Li , Geert Uytterhoeven , Greg Kroah-Hartman , Guenter Roeck , Haojian Zhuang , Ian Campbell , Jingchang Lu , Jiri Slaby , Kees Cook , Kumar Gala , Laurent Pinchart , Linus Walleij , Magnus Damm , Michael Turquette , Nathan Lynch , Nicolas Pitre , Maxime Coquelin stm32 , Olof Johansson , Paul Bolle , Rob Herring , Rob Herring , Russell King , Sergey Senozhatsky , Shawn Guo , Simon Horman , Stefan Agner , Stephen Boyd , Thomas Gleixner , Uwe Kleine-Koenig , Catalin Marinas , Dave Martin , Mark Rutland , Pawel Moll , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org Cc: Paul Osmialowski , Yuri Tikhonov , Sergei Poselenov , Dmitry Cherkassov , Alexander Potashev Subject: [PATCH 2/9] arm: do not place huge encoder tables on stack when it is too small Date: Tue, 23 Jun 2015 23:19:40 +0200 Message-Id: <1435094387-20146-3-git-send-email-pawelo@king.net.pl> X-Mailer: git-send-email 2.3.6 In-Reply-To: <1435094387-20146-1-git-send-email-pawelo@king.net.pl> References: <1435094387-20146-1-git-send-email-pawelo@king.net.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1677 Lines: 48 Since stack on Cortex-M3 is too small, we need configuration option to avoid using it for huge encoder tables of zlib. Signed-off-by: Paul Osmialowski --- arch/arm/Kconfig-nommu | 4 ++++ lib/zlib_inflate/inflate.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu index aed66d5..965ca97 100644 --- a/arch/arm/Kconfig-nommu +++ b/arch/arm/Kconfig-nommu @@ -62,3 +62,7 @@ config ARM_MPU If your CPU has an MPU then you should choose 'y' here unless you know that you do not want to use the MPU. + +config ZLIB_INFLATE_STACK_SAVING + bool 'Do not place huge encoder tables on stack' if ZLIB_INFLATE + depends on ZLIB_INFLATE diff --git a/lib/zlib_inflate/inflate.c b/lib/zlib_inflate/inflate.c index 58a733b..917b7cf 100644 --- a/lib/zlib_inflate/inflate.c +++ b/lib/zlib_inflate/inflate.c @@ -75,9 +75,14 @@ int zlib_inflateInit2(z_streamp strm, int windowBits) Return state with length and distance decoding tables and index sizes set to fixed code decoding. This returns fixed tables from inffixed.h. */ +#ifdef CONFIG_ZLIB_INFLATE_STACK_SAVING +# include "inffixed.h" +#endif static void zlib_fixedtables(struct inflate_state *state) { +#ifndef CONFIG_ZLIB_INFLATE_STACK_SAVING # include "inffixed.h" +#endif state->lencode = lenfix; state->lenbits = 9; state->distcode = distfix; -- 2.3.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/