diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-12 23:05:38 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-12 23:05:38 +0000 |
commit | a2e5062951e1dd7a996369edd9549e4dfa556dcb (patch) | |
tree | 35a108eeb01b26c8296389f9940044ea2355b33b /pkg/sentry/arch | |
parent | 21c8249aa98a113270c9796494c618ad3f3697bf (diff) | |
parent | 252329c1f332319e2f1e2b28751aadd84dedae64 (diff) |
Merge release-20200810.0-18-g252329c1f (automated)
Diffstat (limited to 'pkg/sentry/arch')
-rw-r--r-- | pkg/sentry/arch/arch_aarch64.go | 2 | ||||
-rw-r--r-- | pkg/sentry/arch/arch_aarch64_state_autogen.go | 33 | ||||
-rw-r--r-- | pkg/sentry/arch/arch_arm64.go | 2 | ||||
-rw-r--r-- | pkg/sentry/arch/arch_arm64_state_autogen.go | 34 |
4 files changed, 71 insertions, 0 deletions
diff --git a/pkg/sentry/arch/arch_aarch64.go b/pkg/sentry/arch/arch_aarch64.go index fd95eb2d2..0f433ee79 100644 --- a/pkg/sentry/arch/arch_aarch64.go +++ b/pkg/sentry/arch/arch_aarch64.go @@ -101,6 +101,8 @@ func NewFloatingPointData() *FloatingPointData { // State contains the common architecture bits for aarch64 (the build tag of this // file ensures it's only built on aarch64). +// +// +stateify savable type State struct { // The system registers. Regs Registers diff --git a/pkg/sentry/arch/arch_aarch64_state_autogen.go b/pkg/sentry/arch/arch_aarch64_state_autogen.go index 4f42d07ce..6b698f9ce 100644 --- a/pkg/sentry/arch/arch_aarch64_state_autogen.go +++ b/pkg/sentry/arch/arch_aarch64_state_autogen.go @@ -34,6 +34,39 @@ func (x *Registers) StateLoad(m state.Source) { m.Load(1, &x.TPIDR_EL0) } +func (x *State) StateTypeName() string { + return "pkg/sentry/arch.State" +} + +func (x *State) StateFields() []string { + return []string{ + "Regs", + "aarch64FPState", + "FeatureSet", + "OrigR0", + } +} + +func (x *State) beforeSave() {} + +func (x *State) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.Regs) + m.Save(1, &x.aarch64FPState) + m.Save(2, &x.FeatureSet) + m.Save(3, &x.OrigR0) +} + +func (x *State) afterLoad() {} + +func (x *State) StateLoad(m state.Source) { + m.Load(0, &x.Regs) + m.LoadWait(1, &x.aarch64FPState) + m.Load(2, &x.FeatureSet) + m.Load(3, &x.OrigR0) +} + func init() { state.Register((*Registers)(nil)) + state.Register((*State)(nil)) } diff --git a/pkg/sentry/arch/arch_arm64.go b/pkg/sentry/arch/arch_arm64.go index cabbf60e0..550741d8c 100644 --- a/pkg/sentry/arch/arch_arm64.go +++ b/pkg/sentry/arch/arch_arm64.go @@ -73,6 +73,8 @@ const ( ) // context64 represents an ARM64 context. +// +// +stateify savable type context64 struct { State sigFPState []aarch64FPState // fpstate to be restored on sigreturn. diff --git a/pkg/sentry/arch/arch_arm64_state_autogen.go b/pkg/sentry/arch/arch_arm64_state_autogen.go index 9c6dfdf2e..a88aef9d0 100644 --- a/pkg/sentry/arch/arch_arm64_state_autogen.go +++ b/pkg/sentry/arch/arch_arm64_state_autogen.go @@ -4,3 +4,37 @@ // +build arm64 package arch + +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) StateSave(m state.Sink) { + x.beforeSave() + m.Save(0, &x.State) + m.Save(1, &x.sigFPState) +} + +func (x *context64) afterLoad() {} + +func (x *context64) StateLoad(m state.Source) { + m.Load(0, &x.State) + m.Load(1, &x.sigFPState) +} + +func init() { + state.Register((*context64)(nil)) +} |