// automatically generated by stateify.

package arch

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

func (m *MmapLayout) StateTypeName() string {
	return "pkg/sentry/arch.MmapLayout"
}

func (m *MmapLayout) StateFields() []string {
	return []string{
		"MinAddr",
		"MaxAddr",
		"BottomUpBase",
		"TopDownBase",
		"DefaultDirection",
		"MaxStackRand",
	}
}

func (m *MmapLayout) beforeSave() {}

// +checklocksignore
func (m *MmapLayout) StateSave(stateSinkObject state.Sink) {
	m.beforeSave()
	stateSinkObject.Save(0, &m.MinAddr)
	stateSinkObject.Save(1, &m.MaxAddr)
	stateSinkObject.Save(2, &m.BottomUpBase)
	stateSinkObject.Save(3, &m.TopDownBase)
	stateSinkObject.Save(4, &m.DefaultDirection)
	stateSinkObject.Save(5, &m.MaxStackRand)
}

func (m *MmapLayout) afterLoad() {}

// +checklocksignore
func (m *MmapLayout) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &m.MinAddr)
	stateSourceObject.Load(1, &m.MaxAddr)
	stateSourceObject.Load(2, &m.BottomUpBase)
	stateSourceObject.Load(3, &m.TopDownBase)
	stateSourceObject.Load(4, &m.DefaultDirection)
	stateSourceObject.Load(5, &m.MaxStackRand)
}

func (a *AuxEntry) StateTypeName() string {
	return "pkg/sentry/arch.AuxEntry"
}

func (a *AuxEntry) StateFields() []string {
	return []string{
		"Key",
		"Value",
	}
}

func (a *AuxEntry) beforeSave() {}

// +checklocksignore
func (a *AuxEntry) StateSave(stateSinkObject state.Sink) {
	a.beforeSave()
	stateSinkObject.Save(0, &a.Key)
	stateSinkObject.Save(1, &a.Value)
}

func (a *AuxEntry) afterLoad() {}

// +checklocksignore
func (a *AuxEntry) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &a.Key)
	stateSourceObject.Load(1, &a.Value)
}

func init() {
	state.Register((*MmapLayout)(nil))
	state.Register((*AuxEntry)(nil))
}
