summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/arch
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/arch')
-rw-r--r--pkg/sentry/arch/BUILD18
-rw-r--r--pkg/sentry/arch/arch.go2
-rw-r--r--pkg/sentry/arch/arch_amd64.go2
-rw-r--r--pkg/sentry/arch/arch_state_x86.go1
-rw-r--r--pkg/sentry/arch/arch_x86.go2
-rw-r--r--pkg/sentry/arch/auxv.go2
-rw-r--r--pkg/sentry/arch/signal_amd64.go6
7 files changed, 16 insertions, 17 deletions
diff --git a/pkg/sentry/arch/BUILD b/pkg/sentry/arch/BUILD
index 0a2a35400..314b3e962 100644
--- a/pkg/sentry/arch/BUILD
+++ b/pkg/sentry/arch/BUILD
@@ -1,21 +1,7 @@
package(licenses = ["notice"]) # Apache 2.0
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
-load("//tools/go_stateify:defs.bzl", "go_library", "go_stateify")
-
-go_stateify(
- name = "arch_state",
- srcs = [
- "arch.go",
- "arch_amd64.go",
- "arch_state_x86.go",
- "arch_x86.go",
- "auxv.go",
- "signal_amd64.go",
- ],
- out = "arch_state.go",
- package = "arch",
-)
+load("//tools/go_stateify:defs.bzl", "go_library")
go_library(
name = "arch",
@@ -24,7 +10,6 @@ go_library(
"arch.go",
"arch_amd64.go",
"arch_amd64.s",
- "arch_state.go",
"arch_state_x86.go",
"arch_x86.go",
"auxv.go",
@@ -46,7 +31,6 @@ go_library(
"//pkg/sentry/context",
"//pkg/sentry/limits",
"//pkg/sentry/usermem",
- "//pkg/state",
"//pkg/syserror",
],
)
diff --git a/pkg/sentry/arch/arch.go b/pkg/sentry/arch/arch.go
index 0189e958d..21cb84502 100644
--- a/pkg/sentry/arch/arch.go
+++ b/pkg/sentry/arch/arch.go
@@ -254,6 +254,8 @@ const (
// MemoryManager.
//
// Note that "highest address" below is always exclusive.
+//
+// +stateify savable
type MmapLayout struct {
// MinAddr is the lowest mappable address.
MinAddr usermem.Addr
diff --git a/pkg/sentry/arch/arch_amd64.go b/pkg/sentry/arch/arch_amd64.go
index 23526fe8e..f1e408af9 100644
--- a/pkg/sentry/arch/arch_amd64.go
+++ b/pkg/sentry/arch/arch_amd64.go
@@ -95,6 +95,8 @@ const (
)
// context64 represents an AMD64 context.
+//
+// +stateify savable
type context64 struct {
State
sigFPState []x86FPState // fpstate to be restored on sigreturn.
diff --git a/pkg/sentry/arch/arch_state_x86.go b/pkg/sentry/arch/arch_state_x86.go
index cb38d098a..e9c23a06b 100644
--- a/pkg/sentry/arch/arch_state_x86.go
+++ b/pkg/sentry/arch/arch_state_x86.go
@@ -56,6 +56,7 @@ func (s *State) afterLoad() {
copy(s.x86FPState, old)
}
+// +stateify savable
type syscallPtraceRegs struct {
R15 uint64
R14 uint64
diff --git a/pkg/sentry/arch/arch_x86.go b/pkg/sentry/arch/arch_x86.go
index 5cc4f8377..b35eec53c 100644
--- a/pkg/sentry/arch/arch_x86.go
+++ b/pkg/sentry/arch/arch_x86.go
@@ -153,6 +153,8 @@ func NewFloatingPointData() *FloatingPointData {
// State contains the common architecture bits for X86 (the build tag of this
// file ensures it's only built on x86).
+//
+// +stateify savable
type State struct {
// The system registers.
Regs syscall.PtraceRegs `state:".(syscallPtraceRegs)"`
diff --git a/pkg/sentry/arch/auxv.go b/pkg/sentry/arch/auxv.go
index 70e0e35b7..81cfb4a01 100644
--- a/pkg/sentry/arch/auxv.go
+++ b/pkg/sentry/arch/auxv.go
@@ -19,6 +19,8 @@ import (
)
// An AuxEntry represents an entry in an ELF auxiliary vector.
+//
+// +stateify savable
type AuxEntry struct {
Key uint64
Value usermem.Addr
diff --git a/pkg/sentry/arch/signal_amd64.go b/pkg/sentry/arch/signal_amd64.go
index c1d743f38..e81717e8b 100644
--- a/pkg/sentry/arch/signal_amd64.go
+++ b/pkg/sentry/arch/signal_amd64.go
@@ -28,6 +28,8 @@ import (
// SignalAct represents the action that should be taken when a signal is
// delivered, and is equivalent to struct sigaction on 64-bit x86.
+//
+// +stateify savable
type SignalAct struct {
Handler uint64
Flags uint64
@@ -47,6 +49,8 @@ func (s *SignalAct) DeserializeTo(other *SignalAct) {
// SignalStack represents information about a user stack, and is equivalent to
// stack_t on 64-bit x86.
+//
+// +stateify savable
type SignalStack struct {
Addr uint64
Flags uint32
@@ -66,6 +70,8 @@ func (s *SignalStack) DeserializeTo(other *SignalStack) {
// SignalInfo represents information about a signal being delivered, and is
// equivalent to struct siginfo on 64-bit x86.
+//
+// +stateify savable
type SignalInfo struct {
Signo int32 // Signal number
Errno int32 // Errno value