linux_dsm_epyc7002/arch/x86/boot/compressed
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
..
.gitignore i386: move boot 2007-10-11 11:16:43 +02:00
head_32.S x86: cleanup boot-heap usage 2008-04-19 19:19:54 +02:00
head_64.S x86: compressed/head_64.S cleanup - use predefined flags from processor-flags.h 2008-05-25 08:58:32 +02:00
Makefile x86: use ELF format in compressed images. 2008-04-17 17:40:46 +02:00
misc.c inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
relocs.c x86: remove arbitrary ELF section limit in i386 relocatable kernel 2008-06-30 20:22:58 -07:00
vmlinux_32.lds x86: switch to .rodata.compressed in arch/x86/boot/compressed/vmlinux_??.scr 2008-01-30 13:33:38 +01:00
vmlinux_64.lds x86: cleanup: change _end to end_before_pgt 2008-04-19 19:19:55 +02:00
vmlinux.scr x86: unify arch/x86/boot/compressed/vmlinux_??.scr 2008-01-30 13:33:38 +01:00