Rev 2479 | Rev 2531 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2479 | Rev 2482 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | 34 | ||
| 35 | #ifndef LIBC_ASYNC_H_ |
35 | #ifndef LIBC_ASYNC_H_ |
| 36 | #define LIBC_ASYNC_H_ |
36 | #define LIBC_ASYNC_H_ |
| 37 | 37 | ||
| 38 | #include <ipc/ipc.h> |
38 | #include <ipc/ipc.h> |
| 39 | #include <psthread.h> |
39 | #include <fibril.h> |
| 40 | #include <sys/time.h> |
40 | #include <sys/time.h> |
| 41 | #include <atomic.h> |
41 | #include <atomic.h> |
| 42 | 42 | ||
| 43 | typedef ipc_callid_t aid_t; |
43 | typedef ipc_callid_t aid_t; |
| 44 | typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call); |
44 | typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call); |
| 45 | 45 | ||
| 46 | static inline void async_manager(void) |
46 | static inline void async_manager(void) |
| 47 | { |
47 | { |
| 48 | psthread_schedule_next_adv(PS_TO_MANAGER); |
48 | fibril_schedule_next_adv(FIBRIL_TO_MANAGER); |
| 49 | } |
49 | } |
| 50 | 50 | ||
| 51 | ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs); |
51 | ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs); |
| 52 | 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) |
| 53 | { |
53 | { |
| Line 99... | Line 99... | ||
| 99 | *r3 = IPC_GET_ARG3(result); |
99 | *r3 = IPC_GET_ARG3(result); |
| 100 | return rc; |
100 | return rc; |
| 101 | } |
101 | } |
| 102 | 102 | ||
| 103 | 103 | ||
| 104 | pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, |
104 | fid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, |
| 105 | ipc_call_t *call, |
105 | ipc_call_t *call, |
| 106 | void (*cthread)(ipc_callid_t,ipc_call_t *)); |
106 | void (*cthread)(ipc_callid_t,ipc_call_t *)); |
| 107 | void async_usleep(suseconds_t timeout); |
107 | void async_usleep(suseconds_t timeout); |
| 108 | void async_create_manager(void); |
108 | void async_create_manager(void); |
| 109 | void async_destroy_manager(void); |
109 | void async_destroy_manager(void); |
| Line 118... | Line 118... | ||
| 118 | void async_msg_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2); |
118 | void async_msg_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2); |
| 119 | #define async_msg(ph, m, a1) async_msg_2(ph, m, a1, 0) |
119 | #define async_msg(ph, m, a1) async_msg_2(ph, m, a1, 0) |
| 120 | 120 | ||
| 121 | static inline void async_serialize_start(void) |
121 | static inline void async_serialize_start(void) |
| 122 | { |
122 | { |
| 123 | psthread_inc_sercount(); |
123 | fibril_inc_sercount(); |
| 124 | } |
124 | } |
| 125 | 125 | ||
| 126 | static inline void async_serialize_end(void) |
126 | static inline void async_serialize_end(void) |
| 127 | { |
127 | { |
| 128 | psthread_dec_sercount(); |
128 | fibril_dec_sercount(); |
| 129 | } |
129 | } |
| 130 | 130 | ||
| 131 | extern atomic_t async_futex; |
131 | extern atomic_t async_futex; |
| 132 | #endif |
132 | #endif |
| 133 | 133 | ||