xref: /linux-6.15/include/linux/shm.h (revision a2e102cd)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SHM_H_
3 #define _LINUX_SHM_H_
4 
5 #include <linux/list.h>
6 #include <asm/page.h>
7 #include <uapi/linux/shm.h>
8 #include <asm/shmparam.h>
9 
10 #ifdef CONFIG_SYSVIPC
11 struct sysv_shm {
12 	struct list_head shm_clist;
13 };
14 
15 long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
16 	      unsigned long shmlba);
17 bool is_file_shm_hugepages(struct file *file);
18 void exit_shm(struct task_struct *task);
19 #define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
20 #else
21 struct sysv_shm {
22 	/* empty */
23 };
24 
25 static inline long do_shmat(int shmid, char __user *shmaddr,
26 			    int shmflg, unsigned long *addr,
27 			    unsigned long shmlba)
28 {
29 	return -ENOSYS;
30 }
31 static inline bool is_file_shm_hugepages(struct file *file)
32 {
33 	return false;
34 }
35 static inline void exit_shm(struct task_struct *task)
36 {
37 }
38 static inline void shm_init_task(struct task_struct *task)
39 {
40 }
41 #endif
42 
43 #endif /* _LINUX_SHM_H_ */
44