shm.h 968 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_SHM_H_
  3. #define _LINUX_SHM_H_
  4. #include <linux/list.h>
  5. #include <asm/page.h>
  6. #include <uapi/linux/shm.h>
  7. #include <asm/shmparam.h>
  8. struct file;
  9. #ifdef CONFIG_SYSVIPC
  10. struct sysv_shm {
  11. struct list_head shm_clist;
  12. };
  13. long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
  14. unsigned long shmlba);
  15. bool is_file_shm_hugepages(struct file *file);
  16. void exit_shm(struct task_struct *task);
  17. #define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist)
  18. #else
  19. struct sysv_shm {
  20. /* empty */
  21. };
  22. static inline long do_shmat(int shmid, char __user *shmaddr,
  23. int shmflg, unsigned long *addr,
  24. unsigned long shmlba)
  25. {
  26. return -ENOSYS;
  27. }
  28. static inline bool is_file_shm_hugepages(struct file *file)
  29. {
  30. return false;
  31. }
  32. static inline void exit_shm(struct task_struct *task)
  33. {
  34. }
  35. static inline void shm_init_task(struct task_struct *task)
  36. {
  37. }
  38. #endif
  39. #endif /* _LINUX_SHM_H_ */