Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
1da177e4 LT |
2 | #ifndef _LINUX_SHM_H_ |
3 | #define _LINUX_SHM_H_ | |
4 | ||
ab602f79 | 5 | #include <linux/list.h> |
1da177e4 | 6 | #include <asm/page.h> |
607ca46e | 7 | #include <uapi/linux/shm.h> |
1da177e4 | 8 | #include <asm/shmparam.h> |
060028ba | 9 | |
8ecd2953 SR |
10 | struct file; |
11 | ||
1da177e4 | 12 | #ifdef CONFIG_SYSVIPC |
ab602f79 JM |
13 | struct sysv_shm { |
14 | struct list_head shm_clist; | |
15 | }; | |
16 | ||
079a96ae WD |
17 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, |
18 | unsigned long shmlba); | |
2954e440 | 19 | bool is_file_shm_hugepages(struct file *file); |
ab602f79 JM |
20 | void exit_shm(struct task_struct *task); |
21 | #define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist) | |
1da177e4 | 22 | #else |
ab602f79 JM |
23 | struct sysv_shm { |
24 | /* empty */ | |
25 | }; | |
26 | ||
1da177e4 | 27 | static inline long do_shmat(int shmid, char __user *shmaddr, |
079a96ae WD |
28 | int shmflg, unsigned long *addr, |
29 | unsigned long shmlba) | |
1da177e4 LT |
30 | { |
31 | return -ENOSYS; | |
32 | } | |
2954e440 | 33 | static inline bool is_file_shm_hugepages(struct file *file) |
516dffdc | 34 | { |
2954e440 | 35 | return false; |
516dffdc | 36 | } |
b34a6b1d VK |
37 | static inline void exit_shm(struct task_struct *task) |
38 | { | |
39 | } | |
ab602f79 JM |
40 | static inline void shm_init_task(struct task_struct *task) |
41 | { | |
42 | } | |
1da177e4 LT |
43 | #endif |
44 | ||
1da177e4 | 45 | #endif /* _LINUX_SHM_H_ */ |