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

     1  // Code generated by g_typedef; DO NOT EDIT.
     2  
     3  //go:build go1.10 && !go1.11
     4  // +build go1.10,!go1.11
     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  	sched          gobuf
    26  	syscallsp      uintptr        // if status==Gsyscall, syscallsp = sched.sp to use during gc
    27  	syscallpc      uintptr        // if status==Gsyscall, syscallpc = sched.pc to use during gc
    28  	stktopsp       uintptr        // expected sp at top of stack, to check in traceback
    29  	param          unsafe.Pointer // passed parameter on wakeup
    30  	atomicstatus   uint32
    31  	stackLock      uint32 // sigprof/scang lock; TODO: fold in to atomicstatus
    32  	goid           int64
    33  	waitsince      int64  // approx time when the g become blocked
    34  	waitreason     string // if status==Gwaiting
    35  	schedlink      guintptr
    36  	preempt        bool     // preemption signal, duplicates stackguard0 = stackpreempt
    37  	paniconfault   bool     // panic (instead of crash) on unexpected fault address
    38  	preemptscan    bool     // preempted g does scan for gc
    39  	gcscandone     bool     // g has scanned stack; protected by _Gscan bit in status
    40  	gcscanvalid    bool     // false at start of gc cycle, true if G has not run since last scan; TODO: remove?
    41  	throwsplit     bool     // must not split stack
    42  	raceignore     int8     // ignore race detection events
    43  	sysblocktraced bool     // StartTrace has emitted EvGoInSyscall about this goroutine
    44  	sysexitticks   int64    // cputicks when syscall has returned (for tracing)
    45  	traceseq       uint64   // trace event sequencer
    46  	tracelastp     puintptr // last P emitted an event for this goroutine
    47  	lockedm        muintptr
    48  	sig            uint32
    49  	writebuf       []byte
    50  	sigcode0       uintptr
    51  	sigcode1       uintptr
    52  	sigpc          uintptr
    53  	gopc           uintptr // pc of go statement that created this goroutine
    54  	startpc        uintptr // pc of goroutine function
    55  	racectx        uintptr
    56  	waiting        *sudog         // sudog structures this g is waiting on (that have a valid elem ptr); in lock order
    57  	cgoCtxt        []uintptr      // cgo traceback context
    58  	labels         unsafe.Pointer // profiler labels
    59  	timer          *timer         // cached timer for time.Sleep
    60  	selectDone     uint32         // are we participating in a select and did someone win the race?
    61  
    62  	// gcAssistBytes is this G's GC assist credit in terms of
    63  	// bytes allocated. If this is positive, then the G has credit
    64  	// to allocate gcAssistBytes bytes without assisting. If this
    65  	// is negative, then the G must correct this by performing
    66  	// scan work. We track this in bytes to make it fast to update
    67  	// and check for debt in the malloc hot path. The assist ratio
    68  	// determines how this corresponds to scan work debt.
    69  	gcAssistBytes int64
    70  }
    71  type stack struct {
    72  	lo uintptr
    73  	hi uintptr
    74  }
    75  type _panic struct {
    76  	argp      unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink
    77  	arg       interface{}    // argument to panic
    78  	link      *_panic        // link to earlier panic
    79  	recovered bool           // whether this panic is over
    80  	aborted   bool           // the panic was aborted
    81  }
    82  type _defer struct {
    83  	siz     int32
    84  	started bool
    85  	sp      uintptr // sp at time of defer
    86  	pc      uintptr
    87  	fn      *funcval
    88  	_panic  *_panic // panic that is running defer
    89  	link    *_defer
    90  }
    91  type gobuf struct {
    92  	// The offsets of sp, pc, and g are known to (hard-coded in) libmach.
    93  	//
    94  	// ctxt is unusual with respect to GC: it may be a
    95  	// heap-allocated funcval, so GC needs to track it, but it
    96  	// needs to be set and cleared from assembly, where it's
    97  	// difficult to have write barriers. However, ctxt is really a
    98  	// saved, live register, and we only ever exchange it between
    99  	// the real register and the gobuf. Hence, we treat it as a
   100  	// root during stack scanning, which means assembly that saves
   101  	// and restores it doesn't need write barriers. It's still
   102  	// typed as a pointer so that any other writes from Go get
   103  	// write barriers.
   104  	sp   uintptr
   105  	pc   uintptr
   106  	g    guintptr
   107  	ctxt unsafe.Pointer
   108  	ret  uintreg
   109  	lr   uintptr
   110  	bp   uintptr // for GOEXPERIMENT=framepointer
   111  }
   112  type funcval struct {
   113  	fn uintptr
   114  }
   115  type timer struct {
   116  	tb *timersBucket // the bucket the timer lives in
   117  	i  int           // heap index
   118  
   119  	// Timer wakes up at when, and then at when+period, ... (period > 0 only)
   120  	// each time calling f(arg, now) in the timer goroutine, so f must be
   121  	// a well-behaved function and not block.
   122  	when   int64
   123  	period int64
   124  	f      func(interface{}, uintptr)
   125  	arg    interface{}
   126  	seq    uintptr
   127  }
   128  type guintptr uintptr
   129  type puintptr uintptr
   130  type muintptr uintptr
   131  type uintreg uint          // FIXME wrong on amd64p32
   132  type m struct{}            // FIXME stub
   133  type sudog struct{}        // FIXME stub
   134  type timersBucket struct{} // FIXME stub