lh | 758261d | 2023-07-13 05:52:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/ipc/cross_msg.h |
| 3 | * Copyright (C) 2023 Sanechips Technology Co., Ltd. |
| 4 | */ |
| 5 | #ifndef _CROSS_MSG_H |
| 6 | #define _CROSS_MSG_H |
| 7 | |
| 8 | #ifdef CONFIG_SYSVIPC_CROSSMSG |
| 9 | #include <linux/soc/zte/rpm/rpmsg.h> |
| 10 | |
| 11 | #define CROSS_MSG_ACT CAP_ID |
| 12 | #define CROSS_MSG_CHN 13 |
| 13 | #define CROSS_MSG_CHN_CAP 14 |
| 14 | #define CROSS_MSG_SIZE ((size_t)0x1000) |
| 15 | #define CROSS_MSG_NUM (4) |
| 16 | #define CROSS_CHN_SIZE ((size_t)CROSS_MSG_SIZE * CROSS_MSG_NUM) |
| 17 | #define CROSS_PRINT "[MESSAGE QUEUE] " |
| 18 | #define CROSS_DEBUG 0 |
| 19 | |
| 20 | #define CROSS_MSG_HEAD 0xABBA |
| 21 | #define CROSS_MSG_MASK 0xFFFF0000 |
| 22 | #define CROSS_REMOTE_MASK 0x80000000 |
| 23 | |
| 24 | enum msg_function { |
| 25 | MSGGET_F = 0xAA, |
| 26 | MSGCTL_F = 0xBB, |
| 27 | MSGSND_F = 0xCC, |
| 28 | MSGRCV_F = 0xDD |
| 29 | }; |
| 30 | |
| 31 | struct msgget_para { |
| 32 | key_t key; |
| 33 | int msgflg; |
| 34 | }; |
| 35 | |
| 36 | struct msgctl_para { |
| 37 | struct msgget_para getp; |
| 38 | int cmd; |
| 39 | }; |
| 40 | |
| 41 | struct msgsnd_para { |
| 42 | struct msgget_para getp; |
| 43 | int msgflg; |
| 44 | size_t msgsz; |
| 45 | }; |
| 46 | |
| 47 | typedef struct msg_para { |
| 48 | unsigned short head; |
| 49 | unsigned short ops; |
| 50 | union { |
| 51 | struct msgctl_para ctlp; |
| 52 | struct msgsnd_para sndp; |
| 53 | struct { |
| 54 | int ret; |
| 55 | int merrno; |
| 56 | }; |
| 57 | }; |
| 58 | } T_sc_msg_header; |
| 59 | |
| 60 | #endif |
| 61 | #endif // _CROSS_MSG_H |
| 62 | |