Initial clean up of gettimeofday and timekeeping
authorMichael Davidson <md@google.com>
Fri, 29 Apr 2016 00:11:30 +0000 (17:11 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 29 Apr 2016 14:09:00 +0000 (10:09 -0400)
commit5aa00200baf7236595c1ab0cb639a64f201dc349
tree6bf9838c074f4c1cfad988b822e3680cb3fc1882
parent5fa9f64d90ae46c25fedd00626048cb5729ad297
Initial clean up of gettimeofday and timekeeping

Add the date command to busybox

Use scaled integer arithmetic for TSC cycles to nanoseconds conversions.

Add inline conversion functions from nanoseconds to timespec and timeval
and update existing tsc2timespec() interface to return its result.

Add a get_persistent_clock() interface to get the initial date and time
when the system is initialized. (Not yet implemented)

Add very rudimentary timekeeping data to keep track of both initial
walltime in nsecs and initial TSC value.

Use epoch_nsec() to implement gettimeofday() system call.

Note: these changes should not cause any differences in system behavior.

Signed-off-by: Michael Davidson <md@google.com>
[minor checkpatch touchup]
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/riscv/time.c
kern/arch/x86/kclock.c
kern/drivers/dev/kprof.c
kern/include/time.h
kern/src/init.c
kern/src/syscall.c
kern/src/time.c
kern/src/vfs.c
tools/apps/busybox/defconfig-1.17.3