summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/futex/futex_state_autogen.go
blob: e96b86d1c537040268cabae8b79e1d758e03b2f2 (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
// automatically generated by stateify.

package futex

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

func (x *AtomicPtrBucket) beforeSave() {}
func (x *AtomicPtrBucket) save(m state.Map) {
	x.beforeSave()
	var ptr *bucket = x.savePtr()
	m.SaveValue("ptr", ptr)
}

func (x *AtomicPtrBucket) afterLoad() {}
func (x *AtomicPtrBucket) load(m state.Map) {
	m.LoadValue("ptr", new(*bucket), func(y interface{}) { x.loadPtr(y.(*bucket)) })
}

func (x *bucket) beforeSave() {}
func (x *bucket) save(m state.Map) {
	x.beforeSave()
	if !state.IsZeroValue(x.waiters) {
		m.Failf("waiters is %v, expected zero", x.waiters)
	}
}

func (x *bucket) afterLoad() {}
func (x *bucket) load(m state.Map) {
}

func (x *Manager) beforeSave() {}
func (x *Manager) save(m state.Map) {
	x.beforeSave()
	if !state.IsZeroValue(x.privateBuckets) {
		m.Failf("privateBuckets is %v, expected zero", x.privateBuckets)
	}
	m.Save("sharedBucket", &x.sharedBucket)
}

func (x *Manager) afterLoad() {}
func (x *Manager) load(m state.Map) {
	m.Load("sharedBucket", &x.sharedBucket)
}

func (x *waiterList) beforeSave() {}
func (x *waiterList) save(m state.Map) {
	x.beforeSave()
	m.Save("head", &x.head)
	m.Save("tail", &x.tail)
}

func (x *waiterList) afterLoad() {}
func (x *waiterList) load(m state.Map) {
	m.Load("head", &x.head)
	m.Load("tail", &x.tail)
}

func (x *waiterEntry) beforeSave() {}
func (x *waiterEntry) save(m state.Map) {
	x.beforeSave()
	m.Save("next", &x.next)
	m.Save("prev", &x.prev)
}

func (x *waiterEntry) afterLoad() {}
func (x *waiterEntry) load(m state.Map) {
	m.Load("next", &x.next)
	m.Load("prev", &x.prev)
}

func init() {
	state.Register("futex.AtomicPtrBucket", (*AtomicPtrBucket)(nil), state.Fns{Save: (*AtomicPtrBucket).save, Load: (*AtomicPtrBucket).load})
	state.Register("futex.bucket", (*bucket)(nil), state.Fns{Save: (*bucket).save, Load: (*bucket).load})
	state.Register("futex.Manager", (*Manager)(nil), state.Fns{Save: (*Manager).save, Load: (*Manager).load})
	state.Register("futex.waiterList", (*waiterList)(nil), state.Fns{Save: (*waiterList).save, Load: (*waiterList).load})
	state.Register("futex.waiterEntry", (*waiterEntry)(nil), state.Fns{Save: (*waiterEntry).save, Load: (*waiterEntry).load})
}