// automatically generated by stateify.

package nvgpu

import (
	"context"

	"github.com/sagernet/gvisor/pkg/state"
)

func (n *NVOS64_PARAMETERS) StateTypeName() string {
	return "pkg/abi/nvgpu.NVOS64_PARAMETERS"
}

func (n *NVOS64_PARAMETERS) StateFields() []string {
	return []string{
		"HRoot",
		"HObjectParent",
		"HObjectNew",
		"HClass",
		"PAllocParms",
		"PRightsRequested",
		"ParamsSize",
		"Flags",
		"Status",
	}
}

func (n *NVOS64_PARAMETERS) beforeSave() {}

// +checklocksignore
func (n *NVOS64_PARAMETERS) StateSave(stateSinkObject state.Sink) {
	n.beforeSave()
	stateSinkObject.Save(0, &n.HRoot)
	stateSinkObject.Save(1, &n.HObjectParent)
	stateSinkObject.Save(2, &n.HObjectNew)
	stateSinkObject.Save(3, &n.HClass)
	stateSinkObject.Save(4, &n.PAllocParms)
	stateSinkObject.Save(5, &n.PRightsRequested)
	stateSinkObject.Save(6, &n.ParamsSize)
	stateSinkObject.Save(7, &n.Flags)
	stateSinkObject.Save(8, &n.Status)
}

func (n *NVOS64_PARAMETERS) afterLoad(context.Context) {}

// +checklocksignore
func (n *NVOS64_PARAMETERS) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &n.HRoot)
	stateSourceObject.Load(1, &n.HObjectParent)
	stateSourceObject.Load(2, &n.HObjectNew)
	stateSourceObject.Load(3, &n.HClass)
	stateSourceObject.Load(4, &n.PAllocParms)
	stateSourceObject.Load(5, &n.PRightsRequested)
	stateSourceObject.Load(6, &n.ParamsSize)
	stateSourceObject.Load(7, &n.Flags)
	stateSourceObject.Load(8, &n.Status)
}

func (h *Handle) StateTypeName() string {
	return "pkg/abi/nvgpu.Handle"
}

func (h *Handle) StateFields() []string {
	return []string{
		"Val",
	}
}

func (h *Handle) beforeSave() {}

// +checklocksignore
func (h *Handle) StateSave(stateSinkObject state.Sink) {
	h.beforeSave()
	stateSinkObject.Save(0, &h.Val)
}

func (h *Handle) afterLoad(context.Context) {}

// +checklocksignore
func (h *Handle) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &h.Val)
}

func (r *RS_ACCESS_MASK) StateTypeName() string {
	return "pkg/abi/nvgpu.RS_ACCESS_MASK"
}

func (r *RS_ACCESS_MASK) StateFields() []string {
	return []string{
		"Limbs",
	}
}

func (r *RS_ACCESS_MASK) beforeSave() {}

// +checklocksignore
func (r *RS_ACCESS_MASK) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.Limbs)
}

func (r *RS_ACCESS_MASK) afterLoad(context.Context) {}

// +checklocksignore
func (r *RS_ACCESS_MASK) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.Limbs)
}

func init() {
	state.Register((*NVOS64_PARAMETERS)(nil))
	state.Register((*Handle)(nil))
	state.Register((*RS_ACCESS_MASK)(nil))
}
