]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: more cleanups
authorKeith Randall <khr@golang.org>
Tue, 9 Sep 2014 21:32:53 +0000 (14:32 -0700)
committerKeith Randall <khr@golang.org>
Tue, 9 Sep 2014 21:32:53 +0000 (14:32 -0700)
Move timenow thunk into time.s
Move declarations for generic c/asm services into stubs.go

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/137360043

src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/extern.go
src/runtime/mgc0.go
src/runtime/mprof.go
src/runtime/stubs.go
src/runtime/thunk.s

index 2376ab92ba1635ac364399e3101d667e20b46cd5..3e93025fafff3b1a6a3f8660d5dd763b977e5a33 100644 (file)
@@ -2241,9 +2241,6 @@ TEXT runtime·duffcopy(SB), NOSPLIT, $0-0
        
        RET
 
-TEXT runtime·timenow(SB), NOSPLIT, $0-0
-       JMP     time·now(SB)
-
 TEXT runtime·fastrand1(SB), NOSPLIT, $0-4
        get_tls(CX)
        MOVL    g(CX), AX
index a32e03e4ee765800272e11a69f1b6eee6a542993..1a106dc1f1d4a3876093a5c36f7bb85a06b69403 100644 (file)
@@ -2186,9 +2186,6 @@ TEXT runtime·duffcopy(SB), NOSPLIT, $0-0
 
        RET
 
-TEXT runtime·timenow(SB), NOSPLIT, $0-0
-       JMP     time·now(SB)
-
 TEXT runtime·fastrand1(SB), NOSPLIT, $0-4
        get_tls(CX)
        MOVQ    g(CX), AX
index 5d82d84aa421bdec0727e0cdfafbb0c1aa183ae9..32276c895277f8efdbce85cada872f23aea7fe85 100644 (file)
@@ -1069,9 +1069,6 @@ eqret:
        MOVB    AX, ret+24(FP)
        RET
 
-TEXT runtime·timenow(SB), NOSPLIT, $0-0
-       JMP     time·now(SB)
-
 TEXT runtime·fastrand1(SB), NOSPLIT, $0-4
        get_tls(CX)
        MOVL    g(CX), AX
index ac78bd9dc583630338709f9deaf3bc1e57d258ab..73d23fce34ccc7fa6d88de81974bb57b9e1bf049 100644 (file)
@@ -848,9 +848,6 @@ _sib_notfound:
        MOVW    R0, ret+12(FP)
        RET
 
-TEXT runtime·timenow(SB),NOSPLIT,$0-0
-       B       time·now(SB)
-
 // A Duff's device for zeroing memory.
 // The compiler jumps to computed addresses within
 // this routine to zero chunks of memory.  Do not
index 3d06a23fcea414e5a0f5789fe7610c69bae7f655..b8db5d0c4b7658f2299277bbb05f0268c0496fe6 100644 (file)
@@ -126,8 +126,6 @@ func Callers(skip int, pc []uintptr) int {
        return callers(skip, &pc[0], len(pc))
 }
 
-func getgoroot() string
-
 // GOROOT returns the root of the Go tree.
 // It uses the GOROOT environment variable, if set,
 // or else the root used during the Go build.
index 0984fc58d672ecbace6e01daca0139c9e4960e2e..ec5edb0244ef9a9fd28b277e009087f32164f270 100644 (file)
@@ -28,8 +28,6 @@ func gc_notype_ptr(ret *interface{}) {
        *ret = x
 }
 
-func timenow() (sec int64, nsec int32)
-
 func gc_unixnanotime(now *int64) {
        sec, nsec := timenow()
        *now = sec*1e9 + int64(nsec)
index 7177c845923b59ae6a6270fb4a68d5a0b8eda7c4..89e991523692fa517192850b5eb9d9241d1ea662 100644 (file)
@@ -295,9 +295,6 @@ func SetBlockProfileRate(rate int) {
        atomicstore64(&blockprofilerate, uint64(r))
 }
 
-func fastrand1() uint32     // assembly
-func readgstatus(*g) uint32 // proc.c
-
 func blockevent(cycles int64, skip int) {
        if cycles <= 0 {
                return
index f3af34a584737645c7cd7b862af01074a2aa2f46..8bae98c73d7995cb33a543b19d416c4f4ffc0565 100644 (file)
@@ -28,6 +28,7 @@ func getg() *g
 func acquirem() *m
 func releasem(mp *m)
 func gomcache() *mcache
+func readgstatus(*g) uint32 // proc.c
 
 // mcall switches from the g to the g0 stack and invokes fn(g),
 // where g is the goroutine that made the call.
@@ -121,6 +122,9 @@ func unlockOSThread()
 // exported value for testing
 var hashLoad = loadFactor
 
+// in asm_*.s
+func fastrand1() uint32
+
 // in asm_*.s
 //go:noescape
 func memeq(a, b unsafe.Pointer, size uintptr) bool
@@ -229,3 +233,6 @@ func rt0_go()
 // to deferreturn.
 // in asm_*.s
 func return0()
+
+// thunk to call time.now.
+func timenow() (sec int64, nsec int32)
index 35b250f8c538030b1624d079c3b66b44ea0c007b..7ba22d705e5341a534f9e2e0d0327aa0ea8876a9 100644 (file)
@@ -157,3 +157,6 @@ TEXT runtime·main_init(SB),NOSPLIT,$0-0
 
 TEXT runtime·main_main(SB),NOSPLIT,$0-0
        JMP     main·main(SB)
+
+TEXT runtime·timenow(SB), NOSPLIT, $0-0
+       JMP     time·now(SB)