diff options
Diffstat (limited to 'pkg/sentry/arch')
-rw-r--r-- | pkg/sentry/arch/arch_amd64_state_autogen.go | 27 | ||||
-rw-r--r-- | pkg/sentry/arch/arch_state_autogen.go | 180 | ||||
-rw-r--r-- | pkg/sentry/arch/arch_x86_impl_state_autogen.go | 31 |
3 files changed, 169 insertions, 69 deletions
diff --git a/pkg/sentry/arch/arch_amd64_state_autogen.go b/pkg/sentry/arch/arch_amd64_state_autogen.go index 73c523c90..a6afbbb53 100644 --- a/pkg/sentry/arch/arch_amd64_state_autogen.go +++ b/pkg/sentry/arch/arch_amd64_state_autogen.go @@ -10,19 +10,32 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *context64) StateTypeName() string { + return "pkg/sentry/arch.context64" +} + +func (x *context64) StateFields() []string { + return []string{ + "State", + "sigFPState", + } +} + func (x *context64) beforeSave() {} -func (x *context64) save(m state.Map) { + +func (x *context64) StateSave(m state.Sink) { x.beforeSave() - m.Save("State", &x.State) - m.Save("sigFPState", &x.sigFPState) + m.Save(0, &x.State) + m.Save(1, &x.sigFPState) } func (x *context64) afterLoad() {} -func (x *context64) load(m state.Map) { - m.Load("State", &x.State) - m.Load("sigFPState", &x.sigFPState) + +func (x *context64) StateLoad(m state.Source) { + m.Load(0, &x.State) + m.Load(1, &x.sigFPState) } func init() { - state.Register("pkg/sentry/arch.context64", (*context64)(nil), state.Fns{Save: (*context64).save, Load: (*context64).load}) + state.Register((*context64)(nil)) } diff --git a/pkg/sentry/arch/arch_state_autogen.go b/pkg/sentry/arch/arch_state_autogen.go index 82f4d9d73..b29124813 100644 --- a/pkg/sentry/arch/arch_state_autogen.go +++ b/pkg/sentry/arch/arch_state_autogen.go @@ -8,93 +8,167 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *MmapLayout) StateTypeName() string { + return "pkg/sentry/arch.MmapLayout" +} + +func (x *MmapLayout) StateFields() []string { + return []string{ + "MinAddr", + "MaxAddr", + "BottomUpBase", + "TopDownBase", + "DefaultDirection", + "MaxStackRand", + } +} + func (x *MmapLayout) beforeSave() {} -func (x *MmapLayout) save(m state.Map) { + +func (x *MmapLayout) StateSave(m state.Sink) { x.beforeSave() - m.Save("MinAddr", &x.MinAddr) - m.Save("MaxAddr", &x.MaxAddr) - m.Save("BottomUpBase", &x.BottomUpBase) - m.Save("TopDownBase", &x.TopDownBase) - m.Save("DefaultDirection", &x.DefaultDirection) - m.Save("MaxStackRand", &x.MaxStackRand) + m.Save(0, &x.MinAddr) + m.Save(1, &x.MaxAddr) + m.Save(2, &x.BottomUpBase) + m.Save(3, &x.TopDownBase) + m.Save(4, &x.DefaultDirection) + m.Save(5, &x.MaxStackRand) } func (x *MmapLayout) afterLoad() {} -func (x *MmapLayout) load(m state.Map) { - m.Load("MinAddr", &x.MinAddr) - m.Load("MaxAddr", &x.MaxAddr) - m.Load("BottomUpBase", &x.BottomUpBase) - m.Load("TopDownBase", &x.TopDownBase) - m.Load("DefaultDirection", &x.DefaultDirection) - m.Load("MaxStackRand", &x.MaxStackRand) + +func (x *MmapLayout) StateLoad(m state.Source) { + m.Load(0, &x.MinAddr) + m.Load(1, &x.MaxAddr) + m.Load(2, &x.BottomUpBase) + m.Load(3, &x.TopDownBase) + m.Load(4, &x.DefaultDirection) + m.Load(5, &x.MaxStackRand) +} + +func (x *AuxEntry) StateTypeName() string { + return "pkg/sentry/arch.AuxEntry" +} + +func (x *AuxEntry) StateFields() []string { + return []string{ + "Key", + "Value", + } } func (x *AuxEntry) beforeSave() {} -func (x *AuxEntry) save(m state.Map) { + +func (x *AuxEntry) StateSave(m state.Sink) { x.beforeSave() - m.Save("Key", &x.Key) - m.Save("Value", &x.Value) + m.Save(0, &x.Key) + m.Save(1, &x.Value) } func (x *AuxEntry) afterLoad() {} -func (x *AuxEntry) load(m state.Map) { - m.Load("Key", &x.Key) - m.Load("Value", &x.Value) + +func (x *AuxEntry) StateLoad(m state.Source) { + m.Load(0, &x.Key) + m.Load(1, &x.Value) +} + +func (x *SignalAct) StateTypeName() string { + return "pkg/sentry/arch.SignalAct" +} + +func (x *SignalAct) StateFields() []string { + return []string{ + "Handler", + "Flags", + "Restorer", + "Mask", + } } func (x *SignalAct) beforeSave() {} -func (x *SignalAct) save(m state.Map) { + +func (x *SignalAct) StateSave(m state.Sink) { x.beforeSave() - m.Save("Handler", &x.Handler) - m.Save("Flags", &x.Flags) - m.Save("Restorer", &x.Restorer) - m.Save("Mask", &x.Mask) + m.Save(0, &x.Handler) + m.Save(1, &x.Flags) + m.Save(2, &x.Restorer) + m.Save(3, &x.Mask) } func (x *SignalAct) afterLoad() {} -func (x *SignalAct) load(m state.Map) { - m.Load("Handler", &x.Handler) - m.Load("Flags", &x.Flags) - m.Load("Restorer", &x.Restorer) - m.Load("Mask", &x.Mask) + +func (x *SignalAct) StateLoad(m state.Source) { + m.Load(0, &x.Handler) + m.Load(1, &x.Flags) + m.Load(2, &x.Restorer) + m.Load(3, &x.Mask) +} + +func (x *SignalStack) StateTypeName() string { + return "pkg/sentry/arch.SignalStack" +} + +func (x *SignalStack) StateFields() []string { + return []string{ + "Addr", + "Flags", + "Size", + } } func (x *SignalStack) beforeSave() {} -func (x *SignalStack) save(m state.Map) { + +func (x *SignalStack) StateSave(m state.Sink) { x.beforeSave() - m.Save("Addr", &x.Addr) - m.Save("Flags", &x.Flags) - m.Save("Size", &x.Size) + m.Save(0, &x.Addr) + m.Save(1, &x.Flags) + m.Save(2, &x.Size) } func (x *SignalStack) afterLoad() {} -func (x *SignalStack) load(m state.Map) { - m.Load("Addr", &x.Addr) - m.Load("Flags", &x.Flags) - m.Load("Size", &x.Size) + +func (x *SignalStack) StateLoad(m state.Source) { + m.Load(0, &x.Addr) + m.Load(1, &x.Flags) + m.Load(2, &x.Size) +} + +func (x *SignalInfo) StateTypeName() string { + return "pkg/sentry/arch.SignalInfo" +} + +func (x *SignalInfo) StateFields() []string { + return []string{ + "Signo", + "Errno", + "Code", + "Fields", + } } func (x *SignalInfo) beforeSave() {} -func (x *SignalInfo) save(m state.Map) { + +func (x *SignalInfo) StateSave(m state.Sink) { x.beforeSave() - m.Save("Signo", &x.Signo) - m.Save("Errno", &x.Errno) - m.Save("Code", &x.Code) - m.Save("Fields", &x.Fields) + m.Save(0, &x.Signo) + m.Save(1, &x.Errno) + m.Save(2, &x.Code) + m.Save(3, &x.Fields) } func (x *SignalInfo) afterLoad() {} -func (x *SignalInfo) load(m state.Map) { - m.Load("Signo", &x.Signo) - m.Load("Errno", &x.Errno) - m.Load("Code", &x.Code) - m.Load("Fields", &x.Fields) + +func (x *SignalInfo) StateLoad(m state.Source) { + m.Load(0, &x.Signo) + m.Load(1, &x.Errno) + m.Load(2, &x.Code) + m.Load(3, &x.Fields) } func init() { - state.Register("pkg/sentry/arch.MmapLayout", (*MmapLayout)(nil), state.Fns{Save: (*MmapLayout).save, Load: (*MmapLayout).load}) - state.Register("pkg/sentry/arch.AuxEntry", (*AuxEntry)(nil), state.Fns{Save: (*AuxEntry).save, Load: (*AuxEntry).load}) - state.Register("pkg/sentry/arch.SignalAct", (*SignalAct)(nil), state.Fns{Save: (*SignalAct).save, Load: (*SignalAct).load}) - state.Register("pkg/sentry/arch.SignalStack", (*SignalStack)(nil), state.Fns{Save: (*SignalStack).save, Load: (*SignalStack).load}) - state.Register("pkg/sentry/arch.SignalInfo", (*SignalInfo)(nil), state.Fns{Save: (*SignalInfo).save, Load: (*SignalInfo).load}) + state.Register((*MmapLayout)(nil)) + state.Register((*AuxEntry)(nil)) + state.Register((*SignalAct)(nil)) + state.Register((*SignalStack)(nil)) + state.Register((*SignalInfo)(nil)) } diff --git a/pkg/sentry/arch/arch_x86_impl_state_autogen.go b/pkg/sentry/arch/arch_x86_impl_state_autogen.go index 7303bb17f..e7738a847 100644 --- a/pkg/sentry/arch/arch_x86_impl_state_autogen.go +++ b/pkg/sentry/arch/arch_x86_impl_state_autogen.go @@ -8,21 +8,34 @@ import ( "gvisor.dev/gvisor/pkg/state" ) +func (x *State) StateTypeName() string { + return "pkg/sentry/arch.State" +} + +func (x *State) StateFields() []string { + return []string{ + "Regs", + "x86FPState", + "FeatureSet", + } +} + func (x *State) beforeSave() {} -func (x *State) save(m state.Map) { + +func (x *State) StateSave(m state.Sink) { x.beforeSave() - m.Save("Regs", &x.Regs) - m.Save("x86FPState", &x.x86FPState) - m.Save("FeatureSet", &x.FeatureSet) + m.Save(0, &x.Regs) + m.Save(1, &x.x86FPState) + m.Save(2, &x.FeatureSet) } -func (x *State) load(m state.Map) { - m.Load("Regs", &x.Regs) - m.LoadWait("x86FPState", &x.x86FPState) - m.Load("FeatureSet", &x.FeatureSet) +func (x *State) StateLoad(m state.Source) { + m.Load(0, &x.Regs) + m.LoadWait(1, &x.x86FPState) + m.Load(2, &x.FeatureSet) m.AfterLoad(x.afterLoad) } func init() { - state.Register("pkg/sentry/arch.State", (*State)(nil), state.Fns{Save: (*State).save, Load: (*State).load}) + state.Register((*State)(nil)) } |