Subversion Repositories HelenOS

Rev

Rev 4537 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4537 Rev 4668
Line 41... Line 41...
41
#include <atomic.h>
41
#include <atomic.h>
42
#include <bool.h>
42
#include <bool.h>
43
 
43
 
44
typedef ipc_callid_t aid_t;
44
typedef ipc_callid_t aid_t;
45
typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call);
45
typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call);
46
typedef void (*async_pending_t)(void);
-
 
47
 
46
 
48
extern atomic_t async_futex;
47
extern atomic_t async_futex;
49
 
48
 
50
static inline void async_manager(void)
49
extern int __async_init(void);
51
{
-
 
52
    fibril_switch(FIBRIL_TO_MANAGER);
-
 
53
}
-
 
54
 
-
 
55
extern ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs);
50
extern ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs);
56
 
51
 
57
static inline ipc_callid_t async_get_call(ipc_call_t *data)
52
static inline ipc_callid_t async_get_call(ipc_call_t *data)
58
{
53
{
59
    return async_get_call_timeout(data, 0);
54
    return async_get_call_timeout(data, 0);
60
}
55
}
61
 
56
 
-
 
57
static inline void async_manager(void)
-
 
58
{
-
 
59
    fibril_switch(FIBRIL_TO_MANAGER);
-
 
60
}
-
 
61
 
62
/*
62
/*
63
 * User-friendly wrappers for async_send_fast() and async_send_slow(). The
63
 * User-friendly wrappers for async_send_fast() and async_send_slow(). The
64
 * macros are in the form async_send_m(), where m denotes the number of payload
64
 * macros are in the form async_send_m(), where m denotes the number of payload
65
 * arguments.  Each macros chooses between the fast and the slow version based
65
 * arguments.  Each macros chooses between the fast and the slow version based
66
 * on m.
66
 * on m.
Line 93... Line 93...
93
extern fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
93
extern fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
94
    ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *));
94
    ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *));
95
extern void async_usleep(suseconds_t timeout);
95
extern void async_usleep(suseconds_t timeout);
96
extern void async_create_manager(void);
96
extern void async_create_manager(void);
97
extern void async_destroy_manager(void);
97
extern void async_destroy_manager(void);
98
extern int _async_init(void);
-
 
99
 
98
 
100
extern void async_set_client_connection(async_client_conn_t conn);
99
extern void async_set_client_connection(async_client_conn_t conn);
101
extern void async_set_interrupt_received(async_client_conn_t conn);
100
extern void async_set_interrupt_received(async_client_conn_t conn);
102
extern void async_set_pending(async_pending_t pend);
-
 
103
 
101
 
104
/* Wrappers for simple communication */
102
/* Wrappers for simple communication */
105
#define async_msg_0(phone, method) \
103
#define async_msg_0(phone, method) \
106
    ipc_call_async_0((phone), (method), NULL, NULL, true)
104
    ipc_call_async_0((phone), (method), NULL, NULL, true)
107
#define async_msg_1(phone, method, arg1) \
105
#define async_msg_1(phone, method, arg1) \