diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2020-09-28 10:11:06 +0200 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2020-09-28 22:28:06 +0000 |
commit | 1f4d035178d2d792a74b6b872f6a213bf5fd9326 (patch) | |
tree | 90e8a0ab98d753ae297d5802c095c56290fc2307 /src/runtime/os_netbsd_arm64.go | |
parent | af18bce87cc7ee1ffc68f91abefa241ab209539e (diff) | |
download | go-1f4d035178d2d792a74b6b872f6a213bf5fd9326.tar.gz go-1f4d035178d2d792a74b6b872f6a213bf5fd9326.zip |
runtime: initialise cpu.HWCap on netbsd/arm64
NetBSD does not supply AT_HWCAP, however we still need to initialise
cpu.HWCaps. For now specify the bare minimum until we add some form of
capabilities detection. See
https://golang.org/issue/30824#issuecomment-494901591
Follows CL 174129 which did the same for openbsd/arm64.
Updates #30824
Change-Id: I43a86b583bc60d259a66772703de06970124bb7f
Reviewed-on: https://go-review.googlesource.com/c/go/+/257998
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Trust: Benny Siegert <bsiegert@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/os_netbsd_arm64.go')
-rw-r--r-- | src/runtime/os_netbsd_arm64.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/runtime/os_netbsd_arm64.go b/src/runtime/os_netbsd_arm64.go index 8d21b0a430..ae2638c778 100644 --- a/src/runtime/os_netbsd_arm64.go +++ b/src/runtime/os_netbsd_arm64.go @@ -4,7 +4,10 @@ package runtime -import "unsafe" +import ( + "internal/cpu" + "unsafe" +) func lwp_mcontext_init(mc *mcontextt, stk unsafe.Pointer, mp *m, gp *g, fn uintptr) { // Machine dependent mcontext initialisation for LWP. @@ -21,3 +24,10 @@ func cputicks() int64 { // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler. return nanotime() } + +func archauxv(auxv []uintptr) { + // NetBSD does not supply AT_HWCAP, however we still need to initialise cpu.HWCaps. + // For now specify the bare minimum until we add some form of capabilities + // detection. See issue https://golang.org/issue/30824#issuecomment-494901591 + cpu.HWCap = 1<<1 | 1<<0 // ASIMD, FP +} |