lab.nexedi.com/kirr/go123@v0.0.0-20240207185015-8299741fa871/tracing/internal/xruntime/zruntime_g_go1.8.go (about)

     1  // Code generated by g_typedef; DO NOT EDIT.
     2  
     3  //go:build go1.8 && !go1.9
     4  // +build go1.8,!go1.9
     5  
     6  package xruntime
     7  
     8  import "unsafe"
     9  
    10  type g struct {
    11  	// Stack parameters.
    12  	// stack describes the actual stack memory: [stack.lo, stack.hi).
    13  	// stackguard0 is the stack pointer compared in the Go stack growth prologue.
    14  	// It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
    15  	// stackguard1 is the stack pointer compared in the C stack growth prologue.
    16  	// It is stack.lo+StackGuard on g0 and gsignal stacks.
    17  	// It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
    18  	stack       stack   // offset known to runtime/cgo
    19  	stackguard0 uintptr // offset known to liblink
    20  	stackguard1 uintptr // offset known to liblink
    21  
    22  	_panic         *_panic // innermost panic - offset known to liblink
    23  	_defer         *_defer // innermost defer
    24  	m              *m      // current m; offset known to arm liblink
    25  	stackAlloc     uintptr // stack allocation is [stack.lo,stack.lo+stackAlloc)
    26  	sched          gobuf
    27  	syscallsp      uintptr        // if status==Gsyscall, syscallsp = sched.sp to use during gc
    28  	syscallpc      uintptr        // if status==Gsyscall, syscallpc = sched.pc to use during gc
    29  	stkbar         []stkbar       // stack barriers, from low to high (see top of mstkbar.go)
    30  	stkbarPos      uintptr        // index of lowest stack barrier not hit
    31  	stktopsp       uintptr        // expected sp at top of stack, to check in traceback
    32  	param          unsafe.Pointer // passed parameter on wakeup
    33  	atomicstatus   uint32
    34  	stackLock      uint32 // sigprof/scang lock; TODO: fold in to atomicstatus
    35  	goid           int64
    36  	waitsince      int64  // approx time when the g become blocked
    37  	waitreason     string // if status==Gwaiting
    38  	schedlink      guintptr
    39  	preempt        bool     // preemption signal, duplicates stackguard0 = stackpreempt
    40  	paniconfault   bool     // panic (instead of crash) on unexpected fault address
    41  	preemptscan    bool     // preempted g does scan for gc
    42  	gcscandone     bool     // g has scanned stack; protected by _Gscan bit in status
    43  	gcscanvalid    bool     // false at start of gc cycle, true if G has not run since last scan; transition from true to false by calling queueRescan and false to true by calling dequeueRescan
    44  	throwsplit     bool     // must not split stack
    45  	raceignore     int8     // ignore race detection events
    46  	sysblocktraced bool     // StartTrace has emitted EvGoInSyscall about this goroutine
    47  	sysexitticks   int64    // cputicks when syscall has returned (for tracing)
    48  	traceseq       uint64   // trace event sequencer
    49  	tracelastp     puintptr // last P emitted an event for this goroutine
    50  	lockedm        *m
    51  	sig            uint32
    52  	writebuf       []byte
    53  	sigcode0       uintptr
    54  	sigcode1       uintptr
    55  	sigpc          uintptr
    56  	gopc           uintptr // pc of go statement that created this goroutine
    57  	startpc        uintptr // pc of goroutine function
    58  	racectx        uintptr
    59  	waiting        *sudog    // sudog structures this g is waiting on (that have a valid elem ptr); in lock order
    60  	cgoCtxt        []uintptr // cgo traceback context
    61  
    62  	// gcRescan is this G's index in work.rescan.list. If this is
    63  	// -1, this G is not on the rescan list.
    64  	//
    65  	// If gcphase != _GCoff and this G is visible to the garbage
    66  	// collector, writes to this are protected by work.rescan.lock.
    67  	gcRescan int32
    68  
    69  	// gcAssistBytes is this G's GC assist credit in terms of
    70  	// bytes allocated. If this is positive, then the G has credit
    71  	// to allocate gcAssistBytes bytes without assisting. If this
    72  	// is negative, then the G must correct this by performing
    73  	// scan work. We track this in bytes to make it fast to update
    74  	// and check for debt in the malloc hot path. The assist ratio
    75  	// determines how this corresponds to scan work debt.
    76  	gcAssistBytes int64
    77  }
    78  type stack struct {
    79  	lo uintptr
    80  	hi uintptr
    81  }
    82  type _panic struct {
    83  	argp      unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink
    84  	arg       interface{}    // argument to panic
    85  	link      *_panic        // link to earlier panic
    86  	recovered bool           // whether this panic is over
    87  	aborted   bool           // the panic was aborted
    88  }
    89  type _defer struct {
    90  	siz     int32
    91  	started bool
    92  	sp      uintptr // sp at time of defer
    93  	pc      uintptr
    94  	fn      *funcval
    95  	_panic  *_panic // panic that is running defer
    96  	link    *_defer
    97  }
    98  type gobuf struct {
    99  	// The offsets of sp, pc, and g are known to (hard-coded in) libmach.
   100  	//
   101  	// ctxt is unusual with respect to GC: it may be a
   102  	// heap-allocated funcval so write require a write barrier,
   103  	// but gobuf needs to be cleared from assembly. We take
   104  	// advantage of the fact that the only path that uses a
   105  	// non-nil ctxt is morestack. As a result, gogo is the only
   106  	// place where it may not already be nil, so gogo uses an
   107  	// explicit write barrier. Everywhere else that resets the
   108  	// gobuf asserts that ctxt is already nil.
   109  	sp   uintptr
   110  	pc   uintptr
   111  	g    guintptr
   112  	ctxt unsafe.Pointer // this has to be a pointer so that gc scans it
   113  	ret  uintreg
   114  	lr   uintptr
   115  	bp   uintptr // for GOEXPERIMENT=framepointer
   116  }
   117  type funcval struct {
   118  	fn uintptr
   119  }
   120  type timer struct {
   121  	i int // heap index
   122  
   123  	// Timer wakes up at when, and then at when+period, ... (period > 0 only)
   124  	// each time calling f(arg, now) in the timer goroutine, so f must be
   125  	// a well-behaved function and not block.
   126  	when   int64
   127  	period int64
   128  	f      func(interface{}, uintptr)
   129  	arg    interface{}
   130  	seq    uintptr
   131  }
   132  type guintptr uintptr
   133  type puintptr uintptr
   134  type muintptr uintptr
   135  type stkbar struct {
   136  	savedLRPtr uintptr // location overwritten by stack barrier PC
   137  	savedLRVal uintptr // value overwritten at savedLRPtr
   138  }
   139  type uintreg uint   // FIXME wrong on amd64p32
   140  type m struct{}     // FIXME stub
   141  type sudog struct{} // FIXME stub