Subversion Repositories HelenOS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1350 → Rev 1349

/uspace/trunk/kbd/include/arch
0,0 → 1,0
link ../arch/mips32/include
Property changes:
Added: svn:special
+*
\ No newline at end of property
/uspace/trunk/libipc/include/ipc.h
68,6 → 68,5
extern int ipc_register_irq(int irq, irq_code_t *code);
extern int ipc_unregister_irq(int irq);
extern int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, ipcarg_t arg1);
extern void _ipc_init(void);
 
#endif
/uspace/trunk/libipc/generic/ipc.c
33,7 → 33,6
#include <list.h>
#include <stdio.h>
#include <unistd.h>
#include <futex.h>
 
/** Structure used for keeping track of sent async msgs
* and queing unsent msgs
56,13 → 55,6
LIST_INITIALIZE(dispatched_calls);
LIST_INITIALIZE(queued_calls);
 
static atomic_t ipc_futex;
 
void _ipc_init(void)
{
futex_initialize(&ipc_futex, 1);
}
 
int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1,
ipcarg_t *result)
{
145,17 → 137,13
IPC_SET_METHOD(call->u.msg.data, method);
IPC_SET_ARG1(call->u.msg.data, arg1);
IPC_SET_ARG2(call->u.msg.data, arg2);
futex_down(&ipc_futex);
 
list_append(&call->list, &queued_calls);
futex_up(&ipc_futex);
return;
}
call->u.callid = callid;
/* Add call to list of dispatched calls */
futex_down(&ipc_futex);
list_append(&call->list, &dispatched_calls);
futex_up(&ipc_futex);
}
 
 
196,7 → 184,6
async_call_t *call;
ipc_callid_t callid;
 
futex_down(&ipc_futex);
while (!list_empty(&queued_calls)) {
call = list_get_instance(queued_calls.next, async_call_t,
list);
206,18 → 193,14
if (callid == IPC_CALLRET_TEMPORARY)
break;
list_remove(&call->list);
 
if (callid == IPC_CALLRET_FATAL) {
futex_up(&ipc_futex);
call->callback(call->private, ENOENT, NULL);
free(call);
futex_down(&ipc_futex);
} else {
call->u.callid = callid;
list_append(&call->list, &dispatched_calls);
}
}
futex_up(&ipc_futex);
}
 
/** Handle received answer
233,13 → 216,11
 
callid &= ~IPC_CALLID_ANSWERED;
futex_down(&ipc_futex);
for (item = dispatched_calls.next; item != &dispatched_calls;
item = item->next) {
call = list_get_instance(item, async_call_t, list);
if (call->u.callid == callid) {
list_remove(&call->list);
futex_up(&ipc_futex);
call->callback(call->private,
IPC_GET_RETVAL(*data),
data);
246,7 → 227,6
return;
}
}
futex_up(&ipc_futex);
printf("Received unidentified answer: %P!!!\n", callid);
}
 
321,43 → 301,11
return __SYSCALL4(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1);
}
 
 
/** Open shared memory connection over specified phoneid
*
*
* Allocates AS_area, notify the other side about our intention
* to open the connection
*
* @return Connection id identifying this connection
*/
//int ipc_dgr_open(int pohoneid, size_t bufsize)
//{
/* Find new file descriptor in local descriptor table */
/* Create AS_area, initialize structures */
/* Send AS to other side, handle error states */
 
//}
/*
void ipc_dgr_close(int cid)
int ipc_open_dgrconn(int pohoneid, size_t max_dgram)
{
}
 
void * ipc_dgr_alloc(int cid, size_t size)
{
}
 
void ipc_dgr_free(int cid, void *area)
{
 
}
 
int ipc_dgr_send(int cid, void *area)
{
}
 
 
int ipc_dgr_send_data(int cid, void *data, size_t size)
{
}
 
*/
/uspace/trunk/libc/generic/libc.c
32,13 → 32,11
#include <malloc.h>
#include <psthread.h>
 
/* We should probably merge libc and libipc together */
extern void _ipc_init(void);
 
void _exit(int status) {
thread_exit(status);
}
 
#include <stdio.h>
void __main(void) {
tcb_t *tcb;
45,7 → 43,6
tcb = __make_tls();
__tcb_set(tcb);
psthread_setup(tcb);
_ipc_init();
}
 
void __exit(void) {