github.com/ttpreport/gvisor-ligolo@v0.0.0-20240123134145-a858404967ba/pkg/sentry/kernel/futex/futex_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package futex
     4  
     5  import (
     6  	"github.com/ttpreport/gvisor-ligolo/pkg/state"
     7  )
     8  
     9  func (b *bucket) StateTypeName() string {
    10  	return "pkg/sentry/kernel/futex.bucket"
    11  }
    12  
    13  func (b *bucket) StateFields() []string {
    14  	return []string{}
    15  }
    16  
    17  func (b *bucket) beforeSave() {}
    18  
    19  // +checklocksignore
    20  func (b *bucket) StateSave(stateSinkObject state.Sink) {
    21  	b.beforeSave()
    22  	if !state.IsZeroValue(&b.waiters) {
    23  		state.Failf("waiters is %#v, expected zero", &b.waiters)
    24  	}
    25  }
    26  
    27  func (b *bucket) afterLoad() {}
    28  
    29  // +checklocksignore
    30  func (b *bucket) StateLoad(stateSourceObject state.Source) {
    31  }
    32  
    33  func (m *Manager) StateTypeName() string {
    34  	return "pkg/sentry/kernel/futex.Manager"
    35  }
    36  
    37  func (m *Manager) StateFields() []string {
    38  	return []string{
    39  		"sharedBucket",
    40  	}
    41  }
    42  
    43  func (m *Manager) beforeSave() {}
    44  
    45  // +checklocksignore
    46  func (m *Manager) StateSave(stateSinkObject state.Sink) {
    47  	m.beforeSave()
    48  	if !state.IsZeroValue(&m.privateBuckets) {
    49  		state.Failf("privateBuckets is %#v, expected zero", &m.privateBuckets)
    50  	}
    51  	stateSinkObject.Save(0, &m.sharedBucket)
    52  }
    53  
    54  func (m *Manager) afterLoad() {}
    55  
    56  // +checklocksignore
    57  func (m *Manager) StateLoad(stateSourceObject state.Source) {
    58  	stateSourceObject.Load(0, &m.sharedBucket)
    59  }
    60  
    61  func (l *waiterList) StateTypeName() string {
    62  	return "pkg/sentry/kernel/futex.waiterList"
    63  }
    64  
    65  func (l *waiterList) StateFields() []string {
    66  	return []string{
    67  		"head",
    68  		"tail",
    69  	}
    70  }
    71  
    72  func (l *waiterList) beforeSave() {}
    73  
    74  // +checklocksignore
    75  func (l *waiterList) StateSave(stateSinkObject state.Sink) {
    76  	l.beforeSave()
    77  	stateSinkObject.Save(0, &l.head)
    78  	stateSinkObject.Save(1, &l.tail)
    79  }
    80  
    81  func (l *waiterList) afterLoad() {}
    82  
    83  // +checklocksignore
    84  func (l *waiterList) StateLoad(stateSourceObject state.Source) {
    85  	stateSourceObject.Load(0, &l.head)
    86  	stateSourceObject.Load(1, &l.tail)
    87  }
    88  
    89  func (e *waiterEntry) StateTypeName() string {
    90  	return "pkg/sentry/kernel/futex.waiterEntry"
    91  }
    92  
    93  func (e *waiterEntry) StateFields() []string {
    94  	return []string{
    95  		"next",
    96  		"prev",
    97  	}
    98  }
    99  
   100  func (e *waiterEntry) beforeSave() {}
   101  
   102  // +checklocksignore
   103  func (e *waiterEntry) StateSave(stateSinkObject state.Sink) {
   104  	e.beforeSave()
   105  	stateSinkObject.Save(0, &e.next)
   106  	stateSinkObject.Save(1, &e.prev)
   107  }
   108  
   109  func (e *waiterEntry) afterLoad() {}
   110  
   111  // +checklocksignore
   112  func (e *waiterEntry) StateLoad(stateSourceObject state.Source) {
   113  	stateSourceObject.Load(0, &e.next)
   114  	stateSourceObject.Load(1, &e.prev)
   115  }
   116  
   117  func init() {
   118  	state.Register((*bucket)(nil))
   119  	state.Register((*Manager)(nil))
   120  	state.Register((*waiterList)(nil))
   121  	state.Register((*waiterEntry)(nil))
   122  }