diff options
author | Martin Möhrmann <moehrmann@google.com> | 2020-10-20 11:06:02 +0200 |
---|---|---|
committer | Martin Möhrmann <moehrmann@google.com> | 2020-10-20 12:10:43 +0000 |
commit | feb984c96b10900daade4b47c4d308d7dd4ed5c3 (patch) | |
tree | b36236c5585820bc046e2fca8b1795f1b8e1600d /src/internal | |
parent | de932da453f68b8fc04e9c2ab25136748173c806 (diff) | |
download | go-feb984c96b10900daade4b47c4d308d7dd4ed5c3.tar.gz go-feb984c96b10900daade4b47c4d308d7dd4ed5c3.zip |
internal/cpu: make architectures without initialization work explicit
When cpu_no_init.go was created most architectures did not have
code in the doinit function. Currently only mips(le), riscv64 and
wasm do not have empty doinit functions.
Keeping cpu_no_init.go around does not reduce the work to satisfy
the build process when adding support for new architectures.
To support a new architecture a new file or build directive has to
be added to an existing file at any rate to define the constant
CacheLinePadSize. A new empty doinit can then be created in the
new file or the existing doinit can be reused when adding the
additional build directive.
Change-Id: I58a97f8cdf1cf1be85c37f4550c40750358aa031
Reviewed-on: https://go-review.googlesource.com/c/go/+/263801
Trust: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/internal')
-rw-r--r-- | src/internal/cpu/cpu_mips.go | 3 | ||||
-rw-r--r-- | src/internal/cpu/cpu_mipsle.go | 3 | ||||
-rw-r--r-- | src/internal/cpu/cpu_no_init.go | 18 | ||||
-rw-r--r-- | src/internal/cpu/cpu_riscv64.go | 3 | ||||
-rw-r--r-- | src/internal/cpu/cpu_wasm.go | 3 |
5 files changed, 12 insertions, 18 deletions
diff --git a/src/internal/cpu/cpu_mips.go b/src/internal/cpu/cpu_mips.go index 0f821e44e7..14a9c975ea 100644 --- a/src/internal/cpu/cpu_mips.go +++ b/src/internal/cpu/cpu_mips.go @@ -5,3 +5,6 @@ package cpu const CacheLinePadSize = 32 + +func doinit() { +} diff --git a/src/internal/cpu/cpu_mipsle.go b/src/internal/cpu/cpu_mipsle.go index 0f821e44e7..14a9c975ea 100644 --- a/src/internal/cpu/cpu_mipsle.go +++ b/src/internal/cpu/cpu_mipsle.go @@ -5,3 +5,6 @@ package cpu const CacheLinePadSize = 32 + +func doinit() { +} diff --git a/src/internal/cpu/cpu_no_init.go b/src/internal/cpu/cpu_no_init.go deleted file mode 100644 index fb381e1ce2..0000000000 --- a/src/internal/cpu/cpu_no_init.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !386 -// +build !amd64 -// +build !arm -// +build !arm64 -// +build !ppc64 -// +build !ppc64le -// +build !s390x -// +build !mips64 -// +build !mips64le - -package cpu - -func doinit() { -} diff --git a/src/internal/cpu/cpu_riscv64.go b/src/internal/cpu/cpu_riscv64.go index c49cab79fd..54b8c3378b 100644 --- a/src/internal/cpu/cpu_riscv64.go +++ b/src/internal/cpu/cpu_riscv64.go @@ -5,3 +5,6 @@ package cpu const CacheLinePadSize = 32 + +func doinit() { +} diff --git a/src/internal/cpu/cpu_wasm.go b/src/internal/cpu/cpu_wasm.go index b459738770..2310ad6a48 100644 --- a/src/internal/cpu/cpu_wasm.go +++ b/src/internal/cpu/cpu_wasm.go @@ -5,3 +5,6 @@ package cpu const CacheLinePadSize = 64 + +func doinit() { +} |