runtime: convert common scheduler functions to Go
These are required for chans, semaphores, timers, etc.

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/123640043
diff --git a/src/pkg/runtime/stubs.go b/src/pkg/runtime/stubs.go
index 39244ef..f3ac783 100644
--- a/src/pkg/runtime/stubs.go
+++ b/src/pkg/runtime/stubs.go
@@ -41,6 +41,7 @@
 }
 
 // in stubs.goc
+func getg() *g
 func acquirem() *m
 func releasem(mp *m)
 func gomcache() *mcache
@@ -69,7 +70,10 @@
 	markallocated_m,
 	unrollgcprog_m,
 	unrollgcproginplace_m,
-	gosched_m mFunction
+	gosched_m,
+	ready_m,
+	park_m,
+	blockevent_m mFunction
 )
 
 // memclr clears n bytes starting at ptr.
@@ -163,3 +167,5 @@
 // gopersistentalloc allocates a permanent (not garbage collected)
 // memory region of size n.  Use wisely!
 func gopersistentalloc(n uintptr) unsafe.Pointer
+
+func gocputicks() int64