github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/cpuid/cpuid_arm64_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  //go:build arm64 && arm64 && arm64
     4  // +build arm64,arm64,arm64
     5  
     6  package cpuid
     7  
     8  import (
     9  	"context"
    10  
    11  	"github.com/metacubex/gvisor/pkg/state"
    12  )
    13  
    14  func (fs *FeatureSet) StateTypeName() string {
    15  	return "pkg/cpuid.FeatureSet"
    16  }
    17  
    18  func (fs *FeatureSet) StateFields() []string {
    19  	return []string{
    20  		"hwCap",
    21  		"cpuFreqMHz",
    22  		"cpuImplHex",
    23  		"cpuArchDec",
    24  		"cpuVarHex",
    25  		"cpuPartHex",
    26  		"cpuRevDec",
    27  	}
    28  }
    29  
    30  func (fs *FeatureSet) beforeSave() {}
    31  
    32  // +checklocksignore
    33  func (fs *FeatureSet) StateSave(stateSinkObject state.Sink) {
    34  	fs.beforeSave()
    35  	stateSinkObject.Save(0, &fs.hwCap)
    36  	stateSinkObject.Save(1, &fs.cpuFreqMHz)
    37  	stateSinkObject.Save(2, &fs.cpuImplHex)
    38  	stateSinkObject.Save(3, &fs.cpuArchDec)
    39  	stateSinkObject.Save(4, &fs.cpuVarHex)
    40  	stateSinkObject.Save(5, &fs.cpuPartHex)
    41  	stateSinkObject.Save(6, &fs.cpuRevDec)
    42  }
    43  
    44  func (fs *FeatureSet) afterLoad(context.Context) {}
    45  
    46  // +checklocksignore
    47  func (fs *FeatureSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    48  	stateSourceObject.Load(0, &fs.hwCap)
    49  	stateSourceObject.Load(1, &fs.cpuFreqMHz)
    50  	stateSourceObject.Load(2, &fs.cpuImplHex)
    51  	stateSourceObject.Load(3, &fs.cpuArchDec)
    52  	stateSourceObject.Load(4, &fs.cpuVarHex)
    53  	stateSourceObject.Load(5, &fs.cpuPartHex)
    54  	stateSourceObject.Load(6, &fs.cpuRevDec)
    55  }
    56  
    57  func init() {
    58  	state.Register((*FeatureSet)(nil))
    59  }