RPMsg-Lite User's Guide: rpmsg_queue.h Source File

| RPMsg-Lite User's Guide Rev. 3.0.0 NXP Semiconductors

- Main Page
- API Reference

rpmsg_queue.h
1 /*
2 * Copyright (c) 2014, Mentor Graphics Corporation
3 * Copyright (c) 2015 Xilinx, Inc.
4 * Copyright (c) 2016 Freescale Semiconductor, Inc.
5 * Copyright 2016 NXP
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 * 3. Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from this
18 * software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #ifndef RPMSG_QUEUE_H_
34 #define RPMSG_QUEUE_H_
35
36 #include "rpmsg_lite.h"
37
40
44 typedef void *rpmsg_queue_handle;
45
46 /* RL_API_HAS_ZEROCOPY has to be enabled for RPMsg Queue to work */
47 #if defined(RL_API_HAS_ZEROCOPY) && (RL_API_HAS_ZEROCOPY == 1)
48
49 /*******************************************************************************
50 * API
51 ******************************************************************************/
52
53 /* Exported API functions */
54
55 #if defined(__cplusplus)
56 extern "C" {
57 #endif
58
70 int32_t rpmsg_queue_rx_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv);
71
82 rpmsg_queue_handle rpmsg_queue_create(struct rpmsg_lite_instance *rpmsg_lite_dev);
83
95 int32_t rpmsg_queue_destroy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q);
96
121 int32_t rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev,
122 rpmsg_queue_handle q,
123 uint32_t *src,
124 char *data,
125 uint32_t maxlen,
126 uint32_t *len,
127 uint32_t timeout);
128
154 int32_t rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev,
155 rpmsg_queue_handle q,
156 uint32_t *src,
157 char **data,
158 uint32_t *len,
159 uint32_t timeout);
160
175 int32_t rpmsg_queue_nocopy_free(struct rpmsg_lite_instance *rpmsg_lite_dev, void *data);
176
184 int32_t rpmsg_queue_get_current_size(rpmsg_queue_handle q);
185
187
188 #if defined(__cplusplus)
189 }
190 #endif
191
192 #endif /* RL_API_HAS_ZEROCOPY */
193
194 #endif /* RPMSG_QUEUE_H_ */
rpmsg_lite_instance
Definition: rpmsg_lite.h:122
rpmsg_queue_recv
int32_t rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, uint32_t *src, char *data, uint32_t maxlen, uint32_t *len, uint32_t timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...
rpmsg_queue_create
rpmsg_queue_handle rpmsg_queue_create(struct rpmsg_lite_instance *rpmsg_lite_dev)
Create a RPMsg queue which can be used for blocking reception.
rpmsg_queue_destroy
int32_t rpmsg_queue_destroy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q)
Destroy a queue and clean up. Do not destroy a queue which is registered with an active endpoint! ...
rpmsg_queue_nocopy_free
int32_t rpmsg_queue_nocopy_free(struct rpmsg_lite_instance *rpmsg_lite_dev, void *data)
This function frees a buffer previously returned by rpmsg_queue_recv_nocopy().
rpmsg_queue_rx_cb
int32_t rpmsg_queue_rx_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv)
This callback needs to be registered with an endpoint.
rpmsg_queue_handle
void * rpmsg_queue_handle
Rpmsg queue handle type.
Definition: rpmsg_queue.h:44
rpmsg_queue_get_current_size
int32_t rpmsg_queue_get_current_size(rpmsg_queue_handle q)
This function returns the number of pending messages in the queue.
rpmsg_queue_recv_nocopy
int32_t rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, uint32_t *src, char **data, uint32_t *len, uint32_t timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...