]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[riscv] Use generic external heap based on the system memory map
authorMichael Brown <mcb30@ipxe.org>
Mon, 19 May 2025 15:16:33 +0000 (16:16 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 19 May 2025 18:36:25 +0000 (19:36 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/riscv/include/bits/umalloc.h [deleted file]
src/arch/riscv/include/ipxe/sbi_umalloc.h [deleted file]
src/arch/riscv/interface/sbi/sbi_umalloc.c [deleted file]
src/config/defaults/sbi.h

diff --git a/src/arch/riscv/include/bits/umalloc.h b/src/arch/riscv/include/bits/umalloc.h
deleted file mode 100644 (file)
index a7171ca..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef _BITS_UMALLOC_H
-#define _BITS_UMALLOC_H
-
-/** @file
- *
- * RISCV-specific user memory allocation API implementations
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
-
-#include <ipxe/sbi_umalloc.h>
-
-#endif /* _BITS_UMALLOC_H */
diff --git a/src/arch/riscv/include/ipxe/sbi_umalloc.h b/src/arch/riscv/include/ipxe/sbi_umalloc.h
deleted file mode 100644 (file)
index 5763239..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _IPXE_SBI_UMALLOC_H
-#define _IPXE_SBI_UMALLOC_H
-
-/** @file
- *
- * External memory allocation
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
-
-#ifdef UMALLOC_SBI
-#define UMALLOC_PREFIX_sbi
-#else
-#define UMALLOC_PREFIX_sbi __sbi_
-#endif
-
-#endif /* _IPXE_SBI_UMALLOC_H */
diff --git a/src/arch/riscv/interface/sbi/sbi_umalloc.c b/src/arch/riscv/interface/sbi/sbi_umalloc.c
deleted file mode 100644 (file)
index 0e35174..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2024 Michael Brown <mbrown@fensystems.co.uk>.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- * You can also choose to distribute this program under the terms of
- * the Unmodified Binary Distribution Licence (as given in the file
- * COPYING.UBDL), provided that you have satisfied its requirements.
- */
-
-FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
-
-#include <stdlib.h>
-#include <ipxe/umalloc.h>
-
-/** @file
- *
- * iPXE user memory allocation API for SBI
- *
- */
-
-/**
- * Reallocate external memory
- *
- * @v old_ptr          Memory previously allocated by umalloc(), or NULL
- * @v new_size         Requested size
- * @ret new_ptr                Allocated memory, or NULL
- *
- * Calling realloc() with a new size of zero is a valid way to free a
- * memory block.
- */
-static void * sbi_urealloc ( void * old_ptr, size_t new_size ) {
-
-       /* External allocation not yet implemented: allocate from heap */
-       return ( realloc ( old_ptr, new_size ) );
-}
-
-PROVIDE_UMALLOC ( sbi, urealloc, sbi_urealloc );
index 8e02bc3d1908bec022774e8e07bbc28d610f5c40..4edc0ab015e0e543780a1870f8394b20df0e9063 100644 (file)
@@ -18,7 +18,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 #define CONSOLE_SBI
 #define REBOOT_SBI
-#define UMALLOC_SBI
+#define UMALLOC_UHEAP
 #define MEMMAP_FDT
 
 #define ACPI_NULL