0001
0002 #ifndef _LINUX_SHM_H_
0003 #define _LINUX_SHM_H_
0004
0005 #include <linux/list.h>
0006 #include <asm/page.h>
0007 #include <uapi/linux/shm.h>
0008 #include <asm/shmparam.h>
0009
0010 struct file;
0011
0012 #ifdef CONFIG_SYSVIPC
0013 struct sysv_shm {
0014 struct list_head shm_clist;
0015 };
0016
0017 long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
0018 unsigned long shmlba);
0019 bool is_file_shm_hugepages(struct file *file);
0020 void exit_shm(struct task_struct *task);
0021 #define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
0022 #else
0023 struct sysv_shm {
0024
0025 };
0026
0027 static inline long do_shmat(int shmid, char __user *shmaddr,
0028 int shmflg, unsigned long *addr,
0029 unsigned long shmlba)
0030 {
0031 return -ENOSYS;
0032 }
0033 static inline bool is_file_shm_hugepages(struct file *file)
0034 {
0035 return false;
0036 }
0037 static inline void exit_shm(struct task_struct *task)
0038 {
0039 }
0040 static inline void shm_init_task(struct task_struct *task)
0041 {
0042 }
0043 #endif
0044
0045 #endif