summaryrefslogtreecommitdiff
path: root/libgo/go/runtime/runtime2.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime/runtime2.go')
-rw-r--r--libgo/go/runtime/runtime2.go56
1 files changed, 26 insertions, 30 deletions
diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go
index 7dc27433bae..195d65bbd73 100644
--- a/libgo/go/runtime/runtime2.go
+++ b/libgo/go/runtime/runtime2.go
@@ -209,6 +209,14 @@ func (gp *guintptr) cas(old, new guintptr) bool {
return atomic.Casuintptr((*uintptr)(unsafe.Pointer(gp)), uintptr(old), uintptr(new))
}
+// setGNoWB performs *gp = new without a write barrier.
+// For times when it's impractical to use a guintptr.
+//go:nosplit
+//go:nowritebarrier
+func setGNoWB(gp **g, new *g) {
+ (*guintptr)(unsafe.Pointer(gp)).set(new)
+}
+
type puintptr uintptr
//go:nosplit
@@ -225,6 +233,14 @@ func (mp muintptr) ptr() *m { return (*m)(unsafe.Pointer(mp)) }
//go:nosplit
func (mp *muintptr) set(m *m) { *mp = muintptr(unsafe.Pointer(m)) }
+// setMNoWB performs *mp = new without a write barrier.
+// For times when it's impractical to use an muintptr.
+//go:nosplit
+//go:nowritebarrier
+func setMNoWB(mp **m, new *m) {
+ (*muintptr)(unsafe.Pointer(mp)).set(new)
+}
+
// sudog represents a g in a wait list, such as for sending/receiving
// on a channel.
//
@@ -249,6 +265,7 @@ type sudog struct {
// The following fields are never accessed concurrently.
// waitlink is only accessed by g.
+ acquiretime int64
releasetime int64
ticket uint32
waitlink *sudog // g.waiting list
@@ -538,7 +555,7 @@ type p struct {
runSafePointFn uint32 // if 1, run sched.safePointFn at next safe point
- pad [64]byte
+ pad [sys.CacheLineSize]byte
}
const (
@@ -626,29 +643,6 @@ const (
_SigUnblock // unblocked in minit
)
-/*
-gccgo does not use this.
-
-// Layout of in-memory per-function information prepared by linker
-// See https://golang.org/s/go12symtab.
-// Keep in sync with linker
-// and with package debug/gosym and with symtab.go in package runtime.
-type _func struct {
- entry uintptr // start pc
- nameoff int32 // function name
-
- args int32 // in/out args size
- _ int32 // previously legacy frame size; kept for layout compatibility
-
- pcsp int32
- pcfile int32
- pcln int32
- npcdata int32
- nfuncdata int32
-}
-
-*/
-
// Lock-free stack node.
// // Also known to export_test.go.
type lfnode struct {
@@ -766,15 +760,17 @@ var (
newprocs int32
// Information about what cpu features are available.
- // Set on startup.
+ // Set on startup in asm_{x86,amd64}.s.
cpuid_ecx uint32
support_aes bool
-// cpuid_edx uint32
-// cpuid_ebx7 uint32
-// lfenceBeforeRdtsc bool
-// support_avx bool
-// support_avx2 bool
+ // cpuid_edx uint32
+ // cpuid_ebx7 uint32
+ // lfenceBeforeRdtsc bool
+ // support_avx bool
+ // support_avx2 bool
+ // support_bmi1 bool
+ // support_bmi2 bool
// goarm uint8 // set by cmd/link on arm systems
// framepointer_enabled bool // set by cmd/link