Commit 092dd2bc by Ian Lance Taylor

runtime: move schedt type and sched var from C to Go

    
    This doesn't change any actual code, it just starts using the Go
    definition of the schedt type and the sched variable rather than the C
    definitions.
    
    The schedt type is tweaked slightly for gccgo.  We aren't going to
    release goroutine stacks, so we don't need separate gfreeStack and
    gfreeNostack lists.  We only have one size of defer function, so we
    don't need a list of 5 different pools.
    
    Reviewed-on: https://go-review.googlesource.com/33364

From-SVN: r242600
parent 70e73d3c
fc4ca600b2fc6de81fd3c4014542d6a50593db1a
bf4762823c4543229867436399be3ae30b4d13bb
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
......@@ -550,9 +550,6 @@ const (
_MaxGomaxprocs = 1 << 8
)
/*
Commented out for gccgo for now.
type schedt struct {
// accessed atomically. keep at top to ensure alignment on 32-bit systems.
goidgen uint64
......@@ -578,18 +575,17 @@ type schedt struct {
runqsize int32
// Global cache of dead G's.
gflock mutex
gfreeStack *g
gfreeNoStack *g
ngfree int32
gflock mutex
gfree *g
ngfree int32
// Central cache of sudog structs.
sudoglock mutex
sudogcache *sudog
// Central pool of available defer structs of different sizes.
// Central pool of available defer structs.
deferlock mutex
deferpool [5]*_defer
deferpool *_defer
gcwaiting uint32 // gc is waiting to run
stopwait int32
......@@ -608,7 +604,6 @@ type schedt struct {
procresizetime int64 // nanotime() of last change to gomaxprocs
totaltime int64 // ∫gomaxprocs dt up to procresizetime
}
*/
// The m.locked word holds two pieces of state counting active calls to LockOSThread/lockOSThread.
// The low bit (LockExternal) is a boolean reporting whether any LockOSThread call is active.
......@@ -772,8 +767,10 @@ var (
ncpu int32
// forcegc forcegcstate
// sched schedt
// forcegc forcegcstate
sched schedt
// newprocs int32
// Information about what cpu features are available.
......
......@@ -520,3 +520,9 @@ func dumpregs(*_siginfo_t, unsafe.Pointer)
// Temporary for gccgo until we port panic.go.
func startpanic()
// Temporary for gccgo until we port proc.go.
//go:linkname getsched runtime.getsched
func getsched() *schedt {
return &sched
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment