Kernel APIs

This section contains APIs for the kernel’s core services, as described in the Zephyr Kernel Primer.

重要

Unless otherwise noted these APIs can be used by threads, but not by ISRs.

Threads

A thread is an independently scheduled series of instructions that implements a portion of an application’s processing. Threads are used to perform processing that is too lengthy or too complex to be performed by an ISR. (See Threads.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Workqueues

A workqueue processes a series of work items by executing the associated functions in a dedicated thread. Workqueues are typically used by an ISR or high-priority thread to offload non-urgent processing. (See Workqueue Threads.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Clocks

Kernel clocks enable threads and ISRs to measure the passage of time with either normal and high precision. (See Kernel Clocks.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Timers

Timers enable threads to measure the passage of time, and to optionally execute an action when the timer expires. (See Timers.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Memory Slabs

Memory slabs enable the dynamic allocation and release of fixed-size memory blocks. (See Memory Slabs.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Memory Pools

Memory pools enable the dynamic allocation and release of variable-size memory blocks. (See Memory Pools.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Heap Memory Pool

The heap memory pools enable the dynamic allocation and release of memory in a malloc()-like manner. (See Heap Memory Pool.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Semaphores

Semaphores provide traditional counting semaphore capabilities. (See Semaphores.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Mutexes

Mutexes provide traditional reentrant mutex capabilities with basic priority inheritance. (See Mutexes.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Alerts

Alerts enable an application to perform asynchronous signaling, somewhat akin to Unix-style signals. (See Alerts.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Fifos

Fifos provide traditional first in, first out (FIFO) queuing of data items of any size. (See Fifos.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Lifos

Lifos provide traditional last in, first out (LIFO) queuing of data items of any size. (See Lifos.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Stacks

Stacks provide traditional last in, first out (LIFO) queuing of 32-bit data items. (See Stacks.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Message Queues

Message queues provide a simple message queuing mechanism for fixed-size data items. (See Message Queues.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Mailboxes

Mailboxes provide an enhanced message queuing mechanism for variable-size messages. (See Mailboxes.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Pipes

Pipes provide a traditional anonymous pipe mechanism for sending variable-size chunks of data, in whole or in part. (See Pipes.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Interrupt Service Routines (ISRs)

An interrupt service routine is a series of instructions that is executed asynchronously in response to a hardware or software interrupt. (See Interrupts.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Atomic Services

The atomic services enable multiple threads and ISRs to read and modify 32-bit variables in an uninterruptible manner. (See Atomic Services.)

重要

All atomic services APIs can be used by both threads and ISRs.

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Floating Point Services

The floating point services enable threads to use a board’s floating point registers. (See Floating Point Services.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml

Ring Buffers

Ring buffers enable simple first in, first out (FIFO) queuing of variable-size data items. (See Ring Buffers.)

警告

doxygengroup: Cannot find file: /home/docs/checkouts/readthedocs.org/user_builds/zephyr-doc/checkouts/v1.9.0/doc/doxygen/xml/index.xml