summaryrefslogtreecommitdiffhomepage
path: root/pkg/cpuid/cpuid_x86_state_autogen.go
blob: 14b26bef7adc881fb5f24565027d31d0431e74a5 (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
// automatically generated by stateify.

// +build 386 amd64

package cpuid

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

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

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

func (x *Cache) beforeSave() {}

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

func (x *Cache) afterLoad() {}

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

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

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

func (x *FeatureSet) beforeSave() {}

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

func (x *FeatureSet) afterLoad() {}

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

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