@@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>
+#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+#endif
+
static void __init free_initrd(void)
{
#ifdef CONFIG_KEXEC_CORE
@@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
default ".lzma" if RD_LZMA
default ".bz2" if RD_BZIP2
default ""
+
+# Arches can select this for a generic initrd unloading codepath
+config INITRAMFS_GENERIC_UNLOAD
+ bool
Signed-off-by: Shea Levy <shea@shealevy.com> --- init/initramfs.c | 7 +++++++ usr/Kconfig | 4 ++++ 2 files changed, 11 insertions(+)