From feb984c96b10900daade4b47c4d308d7dd4ed5c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Tue, 20 Oct 2020 11:06:02 +0200 Subject: internal/cpu: make architectures without initialization work explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tobias Klauser --- src/internal/cpu/cpu_wasm.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/internal/cpu/cpu_wasm.go') 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() { +} -- cgit v1.2.1