[PATCH 2/4] 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/crashdump-ppc64.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/kexec/arch/ppc64/crashdump-ppc64.c 
b/kexec/arch/ppc64/crashdump-ppc64.c
index cdda575..fa13141 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -450,6 +450,17 @@ #ifdef DEBUG
 #endif
 }
 
+int is_crashkernel_mem_reserved(void)
+{
+       int fd;
+
+       fd = open("/proc/device-tree/chosen/linux,crashkernel-base", O_RDONLY);
+       if (fd < 0)
+               return 0;
+       close(fd);
+       return 1;
+}
+
 #if 0
 static int sort_regions(mem_rgns_t *rgn)
 {
-- 
1.4.2

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

Reply via email to