github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/arch/arch_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  package arch
     4  
     5  import (
     6  	"github.com/MerlinKodo/gvisor/pkg/state"
     7  )
     8  
     9  func (m *MmapLayout) StateTypeName() string {
    10  	return "pkg/sentry/arch.MmapLayout"
    11  }
    12  
    13  func (m *MmapLayout) StateFields() []string {
    14  	return []string{
    15  		"MinAddr",
    16  		"MaxAddr",
    17  		"BottomUpBase",
    18  		"TopDownBase",
    19  		"DefaultDirection",
    20  		"MaxStackRand",
    21  	}
    22  }
    23  
    24  func (m *MmapLayout) beforeSave() {}
    25  
    26  // +checklocksignore
    27  func (m *MmapLayout) StateSave(stateSinkObject state.Sink) {
    28  	m.beforeSave()
    29  	stateSinkObject.Save(0, &m.MinAddr)
    30  	stateSinkObject.Save(1, &m.MaxAddr)
    31  	stateSinkObject.Save(2, &m.BottomUpBase)
    32  	stateSinkObject.Save(3, &m.TopDownBase)
    33  	stateSinkObject.Save(4, &m.DefaultDirection)
    34  	stateSinkObject.Save(5, &m.MaxStackRand)
    35  }
    36  
    37  func (m *MmapLayout) afterLoad() {}
    38  
    39  // +checklocksignore
    40  func (m *MmapLayout) StateLoad(stateSourceObject state.Source) {
    41  	stateSourceObject.Load(0, &m.MinAddr)
    42  	stateSourceObject.Load(1, &m.MaxAddr)
    43  	stateSourceObject.Load(2, &m.BottomUpBase)
    44  	stateSourceObject.Load(3, &m.TopDownBase)
    45  	stateSourceObject.Load(4, &m.DefaultDirection)
    46  	stateSourceObject.Load(5, &m.MaxStackRand)
    47  }
    48  
    49  func (a *AuxEntry) StateTypeName() string {
    50  	return "pkg/sentry/arch.AuxEntry"
    51  }
    52  
    53  func (a *AuxEntry) StateFields() []string {
    54  	return []string{
    55  		"Key",
    56  		"Value",
    57  	}
    58  }
    59  
    60  func (a *AuxEntry) beforeSave() {}
    61  
    62  // +checklocksignore
    63  func (a *AuxEntry) StateSave(stateSinkObject state.Sink) {
    64  	a.beforeSave()
    65  	stateSinkObject.Save(0, &a.Key)
    66  	stateSinkObject.Save(1, &a.Value)
    67  }
    68  
    69  func (a *AuxEntry) afterLoad() {}
    70  
    71  // +checklocksignore
    72  func (a *AuxEntry) StateLoad(stateSourceObject state.Source) {
    73  	stateSourceObject.Load(0, &a.Key)
    74  	stateSourceObject.Load(1, &a.Value)
    75  }
    76  
    77  func init() {
    78  	state.Register((*MmapLayout)(nil))
    79  	state.Register((*AuxEntry)(nil))
    80  }