linux/arch/sh
Thomas Petazzoni 2d6ffcca62 inflate: refactor inflate malloc code
Inflate requires some dynamic memory allocation very early in the boot
process and this is provided with a set of four functions:
malloc/free/gzip_mark/gzip_release.

The old inflate code used a mark/release strategy rather than implement
free.  This new version instead keeps a count on the number of outstanding
allocations and when it hits zero, it resets the malloc arena.

This allows removing all the mark and release implementations and unifying
all the malloc/free implementations.

The architecture-dependent code must define two addresses:
 - free_mem_ptr, the address of the beginning of the area in which
   allocations should be made
 - free_mem_end_ptr, the address of the end of the area in which
   allocations should be made. If set to 0, then no check is made on
   the number of allocations, it just grows as much as needed

The architecture-dependent code can also provide an arch_decomp_wdog()
function call.  This function will be called several times during the
decompression process, and allow to notify the watchdog that the system is
still running.  If an architecture provides such a call, then it must
define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
arch_decomp_wdog().

Work initially done by Matt Mackall, updated to a recent version of the
kernel and improved by me.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:28 -07:00
..
boards Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-07-23 18:24:08 -07:00
boot inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
cchips sh: Kill off more dead symbols. 2008-02-14 14:22:12 +09:00
configs Merge branches 'at91', 'dyntick', 'ep93xx', 'iop', 'ixp', 'misc', 'orion', 'omap-reviewed', 'rpc', 'rtc' and 's3c' into devel 2008-07-10 16:38:50 +01:00
drivers sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
kernel Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
lib sh: Fix up optimized SH-4 memcpy on big endian. 2008-05-16 14:55:07 +09:00
lib64 sh64: Fix up compile warning in event tracer. 2008-05-08 19:51:37 +09:00
math-emu sh: Fix up the math-emu build. 2007-06-11 15:57:42 +09:00
mm bootmem: replace node_boot_start in struct bootmem_data 2008-07-24 10:47:20 -07:00
oprofile sh: Add -Werror for clean directories. 2007-11-07 11:13:55 +09:00
tools sh: remove the broken SH_MPC1211 support 2008-05-08 19:51:39 +09:00
Kconfig add HAVE_CLK to Kconfig, for driver dependencies 2008-07-24 10:47:13 -07:00
Kconfig.cpu sh: Disable big endian for SH-5. 2008-02-14 14:22:10 +09:00
Kconfig.debug sh: Disable 4KSTACKS on nommu. 2008-06-02 13:48:59 +09:00
Makefile sh: Add -mno-fdpic to default flags. 2008-06-09 16:49:43 +09:00