Subversion Repositories HelenOS-historic

Rev

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

Rev 1547 Rev 1596
Line 136... Line 136...
136
 
136
 
137
 
137
 
138
__thread connection_t *PS_connection;
138
__thread connection_t *PS_connection;
139
 
139
 
140
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
140
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
-
 
141
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call);
141
static async_client_conn_t client_connection = default_client_connection;
142
static async_client_conn_t client_connection = default_client_connection;
-
 
143
static async_client_conn_t interrupt_received = default_interrupt_received;
142
 
144
 
143
/** Add microseconds to give timeval */
145
/** Add microseconds to give timeval */
144
static void tv_add(struct timeval *tv, suseconds_t usecs)
146
static void tv_add(struct timeval *tv, suseconds_t usecs)
145
{
147
{
146
    tv->tv_sec += usecs / 1000000;
148
    tv->tv_sec += usecs / 1000000;
Line 339... Line 341...
339
 */
341
 */
340
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
342
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
341
{
343
{
342
    ipc_answer_fast(callid, ENOENT, 0, 0);
344
    ipc_answer_fast(callid, ENOENT, 0, 0);
343
}
345
}
344
 
-
 
345
/** Function that gets called on interrupt receival
-
 
346
 *
-
 
347
 * This function is defined as a weak symbol - to be redefined in
-
 
348
 * user code.
-
 
349
 */
-
 
350
void interrupt_received(ipc_call_t *call)
346
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call)
351
{
347
{
352
}
348
}
353
 
349
 
354
 
-
 
355
/** Wrapper for client connection thread
350
/** Wrapper for client connection thread
356
 *
351
 *
357
 * When new connection arrives, thread with this function is created.
352
 * When new connection arrives, thread with this function is created.
358
 * It calls client_connection and does final cleanup.
353
 * It calls client_connection and does final cleanup.
359
 *
354
 *
Line 438... Line 433...
438
static void handle_call(ipc_callid_t callid, ipc_call_t *call)
433
static void handle_call(ipc_callid_t callid, ipc_call_t *call)
439
{
434
{
440
    /* Unrouted call - do some default behaviour */
435
    /* Unrouted call - do some default behaviour */
441
    switch (IPC_GET_METHOD(*call)) {
436
    switch (IPC_GET_METHOD(*call)) {
442
    case IPC_M_INTERRUPT:
437
    case IPC_M_INTERRUPT:
443
        interrupt_received(call);
438
        (*interrupt_received)(callid,call);
444
        return;
439
        return;
445
    case IPC_M_CONNECT_ME_TO:
440
    case IPC_M_CONNECT_ME_TO:
446
        /* Open new connection with thread etc. */
441
        /* Open new connection with thread etc. */
447
        async_new_connection(IPC_GET_ARG3(*call), callid, call, client_connection);
442
        async_new_connection(IPC_GET_ARG3(*call), callid, call, client_connection);
448
        return;
443
        return;
Line 755... Line 750...
755
 */
750
 */
756
void async_set_client_connection(async_client_conn_t conn)
751
void async_set_client_connection(async_client_conn_t conn)
757
{
752
{
758
    client_connection = conn;
753
    client_connection = conn;
759
}
754
}
-
 
755
void async_set_interrupt_received(async_client_conn_t conn)
-
 
756
{
-
 
757
    interrupt_received = conn;
-
 
758
}