Subversion Repositories HelenOS

Rev

Rev 2787 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2787 Rev 4377
Line 74... Line 74...
74
    async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
74
    async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
75
        (dataptr))
75
        (dataptr))
76
#define async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
76
#define async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) \
77
    async_send_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
77
    async_send_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
78
        (arg5), (dataptr))
78
        (arg5), (dataptr))
79
 
79
 
80
extern aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
80
extern aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
81
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr);
81
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr);
82
extern aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
82
extern aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
83
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
83
    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5,
84
    ipc_call_t *dataptr);
84
    ipc_call_t *dataptr);
85
extern void async_wait_for(aid_t amsgid, ipcarg_t *result);
85
extern void async_wait_for(aid_t amsgid, ipcarg_t *result);
86
extern int async_wait_timeout(aid_t amsgid, ipcarg_t *retval,
86
extern int async_wait_timeout(aid_t amsgid, ipcarg_t *retval,
87
    suseconds_t timeout);
87
    suseconds_t timeout);
88
 
88
 
89
fid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid,
89
fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid,
90
    ipc_call_t *call, void (*cthread)(ipc_callid_t,ipc_call_t *));
90
    ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *));
91
void async_usleep(suseconds_t timeout);
91
void async_usleep(suseconds_t timeout);
92
void async_create_manager(void);
92
void async_create_manager(void);
93
void async_destroy_manager(void);
93
void async_destroy_manager(void);
94
int _async_init(void);
94
int _async_init(void);
95
 
95
 
96
extern void async_set_client_connection(async_client_conn_t conn);
96
extern void async_set_client_connection(async_client_conn_t conn);
97
extern void async_set_interrupt_received(async_client_conn_t conn);
97
extern void async_set_interrupt_received(async_client_conn_t conn);
98
 
98
 
99
/* Wrappers for simple communication */
99
/* Wrappers for simple communication */
100
#define async_msg_0(phone, method) \
100
#define async_msg_0(phone, method) \
101
    ipc_call_async_0((phone), (method), NULL, NULL, !in_interrupt_handler())
101
    ipc_call_async_0((phone), (method), NULL, NULL, true)
102
#define async_msg_1(phone, method, arg1) \
102
#define async_msg_1(phone, method, arg1) \
103
    ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
103
    ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
104
        !in_interrupt_handler())
104
        true)
105
#define async_msg_2(phone, method, arg1, arg2) \
105
#define async_msg_2(phone, method, arg1, arg2) \
106
    ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
106
    ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
107
        !in_interrupt_handler())
107
        true)
108
#define async_msg_3(phone, method, arg1, arg2, arg3) \
108
#define async_msg_3(phone, method, arg1, arg2, arg3) \
109
    ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
109
    ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
110
        !in_interrupt_handler())
110
        true)
111
#define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
111
#define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
112
    ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
112
    ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
113
        NULL, !in_interrupt_handler())
113
        NULL, true)
114
#define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
114
#define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
115
    ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
115
    ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
116
        (arg5), NULL, NULL, !in_interrupt_handler())
116
        (arg5), NULL, NULL, true)
117
 
117
 
118
/*
118
/*
119
 * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
119
 * User-friendly wrappers for async_req_fast() and async_req_slow(). The macros
120
 * are in the form async_req_m_n(), where m is the number of payload arguments
120
 * are in the form async_req_m_n(), where m is the number of payload arguments
121
 * and n is the number of return arguments. The macros decidce between the fast
121
 * and n is the number of return arguments. The macros decide between the fast
122
 * and slow verion based on m.
122
 * and slow verion based on m.
123
 */
123
 */
124
#define async_req_0_0(phoneid, method) \
124
#define async_req_0_0(phoneid, method) \
125
    async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
125
    async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
126
    NULL)
126
    NULL)
Line 251... Line 251...
251
static inline void async_serialize_end(void)
251
static inline void async_serialize_end(void)
252
{
252
{
253
    fibril_dec_sercount();
253
    fibril_dec_sercount();
254
}
254
}
255
 
255
 
256
extern bool in_interrupt_handler(void);
-
 
257
 
-
 
258
extern atomic_t async_futex;
256
extern atomic_t async_futex;
259
 
257
 
260
#endif
258
#endif
261
 
259
 
262
/** @}
260
/** @}