github.com/noisysockets/netstack@v0.6.0/pkg/cpuid/cpuid_amd64_state_autogen.go (about)

     1  // automatically generated by stateify.
     2  
     3  //go:build amd64 && amd64 && amd64 && amd64
     4  // +build amd64,amd64,amd64,amd64
     5  
     6  package cpuid
     7  
     8  import (
     9  	"context"
    10  
    11  	"github.com/noisysockets/netstack/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  		"Function",
    21  		"hwCap",
    22  	}
    23  }
    24  
    25  func (fs *FeatureSet) beforeSave() {}
    26  
    27  // +checklocksignore
    28  func (fs *FeatureSet) StateSave(stateSinkObject state.Sink) {
    29  	fs.beforeSave()
    30  	var FunctionValue Static
    31  	FunctionValue = fs.saveFunction()
    32  	stateSinkObject.SaveValue(0, FunctionValue)
    33  	stateSinkObject.Save(1, &fs.hwCap)
    34  }
    35  
    36  func (fs *FeatureSet) afterLoad(context.Context) {}
    37  
    38  // +checklocksignore
    39  func (fs *FeatureSet) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    40  	stateSourceObject.Load(1, &fs.hwCap)
    41  	stateSourceObject.LoadValue(0, new(Static), func(y any) { fs.loadFunction(ctx, y.(Static)) })
    42  }
    43  
    44  func (i *In) StateTypeName() string {
    45  	return "pkg/cpuid.In"
    46  }
    47  
    48  func (i *In) StateFields() []string {
    49  	return []string{
    50  		"Eax",
    51  		"Ecx",
    52  	}
    53  }
    54  
    55  func (i *In) beforeSave() {}
    56  
    57  // +checklocksignore
    58  func (i *In) StateSave(stateSinkObject state.Sink) {
    59  	i.beforeSave()
    60  	stateSinkObject.Save(0, &i.Eax)
    61  	stateSinkObject.Save(1, &i.Ecx)
    62  }
    63  
    64  func (i *In) afterLoad(context.Context) {}
    65  
    66  // +checklocksignore
    67  func (i *In) StateLoad(ctx context.Context, stateSourceObject state.Source) {
    68  	stateSourceObject.Load(0, &i.Eax)
    69  	stateSourceObject.Load(1, &i.Ecx)
    70  }
    71  
    72  func (o *Out) StateTypeName() string {
    73  	return "pkg/cpuid.Out"
    74  }
    75  
    76  func (o *Out) StateFields() []string {
    77  	return []string{
    78  		"Eax",
    79  		"Ebx",
    80  		"Ecx",
    81  		"Edx",
    82  	}
    83  }
    84  
    85  func (o *Out) beforeSave() {}
    86  
    87  // +checklocksignore
    88  func (o *Out) StateSave(stateSinkObject state.Sink) {
    89  	o.beforeSave()
    90  	stateSinkObject.Save(0, &o.Eax)
    91  	stateSinkObject.Save(1, &o.Ebx)
    92  	stateSinkObject.Save(2, &o.Ecx)
    93  	stateSinkObject.Save(3, &o.Edx)
    94  }
    95  
    96  func (o *Out) afterLoad(context.Context) {}
    97  
    98  // +checklocksignore
    99  func (o *Out) StateLoad(ctx context.Context, stateSourceObject state.Source) {
   100  	stateSourceObject.Load(0, &o.Eax)
   101  	stateSourceObject.Load(1, &o.Ebx)
   102  	stateSourceObject.Load(2, &o.Ecx)
   103  	stateSourceObject.Load(3, &o.Edx)
   104  }
   105  
   106  func init() {
   107  	state.Register((*FeatureSet)(nil))
   108  	state.Register((*In)(nil))
   109  	state.Register((*Out)(nil))
   110  }