github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/arch/arch_state_autogen.go (about)

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