mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-09-26 20:35:53 +08:00
docs: add no-copy user API description
Add short description of the no-copy user interface. Add some sub-chapters to increase the readability. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
This commit is contained in:
committed by
Arnaud Pouliquen
parent
4e1fa03814
commit
753a20368b
@@ -36,6 +36,7 @@ running on two processors.
|
||||
```
|
||||
struct rpmsg_device *rpmsg_virtio_get_rpmsg_device(struct rpmsg_virtio_device *rvdev)
|
||||
```
|
||||
### RPMsg virtio endpoint APIs
|
||||
* Create RPMsg endpoint:
|
||||
```
|
||||
int rpmsg_create_ept(struct rpmsg_endpoint *ept,
|
||||
@@ -52,6 +53,7 @@ running on two processors.
|
||||
```
|
||||
int is_rpmsg_ept_ready(struct rpmsg_endpoint *ept)
|
||||
```
|
||||
### RPMsg messaging APIs
|
||||
* Send message with RPMsg endpoint default binding:
|
||||
```
|
||||
int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len)
|
||||
@@ -88,6 +90,43 @@ running on two processors.
|
||||
const void *data, int len)`
|
||||
```
|
||||
|
||||
* Hold the rx buffer for usage outside the receive callback:
|
||||
```
|
||||
void rpmsg_hold_rx_buffer(struct rpmsg_endpoint *ept, void *rxbuf)
|
||||
```
|
||||
|
||||
* Release the rx buffer held thanks to the rpmsg_hold_rx_buffer() function:
|
||||
```
|
||||
void rpmsg_release_rx_buffer(struct rpmsg_endpoint *ept, void *rxbuf)
|
||||
|
||||
```
|
||||
* Gets the tx buffer for message payload.
|
||||
```
|
||||
void *rpmsg_get_tx_payload_buffer(struct rpmsg_endpoint *ept,
|
||||
uint32_t *len, int wait)
|
||||
```
|
||||
|
||||
* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function,
|
||||
Send a message with the RPMsg endpoint default binding:
|
||||
```
|
||||
int rpmsg_send_nocopy(struct rpmsg_endpoint *ept,
|
||||
const void *data, int len)
|
||||
```
|
||||
|
||||
* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function,
|
||||
send a message with RPMsg endpoint, specifying the destination address:
|
||||
```
|
||||
int rpmsg_sendto_nocopy(struct rpmsg_endpoint *ept,
|
||||
const void *data, int len, uint32_t dst)
|
||||
```
|
||||
|
||||
* Using a buffer obtained by calling the rpmsg_get_tx_payload_buffer() function,
|
||||
send a message with RPMsg endpoint using explicit source and destination addresses:
|
||||
```
|
||||
int rpmsg_send_offchannel_nocopy(struct rpmsg_endpoint *ept, uint32_t src,
|
||||
uint32_t dst, const void *data, int len)
|
||||
```
|
||||
|
||||
* Releases unused Tx buffer reserved by rpmsg_get_tx_payload_buffer() function:
|
||||
```
|
||||
int rpmsg_release_tx_buffer(struct rpmsg_endpoint *ept, void *txbuf)
|
||||
|
||||
Reference in New Issue
Block a user