# 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 include include 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]) # These are enabled only in snapshot mode because they can easily kill the machine. ioctl$SNAPSHOT_FREEZE(fd fd_snapshot, cmd const[SNAPSHOT_FREEZE]) (snapshot) ioctl$SNAPSHOT_POWER_OFF(fd fd_snapshot, cmd const[SNAPSHOT_POWER_OFF]) (snapshot) 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_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 } [packed]