diff options
Diffstat (limited to 'main/busybox/tod_s390x.c')
-rw-r--r-- | main/busybox/tod_s390x.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/busybox/tod_s390x.c b/main/busybox/tod_s390x.c new file mode 100644 index 0000000000..c39a584c82 --- /dev/null +++ b/main/busybox/tod_s390x.c @@ -0,0 +1,8 @@ +#include <stdio.h> + +void main(){ + unsigned long val; + asm volatile("stck 0(%1)" : "=m" (val) : "a" (&val) : "cc"); + val = ((val >> 9) * 125) + (((val & 0x1ff) * 125) >> 9); + printf("%lu", val / 1000000000UL - 2208988800); +} |