diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-09-30 13:45:08 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-09-30 13:45:08 +0000 |
commit | c0401cf78c555ef38d2d2fba94ebffeaef7c6bc9 (patch) | |
tree | d1646c0c4bb59624dfdc04420f835270129cc18e /libgo/go/runtime/runtime2.go | |
parent | 9e28a77462f81a9a2ab9064d768bd7c9484047e1 (diff) | |
download | gcc-c0401cf78c555ef38d2d2fba94ebffeaef7c6bc9.zip gcc-c0401cf78c555ef38d2d2fba94ebffeaef7c6bc9.tar.gz gcc-c0401cf78c555ef38d2d2fba94ebffeaef7c6bc9.tar.bz2 |
runtime: copy internal locking code from Go 1.7 runtime
Remove the old locking code written in C.
Add a shell script mkrsysinfo.sh to generate the runtime_sysinfo.go
file, so that we can get Go copies of the system time structures and
other types.
Tweak the compiler so that when compiling the runtime package the
address operator does not cause local variables to escape. When the gc
compiler compiles the runtime, an escaping local variable is treated as
an error. We should implement that, instead of this change, when escape
analysis is turned on.
Tweak the compiler so that the generated C header does not include names
that start with an underscore followed by a non-upper-case letter,
except for the special cases of _defer and _panic. Otherwise we
translate C types to Go in runtime_sysinfo.go and then generate those Go
types back as C types in runtime.inc, which is useless and painful for
the C code.
Change entersyscall and friends to take a dummy argument, as the gc
versions do, to simplify calls from the shared code.
Reviewed-on: https://go-review.googlesource.com/30079
From-SVN: r240657
Diffstat (limited to 'libgo/go/runtime/runtime2.go')
-rw-r--r-- | libgo/go/runtime/runtime2.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libgo/go/runtime/runtime2.go b/libgo/go/runtime/runtime2.go index 4fba428..17447eb 100644 --- a/libgo/go/runtime/runtime2.go +++ b/libgo/go/runtime/runtime2.go @@ -396,7 +396,7 @@ type g struct { gcnextsegment unsafe.Pointer gcnextsp unsafe.Pointer gcinitialsp unsafe.Pointer - gcregs _ucontext_t + gcregs g_ucontext_t entry unsafe.Pointer // goroutine entry point fromgogo bool // whether entered from gogo function @@ -406,7 +406,7 @@ type g struct { traceback *traceback // stack traceback buffer - context _ucontext_t // saved context for setcontext + context g_ucontext_t // saved context for setcontext stackcontext [10]unsafe.Pointer // split-stack context } @@ -474,7 +474,7 @@ type m struct { // Not for gccgo: libcallg guintptr // Not for gccgo: syscall libcall // stores syscall parameters on windows - // Not for gccgo: mOS + mos mOS // Remaining fields are specific to gccgo. @@ -485,8 +485,6 @@ type m struct { gcing int32 - waitsema uintptr // semaphore on systems that don't use futexes - cgomal *cgoMal // allocations via _cgo_allocate } @@ -771,13 +769,15 @@ const ( const _TracebackMaxFrames = 100 var ( -// emptystring string -// allglen uintptr -// allm *m -// allp [_MaxGomaxprocs + 1]*p -// gomaxprocs int32 -// panicking uint32 -// ncpu int32 + // emptystring string + // allglen uintptr + // allm *m + // allp [_MaxGomaxprocs + 1]*p + // gomaxprocs int32 + // panicking uint32 + + ncpu int32 + // forcegc forcegcstate // sched schedt // newprocs int32 @@ -803,13 +803,13 @@ var ( // Types that are only used by gccgo. -// _ucontext_t is a Go version of the C ucontext_t type, used by getcontext. -// _sizeof_ucontext_t is defined by the Makefile from <ucontext.h>. +// g_ucontext_t is a Go version of the C ucontext_t type, used by getcontext. +// _sizeof_ucontext_t is defined by mkrsysinfo.sh from <ucontext.h>. // On some systems getcontext and friends require a value that is // aligned to a 16-byte boundary. We implement this by increasing the // required size and picking an appropriate offset when we use the // array. -type _ucontext_t [(_sizeof_ucontext_t + 15) / unsafe.Sizeof(unsafe.Pointer(nil))]unsafe.Pointer +type g_ucontext_t [(_sizeof_ucontext_t + 15) / unsafe.Sizeof(unsafe.Pointer(nil))]unsafe.Pointer // traceback is used to collect stack traces from other goroutines. type traceback struct { |