kexec-tools/kexec-tools-1.102pre-ppc64-devtree.patch
2008-03-24 11:46:05 +00:00

66 lines
2.6 KiB
Diff

diff -up kexec-tools-testing-20070330/kexec/arch/ppc64/crashdump-ppc64.c.orig kexec-tools-testing-20070330/kexec/arch/ppc64/crashdump-ppc64.c
--- kexec-tools-testing-20070330/kexec/arch/ppc64/crashdump-ppc64.c.orig 2008-03-10 15:08:18.000000000 -0400
+++ kexec-tools-testing-20070330/kexec/arch/ppc64/crashdump-ppc64.c 2008-03-10 15:15:27.000000000 -0400
@@ -129,7 +129,8 @@ static int get_crash_memory_ranges(struc
goto err;
}
while ((dentry = readdir(dir)) != NULL) {
- if (strncmp(dentry->d_name, "memory@", 7))
+ if (strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory"))
continue;
strcpy(fname, device_tree);
strcat(fname, dentry->d_name);
diff -up kexec-tools-testing-20070330/kexec/arch/ppc64/kexec-ppc64.c.orig kexec-tools-testing-20070330/kexec/arch/ppc64/kexec-ppc64.c
--- kexec-tools-testing-20070330/kexec/arch/ppc64/kexec-ppc64.c.orig 2008-03-10 15:08:18.000000000 -0400
+++ kexec-tools-testing-20070330/kexec/arch/ppc64/kexec-ppc64.c 2008-03-10 15:15:27.000000000 -0400
@@ -101,7 +101,7 @@ err1:
}
/*
- * Count the memory@ nodes under /proc/device-tree and populate the
+ * Count the memory nodes under /proc/device-tree and populate the
* max_memory_ranges variable. This variable replaces MAX_MEMORY_RANGES
* macro used earlier.
*/
@@ -118,7 +118,8 @@ static int count_memory_ranges()
while ((dentry = readdir(dir)) != NULL) {
if (strncmp(dentry->d_name, "memory@", 7) &&
- strncmp(dentry->d_name, "pci@", 4))
+ strcmp(dentry->d_name, "memory") &&
+ strncmp(dentry->d_name, "pci@", 4))
continue;
max_memory_ranges++;
}
@@ -144,7 +145,8 @@ static int get_base_ranges()
return -1;
}
while ((dentry = readdir(dir)) != NULL) {
- if (strncmp(dentry->d_name, "memory@", 7))
+ if (strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory"))
continue;
strcpy(fname, device_tree);
strcat(fname, dentry->d_name);
@@ -268,7 +270,8 @@ static int get_devtree_details(unsigned
while ((dentry = readdir(dir)) != NULL) {
if (strncmp(dentry->d_name, "chosen", 6) &&
- strncmp(dentry->d_name, "memory@0", 8) &&
+ strncmp(dentry->d_name, "memory@", 7) &&
+ strcmp(dentry->d_name, "memory") &&
strncmp(dentry->d_name, "pci@", 4) &&
strncmp(dentry->d_name, "rtas", 4))
continue;
@@ -437,7 +440,8 @@ static int get_devtree_details(unsigned
add_usable_mem_rgns(rtas_base, rtas_size);
} /* rtas */
- if (strncmp(dentry->d_name, "memory@0", 8) == 0) {
+ if (!strncmp(dentry->d_name, "memory@", 7) ||
+ !strcmp(dentry->d_name, "memory")) {
strcat(fname, "/reg");
if ((file = fopen(fname, "r")) == NULL) {
perror(fname);