From 3938a4f48c1dfc63ff8a9625852f489a87b79ba8 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Fri, 7 Oct 2022 14:08:03 +1100 Subject: [PATCH] cpu: add support for ppc64 on platforms other than aix and linux This allows the cpu package to function on openbsd/ppc64. Updates golang/go#56001 Change-Id: Iff306b6091da8f7dc28dd1bd2c9ba668b5318a67 Reviewed-on: https://go-review.googlesource.com/c/sys/+/439977 Run-TryBot: Joel Sing Reviewed-by: Ian Lance Taylor Reviewed-by: Tobias Klauser TryBot-Result: Gopher Robot Reviewed-by: Bryan Mills --- cpu/cpu_other_ppc64x.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cpu/cpu_other_ppc64x.go diff --git a/cpu/cpu_other_ppc64x.go b/cpu/cpu_other_ppc64x.go new file mode 100644 index 00000000..060d46b6 --- /dev/null +++ b/cpu/cpu_other_ppc64x.go @@ -0,0 +1,15 @@ +// Copyright 2022 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. + +//go:build !aix && !linux && (ppc64 || ppc64le) +// +build !aix +// +build !linux +// +build ppc64 ppc64le + +package cpu + +func archInit() { + PPC64.IsPOWER8 = true + Initialized = true +}