summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/time
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/kernel/time')
-rw-r--r--pkg/sentry/kernel/time/BUILD19
-rw-r--r--pkg/sentry/kernel/time/time_state_autogen.go97
2 files changed, 97 insertions, 19 deletions
diff --git a/pkg/sentry/kernel/time/BUILD b/pkg/sentry/kernel/time/BUILD
deleted file mode 100644
index 7ba7dc50c..000000000
--- a/pkg/sentry/kernel/time/BUILD
+++ /dev/null
@@ -1,19 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(licenses = ["notice"])
-
-go_library(
- name = "time",
- srcs = [
- "context.go",
- "time.go",
- ],
- visibility = ["//pkg/sentry:internal"],
- deps = [
- "//pkg/abi/linux",
- "//pkg/context",
- "//pkg/sync",
- "//pkg/syserror",
- "//pkg/waiter",
- ],
-)
diff --git a/pkg/sentry/kernel/time/time_state_autogen.go b/pkg/sentry/kernel/time/time_state_autogen.go
new file mode 100644
index 000000000..4fb37df9a
--- /dev/null
+++ b/pkg/sentry/kernel/time/time_state_autogen.go
@@ -0,0 +1,97 @@
+// automatically generated by stateify.
+
+package time
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (x *Time) StateTypeName() string {
+ return "pkg/sentry/kernel/time.Time"
+}
+
+func (x *Time) StateFields() []string {
+ return []string{
+ "ns",
+ }
+}
+
+func (x *Time) beforeSave() {}
+
+func (x *Time) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.ns)
+}
+
+func (x *Time) afterLoad() {}
+
+func (x *Time) StateLoad(m state.Source) {
+ m.Load(0, &x.ns)
+}
+
+func (x *Setting) StateTypeName() string {
+ return "pkg/sentry/kernel/time.Setting"
+}
+
+func (x *Setting) StateFields() []string {
+ return []string{
+ "Enabled",
+ "Next",
+ "Period",
+ }
+}
+
+func (x *Setting) beforeSave() {}
+
+func (x *Setting) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.Enabled)
+ m.Save(1, &x.Next)
+ m.Save(2, &x.Period)
+}
+
+func (x *Setting) afterLoad() {}
+
+func (x *Setting) StateLoad(m state.Source) {
+ m.Load(0, &x.Enabled)
+ m.Load(1, &x.Next)
+ m.Load(2, &x.Period)
+}
+
+func (x *Timer) StateTypeName() string {
+ return "pkg/sentry/kernel/time.Timer"
+}
+
+func (x *Timer) StateFields() []string {
+ return []string{
+ "clock",
+ "listener",
+ "setting",
+ "paused",
+ }
+}
+
+func (x *Timer) beforeSave() {}
+
+func (x *Timer) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.clock)
+ m.Save(1, &x.listener)
+ m.Save(2, &x.setting)
+ m.Save(3, &x.paused)
+}
+
+func (x *Timer) afterLoad() {}
+
+func (x *Timer) StateLoad(m state.Source) {
+ m.Load(0, &x.clock)
+ m.Load(1, &x.listener)
+ m.Load(2, &x.setting)
+ m.Load(3, &x.paused)
+}
+
+func init() {
+ state.Register((*Time)(nil))
+ state.Register((*Setting)(nil))
+ state.Register((*Timer)(nil))
+}