blob: 3a8eae3ca33c6e21463eba6ece74bb0130e6d2b1 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _LINUX_SHM_H_
3#define _LINUX_SHM_H_
4
Jack Millerab602f72014-08-08 14:23:19 -07005#include <linux/list.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <asm/page.h>
David Howells607ca462012-10-13 10:46:48 +01007#include <uapi/linux/shm.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/shmparam.h>
Manfred Spraul060028b2014-06-06 14:37:42 -07009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#ifdef CONFIG_SYSVIPC
Jack Millerab602f72014-08-08 14:23:19 -070011struct sysv_shm {
12 struct list_head shm_clist;
13};
14
Will Deacon079a96a2012-07-30 14:42:38 -070015long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
16 unsigned long shmlba);
Yaowei Bai2954e4402016-01-20 15:01:11 -080017bool is_file_shm_hugepages(struct file *file);
Jack Millerab602f72014-08-08 14:23:19 -070018void exit_shm(struct task_struct *task);
19#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#else
Jack Millerab602f72014-08-08 14:23:19 -070021struct sysv_shm {
22 /* empty */
23};
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025static inline long do_shmat(int shmid, char __user *shmaddr,
Will Deacon079a96a2012-07-30 14:42:38 -070026 int shmflg, unsigned long *addr,
27 unsigned long shmlba)
Linus Torvalds1da177e2005-04-16 15:20:36 -070028{
29 return -ENOSYS;
30}
Yaowei Bai2954e4402016-01-20 15:01:11 -080031static inline bool is_file_shm_hugepages(struct file *file)
Adam Litke516dffd2007-03-01 15:46:08 -080032{
Yaowei Bai2954e4402016-01-20 15:01:11 -080033 return false;
Adam Litke516dffd2007-03-01 15:46:08 -080034}
Vasiliy Kulikovb34a6b12011-07-26 16:08:48 -070035static inline void exit_shm(struct task_struct *task)
36{
37}
Jack Millerab602f72014-08-08 14:23:19 -070038static inline void shm_init_task(struct task_struct *task)
39{
40}
Linus Torvalds1da177e2005-04-16 15:20:36 -070041#endif
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043#endif /* _LINUX_SHM_H_ */