rpmsg_queue.h
/*
* Copyright (c) 2014, Mentor Graphics Corporation
* Copyright (c) 2015 Xilinx, Inc.
* Copyright (c) 2016 Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _RPMSG_QUEUE_H
#define _RPMSG_QUEUE_H
#include "rpmsg_lite.h"
typedef void *rpmsg_queue_handle;
/* RL_API_HAS_ZEROCOPY has to be enabled for RPMsg Queue to work */
#if defined(RL_API_HAS_ZEROCOPY) && (RL_API_HAS_ZEROCOPY == 1)
/*******************************************************************************
* API
******************************************************************************/
/* Exported API functions */
#if defined(__cplusplus)
extern "C" {
#endif
int rpmsg_queue_rx_cb(void *payload, int payload_len, unsigned long src, void *priv);
rpmsg_queue_handle rpmsg_queue_create(struct rpmsg_lite_instance *rpmsg_lite_dev);
int rpmsg_queue_destroy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q);
int rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev,
rpmsg_queue_handle q,
unsigned long *src,
char *data,
int maxlen,
int *len,
unsigned long timeout);
int rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev,
rpmsg_queue_handle q,
unsigned long *src,
char **data,
int *len,
unsigned long timeout);
int rpmsg_queue_nocopy_free(struct rpmsg_lite_instance *rpmsg_lite_dev, void *data);
int rpmsg_queue_get_current_size(rpmsg_queue_handle q);
#if defined(__cplusplus)
}
#endif
#endif /* RL_API_HAS_ZEROCOPY */
#endif /* _RPMSG_QUEUE_H */
rpmsg_queue_destroy
int 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_recv
int rpmsg_queue_recv(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, unsigned long *src, char *data, int maxlen, int *len, unsigned long timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...
rpmsg_lite_instance
Definition: rpmsg_lite.h:124
rpmsg_queue_nocopy_free
int 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_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_recv_nocopy
int rpmsg_queue_recv_nocopy(struct rpmsg_lite_instance *rpmsg_lite_dev, rpmsg_queue_handle q, unsigned long *src, char **data, int *len, unsigned long timeout)
blocking receive function - blocking version of the received function that can be called from an RTOS...
rpmsg_queue_get_current_size
int rpmsg_queue_get_current_size(rpmsg_queue_handle q)
This function returns the number of pending messages in the queue.
rpmsg_queue_rx_cb
int rpmsg_queue_rx_cb(void *payload, int payload_len, unsigned long 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