summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch')
-rw-r--r--meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch49
1 files changed, 49 insertions, 0 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
new file mode 100644
index 000000000..4a8968bcc
--- /dev/null
+++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch
@@ -0,0 +1,49 @@
1From e6aa1f18dc44dc71be3ceada2a96383d22454399 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Thu, 19 Apr 2018 00:25:01 +0200
4Subject: [PATCH] kexec-syscall.h: work around missing syscall() wrapper
5
6Fix
7
8 kexec-syscall.h: In function 'kexec_load':
9 kexec-syscall.h:80:16: warning: implicit declaration of function 'syscall'
10
11Upstream-Status: Inappropriate [klibc specific]
12Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
13
14---
15 kexec/kexec-syscall.h | 8 ++++++++
16 1 file changed, 8 insertions(+)
17
18diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
19index 33638c2..6b633e4 100644
20--- a/kexec/kexec-syscall.h
21+++ b/kexec/kexec-syscall.h
22@@ -77,7 +77,11 @@ struct kexec_segment;
23 static inline long kexec_load(void *entry, unsigned long nr_segments,
24 struct kexec_segment *segments, unsigned long flags)
25 {
26+#ifndef __KLIBC__
27 return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags);
28+#else
29+ return (long) kexec_load(entry, nr_segments, segments, flags);
30+#endif
31 }
32
33 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,
35 unsigned long cmdline_len, const char *cmdline_ptr,
36 unsigned long flags)
37 {
38+#ifndef __KLIBC__
39 return (long) syscall(__NR_kexec_file_load, kernel_fd, initrd_fd,
40 cmdline_len, cmdline_ptr, flags);
41+#else
42+ return -1;
43+#endif
44 }
45
46 #define KEXEC_ON_CRASH 0x00000001
47--
482.7.4
49