/uspace/trunk/libc/include/time.h |
---|
File deleted |
/uspace/trunk/libc/include/ipc/services.h |
---|
37,9 → 37,6 |
#define SERVICE_PCI 1 |
#define SERVICE_FRAME_BUFFER 2 |
#define SERVICE_KEYBOARD 3 |
#define SERVICE_VIDEO 4 |
#define SERVICE_VIDEO 4 |
/* Memory area to be received from NS */ |
#define SERVICE_MEM_REALTIME 1 |
#endif |
/uspace/trunk/libc/generic/time.c |
---|
File deleted |
/uspace/trunk/libc/generic/async.c |
---|
331,7 → 331,6 |
{ |
ipc_call_t call; |
ipc_callid_t callid; |
int timeout; |
while (1) { |
if (psthread_schedule_next_adv(PS_FROM_MANAGER)) { |
340,19 → 339,8 |
*/ |
continue; |
} |
/* |
if (expires) |
timeout = .... ; |
else |
*/ |
timeout = SYNCH_NO_TIMEOUT; |
callid = ipc_wait_cycle(&call, timeout, SYNCH_BLOCKING); |
callid = ipc_wait_cycle(&call,SYNCH_NO_TIMEOUT,SYNCH_BLOCKING); |
if (!callid) { |
// handle_expired_timeouts.......; |
continue; |
} |
if (callid & IPC_CALLID_ANSWERED) |
continue; |
416,8 → 404,7 |
*/ |
if (msg->dataptr) |
*msg->dataptr = *data; |
/* TODO: memory barrier?? */ |
msg->done = 1; |
if (! msg->active) { |
msg->active = 1; |
473,38 → 460,3 |
*retval = msg->retval; |
free(msg); |
} |
/* int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, int timeout) */ |
/* { */ |
/* amsg_t *msg = (amsg_t *) amsgid; */ |
/* connection_t *conn; */ |
/* futex_down(&async_futex); */ |
/* if (msg->done) { */ |
/* futex_up(&async_futex); */ |
/* goto done; */ |
/* } */ |
/* msg->ptid = psthread_get_id(); */ |
/* msg->active = 0; */ |
/* msg->expires = gettime() + timeout; */ |
/* setup_timeouts_etc...(); */ |
/* /\* Leave locked async_futex when entering this function *\/ */ |
/* psthread_schedule_next_adv(PS_TO_MANAGER); */ |
/* /\* futex is up automatically after psthread_schedule_next...*\/ */ |
/* if (!msg->done) */ |
/* return casy-casy; */ |
/* /\* TODO: When memory barrier in reply_received, we can skip this *\/ */ |
/* futex_down(&async_futex); */ |
/* futex_up(&async_futex); */ |
/* done: */ |
/* if (retval) */ |
/* *retval = msg->retval; */ |
/* free(msg); */ |
/* } */ |
/uspace/trunk/libc/Makefile |
---|
65,8 → 65,7 |
generic/ipc.c \ |
generic/async.c \ |
generic/libadt/list.o \ |
generic/libadt/hash_table.o \ |
generic/time.c |
generic/libadt/hash_table.o |
ARCH_SOURCES += \ |
arch/$(ARCH)/src/entry.s \ |
/uspace/trunk/init/init.c |
---|
44,7 → 44,6 |
#include <kbd.h> |
#include <ipc/fb.h> |
#include <async.h> |
#include <time.h> |
int a; |
atomic_t ftx; |
402,19 → 401,7 |
ipc_hangup(phoneid); |
} |
static void test_time(void) |
{ |
int rc; |
struct timeval tv; |
struct timezone tz; |
while (1) { |
rc = gettimeofday(&tv, &tz); |
printf("Rc: %d, Secs: %d, Usecs: %d\n", rc, tv.tv_sec, |
tv.tv_usec); |
} |
} |
int main(int argc, char *argv[]) |
{ |
pstid_t ptid; |
433,8 → 420,7 |
// test_as_area_send(); |
// test_pci(); |
// test_kbd(); |
test_time(); |
// test_async_kbd(); |
test_async_kbd(); |
// test_fb(); |
printf("Hello\nThis is Init\n\nBye."); |
/uspace/trunk/ns/ns.c |
---|
40,9 → 40,6 |
#include <assert.h> |
#include <libadt/list.h> |
#include <libadt/hash_table.h> |
#include <sysinfo.h> |
#include <ddi.h> |
#include <as.h> |
#define NAME "NS" |
76,28 → 73,6 |
int static ping_phone; |
static void get_realtime_as(ipc_callid_t callid, ipc_call_t *call) |
{ |
static void *addr = NULL; |
void *ph_addr; |
if (IPC_GET_ARG3(*call) != (AS_AREA_READ | AS_AREA_CACHEABLE)) { |
ipc_answer_fast(callid, EPERM, 0, 0); |
return; |
} |
if (!addr) { |
ph_addr = (void *)sysinfo_value("clock.faddr"); |
if (!ph_addr) { |
ipc_answer_fast(callid, ENOENT, 0, 0); |
return; |
} |
addr = (void *)(200*1024*1024); /* TODO: intelligent freemem space */ |
map_physmem(task_get_id(), ph_addr, addr, 1, |
AS_AREA_READ | AS_AREA_CACHEABLE); |
} |
ipc_answer_fast(callid, 0, (ipcarg_t)addr, 0); |
} |
int main(int argc, char **argv) |
{ |
ipc_call_t call; |
127,12 → 102,12 |
} else |
// printf("Failed answer: %d\n", retval); |
continue; |
case IPC_M_AS_AREA_RECV: |
get_realtime_as(callid, &call); |
continue; |
break; |
case IPC_M_INTERRUPT: |
// printf("GOT INTERRUPT: %c\n", IPC_GET_ARG2(call)); |
break; |
case IPC_M_PHONE_HUNGUP: |
// printf("Phone hung up.\n"); |
retval = 0; |
break; |
case IPC_M_CONNECT_TO_ME: |