56,6 → 56,7 |
* useconds again. This provides assurance, that at least the |
* sequence of subsequent gettimeofday calls is ordered. |
*/ |
#define TMAREA (100*1024*1024) |
int gettimeofday(struct timeval *tv, struct timezone *tz) |
{ |
void *mapping; |
64,10 → 65,12 |
int res; |
|
if (!ktime) { |
mapping = as_get_mappable_page(PAGE_SIZE); |
/* TODO: specify better, where to map the area */ |
/* Get the mapping of kernel clock */ |
res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV, |
mapping, PAGE_SIZE, 0, |
TMAREA, |
PAGE_SIZE, |
0, |
NULL,&rights,NULL); |
if (res) { |
printf("Failed to initialize timeofday memarea\n"); |
76,10 → 79,10 |
if (rights != (AS_AREA_READ | AS_AREA_CACHEABLE)) { |
printf("Received bad rights on time area: %X\n", |
rights); |
as_area_destroy(mapping); |
as_area_destroy(TMAREA); |
_exit(1); |
} |
ktime = mapping; |
ktime = (void *) (TMAREA); |
} |
if (tz) { |
tz->tz_minuteswest = 0; |