github.com/noisysockets/netstack@v0.6.0/pkg/cpuid/cpuid_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package cpuid 4 5 import ( 6 "context" 7 8 "github.com/noisysockets/netstack/pkg/state" 9 ) 10 11 func (h *hwCap) StateTypeName() string { 12 return "pkg/cpuid.hwCap" 13 } 14 15 func (h *hwCap) StateFields() []string { 16 return []string{ 17 "hwCap1", 18 "hwCap2", 19 } 20 } 21 22 func (h *hwCap) beforeSave() {} 23 24 // +checklocksignore 25 func (h *hwCap) StateSave(stateSinkObject state.Sink) { 26 h.beforeSave() 27 stateSinkObject.Save(0, &h.hwCap1) 28 stateSinkObject.Save(1, &h.hwCap2) 29 } 30 31 func (h *hwCap) afterLoad(context.Context) {} 32 33 // +checklocksignore 34 func (h *hwCap) StateLoad(ctx context.Context, stateSourceObject state.Source) { 35 stateSourceObject.Load(0, &h.hwCap1) 36 stateSourceObject.Load(1, &h.hwCap2) 37 } 38 39 func init() { 40 state.Register((*hwCap)(nil)) 41 }