summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/loader/loader_state_autogen.go
blob: 1b306bc6a35434ae50536d3ba4b0e5c4f595911c (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
// automatically generated by stateify.

package loader

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

func (x *VDSO) StateTypeName() string {
	return "pkg/sentry/loader.VDSO"
}

func (x *VDSO) StateFields() []string {
	return []string{
		"ParamPage",
		"vdso",
		"os",
		"arch",
		"phdrs",
	}
}

func (x *VDSO) beforeSave() {}

func (x *VDSO) StateSave(m state.Sink) {
	x.beforeSave()
	var phdrs []elfProgHeader = x.savePhdrs()
	m.SaveValue(4, phdrs)
	m.Save(0, &x.ParamPage)
	m.Save(1, &x.vdso)
	m.Save(2, &x.os)
	m.Save(3, &x.arch)
}

func (x *VDSO) afterLoad() {}

func (x *VDSO) StateLoad(m state.Source) {
	m.Load(0, &x.ParamPage)
	m.Load(1, &x.vdso)
	m.Load(2, &x.os)
	m.Load(3, &x.arch)
	m.LoadValue(4, new([]elfProgHeader), func(y interface{}) { x.loadPhdrs(y.([]elfProgHeader)) })
}

func (x *elfProgHeader) StateTypeName() string {
	return "pkg/sentry/loader.elfProgHeader"
}

func (x *elfProgHeader) StateFields() []string {
	return []string{
		"Type",
		"Flags",
		"Off",
		"Vaddr",
		"Paddr",
		"Filesz",
		"Memsz",
		"Align",
	}
}

func (x *elfProgHeader) beforeSave() {}

func (x *elfProgHeader) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.Type)
	m.Save(1, &x.Flags)
	m.Save(2, &x.Off)
	m.Save(3, &x.Vaddr)
	m.Save(4, &x.Paddr)
	m.Save(5, &x.Filesz)
	m.Save(6, &x.Memsz)
	m.Save(7, &x.Align)
}

func (x *elfProgHeader) afterLoad() {}

func (x *elfProgHeader) StateLoad(m state.Source) {
	m.Load(0, &x.Type)
	m.Load(1, &x.Flags)
	m.Load(2, &x.Off)
	m.Load(3, &x.Vaddr)
	m.Load(4, &x.Paddr)
	m.Load(5, &x.Filesz)
	m.Load(6, &x.Memsz)
	m.Load(7, &x.Align)
}

func init() {
	state.Register((*VDSO)(nil))
	state.Register((*elfProgHeader)(nil))
}