mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 14:32:49 +03:00
[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:
@@ -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
23
src/include/ipxe/initrd.h
Normal 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 */
|
||||
Reference in New Issue
Block a user