There was only one meaningful caller, which changes to call time_now.
This clearly separates systems that use walltime1 to be just those
that use the stub version of time_now. That is to say, those that do
not provide an assembler version of time_now.
Change-Id: I14c06cc402070bd705f953af6f9966785015e2a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/314769
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
return faketime
}
-func walltime() (sec int64, nsec int32) {
- return faketime / 1000000000, int32(faketime % 1000000000)
-}
-
//go:linkname time_now time.now
func time_now() (sec int64, nsec int32, mono int64) {
- sec, nsec = walltime()
- return sec, nsec, nanotime()
+ return faketime / 1e9, int32(faketime % 1e9), faketime
}
func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
return nanotime1()
}
-func walltime() (sec int64, nsec int32) {
- return walltime1()
-}
-
// write must be nosplit on Windows (see write1)
//
//go:nosplit
//go:linkname time_now time.now
func time_now() (sec int64, nsec int32, mono int64) {
- sec, nsec = walltime()
+ sec, nsec = walltime1()
return sec, nsec, nanotime()
}
// hdr[3:7] sec unsigned uint32, little endian.
// hdr[7:11] nsec unsigned uint32, little endian.
hdr[0] = 0 // LOG_ID_MAIN
- sec, nsec := walltime()
+ sec, nsec, _ := time_now()
packUint32(hdr[3:7], uint32(sec))
packUint32(hdr[7:11], uint32(nsec))