mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-01-11 15:11:26 +00:00
Add riscv64 support Rework klibc support patches Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Andrea Adami <andrea.adami@gmail.com>
67 lines
2.0 KiB
Diff
67 lines
2.0 KiB
Diff
From ab24f236cbc0aa8a3eadde5d71d9d7ea1d979a51 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 | 21 +++++++++++++++++++++
|
|
1 file changed, 21 insertions(+)
|
|
|
|
--- a/kexec/kexec-syscall.h
|
|
+++ b/kexec/kexec-syscall.h
|
|
@@ -96,11 +96,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)
|
|
@@ -108,6 +113,21 @@ static inline int is_kexec_file_load_imp
|
|
return 0;
|
|
}
|
|
|
|
+#ifdef __KLIBC__
|
|
+/* Stub provided by klibc only for the following archs */
|
|
+#if defined (__x86_64__) || defined (__powerpc_64__) || defined (__s390x__)
|
|
+extern long kexec_file_load(int kernel_fd, int initrd_fd,
|
|
+ unsigned long cmdline_len, const char *cmdline_ptr,
|
|
+ unsigned long flags);
|
|
+#else
|
|
+static inline long kexec_file_load(int kernel_fd, int initrd_fd,
|
|
+ unsigned long cmdline_len, const char *cmdline_ptr,
|
|
+ unsigned long flags)
|
|
+{
|
|
+ return -1;
|
|
+}
|
|
+#endif
|
|
+#else
|
|
static inline long kexec_file_load(int kernel_fd, int initrd_fd,
|
|
unsigned long cmdline_len, const char *cmdline_ptr,
|
|
unsigned long flags)
|
|
@@ -115,6 +135,7 @@ static inline long kexec_file_load(int k
|
|
return (long) syscall(__NR_kexec_file_load, kernel_fd, initrd_fd,
|
|
cmdline_len, cmdline_ptr, flags);
|
|
}
|
|
+#endif
|
|
|
|
#define KEXEC_ON_CRASH 0x00000001
|
|
#define KEXEC_PRESERVE_CONTEXT 0x00000002
|