Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1609 → Rev 1610

/uspace/trunk/libc/include/psthread.h
40,10 → 40,13
(c)->tls = (sysarg_t) (ptls);
#endif /* context_set */
 
#define PSTHREAD_SERIALIZED 1
 
typedef enum {
PS_TO_MANAGER,
PS_FROM_MANAGER,
PS_PREEMPT
PS_PREEMPT,
PS_FROM_DEAD
} pschange_type;
 
typedef sysarg_t pstid_t;
75,6 → 78,8
void psthread_add_manager(pstid_t psthrid);
void psthread_remove_manager(void);
pstid_t psthread_get_id(void);
void psthread_inc_sercount(void);
void psthread_dec_sercount(void);
 
static inline int psthread_schedule_next() {
return psthread_schedule_next_adv(PS_PREEMPT);
/uspace/trunk/libc/include/async.h
37,7 → 37,11
typedef ipc_callid_t aid_t;
typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call);
 
int async_manager(void);
static inline void async_manager(void)
{
psthread_schedule_next_adv(PS_TO_MANAGER);
}
 
ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs);
static inline ipc_callid_t async_get_call(ipc_call_t *data)
{
57,7 → 61,7
*
* @return Return code of message
*/
static inline ipcarg_t sync_send_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
static inline ipcarg_t async_req_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, ipcarg_t *r1, ipcarg_t *r2)
{
ipc_call_t result;
ipcarg_t rc;
70,9 → 74,9
*r2 = IPC_GET_ARG2(result);
return rc;
}
#define sync_send(phoneid, method, arg1, r1) sync_send_2(phoneid, method, arg1, 0, r1, 0)
#define async_req(phoneid, method, arg1, r1) async_req_2(phoneid, method, arg1, 0, r1, 0)
 
static inline ipcarg_t sync_send_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
static inline ipcarg_t async_req_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t *r1,
ipcarg_t *r2, ipcarg_t *r3)
{
102,6 → 106,20
int _async_init(void);
 
 
/* Primitve functions for IPC communication */
void async_msg_3(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
ipcarg_t arg3);
void async_msg_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2);
#define async_msg(ph,m,a1) async_msg_2(ph,m,a1,0)
 
static inline void async_serialize_start(void)
{
psthread_inc_sercount();
}
static inline void async_serialize_end(void)
{
psthread_dec_sercount();
}
 
extern atomic_t async_futex;
 
#endif
/uspace/trunk/libc/include/ipc/ipc.h
81,16 → 81,4
extern int ipc_unregister_irq(int irq);
extern int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, ipcarg_t arg1);
 
 
/* Primitve functions for IPC communication */
void send_call_3(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2,
ipcarg_t arg3);
void send_call_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2);
#define send_call(ph,m,a1) send_call_2(ph,m,a1,0)
/* These functions never preempt */
void nsend_call_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
ipcarg_t arg2, ipcarg_t arg3);
void nsend_call_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2);
#define nsend_call(ph,m,a1) nsend_call_2(ph,m,a1,0)
 
#endif