Skip to content

Commit

Permalink
internal/cpu: unify HWCap/HWCap2 comments
Browse files Browse the repository at this point in the history
HWCap and HWCap2 are no longer linknamed into package runtime. Also,
merge two sentences both starting with "These are..." and don't mention
any file name where archauxv is defined, as it become outdated if
support for a new $GOOS/$GOARCH combination is added. This is e.g.
already the case for arm64, where archauxv is also defined for
freebsd/arm64.

Change-Id: I9314a66633736b12e777869a832d8b79d442a6f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/228057
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
tklauser committed Apr 13, 2020
1 parent 2545323 commit 916ecbc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/internal/cpu/cpu_arm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ package cpu
const CacheLinePadSize = 32

// arm doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
// These are linknamed in runtime/os_(linux|freebsd)_arm.go and are
// initialized by archauxv().
// These should not be changed after they are initialized.
// These are initialized by archauxv() and should not be changed after they are
// initialized.
var HWCap uint
var HWCap2 uint

Expand Down
4 changes: 2 additions & 2 deletions src/internal/cpu/cpu_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package cpu
const CacheLinePadSize = 64

// arm64 doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
// These are initialized by archauxv in runtime/os_linux_arm64.go.
// These should not be changed after they are initialized.
// These are initialized by archauxv and should not be changed after they are
// initialized.
var HWCap uint
var HWCap2 uint

Expand Down
4 changes: 2 additions & 2 deletions src/internal/cpu/cpu_mips64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package cpu

const CacheLinePadSize = 32

// These are initialized by archauxv in runtime/os_linux_mips64x.go.
// These should not be changed after they are initialized.
// This is initialized by archauxv and should not be changed after it is
// initialized.
var HWCap uint

// HWCAP bits. These are exposed by the Linux kernel 5.4.
Expand Down
4 changes: 2 additions & 2 deletions src/internal/cpu/cpu_ppc64x.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package cpu
const CacheLinePadSize = 128

// ppc64x doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
// These are initialized by archauxv in runtime/os_linux_ppc64x.go.
// These should not be changed after they are initialized.
// These are initialized by archauxv and should not be changed after they are
// initialized.
// On aix/ppc64, these values are initialized early in the runtime in runtime/os_aix.go.
var HWCap uint
var HWCap2 uint
Expand Down

0 comments on commit 916ecbc

Please sign in to comment.