summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/memmap/memmap_state_autogen.go
blob: 42009f82a4668c48afa85c08bafbcc8fc58c60fd (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// automatically generated by stateify.

package memmap

import (
	"gvisor.googlesource.com/gvisor/pkg/state"
)

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

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

func (x *MappingOfRange) beforeSave() {}
func (x *MappingOfRange) save(m state.Map) {
	x.beforeSave()
	m.Save("MappingSpace", &x.MappingSpace)
	m.Save("AddrRange", &x.AddrRange)
	m.Save("Writable", &x.Writable)
}

func (x *MappingOfRange) afterLoad() {}
func (x *MappingOfRange) load(m state.Map) {
	m.Load("MappingSpace", &x.MappingSpace)
	m.Load("AddrRange", &x.AddrRange)
	m.Load("Writable", &x.Writable)
}

func (x *MappingSet) beforeSave() {}
func (x *MappingSet) save(m state.Map) {
	x.beforeSave()
	var root *MappingSegmentDataSlices = x.saveRoot()
	m.SaveValue("root", root)
}

func (x *MappingSet) afterLoad() {}
func (x *MappingSet) load(m state.Map) {
	m.LoadValue("root", new(*MappingSegmentDataSlices), func(y interface{}) { x.loadRoot(y.(*MappingSegmentDataSlices)) })
}

func (x *Mappingnode) beforeSave() {}
func (x *Mappingnode) save(m state.Map) {
	x.beforeSave()
	m.Save("nrSegments", &x.nrSegments)
	m.Save("parent", &x.parent)
	m.Save("parentIndex", &x.parentIndex)
	m.Save("hasChildren", &x.hasChildren)
	m.Save("keys", &x.keys)
	m.Save("values", &x.values)
	m.Save("children", &x.children)
}

func (x *Mappingnode) afterLoad() {}
func (x *Mappingnode) load(m state.Map) {
	m.Load("nrSegments", &x.nrSegments)
	m.Load("parent", &x.parent)
	m.Load("parentIndex", &x.parentIndex)
	m.Load("hasChildren", &x.hasChildren)
	m.Load("keys", &x.keys)
	m.Load("values", &x.values)
	m.Load("children", &x.children)
}

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

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

func init() {
	state.Register("memmap.MappableRange", (*MappableRange)(nil), state.Fns{Save: (*MappableRange).save, Load: (*MappableRange).load})
	state.Register("memmap.MappingOfRange", (*MappingOfRange)(nil), state.Fns{Save: (*MappingOfRange).save, Load: (*MappingOfRange).load})
	state.Register("memmap.MappingSet", (*MappingSet)(nil), state.Fns{Save: (*MappingSet).save, Load: (*MappingSet).load})
	state.Register("memmap.Mappingnode", (*Mappingnode)(nil), state.Fns{Save: (*Mappingnode).save, Load: (*Mappingnode).load})
	state.Register("memmap.MappingSegmentDataSlices", (*MappingSegmentDataSlices)(nil), state.Fns{Save: (*MappingSegmentDataSlices).save, Load: (*MappingSegmentDataSlices).load})
}