summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/time/time_state_autogen.go
blob: 1a30539f052d389fde5abe88eae8c1ff4572ec85 (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
94
95
96
97
// automatically generated by stateify.

package time

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

func (t *Time) StateTypeName() string {
	return "pkg/sentry/kernel/time.Time"
}

func (t *Time) StateFields() []string {
	return []string{
		"ns",
	}
}

func (t *Time) beforeSave() {}

func (t *Time) StateSave(stateSinkObject state.Sink) {
	t.beforeSave()
	stateSinkObject.Save(0, &t.ns)
}

func (t *Time) afterLoad() {}

func (t *Time) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &t.ns)
}

func (s *Setting) StateTypeName() string {
	return "pkg/sentry/kernel/time.Setting"
}

func (s *Setting) StateFields() []string {
	return []string{
		"Enabled",
		"Next",
		"Period",
	}
}

func (s *Setting) beforeSave() {}

func (s *Setting) StateSave(stateSinkObject state.Sink) {
	s.beforeSave()
	stateSinkObject.Save(0, &s.Enabled)
	stateSinkObject.Save(1, &s.Next)
	stateSinkObject.Save(2, &s.Period)
}

func (s *Setting) afterLoad() {}

func (s *Setting) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &s.Enabled)
	stateSourceObject.Load(1, &s.Next)
	stateSourceObject.Load(2, &s.Period)
}

func (t *Timer) StateTypeName() string {
	return "pkg/sentry/kernel/time.Timer"
}

func (t *Timer) StateFields() []string {
	return []string{
		"clock",
		"listener",
		"setting",
		"paused",
	}
}

func (t *Timer) beforeSave() {}

func (t *Timer) StateSave(stateSinkObject state.Sink) {
	t.beforeSave()
	stateSinkObject.Save(0, &t.clock)
	stateSinkObject.Save(1, &t.listener)
	stateSinkObject.Save(2, &t.setting)
	stateSinkObject.Save(3, &t.paused)
}

func (t *Timer) afterLoad() {}

func (t *Timer) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &t.clock)
	stateSourceObject.Load(1, &t.listener)
	stateSourceObject.Load(2, &t.setting)
	stateSourceObject.Load(3, &t.paused)
}

func init() {
	state.Register((*Time)(nil))
	state.Register((*Setting)(nil))
	state.Register((*Timer)(nil))
}