From ca67b09c015d4af3ae3cce12aa72e60941dbb8b5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:29:52 +0200 Subject: Adding debian version 2.06-13+deb12u1. Signed-off-by: Daniel Baumann --- .../disabled/gpxe/src/include/gpxe/malloc.h | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h (limited to 'debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h') diff --git a/debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h b/debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h new file mode 100644 index 0000000..c02a866 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h @@ -0,0 +1,59 @@ +#ifndef _GPXE_MALLOC_H +#define _GPXE_MALLOC_H + +#include + +/** @file + * + * Dynamic memory allocation + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +/* + * Prototypes for the standard functions (malloc() et al) are in + * stdlib.h. Include only if you need the + * non-standard functions, such as malloc_dma(). + * + */ +#include + +extern size_t freemem; + +extern void * __malloc alloc_memblock ( size_t size, size_t align ); +extern void free_memblock ( void *ptr, size_t size ); +extern void mpopulate ( void *start, size_t len ); +extern void mdumpfree ( void ); + +/** + * Allocate memory for DMA + * + * @v size Requested size + * @v align Physical alignment + * @ret ptr Memory, or NULL + * + * Allocates physically-aligned memory for DMA. + * + * @c align must be a power of two. @c size may not be zero. + */ +static inline void * __malloc malloc_dma ( size_t size, size_t phys_align ) { + return alloc_memblock ( size, phys_align ); +} + +/** + * Free memory allocated with malloc_dma() + * + * @v ptr Memory allocated by malloc_dma(), or NULL + * @v size Size of memory, as passed to malloc_dma() + * + * Memory allocated with malloc_dma() can only be freed with + * free_dma(); it cannot be freed with the standard free(). + * + * If @c ptr is NULL, no action is taken. + */ +static inline void free_dma ( void *ptr, size_t size ) { + free_memblock ( ptr, size ); +} + +#endif /* _GPXE_MALLOC_H */ -- cgit v1.2.3