-b24062f0b2e8f6173731d5654afe0addf857270e
+5605a0727d3395becba1fbd4447807073984ec13
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
// +build !amd64
// +build !arm
// +build !arm64
+// +build !ppc
// +build !ppc64
// +build !ppc64le
// +build !s390x
+++ /dev/null
-// Copyright 2017 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 ppc64 ppc64le
-
-package cpu
-
-// ppc64x doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
-// 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
-
-// HWCAP/HWCAP2 bits. These are exposed by the kernel.
-const (
- // ISA Level
- PPC_FEATURE2_ARCH_2_07 = 0x80000000
- PPC_FEATURE2_ARCH_3_00 = 0x00800000
-
- // CPU features
- PPC_FEATURE2_DARN = 0x00200000
- PPC_FEATURE2_SCV = 0x00100000
-)
-
-func doinit() {
- options = []option{
- {Name: "darn", Feature: &PPC64.HasDARN},
- {Name: "scv", Feature: &PPC64.HasSCV},
- {Name: "power9", Feature: &PPC64.IsPOWER9},
- {Name: "power8", Feature: &PPC64.IsPOWER8},
- }
-
- // HWCAP2 feature bits
- PPC64.IsPOWER8 = isSet(HWCap2, PPC_FEATURE2_ARCH_2_07)
- PPC64.IsPOWER9 = isSet(HWCap2, PPC_FEATURE2_ARCH_3_00)
- PPC64.HasDARN = isSet(HWCap2, PPC_FEATURE2_DARN)
- PPC64.HasSCV = isSet(HWCap2, PPC_FEATURE2_SCV)
-}
-
-func isSet(hwc uint, value uint) bool {
- return hwc&value != 0
-}
--- /dev/null
+// Copyright 2017 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 ppc ppc64 ppc64le
+
+package cpu
+
+// ppc64x doesn't have a 'cpuid' equivalent, so we rely on HWCAP/HWCAP2.
+// 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
+
+// HWCAP/HWCAP2 bits. These are exposed by the kernel.
+const (
+ // ISA Level
+ PPC_FEATURE2_ARCH_2_07 = 0x80000000
+ PPC_FEATURE2_ARCH_3_00 = 0x00800000
+
+ // CPU features
+ PPC_FEATURE2_DARN = 0x00200000
+ PPC_FEATURE2_SCV = 0x00100000
+)
+
+func doinit() {
+ options = []option{
+ {Name: "darn", Feature: &PPC64.HasDARN},
+ {Name: "scv", Feature: &PPC64.HasSCV},
+ {Name: "power9", Feature: &PPC64.IsPOWER9},
+ {Name: "power8", Feature: &PPC64.IsPOWER8},
+ }
+
+ // HWCAP2 feature bits
+ PPC64.IsPOWER8 = isSet(HWCap2, PPC_FEATURE2_ARCH_2_07)
+ PPC64.IsPOWER9 = isSet(HWCap2, PPC_FEATURE2_ARCH_3_00)
+ PPC64.HasDARN = isSet(HWCap2, PPC_FEATURE2_DARN)
+ PPC64.HasSCV = isSet(HWCap2, PPC_FEATURE2_SCV)
+}
+
+func isSet(hwc uint, value uint) bool {
+ return hwc&value != 0
+}
const _RTAX_IFA = 5
const _RTAX_MAX = 8
-const _SIOCGIFMTU = -0x3fd796aa
-
func getIfList() ([]byte, error) {
needed, err := syscall.Getkerninfo(_KINFO_RT_IFLIST, 0, 0, 0)
if err != nil {
//go:nosplit
func semacreate(mp *m) {
- if mp.mos.waitsema != 0 {
+ if mp.waitsema != 0 {
return
}
if sem_init(sem, 0, 0) != 0 {
throw("sem_init")
}
- mp.mos.waitsema = uintptr(unsafe.Pointer(sem))
+ mp.waitsema = uintptr(unsafe.Pointer(sem))
}
//go:nosplit
ts.tv_sec = timespec_sec_t(sec)
ts.tv_nsec = timespec_nsec_t(nsec)
- if sem_timedwait((*semt)(unsafe.Pointer(_m_.mos.waitsema)), &ts) != 0 {
+ if sem_timedwait((*semt)(unsafe.Pointer(_m_.waitsema)), &ts) != 0 {
err := errno()
if err == _ETIMEDOUT || err == _EAGAIN || err == _EINTR {
return -1
return 0
}
for {
- r1 := sem_wait((*semt)(unsafe.Pointer(_m_.mos.waitsema)))
+ r1 := sem_wait((*semt)(unsafe.Pointer(_m_.waitsema)))
if r1 == 0 {
break
}
//go:nosplit
func semawakeup(mp *m) {
- if sem_post((*semt)(unsafe.Pointer(mp.mos.waitsema))) != 0 {
+ if sem_post((*semt)(unsafe.Pointer(mp.waitsema))) != 0 {
throw("sem_post")
}
}
const (
// getsystemcfg constants
- _SC_IMPL = 2
_IMPL_POWER8 = 0x10000
_IMPL_POWER9 = 0x20000
)
sed -e 's/^\(const \)_\(IFF[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
grep '^const _IFNAMSIZ' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(IFNAMSIZ[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
-grep '^const _SIOC' gen-sysinfo.go |
+grep '^const _SIOC' gen-sysinfo.go | \
+ grep -v '_val =' | \
sed -e 's/^\(const \)_\(SIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+if ! grep '^const SIOCGIFMTU' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _SIOCGIFMTU_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const SIOCGIFMTU = _SIOCGIFMTU_val' >> ${OUT}
+ fi
+fi
+
# The ifaddrmsg struct.
grep '^type _ifaddrmsg ' gen-sysinfo.go | \
sed -e 's/_ifaddrmsg/IfAddrmsg/' \
#endif
};
+// SIOCGIFMTU can't be added in the above enum as it might
+// be signed in some OSes.
+#ifdef SIOCGIFMTU
+enum {
+ SIOCGIFMTU_val = SIOCGIFMTU,
+};
+#endif
+
#if defined(HAVE_SYS_EPOLL_H)
enum {
epoll_data_offset = offsetof(struct epoll_event, data)