lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/ipc/shm_ctrl.h |
| 3 | * Copyright (C) 2023 Sanechips Technology Co., Ltd. |
| 4 | */ |
| 5 | #ifndef _SHM_CTRL_H |
| 6 | #define _SHM_CTRL_H |
| 7 | |
| 8 | #ifdef CONFIG_SYSVIPC_CROSS_SHM |
| 9 | /** |
| 10 | * ºê¶¨Òå |
| 11 | */ |
| 12 | #include <linux/slab.h> |
| 13 | #include <linux/mm.h> |
| 14 | #include <linux/shm.h> |
| 15 | #include <linux/io.h> |
| 16 | #include <linux/init.h> |
| 17 | #include <linux/file.h> |
| 18 | #include <linux/list.h> |
| 19 | #include <linux/mman.h> |
| 20 | #include <linux/shmem_fs.h> |
| 21 | #include <linux/audit.h> |
| 22 | #include <linux/capability.h> |
| 23 | #include <linux/ptrace.h> |
| 24 | #include <linux/rwsem.h> |
| 25 | #include <linux/nsproxy.h> |
| 26 | #include <linux/ipc_namespace.h> |
| 27 | #include <linux/module.h> |
| 28 | #include <linux/dma-mapping.h> |
| 29 | #include <mach/spinlock.h> |
| 30 | |
| 31 | /** |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 32 | * ºê¶¨Òå |
| 33 | */ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 34 | #define TRUE 1 |
| 35 | #define FALSE 0 |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 36 | |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 37 | #define SHM_CTRL_OK (0) |
| 38 | #define SHM_CTRL_ERROR (-1) |
| 39 | #define SHM_CTRL_VMA_LINK_NUM (2) |
| 40 | #define SHM_CTRL_MEMSYNC_CHANNEL (15) |
| 41 | #define SHM_CTRL_CHANNEL_SIZE (0x40) |
| 42 | #define SHM_CTRL_LONG_32BIT (32) |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 43 | #define SHM_REMOTE_SYSV_YES (0x73797376) /*SYSV ASCIIÂë*/ |
| 44 | #define SHM_REMOTE_POSIX_YES (0x706F7378) /*POSX ASCIIÂë*/ |
| 45 | #define SHM_REMOTE_SYSV_MASK (0xFFFFF800) /*(key:-1~-2047)*/ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 46 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 47 | /** |
| 48 | * Êý¾ÝÀàÐͶ¨Òå |
| 49 | */ |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 50 | struct shm_pool_msg |
| 51 | { |
| 52 | unsigned int shm_len; |
| 53 | unsigned int key_manage_len; |
| 54 | phys_addr_t shm_memory_phy; |
| 55 | phys_addr_t key_manage_phy; |
| 56 | }; |
| 57 | |
xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 58 | extern int shm_remote_free_pages(key_t key); |
| 59 | extern key_t shm_hash_name_to_key(const char *name, int len); |
| 60 | extern int shm_do_newseg_check(key_t key, unsigned long len); |
| 61 | extern int shm_do_remote_map_vma(struct vm_area_struct *vma, key_t key); |
| 62 | extern void shm_unmap_page_range(struct mm_struct *mm, struct vm_area_struct *vma, |
| 63 | unsigned long addr, unsigned long end); |
lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 64 | #endif |
| 65 | #endif // _SHM_CTRL_H |
| 66 | |