#ifndef __LINUX_KSM_H #define __LINUX_KSM_H /* * Userspace interface for /dev/ksm - kvm shared memory */ #include #include #define KSM_API_VERSION 1 /* for KSM_REGISTER_MEMORY_REGION */ struct ksm_memory_region { __u32 npages; /* number of pages to share */ __u64 addr; /* the begining of the virtual address */ }; #define KSMIO 0xAB /* ioctls for /dev/ksm */ #define KSM_GET_API_VERSION _IO(KSMIO, 0x00) #define KSM_CREATE_SHARED_MEMORY_AREA _IO(KSMIO, 0x01) /* return SMA fd */ #define KSM_CREATE_SCAN _IO(KSMIO, 0x02) /* return SCAN fd */ /* ioctls for SMA fds */ #define KSM_REGISTER_MEMORY_REGION _IOW(KSMIO, 0x20,\ struct ksm_memory_region) #define KSM_REMOVE_MEMORY_REGION _IO(KSMIO, 0x21) /* ioctls for SCAN fds */ #define KSM_SCAN _IO(KSMIO, 0x40) #endif