Check for crashkernel reservation in PPC64.

Check whether memory for crashkernel is reserved or not by looking for the
existence of /proc/device-tree/chosen/linux,crashkernel-base file. This file
is created only when crashkernel parameter is passed to the kernel.

Signed-off-by: Mohan Kumar M <[EMAIL PROTECTED]>
---
 kexec/arch/ppc64/kexec-elf-ppc64.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c 
b/kexec/arch/ppc64/kexec-elf-ppc64.c
index 944df79..2ad832e 100644
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -69,6 +69,18 @@ int elf_ppc64_probe(const char *buf, off
        return result;
 }
 
+int is_crashkernel_mem_reserved()
+{
+       int fd;
+
+       fd = open("/proc/device-tree/chosen/linux,crashkernel-base", O_RDONLY);
+       if (fd < 0)
+               return 0; 
+       close(fd);
+       return 1;       
+}
+
+
 int elf_ppc64_load(int argc, char **argv, const char *buf, off_t len,
                        struct kexec_info *info)
 {
-- 
1.4.2

_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to