From b5d062af3d72fce33b5e220ffa97ed696e11d2d3 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Fri, 31 Aug 2018 15:40:54 +0200 Subject: 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 Signed-off-by: Khem Raj --- ...all.h-work-around-missing-syscall-wrapper.patch | 25 +++++++++++++--------- 1 file 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 4a8968bcc6..e0ba9b42b9 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 @@ -From e6aa1f18dc44dc71be3ceada2a96383d22454399 Mon Sep 17 00:00:00 2001 +From 45a80fe7d247898d83edfeabe32b9de80a50a6be Mon Sep 17 00:00:00 2001 From: Andrea Adami -Date: Thu, 19 Apr 2018 00:25:01 +0200 +Date: Fri, 31 Aug 2018 11:33:51 +0200 Subject: [PATCH] kexec-syscall.h: work around missing syscall() wrapper Fix @@ -12,26 +12,31 @@ Upstream-Status: Inappropriate [klibc specific] Signed-off-by: Andrea Adami --- - kexec/kexec-syscall.h | 8 ++++++++ - 1 file changed, 8 insertions(+) + kexec/kexec-syscall.h | 9 +++++++++ + 1 file changed, 9 insertions(+) diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h -index 33638c2..6b633e4 100644 +index 33638c2..b4bd63c 100644 --- a/kexec/kexec-syscall.h +++ b/kexec/kexec-syscall.h -@@ -77,7 +77,11 @@ struct kexec_segment; +@@ -74,11 +74,16 @@ + + struct kexec_segment; + ++#ifndef __KLIBC__ static inline long kexec_load(void *entry, unsigned long nr_segments, struct kexec_segment *segments, unsigned long flags) { -+#ifndef __KLIBC__ return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags); + } +#else -+ return (long) kexec_load(entry, nr_segments, segments, flags); ++extern long kexec_load(void *entry, unsigned long nr_segments, ++ struct kexec_segment *segments, unsigned long flags); +#endif - } static inline int is_kexec_file_load_implemented(void) { -@@ -90,8 +94,12 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, + if (__NR_kexec_file_load != 0xffffffff) +@@ -90,8 +95,12 @@ static inline long kexec_file_load(int kernel_fd, int initrd_fd, unsigned long cmdline_len, const char *cmdline_ptr, unsigned long flags) { -- cgit 1.2.3-korg