summaryrefslogtreecommitdiffhomepage
path: root/pkg/cpuid/cpuid_x86_state_autogen.go
blob: ec639ae386a514f17153094ebe5385425fb1e986 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// automatically generated by stateify.

//go:build 386 || amd64
// +build 386 amd64

package cpuid

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

func (c *Cache) StateTypeName() string {
	return "pkg/cpuid.Cache"
}

func (c *Cache) StateFields() []string {
	return []string{
		"Level",
		"Type",
		"FullyAssociative",
		"Partitions",
		"Ways",
		"Sets",
		"InvalidateHierarchical",
		"Inclusive",
		"DirectMapped",
	}
}

func (c *Cache) beforeSave() {}

// +checklocksignore
func (c *Cache) StateSave(stateSinkObject state.Sink) {
	c.beforeSave()
	stateSinkObject.Save(0, &c.Level)
	stateSinkObject.Save(1, &c.Type)
	stateSinkObject.Save(2, &c.FullyAssociative)
	stateSinkObject.Save(3, &c.Partitions)
	stateSinkObject.Save(4, &c.Ways)
	stateSinkObject.Save(5, &c.Sets)
	stateSinkObject.Save(6, &c.InvalidateHierarchical)
	stateSinkObject.Save(7, &c.Inclusive)
	stateSinkObject.Save(8, &c.DirectMapped)
}

func (c *Cache) afterLoad() {}

// +checklocksignore
func (c *Cache) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &c.Level)
	stateSourceObject.Load(1, &c.Type)
	stateSourceObject.Load(2, &c.FullyAssociative)
	stateSourceObject.Load(3, &c.Partitions)
	stateSourceObject.Load(4, &c.Ways)
	stateSourceObject.Load(5, &c.Sets)
	stateSourceObject.Load(6, &c.InvalidateHierarchical)
	stateSourceObject.Load(7, &c.Inclusive)
	stateSourceObject.Load(8, &c.DirectMapped)
}

func (fs *FeatureSet) StateTypeName() string {
	return "pkg/cpuid.FeatureSet"
}

func (fs *FeatureSet) StateFields() []string {
	return []string{
		"Set",
		"VendorID",
		"ExtendedFamily",
		"ExtendedModel",
		"ProcessorType",
		"Family",
		"Model",
		"SteppingID",
		"Caches",
		"CacheLine",
	}
}

func (fs *FeatureSet) beforeSave() {}

// +checklocksignore
func (fs *FeatureSet) StateSave(stateSinkObject state.Sink) {
	fs.beforeSave()
	stateSinkObject.Save(0, &fs.Set)
	stateSinkObject.Save(1, &fs.VendorID)
	stateSinkObject.Save(2, &fs.ExtendedFamily)
	stateSinkObject.Save(3, &fs.ExtendedModel)
	stateSinkObject.Save(4, &fs.ProcessorType)
	stateSinkObject.Save(5, &fs.Family)
	stateSinkObject.Save(6, &fs.Model)
	stateSinkObject.Save(7, &fs.SteppingID)
	stateSinkObject.Save(8, &fs.Caches)
	stateSinkObject.Save(9, &fs.CacheLine)
}

func (fs *FeatureSet) afterLoad() {}

// +checklocksignore
func (fs *FeatureSet) StateLoad(stateSourceObject state.Source) {
	stateSourceObject.Load(0, &fs.Set)
	stateSourceObject.Load(1, &fs.VendorID)
	stateSourceObject.Load(2, &fs.ExtendedFamily)
	stateSourceObject.Load(3, &fs.ExtendedModel)
	stateSourceObject.Load(4, &fs.ProcessorType)
	stateSourceObject.Load(5, &fs.Family)
	stateSourceObject.Load(6, &fs.Model)
	stateSourceObject.Load(7, &fs.SteppingID)
	stateSourceObject.Load(8, &fs.Caches)
	stateSourceObject.Load(9, &fs.CacheLine)
}

func init() {
	state.Register((*Cache)(nil))
	state.Register((*FeatureSet)(nil))
}