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

package loader

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

func (x *VDSO) beforeSave() {}
func (x *VDSO) save(m state.Map) {
	x.beforeSave()
	var phdrs []elfProgHeader = x.savePhdrs()
	m.SaveValue("phdrs", phdrs)
	m.Save("ParamPage", &x.ParamPage)
	m.Save("vdso", &x.vdso)
	m.Save("os", &x.os)
	m.Save("arch", &x.arch)
}

func (x *VDSO) afterLoad() {}
func (x *VDSO) load(m state.Map) {
	m.Load("ParamPage", &x.ParamPage)
	m.Load("vdso", &x.vdso)
	m.Load("os", &x.os)
	m.Load("arch", &x.arch)
	m.LoadValue("phdrs", new([]elfProgHeader), func(y interface{}) { x.loadPhdrs(y.([]elfProgHeader)) })
}

func (x *elfProgHeader) beforeSave() {}
func (x *elfProgHeader) save(m state.Map) {
	x.beforeSave()
	m.Save("Type", &x.Type)
	m.Save("Flags", &x.Flags)
	m.Save("Off", &x.Off)
	m.Save("Vaddr", &x.Vaddr)
	m.Save("Paddr", &x.Paddr)
	m.Save("Filesz", &x.Filesz)
	m.Save("Memsz", &x.Memsz)
	m.Save("Align", &x.Align)
}

func (x *elfProgHeader) afterLoad() {}
func (x *elfProgHeader) load(m state.Map) {
	m.Load("Type", &x.Type)
	m.Load("Flags", &x.Flags)
	m.Load("Off", &x.Off)
	m.Load("Vaddr", &x.Vaddr)
	m.Load("Paddr", &x.Paddr)
	m.Load("Filesz", &x.Filesz)
	m.Load("Memsz", &x.Memsz)
	m.Load("Align", &x.Align)
}

func init() {
	state.Register("loader.VDSO", (*VDSO)(nil), state.Fns{Save: (*VDSO).save, Load: (*VDSO).load})
	state.Register("loader.elfProgHeader", (*elfProgHeader)(nil), state.Fns{Save: (*elfProgHeader).save, Load: (*elfProgHeader).load})
}