From 7c3109cb6c5e1834bb3b6f788c9dcaa0ddbdf090 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Thu, 15 May 2008 22:42:10 -0700 Subject: Factor uname-based native architecture detection into a common function. This code was copy-pasted into every architecture and was basically identical. Besides producing a nice net reduction in code, this factors a portability challenge into a single function that can be easily replaced at build-time. Signed-off-by: Jamey Sharp Signed-off-by: Simon Horman --- kexec/kexec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kexec/kexec.c') diff --git a/kexec/kexec.c b/kexec/kexec.c index bbfeac3..096fa4f 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -589,6 +589,7 @@ static int my_load(const char *type, int fileind, int argc, char **argv, int i = 0; int result; struct kexec_info info; + long native_arch; int guess_only = 0; memset(&info, 0, sizeof(info)); @@ -656,6 +657,11 @@ 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 */ + native_arch = physical_arch(); + if (native_arch < 0) { + return -1; + } + info.kexec_flags |= native_arch; if (arch_compat_trampoline(&info) < 0) { return -1; } -- cgit