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/umalloc.h | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h (limited to 'debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h') diff --git a/debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h b/debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h new file mode 100644 index 0000000..b0e5564 --- /dev/null +++ b/debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h @@ -0,0 +1,68 @@ +#ifndef _GPXE_UMALLOC_H +#define _GPXE_UMALLOC_H + +/** + * @file + * + * User memory allocation + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include +#include +#include + +/** + * Provide a user memory allocation API implementation + * + * @v _prefix Subsystem prefix + * @v _api_func API function + * @v _func Implementing function + */ +#define PROVIDE_UMALLOC( _subsys, _api_func, _func ) \ + PROVIDE_SINGLE_API ( UMALLOC_PREFIX_ ## _subsys, _api_func, _func ) + +/* Include all architecture-independent I/O API headers */ +#include + +/* Include all architecture-dependent I/O API headers */ +#include + +/** + * Reallocate external memory + * + * @v userptr Memory previously allocated by umalloc(), or UNULL + * @v new_size Requested size + * @ret userptr Allocated memory, or UNULL + * + * Calling realloc() with a new size of zero is a valid way to free a + * memory block. + */ +userptr_t urealloc ( userptr_t userptr, size_t new_size ); + +/** + * Allocate external memory + * + * @v size Requested size + * @ret userptr Memory, or UNULL + * + * Memory is guaranteed to be aligned to a page boundary. + */ +static inline __always_inline userptr_t umalloc ( size_t size ) { + return urealloc ( UNULL, size ); +} + +/** + * Free external memory + * + * @v userptr Memory allocated by umalloc(), or UNULL + * + * If @c ptr is UNULL, no action is taken. + */ +static inline __always_inline void ufree ( userptr_t userptr ) { + urealloc ( userptr, 0 ); +} + +#endif /* _GPXE_UMALLOC_H */ -- cgit v1.2.3