diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2018-09-05 01:37:08 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-09-05 13:59:15 -0700 |
commit | 011383b95dfbdcf7ffdaf767adc3a29c2dc839cf (patch) | |
tree | f79061d083015c93fcfb7610567bf8eb3ef86ccf /meta-initramfs/recipes-kernel | |
parent | 641dff9768a0c0a127d2f60d9dd8dfa1dd347e0a (diff) | |
download | meta-openembedded-011383b95dfbdcf7ffdaf767adc3a29c2dc839cf.tar.gz |
kexec-tools-klibc: enable kexec_file_load() for supported archs
The syscall has been added to klibc.
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-initramfs/recipes-kernel')
-rw-r--r-- | meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch index e0ba9b42b..3020f767a 100644 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch | |||
@@ -12,11 +12,11 @@ Upstream-Status: Inappropriate [klibc specific] | |||
12 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | 12 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> |
13 | 13 | ||
14 | --- | 14 | --- |
15 | kexec/kexec-syscall.h | 9 +++++++++ | 15 | kexec/kexec-syscall.h | 21 +++++++++++++++++++++ |
16 | 1 file changed, 9 insertions(+) | 16 | 1 file changed, 21 insertions(+) |
17 | 17 | ||
18 | diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h | 18 | diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h |
19 | index 33638c2..b4bd63c 100644 | 19 | index 33638c2..204007d 100644 |
20 | --- a/kexec/kexec-syscall.h | 20 | --- a/kexec/kexec-syscall.h |
21 | +++ b/kexec/kexec-syscall.h | 21 | +++ b/kexec/kexec-syscall.h |
22 | @@ -74,11 +74,16 @@ | 22 | @@ -74,11 +74,16 @@ |
@@ -36,19 +36,36 @@ index 33638c2..b4bd63c 100644 | |||
36 | 36 | ||
37 | static inline int is_kexec_file_load_implemented(void) { | 37 | static inline int is_kexec_file_load_implemented(void) { |
38 | if (__NR_kexec_file_load != 0xffffffff) | 38 | if (__NR_kexec_file_load != 0xffffffff) |
39 | @@ -90,8 +95,12 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, | 39 | @@ -86,6 +91,21 @@ static inline int is_kexec_file_load_implemented(void) { |
40 | return 0; | ||
41 | } | ||
42 | |||
43 | +#ifdef __KLIBC__ | ||
44 | +/* Stub provided by klibc only for the following archs */ | ||
45 | +#if defined (__x86_64__) || defined (__powerpc_64__) || defined (__s390x__) | ||
46 | +extern long kexec_file_load(int kernel_fd, int initrd_fd, | ||
47 | + unsigned long cmdline_len, const char *cmdline_ptr, | ||
48 | + unsigned long flags); | ||
49 | +#else | ||
50 | +static inline long kexec_file_load(int kernel_fd, int initrd_fd, | ||
51 | + unsigned long cmdline_len, const char *cmdline_ptr, | ||
52 | + unsigned long flags) | ||
53 | +{ | ||
54 | + return -1; | ||
55 | +} | ||
56 | +#endif | ||
57 | +#else | ||
58 | static inline long kexec_file_load(int kernel_fd, int initrd_fd, | ||
40 | unsigned long cmdline_len, const char *cmdline_ptr, | 59 | unsigned long cmdline_len, const char *cmdline_ptr, |
41 | unsigned long flags) | 60 | unsigned long flags) |
42 | { | 61 | @@ -93,6 +113,7 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, |
43 | +#ifndef __KLIBC__ | ||
44 | return (long) syscall(__NR_kexec_file_load, kernel_fd, initrd_fd, | 62 | return (long) syscall(__NR_kexec_file_load, kernel_fd, initrd_fd, |
45 | cmdline_len, cmdline_ptr, flags); | 63 | cmdline_len, cmdline_ptr, flags); |
46 | +#else | ||
47 | + return -1; | ||
48 | +#endif | ||
49 | } | 64 | } |
65 | +#endif | ||
50 | 66 | ||
51 | #define KEXEC_ON_CRASH 0x00000001 | 67 | #define KEXEC_ON_CRASH 0x00000001 |
68 | #define KEXEC_PRESERVE_CONTEXT 0x00000002 | ||
52 | -- | 69 | -- |
53 | 2.7.4 | 70 | 2.7.4 |
54 | 71 | ||