summaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/0006-kexec-syscall.h-work-around-missing-syscall-wrapper.patch
blob: e0ba9b42b9d2e58b053b7871cd378b83d51d09c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 45a80fe7d247898d83edfeabe32b9de80a50a6be Mon Sep 17 00:00:00 2001
From: Andrea Adami <andrea.adami@gmail.com>
Date: Fri, 31 Aug 2018 11:33:51 +0200
Subject: [PATCH] kexec-syscall.h: work around missing syscall() wrapper

Fix

 kexec-syscall.h: In function 'kexec_load':
 kexec-syscall.h:80:16: warning: implicit declaration of function 'syscall'

Upstream-Status: Inappropriate [klibc specific]
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>

---
 kexec/kexec-syscall.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index 33638c2..b4bd63c 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -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)
 {
 	return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags);
 }
+#else
+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) {
 	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)
 {
+#ifndef __KLIBC__
 	return (long) syscall(__NR_kexec_file_load, kernel_fd, initrd_fd,
 				cmdline_len, cmdline_ptr, flags);
+#else
+	return -1;
+#endif
 }
 
 #define KEXEC_ON_CRASH		0x00000001
-- 
2.7.4