[PATCH 1/2] cobalt/posix: Fold pipeline_attach_current into caller
Jan Kiszka <[email protected]>
| Newsgroups | dev.linux.lists.xenomai |
|---|---|
| Message-ID | <[email protected]> |
From: Jan Kiszka <[email protected]> Single caller, no abstraction anymore. Furthermore, the caller already invoked dovetail_init_altsched before, so we can drop the second call while at it. Signed-off-by: Jan Kiszka <[email protected]> --- include/cobalt/kernel/dovetail/pipeline/kevents.h | 2 -- kernel/cobalt/dovetail/kevents.c | 10 ---------- kernel/cobalt/posix/process.c | 7 ++++++- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/cobalt/kernel/dovetail/pipeline/kevents.h b/include/cobalt/kernel/dovetail/pipeline/kevents.h index fa47f0375c..b7502accd9 100644 --- a/include/cobalt/kernel/dovetail/pipeline/kevents.h +++ b/include/cobalt/kernel/dovetail/pipeline/kevents.h @@ -25,8 +25,6 @@ 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); diff --git a/kernel/cobalt/dovetail/kevents.c b/kernel/cobalt/dovetail/kevents.c index f31f315d19..7402e2ef6a 100644 --- a/kernel/cobalt/dovetail/kevents.c +++ b/kernel/cobalt/dovetail/kevents.c @@ -330,16 +330,6 @@ void resume_oob_task(struct task_struct *p) /* inband, oob stage stalled */ } -void pipeline_attach_current(struct xnthread *thread) -{ - struct cobalt_threadinfo *p; - - p = pipeline_current(); - p->thread = thread; - p->process = cobalt_search_process(current->mm); - dovetail_init_altsched(&xnthread_archtcb(thread)->altsched); -} - int pipeline_trap_kevents(void) { dovetail_start(); diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 854e3a6657..2161ff5584 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -595,6 +595,7 @@ int cobalt_map_user(struct xnthread *thread, __u32 __user *u_winoff) { struct xnthread_user_window *u_window; struct xnthread_start_attr attr; + struct cobalt_threadinfo *p; struct cobalt_ppd *sys_ppd; struct cobalt_umm *umm; int ret; @@ -632,7 +633,11 @@ int cobalt_map_user(struct xnthread *thread, __u32 __user *u_winoff) */ pipeline_init_shadow_tcb(thread); xnthread_suspend(thread, XNRELAX, XN_INFINITE, XN_RELATIVE, NULL); - pipeline_attach_current(thread); + + p = pipeline_current(); + p->thread = thread; + p->process = cobalt_search_process(current->mm); + xnthread_set_state(thread, XNMAPPED); xndebug_shadow_init(thread); sys_ppd = cobalt_ppd_get(0); -- 2.47.3