[initrd] Move initrd reshuffling to be architecture-independent code

There is nothing x86-specific in initrd.c, and a variant of the
reshuffling logic will be required for executing bare-metal kernels on
RISC-V and AArch64.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-21 12:07:24 +01:00
parent d15a11f3a4
commit c1cd54ad74
5 changed files with 6 additions and 6 deletions

View File

@@ -329,6 +329,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_gzip ( ERRFILE_IMAGE | 0x000c0000 )
#define ERRFILE_efi_siglist ( ERRFILE_IMAGE | 0x000d0000 )
#define ERRFILE_lkrn ( ERRFILE_IMAGE | 0x000e0000 )
#define ERRFILE_initrd ( ERRFILE_IMAGE | 0x000f0000 )
#define ERRFILE_asn1 ( ERRFILE_OTHER | 0x00000000 )
#define ERRFILE_chap ( ERRFILE_OTHER | 0x00010000 )

23
src/include/ipxe/initrd.h Normal file
View File

@@ -0,0 +1,23 @@
#ifndef _IPXE_INITRD_H
#define _IPXE_INITRD_H
/** @file
*
* Initial ramdisk (initrd) reshuffling
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
/** Minimum free space required to reshuffle initrds
*
* Chosen to avoid absurdly long reshuffling times
*/
#define INITRD_MIN_FREE_LEN ( 512 * 1024 )
extern void initrd_reshuffle ( physaddr_t bottom );
extern int initrd_reshuffle_check ( size_t len, physaddr_t bottom );
#endif /* _IPXE_INITRD_H */