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

     1  // automatically generated by stateify.
     2  
     3  package kernel
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/metacubex/gvisor/pkg/state"
     9  )
    10  
    11  func (p *descriptorBucketSliceAtomicPtr) StateTypeName() string {
    12  	return "pkg/sentry/kernel.descriptorBucketSliceAtomicPtr"
    13  }
    14  
    15  func (p *descriptorBucketSliceAtomicPtr) StateFields() []string {
    16  	return []string{
    17  		"ptr",
    18  	}
    19  }
    20  
    21  func (p *descriptorBucketSliceAtomicPtr) beforeSave() {}
    22  
    23  // +checklocksignore
    24  func (p *descriptorBucketSliceAtomicPtr) StateSave(stateSinkObject state.Sink) {
    25  	p.beforeSave()
    26  	var ptrValue *descriptorBucketSlice
    27  	ptrValue = p.savePtr()
    28  	stateSinkObject.SaveValue(0, ptrValue)
    29  }
    30  
    31  func (p *descriptorBucketSliceAtomicPtr) afterLoad(context.Context) {}
    32  
    33  // +checklocksignore
    34  func (p *descriptorBucketSliceAtomicPtr) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    35  	stateSourceObject.LoadValue(0, new(*descriptorBucketSlice), func(y any) { p.loadPtr(ctx, y.(*descriptorBucketSlice)) })
    36  }
    37  
    38  func (p *descriptorBucketAtomicPtr) StateTypeName() string {
    39  	return "pkg/sentry/kernel.descriptorBucketAtomicPtr"
    40  }
    41  
    42  func (p *descriptorBucketAtomicPtr) StateFields() []string {
    43  	return []string{
    44  		"ptr",
    45  	}
    46  }
    47  
    48  func (p *descriptorBucketAtomicPtr) beforeSave() {}
    49  
    50  // +checklocksignore
    51  func (p *descriptorBucketAtomicPtr) StateSave(stateSinkObject state.Sink) {
    52  	p.beforeSave()
    53  	var ptrValue *descriptorBucket
    54  	ptrValue = p.savePtr()
    55  	stateSinkObject.SaveValue(0, ptrValue)
    56  }
    57  
    58  func (p *descriptorBucketAtomicPtr) afterLoad(context.Context) {}
    59  
    60  // +checklocksignore
    61  func (p *descriptorBucketAtomicPtr) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    62  	stateSourceObject.LoadValue(0, new(*descriptorBucket), func(y any) { p.loadPtr(ctx, y.(*descriptorBucket)) })
    63  }
    64  
    65  func (p *descriptorAtomicPtr) StateTypeName() string {
    66  	return "pkg/sentry/kernel.descriptorAtomicPtr"
    67  }
    68  
    69  func (p *descriptorAtomicPtr) StateFields() []string {
    70  	return []string{
    71  		"ptr",
    72  	}
    73  }
    74  
    75  func (p *descriptorAtomicPtr) beforeSave() {}
    76  
    77  // +checklocksignore
    78  func (p *descriptorAtomicPtr) StateSave(stateSinkObject state.Sink) {
    79  	p.beforeSave()
    80  	var ptrValue *descriptor
    81  	ptrValue = p.savePtr()
    82  	stateSinkObject.SaveValue(0, ptrValue)
    83  }
    84  
    85  func (p *descriptorAtomicPtr) afterLoad(context.Context) {}
    86  
    87  // +checklocksignore
    88  func (p *descriptorAtomicPtr) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    89  	stateSourceObject.LoadValue(0, new(*descriptor), func(y any) { p.loadPtr(ctx, y.(*descriptor)) })
    90  }
    91  
    92  func init() {
    93  	state.Register((*descriptorBucketSliceAtomicPtr)(nil))
    94  	state.Register((*descriptorBucketAtomicPtr)(nil))
    95  	state.Register((*descriptorAtomicPtr)(nil))
    96  }