kexec-tools: Use generic /proc/iomem code (i386)

This patch modifies the i386-specific code to use the new generic code.

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>
---

 kexec/arch/i386/crashdump-x86.c |   28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

--- 0007/kexec/arch/i386/crashdump-x86.c
+++ work/kexec/arch/i386/crashdump-x86.c        2006-11-17 16:34:27.000000000 
+0900
@@ -555,30 +555,8 @@ int load_crashdump_segments(struct kexec
 
 int is_crashkernel_mem_reserved(void)
 {
-       const char iomem[]= "/proc/iomem";
-       char line[MAX_LINE];
-       FILE *fp;
-       unsigned long long start, end;
-       char *str;
-       int consumed;
-       int count;
+       uint64_t start, end;
 
-       fp = fopen(iomem, "r");
-       if (!fp)
-               die("Cannot open /proc/iomem");
-
-       while(fgets(line, sizeof(line), fp) != 0) {
-               count = sscanf(line, "%Lx-%Lx : %n", &start, &end, &consumed);
-               if (count != 2)
-                       continue;
-               str = line + consumed;
-               if (memcmp(str, "Crash kernel\n", 13) == 0)
-                       break;
-       }
-
-       fclose(fp);
-       if (!memcmp(str, "Crash kernel\n", 13) == 0 || (start == end))
-               return 0;
-       else
-               return 1;
+       return kexec_iomem_single("Crash kernel\n", &start, &end) == 0 ?
+         (start != end) : 0;
 }
_______________________________________________
fastboot mailing list
fastboot@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to