Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > b8204bfed5255fbbec2bb0fe190e1aec > files > 40

kexec-tools-1.102pre-77.el5.3.src.rpm

diff -up kexec-tools-testing-20070330/kexec/arch/x86_64/crashdump-x86_64.c.orig kexec-tools-testing-20070330/kexec/arch/x86_64/crashdump-x86_64.c
--- kexec-tools-testing-20070330/kexec/arch/x86_64/crashdump-x86_64.c.orig	2008-12-22 13:36:52.000000000 -0500
+++ kexec-tools-testing-20070330/kexec/arch/x86_64/crashdump-x86_64.c	2008-12-22 13:37:29.000000000 -0500
@@ -219,6 +219,8 @@ static int get_crash_memory_ranges(struc
 			 * initializing acpi tables in second kernel.
 			 */
 			type = RANGE_ACPI;
+		} else if (memcmp(str, "reserved\n", 9) == 0){
+			type = RANGE_RESERVED;
 		} else if(memcmp(str,"ACPI Non-volatile Storage\n",26) == 0 ) {
 			type = RANGE_ACPI_NVS;
 		} else if (memcmp(str, "GART\n", 5) == 0) {
@@ -540,9 +542,9 @@ static int cmdline_add_elfcorehdr(char *
 	return 0;
 }
 
-/* Appends memmap=X#Y commandline for ACPI to command line*/
-static int cmdline_add_memmap_acpi(char *cmdline, unsigned long start,
-					unsigned long end)
+/* Appends memmap=X#Y or memmap=X$Y commandline for ACPI/reserved to command line*/
+static int cmdline_add_memmap_type(char *cmdline, unsigned long start,
+					unsigned long end, int type)
 {
 	int cmdlen, len, align = 1024;
 	unsigned long startk, endk;
@@ -556,7 +558,11 @@ static int cmdline_add_memmap_acpi(char 
 	strcpy (str_mmap, " memmap=");
 	ultoa((endk - startk), str_tmp);
 	strcat (str_mmap, str_tmp);
-	strcat (str_mmap, "K#");
+	strcat (str_mmap, "K");
+	if (type == RANGE_ACPI || type == RANGE_ACPI_NVS)
+		strcat (str_mmap, "#");
+	else
+		strcat (str_mmap, "$");
 	ultoa(startk, str_tmp);
 	strcat (str_mmap, str_tmp);
 	strcat (str_mmap, "K");
@@ -635,12 +641,13 @@ int load_crashdump_segments(struct kexec
 	/* Inform second kernel about the presence of ACPI tables. */
 	for (i = 0; i < CRASH_MAX_MEMORY_RANGES; i++) {
 		unsigned long start, end;
-		if ( !( mem_range[i].type == RANGE_ACPI
-			|| mem_range[i].type == RANGE_ACPI_NVS) )
-			continue;
-		start = mem_range[i].start;
-		end = mem_range[i].end;
-		cmdline_add_memmap_acpi(mod_cmdline, start, end);
+		if (mem_range[i].type == RANGE_ACPI
+			|| mem_range[i].type == RANGE_ACPI_NVS
+			|| mem_range[i].type == RANGE_RESERVED){
+			start = mem_range[i].start;
+			end = mem_range[i].end;
+			cmdline_add_memmap_type(mod_cmdline, start, end, mem_range[i].type);
+		}
 	}
 	return 0;
 }