HAL queues updated.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6113 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2013-08-09 13:56:40 +00:00
parent 7b51712449
commit 44f6cc6308
3 changed files with 55 additions and 55 deletions

View File

@ -290,7 +290,7 @@
* @note The default is @p TRUE.
*/
#if !defined(CH_CFG_USE_QUEUES) || defined(__DOXYGEN__)
#define CH_CFG_USE_QUEUES TRUE
#define CH_CFG_USE_QUEUES FALSE
#endif
/**

View File

@ -47,10 +47,10 @@
/**
* @brief Type of a generic I/O queue structure.
*/
typedef struct GenericQueue GenericQueue;
typedef struct io_queue_t io_queue_t;
/** @brief Queue notification callback type.*/
typedef void (*qnotify_t)(GenericQueue *qp);
typedef void (*qnotify_t)(io_queue_t *qp);
/**
* @brief Generic I/O queue structure.
@ -61,7 +61,7 @@ typedef void (*qnotify_t)(GenericQueue *qp);
* lock zone (see <b>I-Locked</b> and <b>S-Locked</b> states in
* @ref system_states) and is non-blocking.
*/
struct GenericQueue {
struct io_queue_t {
threads_queue_t q_waiting; /**< @brief Waiting thread. */
size_t q_counter; /**< @brief Resources counter. */
uint8_t *q_buffer; /**< @brief Pointer to the queue buffer.*/
@ -80,7 +80,7 @@ struct GenericQueue {
/**
* @brief Returns the queue's buffer size.
*
* @param[in] qp pointer to a @p GenericQueue structure.
* @param[in] qp pointer to a @p io_queue_t structure.
* @return The buffer size.
*
* @iclass
@ -92,7 +92,7 @@ struct GenericQueue {
* @details Returns the used space if used on an input queue or the empty
* space if used on an output queue.
*
* @param[in] qp pointer to a @p GenericQueue structure.
* @param[in] qp pointer to a @p io_queue_t structure.
* @return The buffer space.
*
* @iclass
@ -103,7 +103,7 @@ struct GenericQueue {
* @brief Returns the queue application-defined link.
* @note This function can be called in any context.
*
* @param[in] qp pointer to a @p GenericQueue structure.
* @param[in] qp pointer to a @p io_queue_t structure.
* @return The application-defined link.
*
* @special
@ -112,7 +112,7 @@ struct GenericQueue {
/** @} */
/**
* @extends GenericQueue
* @extends io_queue_t
*
* @brief Type of an input queue structure.
* @details This structure represents a generic asymmetrical input queue.
@ -122,7 +122,7 @@ struct GenericQueue {
* Reading the queue can be a blocking operation and is supposed to
* be performed by a system thread.
*/
typedef GenericQueue InputQueue;
typedef io_queue_t input_queue_t;
/**
* @name Macro Functions
@ -131,7 +131,7 @@ typedef GenericQueue InputQueue;
/**
* @brief Returns the filled space into an input queue.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @return The number of full bytes in the queue.
* @retval 0 if the queue is empty.
*
@ -142,7 +142,7 @@ typedef GenericQueue InputQueue;
/**
* @brief Returns the empty space into an input queue.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @return The number of empty bytes in the queue.
* @retval 0 if the queue is full.
*
@ -153,7 +153,7 @@ typedef GenericQueue InputQueue;
/**
* @brief Evaluates to @p TRUE if the specified input queue is empty.
*
* @param[in] iqp pointer to an @p InputQueue structure.
* @param[in] iqp pointer to an @p input_queue_t structure.
* @return The queue status.
* @retval FALSE if the queue is not empty.
* @retval TRUE if the queue is empty.
@ -165,7 +165,7 @@ typedef GenericQueue InputQueue;
/**
* @brief Evaluates to @p TRUE if the specified input queue is full.
*
* @param[in] iqp pointer to an @p InputQueue structure.
* @param[in] iqp pointer to an @p input_queue_t structure.
* @return The queue status.
* @retval FALSE if the queue is not full.
* @retval TRUE if the queue is full.
@ -181,7 +181,7 @@ typedef GenericQueue InputQueue;
* is empty then the calling thread is suspended until a byte arrives
* in the queue.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @return A byte value from the queue.
* @retval Q_RESET if the queue has been reset.
*
@ -224,10 +224,10 @@ typedef GenericQueue InputQueue;
* @param[in] link application defined pointer
*/
#define INPUTQUEUE_DECL(name, buffer, size, inotify, link) \
InputQueue name = _INPUTQUEUE_DATA(name, buffer, size, inotify, link)
input_queue_t name = _INPUTQUEUE_DATA(name, buffer, size, inotify, link)
/**
* @extends GenericQueue
* @extends io_queue_t
*
* @brief Type of an output queue structure.
* @details This structure represents a generic asymmetrical output queue.
@ -237,7 +237,7 @@ typedef GenericQueue InputQueue;
* Writing the queue can be a blocking operation and is supposed to
* be performed by a system thread.
*/
typedef GenericQueue OutputQueue;
typedef io_queue_t output_queue_t;
/**
* @name Macro Functions
@ -246,7 +246,7 @@ typedef GenericQueue OutputQueue;
/**
* @brief Returns the filled space into an output queue.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @return The number of full bytes in the queue.
* @retval 0 if the queue is empty.
*
@ -257,7 +257,7 @@ typedef GenericQueue OutputQueue;
/**
* @brief Returns the empty space into an output queue.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @return The number of empty bytes in the queue.
* @retval 0 if the queue is full.
*
@ -268,7 +268,7 @@ typedef GenericQueue OutputQueue;
/**
* @brief Evaluates to @p TRUE if the specified output queue is empty.
*
* @param[in] oqp pointer to an @p OutputQueue structure.
* @param[in] oqp pointer to an @p output_queue_t structure.
* @return The queue status.
* @retval FALSE if the queue is not empty.
* @retval TRUE if the queue is empty.
@ -281,7 +281,7 @@ typedef GenericQueue OutputQueue;
/**
* @brief Evaluates to @p TRUE if the specified output queue is full.
*
* @param[in] oqp pointer to an @p OutputQueue structure.
* @param[in] oqp pointer to an @p output_queue_t structure.
* @return The queue status.
* @retval FALSE if the queue is not full.
* @retval TRUE if the queue is full.
@ -296,7 +296,7 @@ typedef GenericQueue OutputQueue;
* is full then the calling thread is suspended until there is space
* in the queue.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @param[in] b the byte value to be written in the queue
* @return The operation status.
* @retval Q_OK if the operation succeeded.
@ -341,25 +341,25 @@ typedef GenericQueue OutputQueue;
* @param[in] link application defined pointer
*/
#define OUTPUTQUEUE_DECL(name, buffer, size, onotify, link) \
OutputQueue name = _OUTPUTQUEUE_DATA(name, buffer, size, onotify, link)
output_queue_t name = _OUTPUTQUEUE_DATA(name, buffer, size, onotify, link)
#ifdef __cplusplus
extern "C" {
#endif
void iqObjectInit(InputQueue *iqp, uint8_t *bp, size_t size,
void iqObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size,
qnotify_t infy, void *link);
void iqResetI(InputQueue *iqp);
msg_t iqPutI(InputQueue *iqp, uint8_t b);
msg_t iqGetTimeout(InputQueue *iqp, systime_t time);
size_t iqReadTimeout(InputQueue *iqp, uint8_t *bp,
void iqResetI(input_queue_t *iqp);
msg_t iqPutI(input_queue_t *iqp, uint8_t b);
msg_t iqGetTimeout(input_queue_t *iqp, systime_t time);
size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp,
size_t n, systime_t time);
void oqObjectInit(OutputQueue *oqp, uint8_t *bp, size_t size,
void oqObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size,
qnotify_t onfy, void *link);
void oqResetI(OutputQueue *oqp);
msg_t oqPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time);
msg_t oqGetI(OutputQueue *oqp);
size_t oqWriteTimeout(OutputQueue *oqp, const uint8_t *bp,
void oqResetI(output_queue_t *oqp);
msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, systime_t time);
msg_t oqGetI(output_queue_t *oqp);
size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
size_t n, systime_t time);
#ifdef __cplusplus
}

View File

@ -50,7 +50,7 @@
* @note The callback is invoked from within the S-Locked system state,
* see @ref system_states.
*
* @param[out] iqp pointer to an @p InputQueue structure
* @param[out] iqp pointer to an @p input_queue_t structure
* @param[in] bp pointer to a memory area allocated as queue buffer
* @param[in] size size of the queue buffer
* @param[in] infy pointer to a callback function that is invoked when
@ -59,7 +59,7 @@
*
* @init
*/
void iqObjectInit(InputQueue *iqp, uint8_t *bp, size_t size,
void iqObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size,
qnotify_t infy, void *link) {
osalQueueObjectInit(&iqp->q_waiting);
@ -77,11 +77,11 @@ void iqObjectInit(InputQueue *iqp, uint8_t *bp, size_t size,
* @note A reset operation can be used by a low level driver in order to
* obtain immediate attention from the high level layers.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
*
* @iclass
*/
void iqResetI(InputQueue *iqp) {
void iqResetI(input_queue_t *iqp) {
osalDbgCheckClassI();
@ -94,7 +94,7 @@ void iqResetI(InputQueue *iqp) {
* @brief Input queue write.
* @details A byte value is written into the low end of an input queue.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @param[in] b the byte value to be written in the queue
* @return The operation status.
* @retval Q_OK if the operation has been completed with success.
@ -103,7 +103,7 @@ void iqResetI(InputQueue *iqp) {
*
* @iclass
*/
msg_t iqPutI(InputQueue *iqp, uint8_t b) {
msg_t iqPutI(input_queue_t *iqp, uint8_t b) {
osalDbgCheckClassI();
@ -128,7 +128,7 @@ msg_t iqPutI(InputQueue *iqp, uint8_t b) {
* @note The callback is invoked before reading the character from the
* buffer or before entering the state @p THD_STATE_WTQUEUE.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
* - @a TIME_IMMEDIATE immediate timeout.
@ -140,7 +140,7 @@ msg_t iqPutI(InputQueue *iqp, uint8_t b) {
*
* @api
*/
msg_t iqGetTimeout(InputQueue *iqp, systime_t time) {
msg_t iqGetTimeout(input_queue_t *iqp, systime_t time) {
uint8_t b;
osalSysLock();
@ -175,7 +175,7 @@ msg_t iqGetTimeout(InputQueue *iqp, systime_t time) {
* @note The callback is invoked before reading each character from the
* buffer or before entering the state @p THD_STATE_WTQUEUE.
*
* @param[in] iqp pointer to an @p InputQueue structure
* @param[in] iqp pointer to an @p input_queue_t structure
* @param[out] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred, the
* value 0 is reserved
@ -188,7 +188,7 @@ msg_t iqGetTimeout(InputQueue *iqp, systime_t time) {
*
* @api
*/
size_t iqReadTimeout(InputQueue *iqp, uint8_t *bp,
size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp,
size_t n, systime_t time) {
qnotify_t nfy = iqp->q_notify;
size_t r = 0;
@ -228,7 +228,7 @@ size_t iqReadTimeout(InputQueue *iqp, uint8_t *bp,
* @note The callback is invoked from within the S-Locked system state,
* see @ref system_states.
*
* @param[out] oqp pointer to an @p OutputQueue structure
* @param[out] oqp pointer to an @p output_queue_t structure
* @param[in] bp pointer to a memory area allocated as queue buffer
* @param[in] size size of the queue buffer
* @param[in] onfy pointer to a callback function that is invoked when
@ -237,7 +237,7 @@ size_t iqReadTimeout(InputQueue *iqp, uint8_t *bp,
*
* @init
*/
void oqObjectInit(OutputQueue *oqp, uint8_t *bp, size_t size,
void oqObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size,
qnotify_t onfy, void *link) {
osalQueueObjectInit(&oqp->q_waiting);
@ -255,11 +255,11 @@ void oqObjectInit(OutputQueue *oqp, uint8_t *bp, size_t size,
* @note A reset operation can be used by a low level driver in order to
* obtain immediate attention from the high level layers.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
*
* @iclass
*/
void oqResetI(OutputQueue *oqp) {
void oqResetI(output_queue_t *oqp) {
osalDbgCheckClassI();
@ -276,7 +276,7 @@ void oqResetI(OutputQueue *oqp) {
* @note The callback is invoked after writing the character into the
* buffer.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @param[in] b the byte value to be written in the queue
* @param[in] time the number of ticks before the operation timeouts,
* the following special values are allowed:
@ -290,7 +290,7 @@ void oqResetI(OutputQueue *oqp) {
*
* @api
*/
msg_t oqPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time) {
msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, systime_t time) {
osalSysLock();
while (oqIsFullI(oqp)) {
@ -318,13 +318,13 @@ msg_t oqPutTimeout(OutputQueue *oqp, uint8_t b, systime_t time) {
* @brief Output queue read.
* @details A byte value is read from the low end of an output queue.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @return The byte value from the queue.
* @retval Q_EMPTY if the queue is empty.
*
* @iclass
*/
msg_t oqGetI(OutputQueue *oqp) {
msg_t oqGetI(output_queue_t *oqp) {
uint8_t b;
osalDbgCheckClassI();
@ -353,7 +353,7 @@ msg_t oqGetI(OutputQueue *oqp) {
* @note The callback is invoked after writing each character into the
* buffer.
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] oqp pointer to an @p output_queue_t structure
* @param[out] bp pointer to the data buffer
* @param[in] n the maximum amount of data to be transferred, the
* value 0 is reserved
@ -366,7 +366,7 @@ msg_t oqGetI(OutputQueue *oqp) {
*
* @api
*/
size_t oqWriteTimeout(OutputQueue *oqp, const uint8_t *bp,
size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
size_t n, systime_t time) {
qnotify_t nfy = oqp->q_notify;
size_t w = 0;