diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2018-08-31 15:40:54 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-08-31 06:55:33 -0700 |
commit | b5d062af3d72fce33b5e220ffa97ed696e11d2d3 (patch) | |
tree | b3c6803b4cf12c5d339b30dd9cb4979264e9643b /meta-initramfs/recipes-kernel | |
parent | e8b9543fb9c3707d7378575b2bd19b6e0fb2bec6 (diff) | |
download | meta-openembedded-b5d062af3d72fce33b5e220ffa97ed696e11d2d3.tar.gz |
kexec-tools-klibc: fix kexec_load() syscall workaround
As soon as klibc adds kexec_file_load() syscall we can rework this patch.
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 | 25 |
1 files changed, 15 insertions, 10 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 4a8968bcc..e0ba9b42b 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 | |||
@@ -1,6 +1,6 @@ | |||
1 | From e6aa1f18dc44dc71be3ceada2a96383d22454399 Mon Sep 17 00:00:00 2001 | 1 | From 45a80fe7d247898d83edfeabe32b9de80a50a6be Mon Sep 17 00:00:00 2001 |
2 | From: Andrea Adami <andrea.adami@gmail.com> | 2 | From: Andrea Adami <andrea.adami@gmail.com> |
3 | Date: Thu, 19 Apr 2018 00:25:01 +0200 | 3 | Date: Fri, 31 Aug 2018 11:33:51 +0200 |
4 | Subject: [PATCH] kexec-syscall.h: work around missing syscall() wrapper | 4 | Subject: [PATCH] kexec-syscall.h: work around missing syscall() wrapper |
5 | 5 | ||
6 | Fix | 6 | Fix |
@@ -12,26 +12,31 @@ 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 | 8 ++++++++ | 15 | kexec/kexec-syscall.h | 9 +++++++++ |
16 | 1 file changed, 8 insertions(+) | 16 | 1 file changed, 9 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..6b633e4 100644 | 19 | index 33638c2..b4bd63c 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 | @@ -77,7 +77,11 @@ struct kexec_segment; | 22 | @@ -74,11 +74,16 @@ |
23 | |||
24 | struct kexec_segment; | ||
25 | |||
26 | +#ifndef __KLIBC__ | ||
23 | static inline long kexec_load(void *entry, unsigned long nr_segments, | 27 | static inline long kexec_load(void *entry, unsigned long nr_segments, |
24 | struct kexec_segment *segments, unsigned long flags) | 28 | struct kexec_segment *segments, unsigned long flags) |
25 | { | 29 | { |
26 | +#ifndef __KLIBC__ | ||
27 | return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags); | 30 | return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags); |
31 | } | ||
28 | +#else | 32 | +#else |
29 | + return (long) kexec_load(entry, nr_segments, segments, flags); | 33 | +extern long kexec_load(void *entry, unsigned long nr_segments, |
34 | + struct kexec_segment *segments, unsigned long flags); | ||
30 | +#endif | 35 | +#endif |
31 | } | ||
32 | 36 | ||
33 | static inline int is_kexec_file_load_implemented(void) { | 37 | static inline int is_kexec_file_load_implemented(void) { |
34 | @@ -90,8 +94,12 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, | 38 | if (__NR_kexec_file_load != 0xffffffff) |
39 | @@ -90,8 +95,12 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, | ||
35 | unsigned long cmdline_len, const char *cmdline_ptr, | 40 | unsigned long cmdline_len, const char *cmdline_ptr, |
36 | unsigned long flags) | 41 | unsigned long flags) |
37 | { | 42 | { |