diff options
Diffstat (limited to 'include/linux/decompress')
| -rw-r--r-- | include/linux/decompress/mm.h | 12 | 
1 files changed, 10 insertions, 2 deletions
| diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 868e9eacd69e..9192986b1a73 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h @@ -25,13 +25,21 @@  #define STATIC_RW_DATA static  #endif +/* + * When an architecture needs to share the malloc()/free() implementation + * between compilation units, it needs to have non-local visibility. + */ +#ifndef MALLOC_VISIBLE +#define MALLOC_VISIBLE static +#endif +  /* A trivial malloc implementation, adapted from   *  malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994   */  STATIC_RW_DATA unsigned long malloc_ptr;  STATIC_RW_DATA int malloc_count; -static void *malloc(int size) +MALLOC_VISIBLE void *malloc(int size)  {  	void *p; @@ -52,7 +60,7 @@ static void *malloc(int size)  	return p;  } -static void free(void *where) +MALLOC_VISIBLE void free(void *where)  {  	malloc_count--;  	if (!malloc_count) |