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

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