summaryrefslogtreecommitdiffhomepage
path: root/pkg/usermem/usermem_state_autogen.go
blob: a93af5eaa5ebee730910718049b366176a8050a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// automatically generated by stateify.

// +build amd64 i386

package usermem

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

func (x *AccessType) beforeSave() {}
func (x *AccessType) save(m state.Map) {
	x.beforeSave()
	m.Save("Read", &x.Read)
	m.Save("Write", &x.Write)
	m.Save("Execute", &x.Execute)
}

func (x *AccessType) afterLoad() {}
func (x *AccessType) load(m state.Map) {
	m.Load("Read", &x.Read)
	m.Load("Write", &x.Write)
	m.Load("Execute", &x.Execute)
}

func (x *Addr) save(m state.Map) {
	m.SaveValue("", (uintptr)(*x))
}

func (x *Addr) load(m state.Map) {
	m.LoadValue("", new(uintptr), func(y interface{}) { *x = (Addr)(y.(uintptr)) })
}

func (x *AddrRange) beforeSave() {}
func (x *AddrRange) save(m state.Map) {
	x.beforeSave()
	m.Save("Start", &x.Start)
	m.Save("End", &x.End)
}

func (x *AddrRange) afterLoad() {}
func (x *AddrRange) load(m state.Map) {
	m.Load("Start", &x.Start)
	m.Load("End", &x.End)
}

func init() {
	state.Register("pkg/usermem.AccessType", (*AccessType)(nil), state.Fns{Save: (*AccessType).save, Load: (*AccessType).load})
	state.Register("pkg/usermem.Addr", (*Addr)(nil), state.Fns{Save: (*Addr).save, Load: (*Addr).load})
	state.Register("pkg/usermem.AddrRange", (*AddrRange)(nil), state.Fns{Save: (*AddrRange).save, Load: (*AddrRange).load})
}