linux/arch/cris/arch-v32
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
..
boot inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
drivers Merge branch 'for-linus' of git://www.jni.nu/cris 2008-07-20 17:37:46 -07:00
kernel smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
lib cris: correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h 2008-03-04 16:35:16 -08:00
mach-a3 CRIS v32: Correct spelling of bandwidth in function name. 2008-02-08 11:16:46 +01:00
mach-fs CRIS v32: Update vcs_hook.c for ETRAX FS. 2008-02-08 11:06:35 +01:00
mm mm: drop unneeded pgdat argument from free_area_init_node() 2008-07-24 10:47:16 -07:00
Kconfig CRIS: Rearrange Kconfigs for v10 and v32 to allow compilation without warnings. 2008-02-08 11:06:22 +01:00
output_arch.ld [PATCH] CRIS update: new subarchitecture v32 2005-07-27 16:26:01 -07:00
vmlinux.lds.S CRIS v32: Fix startup oops and replace hardcoded pagesize in vmlinux.lds.S 2008-02-08 11:06:36 +01:00