Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1595 → Rev 1596

//uspace/trunk/libc/include/async.h
98,12 → 98,10
void async_create_manager(void);
void async_destroy_manager(void);
void async_set_client_connection(async_client_conn_t conn);
void async_set_interrupt_received(async_client_conn_t conn);
int _async_init(void);
 
/* Should be defined by application */
void interrupt_received(ipc_call_t *call) __attribute__((weak));
 
 
extern atomic_t async_futex;
 
#endif
//uspace/trunk/libc/include/ipc/services.h
41,5 → 41,6
 
/* Memory area to be received from NS */
#define SERVICE_MEM_REALTIME 1
#define SERVICE_MEM_KLOG 2
 
#endif
//uspace/trunk/libc/generic/time.c
34,6 → 34,7
#include <unistd.h>
#include <atomic.h>
#include <futex.h>
#include <ipc/services.h>
 
#include <sysinfo.h>
#include <as.h>
67,7 → 68,7
mapping = as_get_mappable_page(PAGE_SIZE);
/* Get the mapping of kernel clock */
res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV,
mapping, PAGE_SIZE, 0,
mapping, PAGE_SIZE, SERVICE_MEM_REALTIME,
NULL,&rights,NULL);
if (res) {
printf("Failed to initialize timeofday memarea\n");
//uspace/trunk/libc/generic/async.c
138,7 → 138,9
__thread connection_t *PS_connection;
 
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call);
static async_client_conn_t client_connection = default_client_connection;
static async_client_conn_t interrupt_received = default_interrupt_received;
 
/** Add microseconds to give timeval */
static void tv_add(struct timeval *tv, suseconds_t usecs)
341,17 → 343,10
{
ipc_answer_fast(callid, ENOENT, 0, 0);
}
 
/** Function that gets called on interrupt receival
*
* This function is defined as a weak symbol - to be redefined in
* user code.
*/
void interrupt_received(ipc_call_t *call)
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call)
{
}
 
 
/** Wrapper for client connection thread
*
* When new connection arrives, thread with this function is created.
440,7 → 435,7
/* Unrouted call - do some default behaviour */
switch (IPC_GET_METHOD(*call)) {
case IPC_M_INTERRUPT:
interrupt_received(call);
(*interrupt_received)(callid,call);
return;
case IPC_M_CONNECT_ME_TO:
/* Open new connection with thread etc. */
757,3 → 752,7
{
client_connection = conn;
}
void async_set_interrupt_received(async_client_conn_t conn)
{
interrupt_received = conn;
}