github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/sentry/kernel/semaphore/semaphore_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 package semaphore 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/state" 7 ) 8 9 func (r *Registry) StateTypeName() string { 10 return "pkg/sentry/kernel/semaphore.Registry" 11 } 12 13 func (r *Registry) StateFields() []string { 14 return []string{ 15 "reg", 16 "indexes", 17 } 18 } 19 20 func (r *Registry) beforeSave() {} 21 22 // +checklocksignore 23 func (r *Registry) StateSave(stateSinkObject state.Sink) { 24 r.beforeSave() 25 stateSinkObject.Save(0, &r.reg) 26 stateSinkObject.Save(1, &r.indexes) 27 } 28 29 func (r *Registry) afterLoad() {} 30 31 // +checklocksignore 32 func (r *Registry) StateLoad(stateSourceObject state.Source) { 33 stateSourceObject.Load(0, &r.reg) 34 stateSourceObject.Load(1, &r.indexes) 35 } 36 37 func (s *Set) StateTypeName() string { 38 return "pkg/sentry/kernel/semaphore.Set" 39 } 40 41 func (s *Set) StateFields() []string { 42 return []string{ 43 "registry", 44 "obj", 45 "opTime", 46 "changeTime", 47 "sems", 48 "dead", 49 } 50 } 51 52 func (s *Set) beforeSave() {} 53 54 // +checklocksignore 55 func (s *Set) StateSave(stateSinkObject state.Sink) { 56 s.beforeSave() 57 stateSinkObject.Save(0, &s.registry) 58 stateSinkObject.Save(1, &s.obj) 59 stateSinkObject.Save(2, &s.opTime) 60 stateSinkObject.Save(3, &s.changeTime) 61 stateSinkObject.Save(4, &s.sems) 62 stateSinkObject.Save(5, &s.dead) 63 } 64 65 func (s *Set) afterLoad() {} 66 67 // +checklocksignore 68 func (s *Set) StateLoad(stateSourceObject state.Source) { 69 stateSourceObject.Load(0, &s.registry) 70 stateSourceObject.Load(1, &s.obj) 71 stateSourceObject.Load(2, &s.opTime) 72 stateSourceObject.Load(3, &s.changeTime) 73 stateSourceObject.Load(4, &s.sems) 74 stateSourceObject.Load(5, &s.dead) 75 } 76 77 func (s *sem) StateTypeName() string { 78 return "pkg/sentry/kernel/semaphore.sem" 79 } 80 81 func (s *sem) StateFields() []string { 82 return []string{ 83 "value", 84 "pid", 85 } 86 } 87 88 func (s *sem) beforeSave() {} 89 90 // +checklocksignore 91 func (s *sem) StateSave(stateSinkObject state.Sink) { 92 s.beforeSave() 93 if !state.IsZeroValue(&s.waiters) { 94 state.Failf("waiters is %#v, expected zero", &s.waiters) 95 } 96 stateSinkObject.Save(0, &s.value) 97 stateSinkObject.Save(1, &s.pid) 98 } 99 100 func (s *sem) afterLoad() {} 101 102 // +checklocksignore 103 func (s *sem) StateLoad(stateSourceObject state.Source) { 104 stateSourceObject.Load(0, &s.value) 105 stateSourceObject.Load(1, &s.pid) 106 } 107 108 func (w *waiter) StateTypeName() string { 109 return "pkg/sentry/kernel/semaphore.waiter" 110 } 111 112 func (w *waiter) StateFields() []string { 113 return []string{ 114 "waiterEntry", 115 "value", 116 "ch", 117 } 118 } 119 120 func (w *waiter) beforeSave() {} 121 122 // +checklocksignore 123 func (w *waiter) StateSave(stateSinkObject state.Sink) { 124 w.beforeSave() 125 stateSinkObject.Save(0, &w.waiterEntry) 126 stateSinkObject.Save(1, &w.value) 127 stateSinkObject.Save(2, &w.ch) 128 } 129 130 func (w *waiter) afterLoad() {} 131 132 // +checklocksignore 133 func (w *waiter) StateLoad(stateSourceObject state.Source) { 134 stateSourceObject.Load(0, &w.waiterEntry) 135 stateSourceObject.Load(1, &w.value) 136 stateSourceObject.Load(2, &w.ch) 137 } 138 139 func (l *waiterList) StateTypeName() string { 140 return "pkg/sentry/kernel/semaphore.waiterList" 141 } 142 143 func (l *waiterList) StateFields() []string { 144 return []string{ 145 "head", 146 "tail", 147 } 148 } 149 150 func (l *waiterList) beforeSave() {} 151 152 // +checklocksignore 153 func (l *waiterList) StateSave(stateSinkObject state.Sink) { 154 l.beforeSave() 155 stateSinkObject.Save(0, &l.head) 156 stateSinkObject.Save(1, &l.tail) 157 } 158 159 func (l *waiterList) afterLoad() {} 160 161 // +checklocksignore 162 func (l *waiterList) StateLoad(stateSourceObject state.Source) { 163 stateSourceObject.Load(0, &l.head) 164 stateSourceObject.Load(1, &l.tail) 165 } 166 167 func (e *waiterEntry) StateTypeName() string { 168 return "pkg/sentry/kernel/semaphore.waiterEntry" 169 } 170 171 func (e *waiterEntry) StateFields() []string { 172 return []string{ 173 "next", 174 "prev", 175 } 176 } 177 178 func (e *waiterEntry) beforeSave() {} 179 180 // +checklocksignore 181 func (e *waiterEntry) StateSave(stateSinkObject state.Sink) { 182 e.beforeSave() 183 stateSinkObject.Save(0, &e.next) 184 stateSinkObject.Save(1, &e.prev) 185 } 186 187 func (e *waiterEntry) afterLoad() {} 188 189 // +checklocksignore 190 func (e *waiterEntry) StateLoad(stateSourceObject state.Source) { 191 stateSourceObject.Load(0, &e.next) 192 stateSourceObject.Load(1, &e.prev) 193 } 194 195 func init() { 196 state.Register((*Registry)(nil)) 197 state.Register((*Set)(nil)) 198 state.Register((*sem)(nil)) 199 state.Register((*waiter)(nil)) 200 state.Register((*waiterList)(nil)) 201 state.Register((*waiterEntry)(nil)) 202 }