Server IP : 13.213.54.232 / Your IP : 216.73.216.72 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/usr/lib/modules/6.8.0-1031-aws/build/include/linux/decompress/ |
Upload File : |
/* SPDX-License-Identifier: GPL-2.0 */ /* * linux/compr_mm.h * * Memory management for pre-boot and ramdisk uncompressors * * Authors: Alain Knaff <alain@knaff.lu> * */ #ifndef DECOMPR_MM_H #define DECOMPR_MM_H #ifdef STATIC /* Code active when included from pre-boot environment: */ /* * Some architectures want to ensure there is no local data in their * pre-boot environment, so that data can arbitrarily relocated (via * GOT references). This is achieved by defining STATIC_RW_DATA to * be null. */ #ifndef STATIC_RW_DATA #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; MALLOC_VISIBLE void *malloc(int size) { void *p; if (size < 0) return NULL; if (!malloc_ptr) malloc_ptr = free_mem_ptr; malloc_ptr = (malloc_ptr + 7) & ~7; /* Align */ p = (void *)malloc_ptr; malloc_ptr += size; if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) return NULL; malloc_count++; return p; } MALLOC_VISIBLE void free(void *where) { malloc_count--; if (!malloc_count) malloc_ptr = free_mem_ptr; } #define large_malloc(a) malloc(a) #define large_free(a) free(a) #define INIT #else /* STATIC */ /* Code active when compiled standalone for use when loading ramdisk: */ #include <linux/kernel.h> #include <linux/fs.h> #include <linux/string.h> #include <linux/slab.h> #include <linux/vmalloc.h> /* Use defines rather than static inline in order to avoid spurious * warnings when not needed (indeed large_malloc / large_free are not * needed by inflate */ #define malloc(a) kmalloc(a, GFP_KERNEL) #define free(a) kfree(a) #define large_malloc(a) vmalloc(a) #define large_free(a) vfree(a) #define INIT __init #define STATIC #include <linux/init.h> #endif /* STATIC */ #endif /* DECOMPR_MM_H */