summaryrefslogtreecommitdiffhomepage
path: root/pkg/usermem/usermem_state_autogen.go
blob: ca20355048bc4cb16f13030850f74a0ac516ba81 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// automatically generated by stateify.

package usermem

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

func (a *AccessType) StateTypeName() string {
	return "pkg/usermem.AccessType"
}

func (a *AccessType) StateFields() []string {
	return []string{
		"Read",
		"Write",
		"Execute",
	}
}

func (a *AccessType) beforeSave() {}

func (a *AccessType) StateSave(stateSinkObject state.Sink) {
	a.beforeSave()
	stateSinkObject.Save(0, &a.Read)
	stateSinkObject.Save(1, &a.Write)
	stateSinkObject.Save(2, &a.Execute)
}

func (a *AccessType) afterLoad() {}

func (a *AccessType) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &a.Read)
	stateSourceObject.Load(1, &a.Write)
	stateSourceObject.Load(2, &a.Execute)
}

func (v *Addr) StateTypeName() string {
	return "pkg/usermem.Addr"
}

func (v *Addr) StateFields() []string {
	return nil
}

func (r *AddrRange) StateTypeName() string {
	return "pkg/usermem.AddrRange"
}

func (r *AddrRange) StateFields() []string {
	return []string{
		"Start",
		"End",
	}
}

func (r *AddrRange) beforeSave() {}

func (r *AddrRange) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.Start)
	stateSinkObject.Save(1, &r.End)
}

func (r *AddrRange) afterLoad() {}

func (r *AddrRange) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.Start)
	stateSourceObject.Load(1, &r.End)
}

func init() {
	state.Register((*AccessType)(nil))
	state.Register((*Addr)(nil))
	state.Register((*AddrRange)(nil))
}