aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_snapshot.txt
diff options
context:
space:
mode:
authorhandeharputlu <43519271+handeharputlu@users.noreply.github.com>2020-07-14 15:51:11 +0300
committerGitHub <noreply@github.com>2020-07-14 14:51:11 +0200
commit609fb51750f5938bd47f9b78c3d7d8fb435d069c (patch)
tree9967c854a78505998c8537578a71bcba7ecf37d6 /sys/linux/dev_snapshot.txt
parent6f4580264a29fa73097e96b436141a8594b97610 (diff)
sys/linux: /dev/snapshot descriptions (#1934)
Diffstat (limited to 'sys/linux/dev_snapshot.txt')
-rw-r--r--sys/linux/dev_snapshot.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/linux/dev_snapshot.txt b/sys/linux/dev_snapshot.txt
new file mode 100644
index 000000000..62af2803e
--- /dev/null
+++ b/sys/linux/dev_snapshot.txt
@@ -0,0 +1,33 @@
+# Copyright 2020 syzkaller project authors. All rights reserved.
+# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+include <uapi/linux/suspend_ioctls.h>
+include <linux/ioctl.h>
+include <linux/fcntl.h>
+
+resource fd_snapshot[fd]
+
+openat$snapshot(fd const[AT_FDCWD], file ptr[in, string["/dev/snapshot"]], flags flags[open_flags], mode const[0]) fd_snapshot
+write$snapshot(fd fd_snapshot, buffer ptr[in, array[int8]], len bytesize[buffer])
+read$snapshot(fd fd_snapshot, buffer ptr[out, array[int8]], len bytesize[buffer])
+
+# SNAPSHOT_FREEZE is disabled because it can easily kill the machine.
+ioctl$SNAPHOT_FREEZE(fd fd_snapshot, cmd const[SNAPSHOT_FREEZE]) (disabled)
+ioctl$SNAPSHOT_UNFREEZE(fd fd_snapshot, cmd const[SNAPSHOT_UNFREEZE])
+ioctl$SNAPSHOT_CREATE_IMAGE(fd fd_snapshot, cmd const[SNAPSHOT_CREATE_IMAGE], arg ptr[out, int32])
+ioctl$SNAPSHOT_ATOMIC_RESTORE(fd fd_snapshot, cmd const[SNAPSHOT_ATOMIC_RESTORE])
+ioctl$SNAPSHOT_FREE(fd fd_snapshot, cmd const[SNAPSHOT_FREE])
+ioctl$SNAPSHOT_PREF_IMAGE_SIZE(fd fd_snapshot, cmd const[SNAPSHOT_PREF_IMAGE_SIZE], arg intptr)
+ioctl$SNAPSHOT_GET_IMAGE_SIZE(fd fd_snapshot, cmd const[SNAPSHOT_GET_IMAGE_SIZE], arg ptr[out, int64])
+ioctl$SNAPSHOT_AVAIL_SWAP_SIZE(fd fd_snapshot, cmd const[SNAPSHOT_AVAIL_SWAP_SIZE], arg ptr[out, int64])
+ioctl$SNAPSHOT_ALLOC_SWAP_PAGE(fd fd_snapshot, cmd const[SNAPSHOT_ALLOC_SWAP_PAGE], arg ptr[out, int64])
+ioctl$SNAPSHOT_FREE_SWAP_PAGES(fd fd_snapshot, cmd const[SNAPSHOT_FREE_SWAP_PAGES])
+ioctl$SNAPSHOT_S2RAM(fd fd_snapshot, cmd const[SNAPSHOT_S2RAM])
+ioctl$SNAPSHOT_PLATFORM_SUPPORT(fd fd_snapshot, cmd const[SNAPSHOT_PLATFORM_SUPPORT], arg intptr)
+ioctl$SNAPSHOT_POWER_OFF(fd fd_snapshot, cmd const[SNAPSHOT_POWER_OFF])
+ioctl$SNAPSHOT_SET_SWAP_AREA(fd fd_snapshot, cmd const[SNAPSHOT_SET_SWAP_AREA], arg ptr[in, resume_swap_area])
+
+resume_swap_area {
+ offset int64
+ dev int32
+}