Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4338 → Rev 4337

/branches/dynload/uspace/lib/libc/generic/console.c
File deleted
/branches/dynload/uspace/lib/libc/generic/libc.c
57,8 → 57,6
extern char _heap;
extern int main(int argc, char *argv[]);
 
int _errno;
 
void _exit(int status)
{
thread_exit(status);
/branches/dynload/uspace/lib/libc/generic/vfs/vfs.c
49,7 → 49,7
#include <errno.h>
#include <string.h>
#include <ipc/devmap.h>
#include "../../../srv/vfs/vfs.h"
#include "../../srv/vfs/vfs.h"
 
int vfs_phone = -1;
futex_t vfs_phone_futex = FUTEX_INITIALIZER;
/branches/dynload/uspace/lib/libc/generic/io/fprintf.c
File deleted
/branches/dynload/uspace/lib/libc/generic/io/stdio.c
File deleted
/branches/dynload/uspace/lib/libc/generic/io/stream.c
42,7 → 42,7
#include <ipc/ns.h>
#include <ipc/fb.h>
#include <ipc/services.h>
#include <ipc/console.h>
#include <console.h>
#include <unistd.h>
#include <async.h>
#include <sys/types.h>
/branches/dynload/uspace/lib/libc/generic/async.c
483,7 → 483,7
{
connection_t *conn;
unsigned long key;
 
conn = malloc(sizeof(*conn));
if (!conn) {
if (callid)
498,7 → 498,7
conn->call = *call;
conn->wdata.active = 1; /* We will activate the fibril ASAP */
conn->cfibril = cfibril;
 
conn->wdata.fid = fibril_create(connection_fibril, conn);
if (!conn->wdata.fid) {
free(conn);
506,15 → 506,14
ipc_answer_0(callid, ENOMEM);
return NULL;
}
/* Add connection to the connection hash table */
key = conn->in_phone_hash;
futex_down(&async_futex);
hash_table_insert(&conn_hash_table, &key, &conn->link);
futex_up(&async_futex);
 
fibril_add_ready(conn->wdata.fid);
 
return conn->wdata.fid;
}
 
525,7 → 524,6
*
* @param callid Hash of the incoming call.
* @param call Data of the incoming call.
*
*/
static void handle_call(ipc_callid_t callid, ipc_call_t *call)
{
535,8 → 533,8
(*interrupt_received)(callid, call);
_in_interrupt_handler = 0;
return;
}
}
 
switch (IPC_GET_METHOD(*call)) {
case IPC_M_CONNECT_ME_TO:
/* Open new connection with fibril etc. */
544,11 → 542,11
client_connection);
return;
}
 
/* Try to route the call through the connection hash table */
if (route_call(callid, call))
return;
 
/* Unknown call from unknown phone - hang it up */
ipc_answer_0(callid, EHANGUP);
}
741,17 → 739,23
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr)
{
amsg_t *msg;
 
if (_in_interrupt_handler) {
printf("Cannot send asynchronous request in interrupt "
"handler.\n");
_exit(1);
}
 
msg = malloc(sizeof(*msg));
msg->done = 0;
msg->dataptr = dataptr;
 
/* We may sleep in the next method, but it will use its own mechanism */
msg->wdata.active = 1;
ipc_call_async_4(phoneid, method, arg1, arg2, arg3, arg4, msg,
reply_received, !_in_interrupt_handler);
reply_received, 1);
 
return (aid_t) msg;
}
 
777,17 → 781,23
ipc_call_t *dataptr)
{
amsg_t *msg;
 
if (_in_interrupt_handler) {
printf("Cannot send asynchronous request in interrupt "
"handler.\n");
_exit(1);
}
 
msg = malloc(sizeof(*msg));
msg->done = 0;
msg->dataptr = dataptr;
 
/* We may sleep in next method, but it will use its own mechanism */
msg->wdata.active = 1;
 
ipc_call_async_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, msg,
reply_received, !_in_interrupt_handler);
reply_received, 1);
 
return (aid_t) msg;
}
 
874,16 → 884,21
{
amsg_t *msg;
if (_in_interrupt_handler) {
printf("Cannot call async_usleep in interrupt handler.\n");
_exit(1);
}
 
msg = malloc(sizeof(*msg));
if (!msg)
return;
 
msg->wdata.fid = fibril_get_id();
msg->wdata.active = 0;
 
gettimeofday(&msg->wdata.expires, NULL);
tv_add(&msg->wdata.expires, timeout);
 
futex_down(&async_futex);
insert_timeout(&msg->wdata);
/* Leave the async_futex locked when entering this function */