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

     1  // Code generated by g_typedef; DO NOT EDIT.
     2  
     3  //go:build go1.11 && !go1.12
     4  // +build go1.11,!go1.12
     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  	schedlink      guintptr
    34  	waitsince      int64      // approx time when the g become blocked
    35  	waitreason     waitReason // if status==Gwaiting
    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  	ancestors      *[]ancestorInfo // ancestor information goroutine(s) that created this goroutine (only used if debug.tracebackancestors)
    55  	startpc        uintptr         // pc of goroutine function
    56  	racectx        uintptr
    57  	waiting        *sudog         // sudog structures this g is waiting on (that have a valid elem ptr); in lock order
    58  	cgoCtxt        []uintptr      // cgo traceback context
    59  	labels         unsafe.Pointer // profiler labels
    60  	timer          *timer         // cached timer for time.Sleep
    61  	selectDone     uint32         // are we participating in a select and did someone win the race?
    62  
    63  	// gcAssistBytes is this G's GC assist credit in terms of
    64  	// bytes allocated. If this is positive, then the G has credit
    65  	// to allocate gcAssistBytes bytes without assisting. If this
    66  	// is negative, then the G must correct this by performing
    67  	// scan work. We track this in bytes to make it fast to update
    68  	// and check for debt in the malloc hot path. The assist ratio
    69  	// determines how this corresponds to scan work debt.
    70  	gcAssistBytes int64
    71  }
    72  type stack struct {
    73  	lo uintptr
    74  	hi uintptr
    75  }
    76  type _panic struct {
    77  	argp      unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink
    78  	arg       interface{}    // argument to panic
    79  	link      *_panic        // link to earlier panic
    80  	recovered bool           // whether this panic is over
    81  	aborted   bool           // the panic was aborted
    82  }
    83  type _defer struct {
    84  	siz     int32
    85  	started bool
    86  	sp      uintptr // sp at time of defer
    87  	pc      uintptr
    88  	fn      *funcval
    89  	_panic  *_panic // panic that is running defer
    90  	link    *_defer
    91  }
    92  type gobuf struct {
    93  	// The offsets of sp, pc, and g are known to (hard-coded in) libmach.
    94  	//
    95  	// ctxt is unusual with respect to GC: it may be a
    96  	// heap-allocated funcval, so GC needs to track it, but it
    97  	// needs to be set and cleared from assembly, where it's
    98  	// difficult to have write barriers. However, ctxt is really a
    99  	// saved, live register, and we only ever exchange it between
   100  	// the real register and the gobuf. Hence, we treat it as a
   101  	// root during stack scanning, which means assembly that saves
   102  	// and restores it doesn't need write barriers. It's still
   103  	// typed as a pointer so that any other writes from Go get
   104  	// write barriers.
   105  	sp   uintptr
   106  	pc   uintptr
   107  	g    guintptr
   108  	ctxt unsafe.Pointer
   109  	ret  uintreg
   110  	lr   uintptr
   111  	bp   uintptr // for GOEXPERIMENT=framepointer
   112  }
   113  type funcval struct {
   114  	fn uintptr
   115  }
   116  type timer struct {
   117  	tb *timersBucket // the bucket the timer lives in
   118  	i  int           // heap index
   119  
   120  	// Timer wakes up at when, and then at when+period, ... (period > 0 only)
   121  	// each time calling f(arg, now) in the timer goroutine, so f must be
   122  	// a well-behaved function and not block.
   123  	when   int64
   124  	period int64
   125  	f      func(interface{}, uintptr)
   126  	arg    interface{}
   127  	seq    uintptr
   128  }
   129  type guintptr uintptr
   130  type puintptr uintptr
   131  type muintptr uintptr
   132  type waitReason uint8
   133  type ancestorInfo struct {
   134  	pcs  []uintptr // pcs from the stack of this goroutine
   135  	goid int64     // goroutine id of this goroutine; original goroutine possibly dead
   136  	gopc uintptr   // pc of go statement that created this goroutine
   137  }
   138  type uintreg uint          // FIXME wrong on amd64p32
   139  type m struct{}            // FIXME stub
   140  type sudog struct{}        // FIXME stub
   141  type timersBucket struct{} // FIXME stub