PM: fix clock_gettime() nanosecond overflow
Change-Id: I969b30862cb671200a26b55afe3d523b6cfd2a7c
This commit is contained in:
parent
539d1e306a
commit
2e7c53b597
1 changed files with 4 additions and 2 deletions
|
@ -41,7 +41,8 @@ int do_gettime()
|
|||
}
|
||||
|
||||
mp->mp_reply.reply_time = (time_t) (boottime + (clock / system_hz));
|
||||
mp->mp_reply.reply_ntime = (clock % system_hz) * 1000000000 / system_hz;
|
||||
mp->mp_reply.reply_ntime =
|
||||
(long) ((clock % system_hz) * 1000000000ULL / system_hz);
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
@ -103,7 +104,8 @@ int do_time()
|
|||
panic("do_time couldn't get uptime: %d", s);
|
||||
|
||||
mp->mp_reply.reply_time = (time_t) (boottime + (realtime / system_hz));
|
||||
mp->mp_reply.reply_utime = (realtime % system_hz) * 1000000 / system_hz;
|
||||
mp->mp_reply.reply_utime =
|
||||
(long) ((realtime % system_hz) * 1000000ULL / system_hz);
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue