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

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