summaryrefslogtreecommitdiff
path: root/kexec/kexec.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@in.ibm.com>2005-08-04 17:46:07 +0530
committerEric W. Biederman <ebiederm@xmission.com>2006-07-27 09:36:34 -0600
commit1ac3ddd1d4a3d8cb7af5fd02c1ffb85893c4ea50 (patch)
tree9df26ececf6fdd915fc54c7d080788efdd40a7b7 /kexec/kexec.c
parentdcb661fb3e778052d64b1b1557621856eade403a (diff)
crashdump backup region handling
o This patch adds support for reserving space for backup region. Also adds code in purgatory to copy the first 640K to backup region. o Moved kexec_flags inside kexec_info structure. Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r--kexec/kexec.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 4d1a3db..fd66e15 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -39,8 +39,8 @@
#include "kexec-sha256.h"
#include <arch/options.h>
-static unsigned long long mem_min = 0;
-static unsigned long long mem_max = ULONG_MAX;
+unsigned long long mem_min = 0;
+unsigned long long mem_max = ULONG_MAX;
void die(char *fmt, ...)
{
@@ -508,6 +508,8 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
info.segment = NULL;
info.nr_segments = 0;
info.entry = NULL;
+ info.backup_start = 0;
+ info.kexec_flags = kexec_flags;
result = 0;
if (argc - fileind <= 0) {
@@ -523,7 +525,8 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
kernel_buf, kernel_size);
#endif
- if (get_memory_ranges(&memory_range, &memory_ranges) < 0) {
+ if (get_memory_ranges(&memory_range, &memory_ranges,
+ info.kexec_flags) < 0) {
fprintf(stderr, "Could not get memory layout\n");
return -1;
}
@@ -565,7 +568,7 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
return -1;
}
/* If we are not in native mode setup an appropriate trampoline */
- if (arch_compat_trampoline(&info, &kexec_flags) < 0) {
+ if (arch_compat_trampoline(&info) < 0) {
return -1;
}
/* Verify all of the segments load to a valid location in memory */
@@ -586,17 +589,17 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
update_purgatory(&info);
#if 0
fprintf(stderr, "kexec_load: entry = %p flags = %lx\n",
- info.entry, kexec_flags);
+ info.entry, info.kexec_flags);
print_segments(stderr, &info);
#endif
result = kexec_load(
- info.entry, info.nr_segments, info.segment, kexec_flags);
+ info.entry, info.nr_segments, info.segment, info.kexec_flags);
if (result != 0) {
/* The load failed, print some debugging information */
fprintf(stderr, "kexec_load failed: %s\n",
strerror(errno));
fprintf(stderr, "entry = %p flags = %lx\n",
- info.entry, kexec_flags);
+ info.entry, info.kexec_flags);
print_segments(stderr, &info);
}
return result;