summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/stubs.go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-15 00:29:06 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-15 00:29:06 +0000
commitecc0b0cee14466e780b78b19758a3b2f0be4e798 (patch)
tree156c9d476a537c240533dedcf79341b37bcdf5d9 /libgo/go/runtime/stubs.go
parent4537dbd222bb31bd1a6e997c3839ba0fec347c90 (diff)
downloadgcc-ecc0b0cee14466e780b78b19758a3b2f0be4e798.tar.gz
runtime: copy runtime package time code from Go 1.7
Fix handling of function values for -fgo-c-header to generate FuncVal*, not simply FuncVal. While we're here change runtime.nanotime to use clock_gettime with CLOCK_MONOTONIC, rather than gettimeofday. This is what the gc library does. It provides nanosecond precision and a monotonic clock. Reviewed-on: https://go-review.googlesource.com/31232 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241197 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/runtime/stubs.go')
-rw-r--r--libgo/go/runtime/stubs.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/runtime/stubs.go b/libgo/go/runtime/stubs.go
index e1c28fac543..477c6be1ab4 100644
--- a/libgo/go/runtime/stubs.go
+++ b/libgo/go/runtime/stubs.go
@@ -196,15 +196,15 @@ func getcallersp(argp unsafe.Pointer) uintptr
// argp used in Defer structs when there is no argp.
const _NoArgs = ^uintptr(0)
-// //go:linkname time_now time.now
-// func time_now() (sec int64, nsec int32)
+//go:linkname time_now time.now
+func time_now() (sec int64, nsec int32)
-/*
+// For gccgo, expose this for C callers.
+//go:linkname unixnanotime runtime.unixnanotime
func unixnanotime() int64 {
sec, nsec := time_now()
return sec*1e9 + int64(nsec)
}
-*/
// round n up to a multiple of a. a must be a power of 2.
func round(n, a uintptr) uintptr {