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

Last change on this file since cb7be8f 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
RevLine 
[b419162]1/*
[d7f7a4a]2 * SPDX-FileCopyrightText: 2006 Ondrej Palkovsky
[b419162]3 *
[d7f7a4a]4 * SPDX-License-Identifier: BSD-3-Clause
[b2951e2]5 */
6
[fadd381]7/** @addtogroup libcipc
[b2951e2]8 * @{
9 */
10/** @file
[ca3ba3a]11 */
[b419162]12
[4805495]13#if ((defined(_LIBC_ASYNC_H_)) && (!defined(_LIBC_ASYNC_C_)))
[5b0cf63]14#error Do not intermix low-level IPC interface and async framework
[64d2b10]15#endif
16
[4805495]17#ifndef _LIBC_IPC_H_
18#define _LIBC_IPC_H_
[b419162]19
[64d2b10]20#include <ipc/common.h>
[c0699467]21#include <abi/ipc/methods.h>
22#include <abi/synch.h>
[1c635d6]23#include <abi/proc/task.h>
[01c3bb4]24#include <abi/cap.h>
[b419162]25
[d054ad3]26extern errno_t ipc_wait(ipc_call_t *, sysarg_t, unsigned int);
[057d21a]27extern void ipc_poke(void);
[ca3ba3a]28
[b74959bd]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 */
[10477601]35
[01c3bb4]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
[eadaeae8]50extern errno_t ipc_answer_fast(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
[96b02eb9]51 sysarg_t, sysarg_t);
[eadaeae8]52extern errno_t ipc_answer_slow(cap_call_handle_t, errno_t, sysarg_t, sysarg_t,
[96b02eb9]53 sysarg_t, sysarg_t, sysarg_t);
[b419162]54
[3209923]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 */
[10477601]61
[d054ad3]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) \
[01c3bb4]69 ipc_call_async_fast((phandle), (method), (arg1), (arg2), (arg3), \
[d054ad3]70 (label))
71#define ipc_call_async_4(phandle, method, arg1, arg2, arg3, arg4, label) \
[01c3bb4]72 ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
[d054ad3]73 (arg4), 0, (label))
[01c3bb4]74#define ipc_call_async_5(phandle, method, arg1, arg2, arg3, arg4, arg5, \
[d054ad3]75 label) \
[01c3bb4]76 ipc_call_async_slow((phandle), (method), (arg1), (arg2), (arg3), \
[d054ad3]77 (arg4), (arg5), (label))
[3209923]78
[d054ad3]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 *);
[10477601]83
[eadaeae8]84extern errno_t ipc_hangup(cap_phone_handle_t);
[10477601]85
[eadaeae8]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);
[a55d5f9f]90
[eadaeae8]91extern errno_t ipc_connect_kbox(task_id_t, cap_phone_handle_t *);
[9a1b20c]92
[b419162]93#endif
[b2951e2]94
[fadd381]95/** @}
[b2951e2]96 */
Note: See TracBrowser for help on using the repository browser.