1 Star 0 Fork 4.9K

丛林 / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
kernel-small-bundles-ipc.md 4.92 KB
一键复制 编辑 原始数据 按行查看 历史
Annie_wang 提交于 2022-05-19 22:02 . update docs

LiteIPC

Basic Concepts

LiteIPC is a new inter-process communication (IPC) mechanism provided by the OpenHarmony LiteOS-A kernel. Different from the traditional System V IPC, LiteIPC is designed for Remote Procedure Call (RPC). In addition, it provides APIs for the upper layer through device files, not through traditional API functions.

LiteIPC has two important concepts: ServiceManager and Service. The entire system can have one ServiceManager and multiple Services. ServiceManager is responsible for registering and unregistering Services, and managing Service access permission (only authorized tasks can send IPC messages to corresponding Services).

Working Principles

ServiceManager registers the task that needs to receive IPC messages as a Service, and sets the access permission for the Service task (specifies the tasks that can send IPC messages to the Service). LiteIPC maintains an IPC message queue for each Service task in kernel mode. The message queue provides the upper-layer user-mode programs with the read operation (receiving IPC messages) and the write operations (sending IPC messages) through LiteIPC device files.

Development Guidelines

Available APIs

Table 1 LiteIPC module APIs (for LiteOS-A internal use only)

Function

API

Description

Module initialization

OsLiteIpcInit

Initializes the LiteIPC module.

IPC message memory pool

LiteIpcPoolInit

Initializes the IPC message memory pool of processes.

LiteIpcPoolReInit

Re-initializes the IPC message memory pool of processes.

LiteIpcPoolDelete

Releases the IPC message memory pool of processes.

Service management

LiteIpcRemoveServiceHandle

Deletes the specified Service.

NOTE: LiteIPC module APIs are used for LiteOS-A internal use only.

1
https://gitee.com/jungle8023/docs.git
git@gitee.com:jungle8023/docs.git
jungle8023
docs
docs
master

搜索帮助