github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/kernel/time/time_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package time
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (t *Time) StateTypeName() string {
    10  	return "pkg/sentry/kernel/time.Time"
    11  }
    12  
    13  func (t *Time) StateFields() []string {
    14  	return []string{
    15  		"ns",
    16  	}
    17  }
    18  
    19  func (t *Time) beforeSave() {}
    20  
    21  // +checklocksignore
    22  func (t *Time) StateSave(stateSinkObject state.Sink) {
    23  	t.beforeSave()
    24  	stateSinkObject.Save(0, &t.ns)
    25  }
    26  
    27  func (t *Time) afterLoad() {}
    28  
    29  // +checklocksignore
    30  func (t *Time) StateLoad(stateSourceObject state.Source) {
    31  	stateSourceObject.Load(0, &t.ns)
    32  }
    33  
    34  func (s *Setting) StateTypeName() string {
    35  	return "pkg/sentry/kernel/time.Setting"
    36  }
    37  
    38  func (s *Setting) StateFields() []string {
    39  	return []string{
    40  		"Enabled",
    41  		"Next",
    42  		"Period",
    43  	}
    44  }
    45  
    46  func (s *Setting) beforeSave() {}
    47  
    48  // +checklocksignore
    49  func (s *Setting) StateSave(stateSinkObject state.Sink) {
    50  	s.beforeSave()
    51  	stateSinkObject.Save(0, &s.Enabled)
    52  	stateSinkObject.Save(1, &s.Next)
    53  	stateSinkObject.Save(2, &s.Period)
    54  }
    55  
    56  func (s *Setting) afterLoad() {}
    57  
    58  // +checklocksignore
    59  func (s *Setting) StateLoad(stateSourceObject state.Source) {
    60  	stateSourceObject.Load(0, &s.Enabled)
    61  	stateSourceObject.Load(1, &s.Next)
    62  	stateSourceObject.Load(2, &s.Period)
    63  }
    64  
    65  func (t *Timer) StateTypeName() string {
    66  	return "pkg/sentry/kernel/time.Timer"
    67  }
    68  
    69  func (t *Timer) StateFields() []string {
    70  	return []string{
    71  		"clock",
    72  		"listener",
    73  		"setting",
    74  		"paused",
    75  	}
    76  }
    77  
    78  func (t *Timer) beforeSave() {}
    79  
    80  // +checklocksignore
    81  func (t *Timer) StateSave(stateSinkObject state.Sink) {
    82  	t.beforeSave()
    83  	stateSinkObject.Save(0, &t.clock)
    84  	stateSinkObject.Save(1, &t.listener)
    85  	stateSinkObject.Save(2, &t.setting)
    86  	stateSinkObject.Save(3, &t.paused)
    87  }
    88  
    89  func (t *Timer) afterLoad() {}
    90  
    91  // +checklocksignore
    92  func (t *Timer) StateLoad(stateSourceObject state.Source) {
    93  	stateSourceObject.Load(0, &t.clock)
    94  	stateSourceObject.Load(1, &t.listener)
    95  	stateSourceObject.Load(2, &t.setting)
    96  	stateSourceObject.Load(3, &t.paused)
    97  }
    98  
    99  func init() {
   100  	state.Register((*Time)(nil))
   101  	state.Register((*Setting)(nil))
   102  	state.Register((*Timer)(nil))
   103  }