github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/pkg/sentry/arch/arch_x86_impl_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 //go:build (amd64 || 386) && !false 4 // +build amd64 386 5 // +build !false 6 7 package arch 8 9 import ( 10 "context" 11 12 "github.com/metacubex/gvisor/pkg/state" 13 ) 14 15 func (s *State) StateTypeName() string { 16 return "pkg/sentry/arch.State" 17 } 18 19 func (s *State) StateFields() []string { 20 return []string{ 21 "Regs", 22 "fpState", 23 } 24 } 25 26 func (s *State) beforeSave() {} 27 28 // +checklocksignore 29 func (s *State) StateSave(stateSinkObject state.Sink) { 30 s.beforeSave() 31 stateSinkObject.Save(0, &s.Regs) 32 stateSinkObject.Save(1, &s.fpState) 33 } 34 35 // +checklocksignore 36 func (s *State) StateLoad(ctx context.Context, stateSourceObject state.Source) { 37 stateSourceObject.Load(0, &s.Regs) 38 stateSourceObject.LoadWait(1, &s.fpState) 39 stateSourceObject.AfterLoad(func() { s.afterLoad(ctx) }) 40 } 41 42 func init() { 43 state.Register((*State)(nil)) 44 }