s390x: Add time functions to lib
RFC v3 12/13 s390x: Add time functions to lib
Always good to know what time it is.
Signed-off-by Janosch Frank <[email protected]>
--- lib/s390x/time.c | 18 ++++++++++ lib/s390x/time.h | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ s390x/Makefile | 1 + 3 files changed, 123 insertions(+) create mode 100644 lib/s390x/time.c create mode 100644 lib/s390x/time.h
lib/s390x/time.c new file +18 -0
@@ -0,0 +1,18 @@ +#include <libcflat.h> +#include "time.h" + +uint64_t time_get_ns (void ) +{ +unsigned long long tod; + + tod =stckf (); +return tod_to_ns (tod); +} + +uint64_t time_get_s (void ) +{ +uint64_t ns; + + ns =time_get_ns (); +return ns /1000000UL ; +}
lib/s390x/time.h new file +104 -0
104 lines not on this page · raw message
s390x/Makefile +1 -0
@@ -43,6 +43,7 @@ cflatobjs += lib/s390x/sclp.o cflatobjs += lib/s390x/sclp-console.o cflatobjs += lib/s390x/interrupt.o cflatobjs += lib/s390x/mmu.o +cflatobjs += lib/s390x/time.o OBJDIRS += lib/s390x
Signature · 1 line
2.14.3