Subversion Repositories HelenOS

Rev

Rev 2616 | Rev 2678 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2616 Rev 2677
Line 133... Line 133...
133
 */
133
 */
134
int gettimeofday(struct timeval *tv, struct timezone *tz)
134
int gettimeofday(struct timeval *tv, struct timezone *tz)
135
{
135
{
136
    void *mapping;
136
    void *mapping;
137
    sysarg_t s1, s2;
137
    sysarg_t s1, s2;
138
    sysarg_t rights;
138
    int rights;
139
    int res;
139
    int res;
140
 
140
 
141
    if (!ktime) {
141
    if (!ktime) {
142
        mapping = as_get_mappable_page(PAGE_SIZE);
142
        mapping = as_get_mappable_page(PAGE_SIZE);
143
        /* Get the mapping of kernel clock */
143
        /* Get the mapping of kernel clock */
144
        res = ipc_call_sync_3_2(PHONE_NS, IPC_M_AS_AREA_RECV,
144
        res = ipc_share_in_send_1_1(PHONE_NS, mapping, PAGE_SIZE,
145
            (sysarg_t) mapping, PAGE_SIZE, SERVICE_MEM_REALTIME, NULL,
145
            SERVICE_MEM_REALTIME, &rights);
146
            &rights);
-
 
147
        if (res) {
146
        if (res) {
148
            printf("Failed to initialize timeofday memarea\n");
147
            printf("Failed to initialize timeofday memarea\n");
149
            _exit(1);
148
            _exit(1);
150
        }
149
        }
151
        if (!(rights & AS_AREA_READ)) {
150
        if (!(rights & AS_AREA_READ)) {