diff options
author | 2021-01-15 13:46:04 +0800 | |
---|---|---|
committer | 2021-02-18 23:17:57 -0800 | |
commit | c72160fe05fb978ad859ba053c4462c2bb960b13 (patch) | |
tree | 7e049e02369f5e4d78f2c9f3cfe24a89163d8b72 /include/linux/initrd.h | |
parent | initrd: Add the preprocessor guard in initrd.h (diff) | |
download | linux-c72160fe05fb978ad859ba053c4462c2bb960b13.tar.gz linux-c72160fe05fb978ad859ba053c4462c2bb960b13.tar.bz2 linux-c72160fe05fb978ad859ba053c4462c2bb960b13.zip |
initramfs: Provide a common initrd reserve function
Some architectures(eg, ARM and riscv) have similar logic to
check and reserve the memory of initrd, let's provide a common
function reserve_initrd_mem() to reduce duplicated code.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'include/linux/initrd.h')
-rw-r--r-- | include/linux/initrd.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/initrd.h b/include/linux/initrd.h index fc30ac30e10e..85c15717af34 100644 --- a/include/linux/initrd.h +++ b/include/linux/initrd.h @@ -18,6 +18,12 @@ extern int initrd_below_start_ok; extern unsigned long initrd_start, initrd_end; extern void free_initrd_mem(unsigned long, unsigned long); +#ifdef CONFIG_BLK_DEV_INITRD +extern void __init reserve_initrd_mem(void); +#else +static inline void __init reserve_initrd_mem(void) {} +#endif + extern phys_addr_t phys_initrd_start; extern unsigned long phys_initrd_size; |