aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/netpoll.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-12-22 13:27:53 -0500
committerRuss Cox <rsc@golang.org>2014-12-23 03:17:22 +0000
commit7a524a103647d0b839ff133be1b1b866c92d11fb (patch)
treec5b1f7f352509a9965911eb8fad11900e9c7ebc7 /src/runtime/netpoll.go
parent200e7bf6b13a16452e5add94bb641ed434526e37 (diff)
downloadgo-7a524a103647d0b839ff133be1b1b866c92d11fb.tar.gz
go-7a524a103647d0b839ff133be1b1b866c92d11fb.zip
runtime: remove thunk.s
Replace with uses of //go:linkname in Go files, direct use of name in .s files. The only one that really truly needs a jump is reflect.call; the jump is now next to the runtime.reflectcall assembly implementations. Change-Id: Ie7ff3020a8f60a8e4c8645fe236e7883a3f23f46 Reviewed-on: https://go-review.googlesource.com/1962 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/netpoll.go')
-rw-r--r--src/runtime/netpoll.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go
index 7a99f18ad2..ba7a0f6931 100644
--- a/src/runtime/netpoll.go
+++ b/src/runtime/netpoll.go
@@ -71,11 +71,13 @@ type pollCache struct {
var pollcache pollCache
-func netpollServerInit() {
+//go:linkname net_runtime_pollServerInit net.runtime_pollServerInit
+func net_runtime_pollServerInit() {
netpollinit()
}
-func netpollOpen(fd uintptr) (*pollDesc, int) {
+//go:linkname net_runtime_pollOpen net.runtime_pollOpen
+func net_runtime_pollOpen(fd uintptr) (*pollDesc, int) {
pd := pollcache.alloc()
lock(&pd.lock)
if pd.wg != 0 && pd.wg != pdReady {
@@ -98,7 +100,8 @@ func netpollOpen(fd uintptr) (*pollDesc, int) {
return pd, int(errno)
}
-func netpollClose(pd *pollDesc) {
+//go:linkname net_runtime_pollClose net.runtime_pollClose
+func net_runtime_pollClose(pd *pollDesc) {
if !pd.closing {
gothrow("netpollClose: close w/o unblock")
}
@@ -119,7 +122,8 @@ func (c *pollCache) free(pd *pollDesc) {
unlock(&c.lock)
}
-func netpollReset(pd *pollDesc, mode int) int {
+//go:linkname net_runtime_pollReset net.runtime_pollReset
+func net_runtime_pollReset(pd *pollDesc, mode int) int {
err := netpollcheckerr(pd, int32(mode))
if err != 0 {
return err
@@ -132,7 +136,8 @@ func netpollReset(pd *pollDesc, mode int) int {
return 0
}
-func netpollWait(pd *pollDesc, mode int) int {
+//go:linkname net_runtime_pollWait net.runtime_pollWait
+func net_runtime_pollWait(pd *pollDesc, mode int) int {
err := netpollcheckerr(pd, int32(mode))
if err != 0 {
return err
@@ -153,14 +158,16 @@ func netpollWait(pd *pollDesc, mode int) int {
return 0
}
-func netpollWaitCanceled(pd *pollDesc, mode int) {
+//go:linkname net_runtime_pollWaitCanceled net.runtime_pollWaitCanceled
+func net_runtime_pollWaitCanceled(pd *pollDesc, mode int) {
// This function is used only on windows after a failed attempt to cancel
// a pending async IO operation. Wait for ioready, ignore closing or timeouts.
for !netpollblock(pd, int32(mode), true) {
}
}
-func netpollSetDeadline(pd *pollDesc, d int64, mode int) {
+//go:linkname net_runtime_pollSetDeadline net.runtime_pollSetDeadline
+func net_runtime_pollSetDeadline(pd *pollDesc, d int64, mode int) {
lock(&pd.lock)
if pd.closing {
unlock(&pd.lock)
@@ -229,7 +236,8 @@ func netpollSetDeadline(pd *pollDesc, d int64, mode int) {
}
}
-func netpollUnblock(pd *pollDesc) {
+//go:linkname net_runtime_pollUnblock net.runtime_pollUnblock
+func net_runtime_pollUnblock(pd *pollDesc) {
lock(&pd.lock)
if pd.closing {
gothrow("netpollUnblock: already closing")