summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/timerfd
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fs/timerfd')
-rw-r--r--pkg/sentry/fs/timerfd/BUILD20
-rw-r--r--pkg/sentry/fs/timerfd/timerfd_state_autogen.go42
2 files changed, 42 insertions, 20 deletions
diff --git a/pkg/sentry/fs/timerfd/BUILD b/pkg/sentry/fs/timerfd/BUILD
deleted file mode 100644
index c7977a217..000000000
--- a/pkg/sentry/fs/timerfd/BUILD
+++ /dev/null
@@ -1,20 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(licenses = ["notice"])
-
-go_library(
- name = "timerfd",
- srcs = ["timerfd.go"],
- visibility = ["//pkg/sentry:internal"],
- deps = [
- "//pkg/context",
- "//pkg/hostarch",
- "//pkg/sentry/fs",
- "//pkg/sentry/fs/anon",
- "//pkg/sentry/fs/fsutil",
- "//pkg/sentry/kernel/time",
- "//pkg/syserror",
- "//pkg/usermem",
- "//pkg/waiter",
- ],
-)
diff --git a/pkg/sentry/fs/timerfd/timerfd_state_autogen.go b/pkg/sentry/fs/timerfd/timerfd_state_autogen.go
new file mode 100644
index 000000000..822eecdd6
--- /dev/null
+++ b/pkg/sentry/fs/timerfd/timerfd_state_autogen.go
@@ -0,0 +1,42 @@
+// automatically generated by stateify.
+
+package timerfd
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (t *TimerOperations) StateTypeName() string {
+ return "pkg/sentry/fs/timerfd.TimerOperations"
+}
+
+func (t *TimerOperations) StateFields() []string {
+ return []string{
+ "timer",
+ "val",
+ }
+}
+
+func (t *TimerOperations) beforeSave() {}
+
+// +checklocksignore
+func (t *TimerOperations) StateSave(stateSinkObject state.Sink) {
+ t.beforeSave()
+ if !state.IsZeroValue(&t.events) {
+ state.Failf("events is %#v, expected zero", &t.events)
+ }
+ stateSinkObject.Save(0, &t.timer)
+ stateSinkObject.Save(1, &t.val)
+}
+
+func (t *TimerOperations) afterLoad() {}
+
+// +checklocksignore
+func (t *TimerOperations) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &t.timer)
+ stateSourceObject.Load(1, &t.val)
+}
+
+func init() {
+ state.Register((*TimerOperations)(nil))
+}