source: mainline/uspace/lib/c/include/ipc/ipc.h@ 9bfa8c8

Last change on this file since 9bfa8c8 was d7f7a4a, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Replace some license headers with SPDX identifier

Headers are replaced using tools/transorm-copyright.sh only
when it can be matched verbatim with the license header used
throughout most of the codebase.

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*
2 * SPDX-FileCopyrightText: 2006 Ondrej Palkovsky
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/** @addtogroup libcipc
8 * @{
9 */
10/** @file
11 */
12
13#if ((defined(_LIBC_ASYNC_H_)) && (!defined(_LIBC_ASYNC_C_)))
14#error Do not intermix low-level IPC interface and async framework
15#endif
16
17#ifndef _LIBC_IPC_H_
18#define _LIBC_IPC_H_
19
20#include <ipc/common.h>
21#include <abi/ipc/methods.h>
22#include <abi/synch.h>
23#include <abi/proc/task.h>
24#include <abi/cap.h>
25
26extern errno_t ipc_wait(ipc_call_t *, sysarg_t, unsigned int);
27extern void ipc_poke(void);
28
29/*
30 * User-friendly wrappers for ipc_answer_fast() and ipc_answer_slow().
31 * They are in the form of ipc_answer_m(), where m is the number of return
32 * arguments. The macros decide between the fast and the slow version according
33 * to m.
34 */
35
36#define ipc_answer_0(chandle, retval) \
37 ipc_answer_fast((chandle), (retval), 0, 0, 0, 0)
38#define ipc_answer_1(chandle, retval, arg1) \
39 ipc_answer_fast((chandle), (retval), (arg1), 0, 0, 0)
40#define ipc_answer_2(chandle, retval, arg1, arg2) \
41 ipc_answer_fast((chandle), (retval), (arg1), (arg2), 0, 0)
42#define ipc_answer_3(chandle, retval, arg1, arg2, arg3) \
43 ipc_answer_fast((chandle), (retval), (arg1), (arg2), (arg3), 0)
44#define ipc_answer_4(chandle, retval, arg1, arg2, arg3, arg4) \
45 ipc_answer_fast((chandle), (retval), (arg1), (arg2), (arg3), (arg4))
46#define ipc_answer_5(chandle, retval, arg1, arg2, arg3, arg4, arg5) \
47 ipc_answer_slow((chandle), (retval), (arg1), (arg2), (arg3), (arg4), \
48 (arg5))
49
50extern errno_t ipc_answer_fast(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
51 sysarg_t, sysarg_t);
52extern errno_t ipc_answer_slow(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
53 sysarg_t, sysarg_t, sysarg_t);
54
55/*
56 * User-friendly wrappers for ipc_call_async_fast() and ipc_call_async_slow().
57 * They are in the form of ipc_call_async_m(), where m is the number of payload
58 * arguments. The macros decide between the fast and the slow version according
59 * to m.
60 */
61
62#define ipc_call_async_0(phandle, method, label) \
63 ipc_call_async_fast((phandle), (method), 0, 0, 0, (label))
64#define ipc_call_async_1(phandle, method, arg1, label) \
65 ipc_call_async_fast((phandle), (method), (arg1), 0, 0, (label))
66#define ipc_call_async_2(phandle, method, arg1, arg2, label) \
67 ipc_call_async_fast((phandle), (method), (arg1), (arg2), 0, (label))
68#define ipc_call_async_3(phandle, method, arg1, arg2, arg3, label) \
69 ipc_call_async_fast((phandle), (method), (arg1), (arg2), (arg3), \
70 (label))
71#define ipc_call_async_4(phandle, method, arg1, arg2, arg3, arg4, label) \
72 ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
73 (arg4), 0, (label))
74#define ipc_call_async_5(phandle, method, arg1, arg2, arg3, arg4, arg5, \
75 label) \
76 ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
77 (arg4), (arg5), (label))
78
79extern errno_t ipc_call_async_fast(cap_phone_handle_t, sysarg_t, sysarg_t,
80 sysarg_t, sysarg_t, void *);
81extern errno_t ipc_call_async_slow(cap_phone_handle_t, sysarg_t, sysarg_t,
82 sysarg_t, sysarg_t, sysarg_t, sysarg_t, void *);
83
84extern errno_t ipc_hangup(cap_phone_handle_t);
85
86extern errno_t ipc_forward_fast(cap_call_handle_t, cap_phone_handle_t, sysarg_t,
87 sysarg_t, sysarg_t, unsigned int);
88extern errno_t ipc_forward_slow(cap_call_handle_t, cap_phone_handle_t, sysarg_t,
89 sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t, unsigned int);
90
91extern errno_t ipc_connect_kbox(task_id_t, cap_phone_handle_t *);
92
93#endif
94
95/** @}
96 */
Note: See TracBrowser for help on using the repository browser.