Commit 34a73fcb authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/posix/process: pipeline: abstract kernel event handlers

Although there are significant commonalities between the I-pipe and
Dovetail when it comes to dealing with synchronous kernel events,
there is no strict 1:1 mapping between the two kernel interfaces.

As an initial step, move all the code handling the kernel events to
the I-pipe section. We may exploit commonalities between the I-pipe
and Dovetail in this area as we gradually merge support for the
latter.

No functional change is introduced.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
[Jan: fixed build issues around pipeline_enable_kevents, kallsyms.h and $(srctree)]
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 38baf072
/*
* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2019 Philippe Gerum <rpm@xenomai.org>
*/
#ifndef _COBALT_KERNEL_IPIPE_KEVENTS_H
#define _COBALT_KERNEL_IPIPE_KEVENTS_H
struct cobalt_process;
struct cobalt_thread;
static inline
int pipeline_attach_process(struct cobalt_process *process)
{
return 0;
}
static inline
void pipeline_detach_process(struct cobalt_process *process)
{ }
int pipeline_prepare_current(void);
void pipeline_attach_current(struct xnthread *thread);
int pipeline_trap_kevents(void);
void pipeline_enable_kevents(void);
#endif /* !_COBALT_KERNEL_IPIPE_KEVENTS_H */
ccflags-y += -I$(srctree)/kernel
obj-y += pipeline.o
pipeline-y := init.o intr.o
pipeline-y := init.o intr.o kevents.o
This diff is collapsed.
This diff is collapsed.
......@@ -149,6 +149,10 @@ void cobalt_del_resource(struct cobalt_resnode *node)
list_del(&node->next);
}
void cobalt_remove_process(struct cobalt_process *process);
void cobalt_signal_yield(void);
extern struct xnthread_personality *cobalt_personalities[];
extern struct xnthread_personality cobalt_personality;
......
......@@ -614,3 +614,8 @@ __init int cobalt_signal_init(void)
return 0;
}
__init void cobalt_signal_cleanup(void)
{
xnheap_vfree(sigpending_mem);
}
......@@ -110,4 +110,6 @@ COBALT_SYSCALL_DECL(sigqueue,
int cobalt_signal_init(void);
void cobalt_signal_cleanup(void);
#endif /* !_COBALT_POSIX_SIGNAL_H */
......@@ -38,6 +38,7 @@
#include <cobalt/kernel/select.h>
#include <cobalt/kernel/lock.h>
#include <cobalt/kernel/thread.h>
#include <pipeline/kevents.h>
#include <trace/events/cobalt-core.h>
#include "debug.h"
......@@ -2502,7 +2503,6 @@ static inline void init_kthread_info(struct xnthread *thread)
*/
int xnthread_map(struct xnthread *thread, struct completion *done)
{
struct task_struct *p = current;
int ret;
spl_t s;
......@@ -2521,7 +2521,7 @@ int xnthread_map(struct xnthread *thread, struct completion *done)
xnthread_set_state(thread, XNMAPPED);
xndebug_shadow_init(thread);
xnthread_run_handler(thread, map_thread);
ipipe_enable_notifier(p);
pipeline_enable_kevents();
/*
* CAUTION: Soon after xnthread_init() has returned,
......
......@@ -377,20 +377,20 @@ TRACE_EVENT(cobalt_thread_resume,
);
TRACE_EVENT(cobalt_thread_fault,
TP_PROTO(struct ipipe_trap_data *td),
TP_ARGS(td),
TP_PROTO(unsigned long ip, unsigned int type),
TP_ARGS(ip, type),
TP_STRUCT__entry(
__field(void *, ip)
__field(unsigned long, ip)
__field(unsigned int, type)
),
TP_fast_assign(
__entry->ip = (void *)xnarch_fault_pc(td);
__entry->type = xnarch_fault_trap(td);
__entry->ip = ip;
__entry->type = type;
),
TP_printk("ip=%p type=%x",
TP_printk("ip=%#lx type=%#x",
__entry->ip, __entry->type)
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment