[initrd] Rename bzimage_align() to initrd_align()

Alignment of initrd lengths is applicable to all Linux kernels, not
just those in the x86 bzImage format.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-22 13:41:21 +01:00
parent 9231d8c952
commit 029c7c4178
5 changed files with 24 additions and 30 deletions

View File

@@ -60,9 +60,6 @@ struct cpio_header {
/** CPIO header length alignment */
#define CPIO_ALIGN 4
/** Alignment for CPIO archives within an initrd */
#define INITRD_ALIGN 4096
/**
* Get CPIO image name
*

View File

@@ -14,4 +14,19 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
extern void initrd_reshuffle ( physaddr_t bottom );
extern int initrd_reshuffle_check ( size_t len, physaddr_t bottom );
/** Initial ramdisk chunk alignment */
#define INITRD_ALIGN 4096
/**
* Align initrd length
*
* @v len Length
* @ret len Aligned length
*/
static inline __attribute__ (( always_inline )) size_t
initrd_align ( size_t len ) {
return ( ( len + INITRD_ALIGN - 1 ) & ~( INITRD_ALIGN - 1 ) );
}
#endif /* _IPXE_INITRD_H */