blob: 4726ea8c097e01d876bff8c6b54523f2adc40e68 [file] [log] [blame]
lh758261d2023-07-13 05:52:04 -07001/*
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.li6c8fc1e2023-08-12 00:11:09 -070032 * ºê¶¨Òå
33*/
lh758261d2023-07-13 05:52:04 -070034#define TRUE 1
35#define FALSE 0
xf.li6c8fc1e2023-08-12 00:11:09 -070036
lh758261d2023-07-13 05:52:04 -070037#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.li6c8fc1e2023-08-12 00:11:09 -070043#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)*/
lh758261d2023-07-13 05:52:04 -070046
xf.li6c8fc1e2023-08-12 00:11:09 -070047/**
48 * Êý¾ÝÀàÐͶ¨Òå
49 */
lh758261d2023-07-13 05:52:04 -070050struct 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.li6c8fc1e2023-08-12 00:11:09 -070058extern int shm_remote_free_pages(key_t key);
59extern key_t shm_hash_name_to_key(const char *name, int len);
60extern int shm_do_newseg_check(key_t key, unsigned long len);
61extern int shm_do_remote_map_vma(struct vm_area_struct *vma, key_t key);
62extern void shm_unmap_page_range(struct mm_struct *mm, struct vm_area_struct *vma,
63 unsigned long addr, unsigned long end);
lh758261d2023-07-13 05:52:04 -070064#endif
65#endif // _SHM_CTRL_H
66