aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include')
-rw-r--r--os/kernel/include/chbsem.h40
-rw-r--r--os/kernel/include/chdebug.h4
-rw-r--r--os/kernel/include/chevents.h9
-rw-r--r--os/kernel/include/chfiles.h10
-rw-r--r--os/kernel/include/chioch.h38
-rw-r--r--os/kernel/include/chlists.h8
-rw-r--r--os/kernel/include/chmboxes.h16
-rw-r--r--os/kernel/include/chmsg.h4
-rw-r--r--os/kernel/include/chmtx.h2
-rw-r--r--os/kernel/include/chqueues.h40
-rw-r--r--os/kernel/include/chschd.h10
-rw-r--r--os/kernel/include/chsem.h9
-rw-r--r--os/kernel/include/chstreams.h4
-rw-r--r--os/kernel/include/chsys.h30
-rw-r--r--os/kernel/include/chthreads.h22
-rw-r--r--os/kernel/include/chvt.h6
16 files changed, 214 insertions, 38 deletions
diff --git a/os/kernel/include/chbsem.h b/os/kernel/include/chbsem.h
index 04d4579da..238ee2607 100644
--- a/os/kernel/include/chbsem.h
+++ b/os/kernel/include/chbsem.h
@@ -91,6 +91,8 @@ typedef struct {
* - @a FALSE, the initial state is not taken.
* - @a TRUE, the initial state is taken.
* .
+ *
+ * @init
*/
#define chBSemInit(bsp, taken) chSemInit(&bsp->bs_sem, taken ? 0 : 1)
@@ -98,9 +100,13 @@ typedef struct {
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p BinarySemaphore structure
- * @retval RDY_OK if the binary semaphore had been successfully taken.
+ * @return A message specifying how the invoking thread has been
+ * released from the semaphore.
+ * @retval RDY_OK if the binary semaphore has been successfully taken.
* @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset().
+ *
+ * @api
*/
#define chBSemWait(bsp) chSemWait(&bsp->bs_sem)
@@ -108,9 +114,13 @@ typedef struct {
* @brief Wait operation on the binary semaphore.
*
* @param[in] bsp pointer to a @p BinarySemaphore structure
- * @retval RDY_OK if the binary semaphore had been successfully taken.
+ * @return A message specifying how the invoking thread has been
+ * released from the semaphore.
+ * @retval RDY_OK if the binary semaphore has been successfully taken.
* @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset().
+ *
+ * @sclass
*/
#define chBSemWaitS(bsp) chSemWaitS(&bsp->bs_sem)
@@ -123,11 +133,15 @@ typedef struct {
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
- * @retval RDY_OK if the binary semaphore had been successfully taken.
+ * @return A message specifying how the invoking thread has been
+ * released from the semaphore.
+ * @retval RDY_OK if the binary semaphore has been successfully taken.
* @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset().
- * @retval RDY_TIMEOUT if the binary semaphore was not signaled or reset
+ * @retval RDY_TIMEOUT if the binary semaphore has not been signaled or reset
* within the specified timeout.
+ *
+ * @api
*/
#define chBSemWaitTimeout(bsp, time) chSemWaitTimeout(&bsp->bs_sem, time)
@@ -140,11 +154,15 @@ typedef struct {
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
- * @retval RDY_OK if the binary semaphore had been successfully taken.
+ * @return A message specifying how the invoking thread has been
+ * released from the semaphore.
+ * @retval RDY_OK if the binary semaphore has been successfully taken.
* @retval RDY_RESET if the binary semaphore has been reset using
* @p bsemReset().
- * @retval RDY_TIMEOUT if the binary semaphore was not signaled or reset
+ * @retval RDY_TIMEOUT if the binary semaphore has not been signaled or reset
* within the specified timeout.
+ *
+ * @sclass
*/
#define chBSemWaitTimeoutS(bsp, time) chSemWaitTimeoutS(&bsp->bs_sem, time)
@@ -159,6 +177,8 @@ typedef struct {
* - @a FALSE, the new state is not taken.
* - @a TRUE, the new state is taken.
* .
+ *
+ * @api
*/
#define chBSemReset(bsp, taken) chSemReset(&bsp->bs_sem, taken ? 0 : 1)
@@ -174,6 +194,8 @@ typedef struct {
* - @a FALSE, the new state is not taken.
* - @a TRUE, the new state is taken.
* .
+ *
+ * @iclass
*/
#define chBSemResetI(bsp, taken) chSemResetI(&bsp->bs_sem, taken ? 0 : 1)
@@ -181,6 +203,8 @@ typedef struct {
* @brief Performs a signal operation on a binary semaphore.
*
* @param[in] bsp pointer to a @p BinarySemaphore structure
+ *
+ * @api
*/
#define chBSemSignal(bsp) { \
chSysLock(); \
@@ -194,6 +218,8 @@ typedef struct {
* @note This function does not reschedule.
*
* @param[in] bsp pointer to a @p BinarySemaphore structure
+ *
+ * @iclass
*/
#define chBSemSignalI(bsp) { \
if (bsp->bs_sem.s_cnt < 1) \
@@ -207,6 +233,8 @@ typedef struct {
* @return The binary semaphore current state.
* @retval FALSE if the binary semaphore is not taken.
* @retval TRUE if the binary semaphore is taken.
+ *
+ * @iclass
*/
#define chBSemGetStateI(bsp) ((bsp)->bs_sem.s_cnt > 0 ? 0 : 1)
diff --git a/os/kernel/include/chdebug.h b/os/kernel/include/chdebug.h
index e6d6f231c..e29b095e8 100644
--- a/os/kernel/include/chdebug.h
+++ b/os/kernel/include/chdebug.h
@@ -91,6 +91,8 @@ typedef struct {
*
* @param[in] c the condition to be verified to be true
* @param[in] func the undecorated function name
+ *
+ * @api
*/
#define chDbgCheck(c, func) { \
if (!(c)) \
@@ -117,6 +119,8 @@ typedef struct {
* @param[in] c the condition to be verified to be true
* @param[in] m the text message
* @param[in] r a remark string
+ *
+ * @api
*/
#define chDbgAssert(c, m, r) { \
if (!(c)) \
diff --git a/os/kernel/include/chevents.h b/os/kernel/include/chevents.h
index cf7939d57..6a1cd6106 100644
--- a/os/kernel/include/chevents.h
+++ b/os/kernel/include/chevents.h
@@ -90,6 +90,8 @@ typedef struct EventSource {
* function.
* The value must range between zero and the size, in bit,
* of the @p eventid_t type minus one.
+ *
+ * @api
*/
#define chEvtRegister(esp, elp, eid) \
chEvtRegisterMask(esp, elp, EVENT_MASK(eid))
@@ -100,17 +102,20 @@ typedef struct EventSource {
* because it just prepares a @p EventSource structure.
*
* @param[in] esp pointer to the @p EventSource structure
+ *
+ * @init
*/
#define chEvtInit(esp) \
((esp)->es_next = (EventListener *)(void *)(esp))
/**
* @brief Verifies if there is at least one @p EventListener registered.
- * @note Can be called with interrupts disabled or enabled.
*
* @param[in] esp pointer to the @p EventSource structure
+ *
+ * @iclass
*/
-#define chEvtIsListening(esp) \
+#define chEvtIsListeningI(esp) \
((void *)(esp) != (void *)(esp)->es_next)
/**
diff --git a/os/kernel/include/chfiles.h b/os/kernel/include/chfiles.h
index 3053419d9..dbe5e0567 100644
--- a/os/kernel/include/chfiles.h
+++ b/os/kernel/include/chfiles.h
@@ -96,6 +96,8 @@ typedef struct {
* @details The function closes a file stream.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ *
+ * @api
*/
#define chFileStreamClose(ip) ((ip)->vmt->close(ip))
@@ -103,6 +105,8 @@ typedef struct {
* @brief Returns an implementation dependent error code.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ *
+ * @api
*/
#define chFileStreamGetError ((ip)->vmt->geterror(ip))
@@ -110,6 +114,8 @@ typedef struct {
* @brief Returns the current file size.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ *
+ * @api
*/
#define chFileStreamGetSize ((ip)->vmt->getposition(ip))
@@ -117,6 +123,8 @@ typedef struct {
* @brief Returns the current file pointer position.
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
+ *
+ * @api
*/
#define chFileStreamGetPosition ((ip)->vmt->getposition(ip))
@@ -125,6 +133,8 @@ typedef struct {
*
* @param[in] ip pointer to a @p BaseFileStream or derived class
* @param[in] offset new absolute position
+ *
+ * @api
*/
#define chFileStreamSeek ((ip)->vmt->lseek(ip, offset))
diff --git a/os/kernel/include/chioch.h b/os/kernel/include/chioch.h
index 40103d0a5..3fff4b626 100644
--- a/os/kernel/include/chioch.h
+++ b/os/kernel/include/chioch.h
@@ -91,11 +91,13 @@ typedef struct {
* block.
*
* @param[in] ip pointer to a @p BaseChannel or derived class
- * @return The output queue status:
+ * @return The output queue status.
* @retval FALSE if the output queue has space and would not block a
* write operation.
* @retval TRUE if the output queue is full and would block a write
* operation.
+ *
+ * @api
*/
#define chIOPutWouldBlock(ip) ((ip)->vmt->putwouldblock(ip))
@@ -105,11 +107,13 @@ typedef struct {
* block.
*
* @param[in] ip pointer to a @p BaseChannel or derived class
- * @return The input queue status:
+ * @return The input queue status.
* @retval FALSE if the input queue contains data and would not block a
* read operation.
* @retval TRUE if the input queue is empty and would block a read
* operation.
+ *
+ * @api
*/
#define chIOGetWouldBlock(ip) ((ip)->vmt->getwouldblock(ip))
@@ -120,9 +124,11 @@ typedef struct {
*
* @param[in] ip pointer to a @p BaseChannel or derived class
* @param[in] b the byte value to be written to the channel
- * @return The operation status:
+ * @return The operation status.
* @retval Q_OK if the operation succeeded.
* @retval Q_RESET if the channel associated queue (if any) was reset.
+ *
+ * @api
*/
#define chIOPut(ip, b) ((ip)->vmt->put(ip, b, TIME_INFINITE))
@@ -138,10 +144,12 @@ typedef struct {
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
- * @return The operation status:
+ * @return The operation status.
* @retval Q_OK if the operation succeeded.
* @retval Q_TIMEOUT if the specified time expired.
* @retval Q_RESET if the channel associated queue (if any) was reset.
+ *
+ * @api
*/
#define chIOPutTimeout(ip, b, time) ((ip)->vmt->put(ip, b, time))
@@ -151,8 +159,11 @@ typedef struct {
* is not available then the calling thread is suspended.
*
* @param[in] ip pointer to a @p BaseChannel or derived class
- * @return A byte value from the queue or:
- * @retval Q_RESET if the channel associated queue (if any) was reset.
+ * @return A byte value from the queue.
+ * @retval Q_RESET if the channel associated queue (if any) has been
+ * reset.
+ *
+ * @api
*/
#define chIOGet(ip) ((ip)->vmt->get(ip, TIME_INFINITE))
@@ -167,9 +178,12 @@ typedef struct {
* - @a TIME_IMMEDIATE immediate timeout.
* - @a TIME_INFINITE no timeout.
* .
- * @return A byte value from the queue or:
+ * @return A byte value from the queue.
* @retval Q_TIMEOUT if the specified time expired.
- * @retval Q_RESET if the channel associated queue (if any) was reset.
+ * @retval Q_RESET if the channel associated queue (if any) has been
+ * reset.
+ *
+ * @api
*/
#define chIOGetTimeout(ip, time) ((ip)->vmt->get(ip, time))
@@ -187,6 +201,8 @@ typedef struct {
* - @a TIME_INFINITE no timeout.
* .
* @return The number of bytes transferred.
+ *
+ * @api
*/
#define chIOWriteTimeout(ip, bp, n, time) \
((ip)->vmt->writet(ip, bp, n, time))
@@ -205,6 +221,8 @@ typedef struct {
* - @a TIME_INFINITE no timeout.
* .
* @return The number of bytes transferred.
+ *
+ * @api
*/
#define chIOReadTimeout(ip, bp, n, time) \
((ip)->vmt->readt(ip, bp, n, time))
@@ -255,6 +273,8 @@ typedef struct {
* @param[in] ip pointer to a @p BaseAsynchronousChannel or derived
* class
* @return A pointer to an @p EventSource object.
+ *
+ * @api
*/
#define chIOGetWriteEventSource(ip) (&((ip)->vmt->oevent))
@@ -267,6 +287,8 @@ typedef struct {
* @param[in] ip pointer to a @p BaseAsynchronousChannel or derived
* class
* @return A pointer to an @p EventSource object.
+ *
+ * @api
*/
#define chIOGetReadEventSource(ip) (&((ip)->vmt->ievent))
diff --git a/os/kernel/include/chlists.h b/os/kernel/include/chlists.h
index d3eef5417..a93ccedb4 100644
--- a/os/kernel/include/chlists.h
+++ b/os/kernel/include/chlists.h
@@ -35,23 +35,31 @@ typedef struct Thread Thread;
/**
* @brief Threads queue initialization.
+ *
+ * @notapi
*/
#define queue_init(tqp) ((tqp)->p_next = (tqp)->p_prev = (Thread *)(tqp));
/**
* @brief Threads list initialization.
+ *
+ * @notapi
*/
#define list_init(tlp) ((tlp)->p_next = (Thread *)(tlp))
/**
* @brief Evaluates to @p TRUE if the specified threads queue or list is
* empty.
+ *
+ * @notapi
*/
#define isempty(p) ((p)->p_next == (Thread *)(p))
/**
* @brief Evaluates to @p TRUE if the specified threads queue or list is
* not empty.
+ *
+ * @notapi
*/
#define notempty(p) ((p)->p_next != (Thread *)(p))
diff --git a/os/kernel/include/chmboxes.h b/os/kernel/include/chmboxes.h
index 4447b02d1..ed4bec8ff 100644
--- a/os/kernel/include/chmboxes.h
+++ b/os/kernel/include/chmboxes.h
@@ -72,8 +72,10 @@ extern "C" {
* @brief Returns the mailbox buffer size.
*
* @param[in] mbp the pointer to an initialized Mailbox object
+ *
+ * @iclass
*/
-#define chMBSize(mbp) \
+#define chMBSizeI(mbp) \
((mbp)->mb_top - (mbp)->mb_buffer)
/**
@@ -85,8 +87,10 @@ extern "C" {
*
* @param[in] mbp the pointer to an initialized Mailbox object
* @return The number of empty message slots.
+ *
+ * @iclass
*/
-#define chMBGetEmpty(mbp) chSemGetCounterI(&(mbp)->mb_emptysem)
+#define chMBGetEmptyI(mbp) chSemGetCounterI(&(mbp)->mb_emptysem)
/**
* @brief Returns the number of messages into the mailbox.
@@ -97,8 +101,10 @@ extern "C" {
*
* @param[in] mbp the pointer to an initialized Mailbox object
* @return The number of queued messages.
+ *
+ * @iclass
*/
-#define chMBGetFull(mbp) chSemGetCounterI(&(mbp)->mb_fullsem)
+#define chMBGetFullI(mbp) chSemGetCounterI(&(mbp)->mb_fullsem)
/**
* @brief Returns the next message in the queue without removing it.
@@ -106,8 +112,10 @@ extern "C" {
* or it would return garbage. The correct way to use this macro is
* to use @p chMBGetFull() and then use this macro, all within a
* lock state.
+ *
+ * @iclass
*/
-#define chMBPeek(mbp) (*(mbp)->mb_rdptr)
+#define chMBPeekI(mbp) (*(mbp)->mb_rdptr)
/**
* @brief Data part of a static mailbox initializer.
diff --git a/os/kernel/include/chmsg.h b/os/kernel/include/chmsg.h
index 16f6d1ef4..438da021f 100644
--- a/os/kernel/include/chmsg.h
+++ b/os/kernel/include/chmsg.h
@@ -32,12 +32,16 @@
/**
* @brief Evaluates to TRUE if the thread has pending messages.
+ *
+ * @iclass
*/
#define chMsgIsPendingI(tp) \
((tp)->p_msgqueue.p_next != (Thread *)&(tp)->p_msgqueue)
/**
* @brief Returns the first message in the queue.
+ *
+ * @iclass
*/
#define chMsgGetI(tp) \
((tp)->p_msgqueue.p_next->p_msg)
diff --git a/os/kernel/include/chmtx.h b/os/kernel/include/chmtx.h
index c551f47bf..cb0e78001 100644
--- a/os/kernel/include/chmtx.h
+++ b/os/kernel/include/chmtx.h
@@ -78,6 +78,8 @@ extern "C" {
/**
* @brief Returns @p TRUE if the mutex queue contains at least a waiting
* thread.
+ *
+ * @sclass
*/
#define chMtxQueueNotEmptyS(mp) notempty(&(mp)->m_queue)
diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h
index c18da0fc7..92007ae0f 100644
--- a/os/kernel/include/chqueues.h
+++ b/os/kernel/include/chqueues.h
@@ -72,8 +72,10 @@ typedef struct {
/**
* @brief Returns the queue's buffer size.
+ *
+ * @iclass
*/
-#define chQSize(q) ((q)->q_top - (q)->q_buffer)
+#define chQSizeI(q) ((q)->q_top - (q)->q_buffer)
/**
* @brief Queue space.
@@ -81,8 +83,10 @@ typedef struct {
* space if used on an Output Queue.
* @note The returned value can be less than zero when there are waiting
* threads on the internal semaphore.
+ *
+ * @iclass
*/
-#define chQSpace(q) chSemGetCounterI(&(q)->q_sem)
+#define chQSpaceI(q) chSemGetCounterI(&(q)->q_sem)
/**
* @extends GenericQueue
@@ -97,11 +101,19 @@ typedef struct {
*/
typedef GenericQueue InputQueue;
-/** @brief Evaluates to @p TRUE if the specified Input Queue is empty.*/
-#define chIQIsEmpty(q) ((bool_t)(chQSpace(q) <= 0))
+/**
+ * @brief Evaluates to @p TRUE if the specified Input Queue is empty.
+ *
+ * @iclass
+ */
+#define chIQIsEmptyI(q) ((bool_t)(chQSpaceI(q) <= 0))
-/** @brief Evaluates to @p TRUE if the specified Input Queue is full.*/
-#define chIQIsFull(q) ((bool_t)(chQSpace(q) >= chQSize(q)))
+/**
+ * @brief Evaluates to @p TRUE if the specified Input Queue is full.
+ *
+ * @iclass
+ */
+#define chIQIsFullI(q) ((bool_t)(chQSpaceI(q) >= chQSizeI(q)))
/**
* @brief Input queue read.
@@ -110,8 +122,10 @@ typedef GenericQueue InputQueue;
* in the queue.
*
* @param[in] iqp pointer to an @p InputQueue structure
- * @return A byte value from the queue or:
+ * @return A byte value from the queue.
* @retval Q_RESET if the queue was reset.
+ *
+ * @api
*/
#define chIQGet(iqp) chIQGetTimeout(iqp, TIME_INFINITE)
@@ -162,13 +176,17 @@ typedef GenericQueue OutputQueue;
/**
* @brief Evaluates to @p TRUE if the specified Output Queue is empty.
+ *
+ * @iclass
*/
-#define chOQIsEmpty(q) ((bool_t)(chQSpace(q) >= chQSize(q)))
+#define chOQIsEmptyI(q) ((bool_t)(chQSpaceI(q) >= chQSizeI(q)))
/**
* @brief Evaluates to @p TRUE if the specified Output Queue is full.
+ *
+ * @iclass
*/
-#define chOQIsFull(q) ((bool_t)(chQSpace(q) <= 0))
+#define chOQIsFullI(q) ((bool_t)(chQSpaceI(q) <= 0))
/**
* @brief Output queue write.
@@ -178,9 +196,11 @@ typedef GenericQueue OutputQueue;
*
* @param[in] oqp pointer to an @p OutputQueue structure
* @param[in] b the byte value to be written in the queue
- * @return The operation status:
+ * @return The operation status.
* @retval Q_OK if the operation succeeded.
* @retval Q_RESET if the queue was reset.
+ *
+ * @api
*/
#define chOQPut(oqp, b) chOQPutTimeout(oqp, b, TIME_INFINITE)
diff --git a/os/kernel/include/chschd.h b/os/kernel/include/chschd.h
index e5c6d7e55..a9283c290 100644
--- a/os/kernel/include/chschd.h
+++ b/os/kernel/include/chschd.h
@@ -58,6 +58,8 @@
/**
* @brief Returns the priority of the first thread on the given ready list.
+ *
+ * @notapi
*/
#define firstprio(rlp) ((rlp)->p_next->p_prio)
@@ -111,6 +113,8 @@ register Thread *currp asm(CH_CURRP_REGISTER_CACHE);
* @brief Current thread pointer change macro.
* @note This macro is not meant to be used in the application code but
* only from within the kernel.
+ *
+ * @notapi
*/
#if !defined(PORT_OPTIMIZED_SETCURRP) || defined(__DOXYGEN__)
#define setcurrp(tp) (currp = (tp))
@@ -152,6 +156,8 @@ extern "C" {
* @brief Determines if the current thread must reschedule.
* @details This function returns @p TRUE if there is a ready thread with
* higher priority.
+ *
+ * @iclass
*/
#if !defined(PORT_OPTIMIZED_ISRESCHREQUIREDI) || defined(__DOXYGEN__)
#define chSchIsRescRequiredI() (firstprio(&rlist.r_queue) > currp->p_prio)
@@ -161,6 +167,8 @@ extern "C" {
* @brief Determines if yielding is possible.
* @details This function returns @p TRUE if there is a ready thread with
* equal or higher priority.
+ *
+ * @sclass
*/
#if !defined(PORT_OPTIMIZED_CANYIELDS) || defined(__DOXYGEN__)
#define chSchCanYieldS() (firstprio(&rlist.r_queue) >= currp->p_prio)
@@ -170,6 +178,8 @@ extern "C" {
* @brief Yields the time slot.
* @details Yields the CPU control to the next thread in the ready list with
* equal or higher priority, if any.
+ *
+ * @sclass
*/
#if !defined(PORT_OPTIMIZED_DOYIELDS) || defined(__DOXYGEN__)
#define chSchDoYieldS() { \
diff --git a/os/kernel/include/chsem.h b/os/kernel/include/chsem.h
index cf0897675..17c6a03e3 100644
--- a/os/kernel/include/chsem.h
+++ b/os/kernel/include/chsem.h
@@ -83,17 +83,24 @@ extern "C" {
/**
* @brief Decreases the semaphore counter.
* @details This macro can be used when the counter is known to be positive.
+ *
+ * @iclass
*/
#define chSemFastWaitI(sp) ((sp)->s_cnt--)
/**
* @brief Increases the semaphore counter.
- * @details This macro can be used when the counter is known to be not negative.
+ * @details This macro can be used when the counter is known to be not
+ * negative.
+ *
+ * @iclass
*/
#define chSemFastSignalI(sp) ((sp)->s_cnt++)
/**
* @brief Returns the semaphore counter current value.
+ *
+ * @iclass
*/
#define chSemGetCounterI(sp) ((sp)->s_cnt)
diff --git a/os/kernel/include/chstreams.h b/os/kernel/include/chstreams.h
index 436697a9a..039f0dbd6 100644
--- a/os/kernel/include/chstreams.h
+++ b/os/kernel/include/chstreams.h
@@ -83,6 +83,8 @@ typedef struct {
* be less than the specified number of bytes if the
* stream reaches a physical end of file and cannot be
* extended.
+ *
+ * @api
*/
#define chSequentialStreamWrite(ip, bp, n) ((ip)->vmt->write(ip, bp, n))
@@ -96,6 +98,8 @@ typedef struct {
* @return The number of bytes transferred. The return value can
* be less than the specified number of bytes if the
* stream reaches the end of the available data.
+ *
+ * @api
*/
#define chSequentialStreamRead(ip, bp, n) ((ip)->vmt->read(ip, bp, n))
diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h
index 22396f41f..2a30ceabf 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.h
@@ -35,6 +35,8 @@
* object.
*
* @return Pointer to the idle thread,
+ *
+ * @api
*/
#define chSysGetIdleThread() ((Thread *)_idle_thread_wa)
@@ -44,6 +46,9 @@
* unrecoverable error is detected, as example because a programming
* error in the application code that triggers an assertion while
* in debug mode.
+ * @note Can be invoked from any system state.
+ *
+ * @special
*/
#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
#define chSysHalt() port_halt()
@@ -56,9 +61,12 @@
/**
* @brief Performs a context switch.
+ * @note This function should nevel be used from user code directly.
*
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
+ *
+ * @special
*/
#define chSysSwitchI(ntp, otp) port_switch(ntp, otp)
@@ -66,9 +74,9 @@
* @brief Raises the system interrupt priority mask to the maximum level.
* @details All the maskable interrupt sources are disabled regardless their
* hardware priority.
- * @note The implementation is architecture dependent, it may just disable
- * the interrupts or be exactly equivalent to @p chSysDisable().
* @note Do not invoke this API from within a kernel lock.
+ *
+ * @special
*/
#define chSysDisable() port_disable()
@@ -77,22 +85,22 @@
* @details The interrupt sources that should not be able to preempt the kernel
* are disabled, interrupt sources with higher priority are still
* enabled.
- * @note The implementation is architecture dependent, it may just disable
- * the interrupts.
* @note Do not invoke this API from within a kernel lock.
* @note This API is no replacement for @p chSysLock(), the @p chSysLock()
* could do more than just disable the interrupts.
+ *
+ * @special
*/
#define chSysSuspend() port_suspend()
/**
* @brief Lowers the system interrupt priority mask to user level.
* @details All the interrupt sources are enabled.
- * @note The implementation is architecture dependent, it may just enable
- * the interrupts.
* @note Do not invoke this API from within a kernel lock.
* @note This API is no replacement for @p chSysUnlock(), the
* @p chSysUnlock() could do more than just enable the interrupts.
+ *
+ * @special
*/
#define chSysEnable() port_enable()
@@ -101,6 +109,8 @@
* @note The use of kernel lock mode is not recommended in the user code,
* it is a better idea to use the semaphores or mutexes instead.
* @see CH_USE_NESTED_LOCKS
+ *
+ * @special
*/
#if CH_USE_NESTED_LOCKS || defined(__DOXYGEN__)
#if CH_OPTIMIZE_SPEED || defined(__DOXYGEN__)
@@ -118,6 +128,8 @@
* @note The use of kernel lock mode is not recommended in the user code,
* it is a better idea to use the semaphores or mutexes instead.
* @see CH_USE_NESTED_LOCKS
+ *
+ * @special
*/
#if CH_USE_NESTED_LOCKS || defined(__DOXYGEN__)
#if CH_OPTIMIZE_SPEED || defined(__DOXYGEN__)
@@ -139,6 +151,8 @@
* It is good practice to invoke this API before invoking any I-class
* syscall from an interrupt handler.
* @note This API must be invoked exclusively from interrupt handlers.
+ *
+ * @special
*/
#define chSysLockFromIsr() port_lock_from_isr()
@@ -151,7 +165,9 @@
* the system mutual exclusion zone.<br>
* It is good practice to invoke this API after invoking any I-class
* syscall from an interrupt handler.
- * @note This API must be invoked exclusively from interrupt handlers.
+ * @note This API must be invoked exclusively from interrupt handlers.
+ *
+ * @special
*/
#define chSysUnlockFromIsr() port_unlock_from_isr()
diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h
index 9748166b9..97e03840b 100644
--- a/os/kernel/include/chthreads.h
+++ b/os/kernel/include/chthreads.h
@@ -244,11 +244,15 @@ extern "C" {
/**
* @brief Returns a pointer to the current @p Thread.
+ *
+ * @api
*/
#define chThdSelf() currp
/**
* @brief Returns the current thread priority.
+ *
+ * @api
*/
#define chThdGetPriority() (currp->p_prio)
@@ -258,11 +262,15 @@ extern "C" {
* @p CH_DBG_THREADS_PROFILING configuration option is enabled.
*
* @param[in] tp the pointer to the thread
+ *
+ * @api
*/
#define chThdGetTicks(tp) ((tp)->p_time)
/**
* @brief Returns the pointer to the @p Thread local storage area, if any.
+ *
+ * @api
*/
#define chThdLS() (void *)(currp + 1)
@@ -272,6 +280,8 @@ extern "C" {
* @param[in] tp the pointer to the thread
* @retval TRUE thread terminated.
* @retval FALSE thread not terminated.
+ *
+ * @api
*/
#define chThdTerminated(tp) ((tp)->p_state == THD_STATE_FINAL)
@@ -280,6 +290,8 @@ extern "C" {
*
* @retval TRUE termination request pended.
* @retval FALSE termination request not pended.
+ *
+ * @api
*/
#define chThdShouldTerminate() (currp->p_flags & THD_TERMINATE)
@@ -287,6 +299,8 @@ extern "C" {
* @brief Resumes a thread created with @p chThdInit().
*
* @param[in] tp the pointer to the thread
+ *
+ * @iclass
*/
#define chThdResumeI(tp) chSchReadyI(tp)
@@ -301,6 +315,8 @@ extern "C" {
* interpreted as a normal time specification not as
* an immediate timeout specification.
* .
+ *
+ * @sclass
*/
#define chThdSleepS(time) chSchGoSleepTimeoutS(THD_STATE_SLEEPING, time)
@@ -311,6 +327,8 @@ extern "C" {
* @note The maximum specified value is implementation dependent.
*
* @param[in] sec the time in seconds
+ *
+ * @api
*/
#define chThdSleepSeconds(sec) chThdSleep(S2ST(sec))
@@ -322,6 +340,8 @@ extern "C" {
* @note The maximum specified value is implementation dependent.
*
* @param[in] msec the time in milliseconds
+ *
+ * @api
*/
#define chThdSleepMilliseconds(msec) chThdSleep(MS2ST(msec))
@@ -333,6 +353,8 @@ extern "C" {
* @note The maximum specified value is implementation dependent.
*
* @param[in] usec the time in microseconds
+ *
+ * @api
*/
#define chThdSleepMicroseconds(usec) chThdSleep(US2ST(usec))
diff --git a/os/kernel/include/chvt.h b/os/kernel/include/chvt.h
index 8b065b208..8a44bf703 100644
--- a/os/kernel/include/chvt.h
+++ b/os/kernel/include/chvt.h
@@ -94,6 +94,8 @@ extern VTList vtlist;
/**
* @brief Virtual timers ticker.
+ *
+ * @iclass
*/
#define chVTDoTickI() { \
vtlist.vt_systime++; \
@@ -127,6 +129,8 @@ extern "C" {
/**
* @brief Returns TRUE if the speciified timer is armed.
+ *
+ * @iclass
*/
#define chVTIsArmedI(vtp) ((vtp)->vt_func != NULL)
@@ -138,6 +142,8 @@ extern "C" {
* @note This function is designed to work with the @p chThdSleepUntil().
*
* @return The system time in ticks.r
+ *
+ * @api
*/
#define chTimeNow() (vtlist.vt_systime)