From b1e03298748c651e6887eea20b39e0e7069e48ad Mon Sep 17 00:00:00 2001 From: Roman Stratiienko Date: Wed, 6 Mar 2019 19:53:27 +0200 Subject: [PATCH] kernel: cobalt: replace siginfo_t with kernel_siginfo_t siginfo_t can't be used in kernel-space starting from v4.20-rc1 commit ae7795bc6187 ("signal: Distinguish between kernel_siginfo and siginfo") replace all siginfo_t to kernel_siginfo_t and create wrapper for kernel < v4.20 Signed-off-by: Roman Stratiienko Signed-off-by: Jan Kiszka --- kernel/cobalt/include/linux/xenomai/wrappers.h | 4 ++++ kernel/cobalt/posix/process.c | 2 +- kernel/cobalt/thread.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/cobalt/include/linux/xenomai/wrappers.h b/kernel/cobalt/include/linux/xenomai/wrappers.h index 7d00aa9d4..847d68088 100644 --- a/kernel/cobalt/include/linux/xenomai/wrappers.h +++ b/kernel/cobalt/include/linux/xenomai/wrappers.h @@ -49,4 +49,8 @@ #define ipipe_root_nr_syscalls(ti) NR_syscalls #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) +typedef siginfo_t kernel_siginfo_t; +#endif + #endif /* !_COBALT_LINUX_WRAPPERS_H */ diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 85dd3cfb7..ee4b70984 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -583,7 +583,7 @@ static inline void clear_threadinfo(void) static inline int disable_ondemand_memory(void) { struct task_struct *p = current; - siginfo_t si; + kernel_siginfo_t si; if ((p->mm->def_flags & VM_LOCKED) == 0) { memset(&si, 0, sizeof(si)); diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c index a43d2f1ad..fa7a65569 100644 --- a/kernel/cobalt/thread.c +++ b/kernel/cobalt/thread.c @@ -2070,7 +2070,7 @@ void xnthread_relax(int notify, int reason) struct xnthread *thread = xnthread_current(); struct task_struct *p = current; int cpu __maybe_unused; - siginfo_t si; + kernel_siginfo_t si; primary_mode_only(); @@ -2183,7 +2183,7 @@ static void lostage_task_signal(struct ipipe_work_header *work) struct lostage_signal *rq; struct xnthread *thread; struct task_struct *p; - siginfo_t si; + kernel_siginfo_t si; int signo; rq = container_of(work, struct lostage_signal, work); -- GitLab