// automatically generated by stateify.

//go:build (amd64 || 386) && !false
// +build amd64 386
// +build !false

package arch

import (
	"context"

	"gvisor.dev/gvisor/pkg/state"
)

func (s *State) StateTypeName() string {
	return "pkg/sentry/arch.State"
}

func (s *State) StateFields() []string {
	return []string{
		"Regs",
		"fpState",
	}
}

func (s *State) beforeSave() {}

// +checklocksignore
func (s *State) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.Regs)
	stateSinkObject.Save(1, &s.fpState)
}

// +checklocksignore
func (s *State) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.Regs)
	stateSourceObject.LoadWait(1, &s.fpState)
	stateSourceObject.AfterLoad(func() { s.afterLoad(ctx) })
}

func init() {
	state.Register((*State)(nil))
}
