1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2*4882a593Smuzhiyun #ifndef _LINUX_SUSPEND_IOCTLS_H 3*4882a593Smuzhiyun #define _LINUX_SUSPEND_IOCTLS_H 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun #include <linux/types.h> 6*4882a593Smuzhiyun /* 7*4882a593Smuzhiyun * This structure is used to pass the values needed for the identification 8*4882a593Smuzhiyun * of the resume swap area from a user space to the kernel via the 9*4882a593Smuzhiyun * SNAPSHOT_SET_SWAP_AREA ioctl 10*4882a593Smuzhiyun */ 11*4882a593Smuzhiyun struct resume_swap_area { 12*4882a593Smuzhiyun __kernel_loff_t offset; 13*4882a593Smuzhiyun __u32 dev; 14*4882a593Smuzhiyun } __attribute__((packed)); 15*4882a593Smuzhiyun 16*4882a593Smuzhiyun #define SNAPSHOT_IOC_MAGIC '3' 17*4882a593Smuzhiyun #define SNAPSHOT_FREEZE _IO(SNAPSHOT_IOC_MAGIC, 1) 18*4882a593Smuzhiyun #define SNAPSHOT_UNFREEZE _IO(SNAPSHOT_IOC_MAGIC, 2) 19*4882a593Smuzhiyun #define SNAPSHOT_ATOMIC_RESTORE _IO(SNAPSHOT_IOC_MAGIC, 4) 20*4882a593Smuzhiyun #define SNAPSHOT_FREE _IO(SNAPSHOT_IOC_MAGIC, 5) 21*4882a593Smuzhiyun #define SNAPSHOT_FREE_SWAP_PAGES _IO(SNAPSHOT_IOC_MAGIC, 9) 22*4882a593Smuzhiyun #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) 23*4882a593Smuzhiyun #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ 24*4882a593Smuzhiyun struct resume_swap_area) 25*4882a593Smuzhiyun #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t) 26*4882a593Smuzhiyun #define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) 27*4882a593Smuzhiyun #define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) 28*4882a593Smuzhiyun #define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int) 29*4882a593Smuzhiyun #define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) 30*4882a593Smuzhiyun #define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t) 31*4882a593Smuzhiyun #define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t) 32*4882a593Smuzhiyun #define SNAPSHOT_IOC_MAXNR 20 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #endif /* _LINUX_SUSPEND_IOCTLS_H */ 35