Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
Macros | |
#define | k_lifo_init(lifo) |
Initialize a LIFO queue. | |
#define | k_lifo_put(lifo, data) |
Add an element to a LIFO queue. | |
#define | k_lifo_alloc_put(lifo, data) |
Add an element to a LIFO queue. | |
#define | k_lifo_get(lifo, timeout) |
Get an element from a LIFO queue. | |
#define | K_LIFO_DEFINE(name) |
Statically define and initialize a LIFO queue. | |
#define k_lifo_alloc_put | ( | lifo, | |
data ) |
#include <zephyr/kernel.h>
Add an element to a LIFO queue.
This routine adds a data item to lifo. There is an implicit memory allocation to create an additional temporary bookkeeping data structure from the calling thread's resource pool, which is automatically freed when the item is removed. The data itself is not copied.
lifo | Address of the LIFO. |
data | Address of the data item. |
0 | on success |
-ENOMEM | if there isn't sufficient RAM in the caller's resource pool |
#define K_LIFO_DEFINE | ( | name | ) |
#include <zephyr/kernel.h>
Statically define and initialize a LIFO queue.
The LIFO queue can be accessed outside the module where it is defined using:
name | Name of the fifo. |
#define k_lifo_get | ( | lifo, | |
timeout ) |
#include <zephyr/kernel.h>
Get an element from a LIFO queue.
This routine removes a data item from LIFO in a "last in, first out" manner. The first word of the data item is reserved for the kernel's use.
lifo | Address of the LIFO queue. |
timeout | Waiting period to obtain a data item, or one of the special values K_NO_WAIT and K_FOREVER. |
#define k_lifo_init | ( | lifo | ) |
#include <zephyr/kernel.h>
Initialize a LIFO queue.
This routine initializes a LIFO queue object, prior to its first use.
lifo | Address of the LIFO queue. |
#define k_lifo_put | ( | lifo, | |
data ) |
#include <zephyr/kernel.h>
Add an element to a LIFO queue.
This routine adds a data item to lifo. A LIFO queue data item must be aligned on a word boundary, and the first word of the item is reserved for the kernel's use.
lifo | Address of the LIFO queue. |
data | Address of the data item. |