Subversion Repositories HelenOS-historic

Rev

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

Rev 1453 Rev 1462
Line 59... Line 59...
59
#define TMAREA (100*1024*1024)
59
#define TMAREA (100*1024*1024)
60
int gettimeofday(struct timeval *tv, struct timezone *tz)
60
int gettimeofday(struct timeval *tv, struct timezone *tz)
61
{
61
{
62
    void *mapping;
62
    void *mapping;
63
    sysarg_t s1, s2;
63
    sysarg_t s1, s2;
64
    sysarg_t t1;
64
    sysarg_t rights;
65
    int res;
65
    int res;
66
 
66
 
67
    if (!ktime) {
67
    if (!ktime) {
68
        /* TODO: specify better, where to map the area */
68
        /* TODO: specify better, where to map the area */
69
        /* Get the mapping of kernel clock */
69
        /* Get the mapping of kernel clock */
70
        res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV,
70
        res = ipc_call_sync_3(PHONE_NS, IPC_M_AS_AREA_RECV,
71
                      TMAREA,
71
                      TMAREA,
72
                      PAGE_SIZE,
72
                      PAGE_SIZE,
73
                      AS_AREA_READ | AS_AREA_CACHEABLE,
73
                      0,
74
                      &t1,&t1,&t1);
74
                      NULL,&rights,NULL);
75
        if (res) {
75
        if (res) {
76
            printf("Failed to initialize timeofday memarea\n");
76
            printf("Failed to initialize timeofday memarea\n");
77
            _exit(1);
77
            _exit(1);
78
        }
78
        }
-
 
79
        if (rights != (AS_AREA_READ | AS_AREA_CACHEABLE)) {
-
 
80
            printf("Received bad rights on time area: %X\n",
-
 
81
                   rights);
-
 
82
            as_area_destroy(TMAREA);
-
 
83
            _exit(1);
-
 
84
        }
79
        ktime = (void *) (TMAREA);
85
        ktime = (void *) (TMAREA);
80
    }
86
    }
81
    if (tz) {
87
    if (tz) {
82
        tz->tz_minuteswest = 0;
88
        tz->tz_minuteswest = 0;
83
        tz->tz_dsttime = DST_NONE;
89
        tz->tz_dsttime = DST_NONE;