summaryrefslogtreecommitdiff
path: root/kexec/kexec.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-03-11 00:21:33 -0800
committerSimon Horman <horms@verge.net.au>2010-03-11 19:47:29 +1100
commita2d9b444eb54029513ad2300466b3cf55dbcd9b5 (patch)
tree7727b923ce185fb13ee7bbe243ba10b36b2e05b2 /kexec/kexec.c
parentc9d224fba0a8997d6008352f0be32aaaf4524fa1 (diff)
kexec: Figure out our native architecture before load
This moves the computing of our native archtecture earlier so that load can use it, as arch/i386/crashdump-x86.c has been trying to. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/kexec.c')
-rw-r--r--kexec/kexec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 43d0189..16a0ec9 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -695,17 +695,19 @@ static int my_load(const char *type, int fileind, int argc, char **argv,
}
}
}
+ /* Figure out our native architecture before load */
+ native_arch = physical_arch();
+ if (native_arch < 0) {
+ return -1;
+ }
+ info.kexec_flags |= native_arch;
+
if (file_type[i].load(argc, argv, kernel_buf,
kernel_size, &info) < 0) {
fprintf(stderr, "Cannot load %s\n", kernel);
return -1;
}
/* If we are not in native mode setup an appropriate trampoline */
- native_arch = physical_arch();
- if (native_arch < 0) {
- return -1;
- }
- info.kexec_flags |= native_arch;
if (arch_compat_trampoline(&info) < 0) {
return -1;
}