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
10struct file;
11
12#ifdef CONFIG_SYSVIPC
13struct sysv_shm {
14 struct list_head shm_clist;
15};
16
17long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
18 unsigned long shmlba);
19bool is_file_shm_hugepages(struct file *file);
20void exit_shm(struct task_struct *task);
21#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
22#else
23struct sysv_shm {
24 /* empty */
25};
26
27static inline long do_shmat(int shmid, char __user *shmaddr,
28 int shmflg, unsigned long *addr,
29 unsigned long shmlba)
30{
31 return -ENOSYS;
32}
33static inline bool is_file_shm_hugepages(struct file *file)
34{
35 return false;
36}
37static inline void exit_shm(struct task_struct *task)
38{
39}
40static inline void shm_init_task(struct task_struct *task)
41{
42}
43#endif
44
45#endif /* _LINUX_SHM_H_ */
46