RPMsg-Lite User's Guide Rev. 5.1.4
NXP Semiconductors
Loading...
Searching...
No Matches
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-2022 NXP
6 * Copyright 2021 ACRIOS Systems s.r.o.
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * 3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef RPMSG_QUEUE_H_
35#define RPMSG_QUEUE_H_
36
37#include "rpmsg_lite.h"
38
41
45typedef void *rpmsg_queue_handle;
46
47/* RL_API_HAS_ZEROCOPY has to be enabled for RPMsg Queue to work */
48#if defined(RL_API_HAS_ZEROCOPY) && (RL_API_HAS_ZEROCOPY == 1)
49
50/*******************************************************************************
51 * API
52 ******************************************************************************/
53
54/* Exported API functions */
55
56#if defined(__cplusplus)
57extern "C" {
58#endif
59
71int32_t rpmsg_queue_rx_cb(void *payload, uint32_t payload_len, uint32_t src, void *priv);
72
86#if defined(RL_USE_STATIC_API) && (RL_USE_STATIC_API == 1)
88 uint8_t *queue_storage,
89 rpmsg_static_queue_ctxt *queue_ctxt);
90#else
92#endif
93
106
131int32_t rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev,
133 uint32_t *src,
134 char *data,
135 uint32_t maxlen,
136 uint32_t *len,
137 uintptr_t timeout);
138
164int32_t rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev,
166 uint32_t *src,
167 char **data,
168 uint32_t *len,
169 uintptr_t timeout);
170
185int32_t rpmsg_queue_nocopy_free(struct rpmsg_lite_instance *rpmsg_lite_dev, void *data);
186
195
197
198#if defined(__cplusplus)
199}
200#endif
201
202#endif /* RL_API_HAS_ZEROCOPY */
203
204#endif /* RPMSG_QUEUE_H_ */
Definition: rpmsg_lite.h:187
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().
int32_t rpmsg_queue_get_current_size(rpmsg_queue_handle q)
This function returns the number of pending messages in the queue.
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!
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, uintptr_t timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...
void * rpmsg_queue_handle
Rpmsg queue handle type.
Definition: rpmsg_queue.h:45
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 rpmsg_queue_create(struct rpmsg_lite_instance *rpmsg_lite_dev)
Create a RPMsg queue which can be used for blocking reception.
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, uintptr_t timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...