Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
shm.h
Go to the documentation of this file.
1 #ifndef _LINUX_SHM_H_
2 #define _LINUX_SHM_H_
3 
4 #include <asm/page.h>
5 #include <uapi/linux/shm.h>
6 
7 #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
8 #include <asm/shmparam.h>
9 struct shmid_kernel /* private to the kernel */
10 {
12  struct file * shm_file;
13  unsigned long shm_nattch;
14  unsigned long shm_segsz;
21 
22  /* The task created the shm object. NULL if the task is dead. */
24 };
25 
26 /* shm_mode upper byte flags */
27 #define SHM_DEST 01000 /* segment will be destroyed on last detach */
28 #define SHM_LOCKED 02000 /* segment will not be swapped */
29 #define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
30 #define SHM_NORESERVE 010000 /* don't check for reservations */
31 
32 #ifdef CONFIG_SYSVIPC
33 long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
34  unsigned long shmlba);
35 extern int is_file_shm_hugepages(struct file *file);
36 extern void exit_shm(struct task_struct *task);
37 #else
38 static inline long do_shmat(int shmid, char __user *shmaddr,
39  int shmflg, unsigned long *addr,
40  unsigned long shmlba)
41 {
42  return -ENOSYS;
43 }
44 static inline int is_file_shm_hugepages(struct file *file)
45 {
46  return 0;
47 }
48 static inline void exit_shm(struct task_struct *task)
49 {
50 }
51 #endif
52 
53 #endif /* _LINUX_SHM_H_ */