From e8a74dcad96b134ba29a7edbc3bc84ba597e7c64 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 14 Sep 2014 22:24:29 -0400 Subject: [PATCH] runtime: fix solaris build, part 2 This file was already assigned to another CL so it didn't make it into the build fix CL. Sigh. TBR=iant CC=golang-codereviews https://golang.org/cl/144850043 --- src/runtime/os_solaris.go | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/runtime/os_solaris.go b/src/runtime/os_solaris.go index a5e6966781..3cffff3e29 100644 --- a/src/runtime/os_solaris.go +++ b/src/runtime/os_solaris.go @@ -31,9 +31,10 @@ var asmsysvicall6 libcFunc //go:nosplit func sysvicall0(fn *libcFunc) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 0 - libcall.args = unsafe.Pointer(fn) // it's unused but must be non-nil, otherwise crashes + // TODO(rsc): Why is noescape necessary here and below? + libcall.args = uintptr(noescape(unsafe.Pointer(&fn))) // it's unused but must be non-nil, otherwise crashes asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -41,9 +42,9 @@ func sysvicall0(fn *libcFunc) uintptr { //go:nosplit func sysvicall1(fn *libcFunc, a1 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 1 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -51,9 +52,9 @@ func sysvicall1(fn *libcFunc, a1 uintptr) uintptr { //go:nosplit func sysvicall2(fn *libcFunc, a1, a2 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 2 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -61,9 +62,9 @@ func sysvicall2(fn *libcFunc, a1, a2 uintptr) uintptr { //go:nosplit func sysvicall3(fn *libcFunc, a1, a2, a3 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 3 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -71,9 +72,9 @@ func sysvicall3(fn *libcFunc, a1, a2, a3 uintptr) uintptr { //go:nosplit func sysvicall4(fn *libcFunc, a1, a2, a3, a4 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 4 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -81,9 +82,9 @@ func sysvicall4(fn *libcFunc, a1, a2, a3, a4 uintptr) uintptr { //go:nosplit func sysvicall5(fn *libcFunc, a1, a2, a3, a4, a5 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 5 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 } @@ -91,9 +92,9 @@ func sysvicall5(fn *libcFunc, a1, a2, a3, a4, a5 uintptr) uintptr { //go:nosplit func sysvicall6(fn *libcFunc, a1, a2, a3, a4, a5, a6 uintptr) uintptr { libcall := &getg().m.libcall - libcall.fn = unsafe.Pointer(fn) + libcall.fn = uintptr(unsafe.Pointer(fn)) libcall.n = 6 - libcall.args = noescape(unsafe.Pointer(&a1)) + libcall.args = uintptr(noescape(unsafe.Pointer(&a1))) asmcgocall(unsafe.Pointer(&asmsysvicall6), unsafe.Pointer(libcall)) return libcall.r1 }