source: mainline/uspace/lib/c/generic/private/async.h@ 241f1985

Last change on this file since 241f1985 was 241f1985, checked in by Matthieu Riolo <matthieu.riolo@…>, 6 years ago

Correcting failure from previous merge

The commits from Michal Koutný from the branch system-daemon
where built on a old version of Helenos. Because of this
many types and API functions have changed. This commit
upgrades the merge code

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2006 Ondrej Palkovsky
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup libc
30 * @{
31 */
32/** @file
33 */
34
35#ifndef _LIBC_PRIVATE_ASYNC_H_
36#define _LIBC_PRIVATE_ASYNC_H_
37
38#include <async.h>
39#include <adt/list.h>
40#include <fibril.h>
41#include <fibril_synch.h>
42#include <time.h>
43#include <stdbool.h>
44#include <stdatomic.h>
45
46/** Session data */
47struct async_sess {
48 /** List of inactive exchanges */
49 list_t exch_list;
50
51 /** Session interface */
52 iface_t iface;
53
54 /** Exchange management style */
55 exch_mgmt_t mgmt;
56
57 /** Session identification */
58 cap_phone_handle_t phone;
59
60 /** First clone connection argument */
61 iface_t arg1;
62
63 /** Second clone connection argument */
64 sysarg_t arg2;
65
66 /** Third clone connection argument */
67 sysarg_t arg3;
68
69 /** Exchange mutex */
70 fibril_mutex_t mutex;
71
72 /** Number of opened exchanges */
73 int exchanges;
74
75 /** Mutex for stateful connections */
76 fibril_mutex_t remote_state_mtx;
77
78 /** Data for stateful connections */
79 void *remote_state_data;
80};
81
82/** Exchange data */
83struct async_exch {
84 /** Link into list of inactive exchanges */
85 link_t sess_link;
86
87 /** Link into global list of inactive exchanges */
88 link_t global_link;
89
90 /** Session pointer */
91 async_sess_t *sess;
92
93 /** Exchange identification */
94 cap_phone_handle_t phone;
95};
96
97extern void __async_server_init(void);
98extern void __async_server_fini(void);
99extern void __async_client_init(void);
100extern void __async_client_fini(void);
101extern void __async_ports_init(void);
102extern void __async_ports_fini(void);
103
104extern errno_t async_create_port_internal(iface_t, async_port_handler_t,
105 void *, port_id_t *);
106extern async_port_handler_t async_get_port_handler(iface_t, port_id_t, void **);
107
108extern void async_reply_received(ipc_call_t *);
109extern async_sess_t *create_session(cap_phone_handle_t, exch_mgmt_t,
110 sysarg_t, sysarg_t, sysarg_t);
111extern cap_phone_handle_t async_session_phone(async_sess_t *);
112
113#endif
114
115/** @}
116 */
Note: See TracBrowser for help on using the repository browser.