kexec-tools/kexec-tools-1.101-ppc64-64k-pages.patch

112 lines
4.0 KiB
Diff
Raw Normal View History

2006-12-15 21:05:01 +00:00
Signed-off-by: Sachin Sant <sachinp@in.ibm.com>
---
diff -Naurp kexec-tools-rh/kexec/arch/ppc64/crashdump-ppc64.c kexec-tools-rh-fix/kexec/arch/ppc64/crashdump-ppc64.c
--- kexec-tools-rh/kexec/arch/ppc64/crashdump-ppc64.c 2006-09-08 07:29:52.000000000 +0530
+++ kexec-tools-rh-fix/kexec/arch/ppc64/crashdump-ppc64.c 2006-09-08 07:32:19.000000000 +0530
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include <elf.h>
@@ -85,8 +86,8 @@ static int get_crash_memory_ranges(struc
unsigned long long start, end, cstart, cend;
/* create a separate program header for the backup region */
- crash_memory_range[0].start = 0x0000000000000000;
- crash_memory_range[0].end = 0x0000000000008000;
+ crash_memory_range[0].start = BACKUP_START;
+ crash_memory_range[0].end = BACKUP_END;
crash_memory_range[0].type = RANGE_RAM;
memory_ranges++;
@@ -125,8 +126,8 @@ static int get_crash_memory_ranges(struc
break;
start = ((unsigned long long *)buf)[0];
end = start + ((unsigned long long *)buf)[1];
- if (start == 0 && end >= 0x8000)
- start = 0x8000;
+ if (start == 0 && end >= BACKUP_END)
+ start = BACKUP_END;
match = 0;
sort_regions(&exclude_rgns);
@@ -420,8 +421,8 @@ void add_usable_mem_rgns(unsigned long l
unsigned long long end = base + size;
unsigned long long ustart, uend;
- base = _ALIGN_DOWN(base, PAGE_SIZE);
- end = _ALIGN_UP(end, PAGE_SIZE);
+ base = _ALIGN_DOWN(base, getpagesize());
+ end = _ALIGN_UP(end, getpagesize());
for (i=0; i < usablemem_rgns.size; i++) {
ustart = usablemem_rgns.ranges[i].start;
diff -Naurp kexec-tools-rh/kexec/arch/ppc64/crashdump-ppc64.h kexec-tools-rh-fix/kexec/arch/ppc64/crashdump-ppc64.h
--- kexec-tools-rh/kexec/arch/ppc64/crashdump-ppc64.h 2006-09-08 07:29:52.000000000 +0530
+++ kexec-tools-rh-fix/kexec/arch/ppc64/crashdump-ppc64.h 2006-09-08 07:33:38.000000000 +0530
@@ -6,28 +6,24 @@ int load_crashdump_segments(struct kexec
void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
void add_exclude_rgns(unsigned long long base, unsigned long long size);
-#define PAGE_OFFSET 0xC000000000000000
+#define PAGE_OFFSET 0xC000000000000000
#define KERNELBASE PAGE_OFFSET
#define VMALLOCBASE 0xD000000000000000
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
-
-#define MAXMEM (-KERNELBASE-VMALLOCBASE)
+#define MAXMEM (-KERNELBASE-VMALLOCBASE)
#define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 6)
#define COMMAND_LINE_SIZE 512 /* from kernel */
-/* Backup Region, First 32K of System RAM. */
+/* Backup Region, First 64K of System RAM. */
#define BACKUP_START 0x0000
-#define BACKUP_END 0x8000
+#define BACKUP_END 0x10000
#define BACKUP_SIZE (BACKUP_END - BACKUP_START + 1)
-#define KDUMP_BACKUP_LIMIT 0x8000
+#define KDUMP_BACKUP_LIMIT BACKUP_END
#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
-#ifndef PAGE_SIZE
-#define PAGE_SIZE 4096
-#endif
extern unsigned long long crash_base;
extern unsigned long long crash_size;
diff -Naurp kexec-tools-rh/purgatory/arch/ppc64/crashdump_backup.c kexec-tools-rh-fix/purgatory/arch/ppc64/crashdump_backup.c
--- kexec-tools-rh/purgatory/arch/ppc64/crashdump_backup.c 2006-09-08 07:29:52.000000000 +0530
+++ kexec-tools-rh-fix/purgatory/arch/ppc64/crashdump_backup.c 2006-09-08 08:42:27.000000000 +0530
@@ -21,9 +21,7 @@
#include <stdint.h>
#include <string.h>
-
-#define BACKUP_REGION_SOURCE 0x0
-#define BACKUP_REGION_SIZE 32*1024
+#include "../../../kexec/arch/ppc64/crashdump-ppc64.h"
extern unsigned long backup_start;
@@ -32,10 +30,10 @@ void crashdump_backup_memory(void)
{
void *dest, *src;
- src = (void *)BACKUP_REGION_SOURCE;
+ src = (void *)BACKUP_START;
if (backup_start) {
dest = (void *)(backup_start);
- memcpy(dest, src, BACKUP_REGION_SIZE);
+ memcpy(dest, src, BACKUP_SIZE);
}
}