]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/shm.h
Merge branch 'acpi-apei'
[mirror_ubuntu-bionic-kernel.git] / include / linux / shm.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_SHM_H_
2#define _LINUX_SHM_H_
3
ab602f79 4#include <linux/list.h>
1da177e4 5#include <asm/page.h>
607ca46e 6#include <uapi/linux/shm.h>
1da177e4 7#include <asm/shmparam.h>
060028ba 8
1da177e4
LT
9struct shmid_kernel /* private to the kernel */
10{
11 struct kern_ipc_perm shm_perm;
239521f3 12 struct file *shm_file;
1da177e4
LT
13 unsigned long shm_nattch;
14 unsigned long shm_segsz;
7ff2819e
DD
15 time64_t shm_atim;
16 time64_t shm_dtim;
17 time64_t shm_ctim;
1da177e4
LT
18 pid_t shm_cprid;
19 pid_t shm_lprid;
20 struct user_struct *mlock_user;
5774ed01
VK
21
22 /* The task created the shm object. NULL if the task is dead. */
23 struct task_struct *shm_creator;
ab602f79 24 struct list_head shm_clist; /* list by creator */
3859a271 25} __randomize_layout;
1da177e4
LT
26
27/* shm_mode upper byte flags */
28#define SHM_DEST 01000 /* segment will be destroyed on last detach */
29#define SHM_LOCKED 02000 /* segment will not be swapped */
42d7395f 30
1da177e4 31#ifdef CONFIG_SYSVIPC
ab602f79
JM
32struct sysv_shm {
33 struct list_head shm_clist;
34};
35
079a96ae
WD
36long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
37 unsigned long shmlba);
2954e440 38bool is_file_shm_hugepages(struct file *file);
ab602f79
JM
39void exit_shm(struct task_struct *task);
40#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
1da177e4 41#else
ab602f79
JM
42struct sysv_shm {
43 /* empty */
44};
45
1da177e4 46static inline long do_shmat(int shmid, char __user *shmaddr,
079a96ae
WD
47 int shmflg, unsigned long *addr,
48 unsigned long shmlba)
1da177e4
LT
49{
50 return -ENOSYS;
51}
2954e440 52static inline bool is_file_shm_hugepages(struct file *file)
516dffdc 53{
2954e440 54 return false;
516dffdc 55}
b34a6b1d
VK
56static inline void exit_shm(struct task_struct *task)
57{
58}
ab602f79
JM
59static inline void shm_init_task(struct task_struct *task)
60{
61}
1da177e4
LT
62#endif
63
1da177e4 64#endif /* _LINUX_SHM_H_ */