Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
communication_ipc
提交
ac22868e
C
communication_ipc
项目概览
OpenHarmony
/
communication_ipc
大约 1 年 前同步成功
通知
20
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
communication_ipc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ac22868e
编写于
4月 13, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
!218 Add interface of ResetIpc() & macro definition optimization
Merge pull request !218 from liubb_0516/master
上级
e0f17b30
608b0271
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
20 addition
and
9 deletion
+20
-9
interfaces/innerkits/c/ipc/include/serializer.h
interfaces/innerkits/c/ipc/include/serializer.h
+1
-1
ipc/native/c/ipc/include/ipc_types.h
ipc/native/c/ipc/include/ipc_types.h
+0
-2
ipc/native/c/ipc/src/linux/ipc_invoker.c
ipc/native/c/ipc/src/linux/ipc_invoker.c
+7
-4
ipc/native/c/ipc/src/linux/serializer_inner.c
ipc/native/c/ipc/src/linux/serializer_inner.c
+1
-1
ipc/native/c/manager/include/ipc_process_skeleton.h
ipc/native/c/manager/include/ipc_process_skeleton.h
+1
-0
ipc/native/c/manager/include/iremote_invoker.h
ipc/native/c/manager/include/iremote_invoker.h
+1
-0
ipc/native/c/manager/src/ipc_process_skeleton.c
ipc/native/c/manager/src/ipc_process_skeleton.c
+8
-0
ipc/test/ipc/client/client.c
ipc/test/ipc/client/client.c
+1
-1
未找到文件。
interfaces/innerkits/c/ipc/include/serializer.h
浏览文件 @
ac22868e
...
...
@@ -42,7 +42,7 @@ typedef struct {
uintptr_t
cookie
;
}
SvcIdentity
;
#define
MIN_BINDER
_HANDLE (-1)
#define
IPC_INVALID
_HANDLE (-1)
#define IPC_IO_INITIALIZED 0x01
/* ipc flag indicates whether io is initialized */
#define IPC_IO_OVERFLOW 0x02
/* ipc flag indicates whether io is running out of space */
#define MAX_IO_SIZE 8192UL
...
...
ipc/native/c/ipc/include/ipc_types.h
浏览文件 @
ac22868e
...
...
@@ -18,7 +18,5 @@
#define BINDER_DRIVER "/dev/binder"
#define MMAP_MAX_SIZE 262144UL
/* 256KB */
#define IPC_IO_DATA_MAX 8192UL
#define MAX_OBJECT_NUM 4
#endif
/* OHOS_BINDER_TYPES_H */
\ No newline at end of file
ipc/native/c/ipc/src/linux/ipc_invoker.c
浏览文件 @
ac22868e
...
...
@@ -229,8 +229,8 @@ static void HandleTransaction(const struct binder_transaction_data *tr)
.
args
=
objectStub
->
args
};
IpcIo
reply
;
uint8
tempData
[
IPC_IO_DATA_MAX
];
IpcIoInit
(
&
reply
,
tempData
,
IPC_IO_DATA_MAX
,
MAX_OBJECT
_NUM
);
uint8
tempData
[
MAX_IO_SIZE
];
IpcIoInit
(
&
reply
,
tempData
,
MAX_IO_SIZE
,
MAX_OBJ
_NUM
);
int32_t
error
=
OnRemoteRequestInner
(
tr
->
code
,
&
data
,
&
reply
,
option
,
objectStub
);
if
(
tr
->
flags
&
TF_ONE_WAY
)
{
IpcFreeBuffer
((
void
*
)(
tr
->
data
.
ptr
.
buffer
));
...
...
@@ -421,8 +421,8 @@ static int32_t InternalRequest(SvcIdentity sid, uint32_t code, IpcIo *data, IpcI
data
->
offsetsCur
=
data
->
offsetsBase
;
}
if
(
flags
==
TF_OP_SYNC
&&
reply
!=
NULL
)
{
uint8
tempData
[
IPC_IO_DATA_MAX
];
IpcIoInit
(
reply
,
tempData
,
IPC_IO_DATA_MAX
,
MAX_OBJECT
_NUM
);
uint8
tempData
[
MAX_IO_SIZE
];
IpcIoInit
(
reply
,
tempData
,
MAX_IO_SIZE
,
MAX_OBJ
_NUM
);
}
MessageOption
option
=
{
.
flags
=
flags
,
...
...
@@ -521,6 +521,8 @@ static void IpcExitCurrentThread(void)
ioctl
(
g_connector
->
fd
,
BINDER_THREAD_EXIT
,
0
);
}
static
void
InvokerResetIpc
(
void
)
{}
static
BinderConnector
*
InitBinderConnector
(
void
)
{
if
(
g_connector
==
NULL
)
{
...
...
@@ -547,6 +549,7 @@ static BinderConnector *InitBinderConnector(void)
g_ipcInvoker
.
AddDeathRecipient
=
IpcAddDeathRecipient
;
g_ipcInvoker
.
RemoveDeathRecipient
=
IpcRemoveDeathRecipient
;
g_ipcInvoker
.
ExitCurrentThread
=
IpcExitCurrentThread
;
g_ipcInvoker
.
InvokerResetIpc
=
InvokerResetIpc
;
}
pthread_mutex_unlock
(
&
g_connectorMutex
);
}
...
...
ipc/native/c/ipc/src/linux/serializer_inner.c
浏览文件 @
ac22868e
...
...
@@ -114,7 +114,7 @@ bool ReadRemoteObject(IpcIo *io, SvcIdentity *svc)
}
if
(
obj
->
type
==
BINDER_TYPE_BINDER
)
{
svc
->
token
=
obj
->
binder
;
svc
->
handle
=
MIN_BINDER
_HANDLE
;
svc
->
handle
=
IPC_INVALID
_HANDLE
;
svc
->
cookie
=
obj
->
cookie
;
}
else
{
svc
->
handle
=
obj
->
handle
;
...
...
ipc/native/c/manager/include/ipc_process_skeleton.h
浏览文件 @
ac22868e
...
...
@@ -72,6 +72,7 @@ void SendObituary(DeathCallback *deathCallback);
void
DeleteDeathCallback
(
DeathCallback
*
deathCallback
);
void
WaitForProxyInit
(
SvcIdentity
*
svc
);
int32_t
DeleteHandle
(
int32_t
handle
);
void
ResetIpc
(
void
);
#ifdef __cplusplus
#if __cplusplus
}
...
...
ipc/native/c/manager/include/iremote_invoker.h
浏览文件 @
ac22868e
...
...
@@ -40,6 +40,7 @@ typedef struct {
int32_t
(
*
SetRegistryObject
)(
void
);
int32_t
(
*
AddDeathRecipient
)(
int32_t
handle
,
void
*
cookie
);
int32_t
(
*
RemoveDeathRecipient
)(
int32_t
handle
,
void
*
cookie
);
void
(
*
InvokerResetIpc
)(
void
);
}
RemoteInvoker
;
RemoteInvoker
*
InitRemoteInvoker
(
int32_t
proto
);
...
...
ipc/native/c/manager/src/ipc_process_skeleton.c
浏览文件 @
ac22868e
...
...
@@ -420,4 +420,12 @@ void DeleteDeathCallback(DeathCallback *deathCallback)
UtilsListDelete
(
&
deathCallback
->
list
);
pthread_mutex_destroy
(
&
deathCallback
->
lock
);
free
(
deathCallback
);
}
void
ResetIpc
(
void
)
{
RemoteInvoker
*
invoker
=
GetRemoteInvoker
();
if
(
invoker
!=
NULL
&&
invoker
->
InvokerResetIpc
!=
NULL
)
{
(
invoker
->
InvokerResetIpc
)();
}
}
\ No newline at end of file
ipc/test/ipc/client/client.c
浏览文件 @
ac22868e
...
...
@@ -189,6 +189,6 @@ int main(int argc, char *argv[])
CallServerAdd
();
AnonymousTest
();
DeathCallbackTest
();
JoinWorkThread
();
while
(
1
)
{}
return
-
1
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录