hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * SPDX-License-Identifier: GPL-2.0
 *
 * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>
 * Copyright (C) 2005 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
 */
 
#include <pipeline/pipeline.h>
#include <pipeline/kevents.h>
#include <cobalt/kernel/assert.h>
#include <xenomai/posix/syscall.h>
 
int ipipe_syscall_hook(struct ipipe_domain *ipd, struct pt_regs *regs)
{
   if (unlikely(is_secondary_domain()))
       return handle_root_syscall(regs);
 
   return handle_head_syscall(ipd != &xnsched_primary_domain, regs);
}
 
int ipipe_fastcall_hook(struct pt_regs *regs)
{
   int ret;
 
   ret = handle_head_syscall(false, regs);
   XENO_BUG_ON(COBALT, ret == KEVENT_PROPAGATE);
 
   return ret;
}