Commit 58f5001f authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/syscall: dovetail: implement syscall hooks

Dovetail interposes on the in-band syscall entry, passing the request
on to Cobalt via different handlers depending on the calling context:

- via handle_oob_syscall() when the current thread is running
  out-of-band, and the request is not an in-band (i.e. regular Linux)
  system call, therefore shall be handled by Xenomai. This is the fast

- via handle_pipelined_syscall() in all other cases, e.g. when current
  is running in-band, and/or the system call shall be handled by the
  in-band kernel eventually (useful for relaxing the current thread in
  the process if out-of-band on entry).
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent 24e1236e
...@@ -2,4 +2,4 @@ ccflags-y += -I$(srctree)/kernel ...@@ -2,4 +2,4 @@ ccflags-y += -I$(srctree)/kernel
obj-y += pipeline.o obj-y += pipeline.o
pipeline-y := init.o kevents.o sched.o tick.o pipeline-y := init.o kevents.o sched.o tick.o syscall.o
* SPDX-License-Identifier: GPL-2.0
* Copyright (C) 2005 Philippe Gerum <>
* Copyright (C) 2005 Gilles Chanteperdrix <>
#include <linux/irqstage.h>
#include <pipeline/pipeline.h>
#include <pipeline/kevents.h>
#include <cobalt/kernel/assert.h>
#include <xenomai/posix/syscall.h>
int handle_pipelined_syscall(struct irq_stage *stage, struct pt_regs *regs)
if (unlikely(running_inband()))
return handle_root_syscall(regs);
return handle_head_syscall(stage == &inband_stage, regs);
void handle_oob_syscall(struct pt_regs *regs)
int ret = handle_head_syscall(false, regs);
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