github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/atomicbitops/atomicbitops_32bit_state_autogen.go (about) 1 // automatically generated by stateify. 2 3 //go:build arm || mips || mipsle || 386 4 // +build arm mips mipsle 386 5 6 package atomicbitops 7 8 import ( 9 "context" 10 11 "github.com/sagernet/gvisor/pkg/state" 12 ) 13 14 func (i *Int32) StateTypeName() string { 15 return "pkg/atomicbitops.Int32" 16 } 17 18 func (i *Int32) StateFields() []string { 19 return []string{ 20 "value", 21 } 22 } 23 24 func (i *Int32) beforeSave() {} 25 26 // +checklocksignore 27 func (i *Int32) StateSave(stateSinkObject state.Sink) { 28 i.beforeSave() 29 stateSinkObject.Save(0, &i.value) 30 } 31 32 func (i *Int32) afterLoad(context.Context) {} 33 34 // +checklocksignore 35 func (i *Int32) StateLoad(ctx context.Context, stateSourceObject state.Source) { 36 stateSourceObject.Load(0, &i.value) 37 } 38 39 func (u *Uint32) StateTypeName() string { 40 return "pkg/atomicbitops.Uint32" 41 } 42 43 func (u *Uint32) StateFields() []string { 44 return []string{ 45 "value", 46 } 47 } 48 49 func (u *Uint32) beforeSave() {} 50 51 // +checklocksignore 52 func (u *Uint32) StateSave(stateSinkObject state.Sink) { 53 u.beforeSave() 54 stateSinkObject.Save(0, &u.value) 55 } 56 57 func (u *Uint32) afterLoad(context.Context) {} 58 59 // +checklocksignore 60 func (u *Uint32) StateLoad(ctx context.Context, stateSourceObject state.Source) { 61 stateSourceObject.Load(0, &u.value) 62 } 63 64 func (b *Bool) StateTypeName() string { 65 return "pkg/atomicbitops.Bool" 66 } 67 68 func (b *Bool) StateFields() []string { 69 return []string{ 70 "Uint32", 71 } 72 } 73 74 func (b *Bool) beforeSave() {} 75 76 // +checklocksignore 77 func (b *Bool) StateSave(stateSinkObject state.Sink) { 78 b.beforeSave() 79 stateSinkObject.Save(0, &b.Uint32) 80 } 81 82 func (b *Bool) afterLoad(context.Context) {} 83 84 // +checklocksignore 85 func (b *Bool) StateLoad(ctx context.Context, stateSourceObject state.Source) { 86 stateSourceObject.Load(0, &b.Uint32) 87 } 88 89 func init() { 90 state.Register((*Int32)(nil)) 91 state.Register((*Uint32)(nil)) 92 state.Register((*Bool)(nil)) 93 }