aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/USBv1/usb_lld.c4
-rw-r--r--os/hal/ports/STM32/can_lld.c6
-rw-r--r--os/hal/src/can.c12
-rw-r--r--os/hal/src/hal_queues.c20
-rw-r--r--os/nil/osal/osal.c4
-rw-r--r--os/nil/osal/osal.h10
-rw-r--r--os/rt/include/ch.h4
-rw-r--r--os/rt/osal/osal.h2
8 files changed, 32 insertions, 30 deletions
diff --git a/os/hal/ports/STM32/USBv1/usb_lld.c b/os/hal/ports/STM32/USBv1/usb_lld.c
index 1a44a678f..a8159a898 100644
--- a/os/hal/ports/STM32/USBv1/usb_lld.c
+++ b/os/hal/ports/STM32/USBv1/usb_lld.c
@@ -178,7 +178,7 @@ static void usb_packet_read_to_queue(stm32_usb_descriptor_t *udp,
osalSysLockFromISR();
iqp->q_counter += n;
- osalQueueWakeupAllI(&iqp->q_waiting, Q_OK);
+ osalThreadDequeueAllI(&iqp->q_waiting, Q_OK);
osalSysUnlockFromISR();
}
@@ -251,7 +251,7 @@ static void usb_packet_write_from_queue(stm32_usb_descriptor_t *udp,
sts = osalSysGetStatusAndLockX();
oqp->q_counter += n;
- osalQueueWakeupAllI(&oqp->q_waiting, Q_OK);
+ osalThreadDequeueAllI(&oqp->q_waiting, Q_OK);
osalSysRestoreStatusX(sts);
}
diff --git a/os/hal/ports/STM32/can_lld.c b/os/hal/ports/STM32/can_lld.c
index 266f87504..5b021ccc8 100644
--- a/os/hal/ports/STM32/can_lld.c
+++ b/os/hal/ports/STM32/can_lld.c
@@ -130,7 +130,7 @@ static void can_lld_tx_handler(CANDriver *canp) {
/* No more events until a message is transmitted.*/
canp->can->TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2;
osalSysLockFromISR();
- osalQueueWakeupAllI(&canp->txqueue, MSG_OK);
+ osalThreadDequeueAllI(&canp->txqueue, MSG_OK);
osalEventBroadcastFlagsI(&canp->txempty_event, CAN_MAILBOX_TO_MASK(1));
osalSysUnlockFromISR();
}
@@ -150,7 +150,7 @@ static void can_lld_rx0_handler(CANDriver *canp) {
/* No more receive events until the queue 0 has been emptied.*/
canp->can->IER &= ~CAN_IER_FMPIE0;
osalSysLockFromISR();
- osalQueueWakeupAllI(&canp->rxqueue, MSG_OK);
+ osalThreadDequeueAllI(&canp->rxqueue, MSG_OK);
osalEventBroadcastFlagsI(&canp->rxfull_event, CAN_MAILBOX_TO_MASK(1));
osalSysUnlockFromISR();
}
@@ -178,7 +178,7 @@ static void can_lld_rx1_handler(CANDriver *canp) {
/* No more receive events until the queue 0 has been emptied.*/
canp->can->IER &= ~CAN_IER_FMPIE1;
osalSysLockFromISR();
- osalQueueWakeupAllI(&canp->rxqueue, MSG_OK);
+ osalThreadDequeueAllI(&canp->rxqueue, MSG_OK);
osalEventBroadcastFlagsI(&canp->rxfull_event, CAN_MAILBOX_TO_MASK(2));
osalSysUnlockFromISR();
}
diff --git a/os/hal/src/can.c b/os/hal/src/can.c
index ed5c43f87..92efdf7e7 100644
--- a/os/hal/src/can.c
+++ b/os/hal/src/can.c
@@ -73,8 +73,8 @@ void canObjectInit(CANDriver *canp) {
canp->state = CAN_STOP;
canp->config = NULL;
- osalQueueObjectInit(&canp->txqueue);
- osalQueueObjectInit(&canp->rxqueue);
+ osalThreadQueueObjectInit(&canp->txqueue);
+ osalThreadQueueObjectInit(&canp->rxqueue);
osalEventObjectInit(&canp->rxfull_event);
osalEventObjectInit(&canp->txempty_event);
osalEventObjectInit(&canp->error_event);
@@ -131,8 +131,8 @@ void canStop(CANDriver *canp) {
"invalid state");
can_lld_stop(canp);
canp->state = CAN_STOP;
- osalQueueWakeupAllI(&canp->rxqueue, MSG_RESET);
- osalQueueWakeupAllI(&canp->txqueue, MSG_RESET);
+ osalThreadDequeueAllI(&canp->rxqueue, MSG_RESET);
+ osalThreadDequeueAllI(&canp->txqueue, MSG_RESET);
osalOsRescheduleS();
osalSysUnlock();
}
@@ -170,7 +170,7 @@ msg_t canTransmit(CANDriver *canp,
osalDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP),
"invalid state");
while ((canp->state == CAN_SLEEP) || !can_lld_is_tx_empty(canp, mailbox)) {
- msg_t msg = osalQueueGoSleepTimeoutS(&canp->txqueue, timeout);
+ msg_t msg = osalThreadEnqueueTimeoutS(&canp->txqueue, timeout);
if (msg != MSG_OK) {
osalSysUnlock();
return msg;
@@ -215,7 +215,7 @@ msg_t canReceive(CANDriver *canp,
osalDbgAssert((canp->state == CAN_READY) || (canp->state == CAN_SLEEP),
"invalid state");
while ((canp->state == CAN_SLEEP) || !can_lld_is_rx_nonempty(canp, mailbox)) {
- msg_t msg = osalQueueGoSleepTimeoutS(&canp->rxqueue, timeout);
+ msg_t msg = osalThreadEnqueueTimeoutS(&canp->rxqueue, timeout);
if (msg != MSG_OK) {
osalSysUnlock();
return msg;
diff --git a/os/hal/src/hal_queues.c b/os/hal/src/hal_queues.c
index 52b9daf6c..dac58a155 100644
--- a/os/hal/src/hal_queues.c
+++ b/os/hal/src/hal_queues.c
@@ -62,7 +62,7 @@
void iqObjectInit(input_queue_t *iqp, uint8_t *bp, size_t size,
qnotify_t infy, void *link) {
- osalQueueObjectInit(&iqp->q_waiting);
+ osalThreadQueueObjectInit(&iqp->q_waiting);
iqp->q_counter = 0;
iqp->q_buffer = iqp->q_rdptr = iqp->q_wrptr = bp;
iqp->q_top = bp + size;
@@ -87,7 +87,7 @@ void iqResetI(input_queue_t *iqp) {
iqp->q_rdptr = iqp->q_wrptr = iqp->q_buffer;
iqp->q_counter = 0;
- osalQueueWakeupAllI(&iqp->q_waiting, Q_RESET);
+ osalThreadDequeueAllI(&iqp->q_waiting, Q_RESET);
}
/**
@@ -115,7 +115,7 @@ msg_t iqPutI(input_queue_t *iqp, uint8_t b) {
if (iqp->q_wrptr >= iqp->q_top)
iqp->q_wrptr = iqp->q_buffer;
- osalQueueWakeupOneI(&iqp->q_waiting, Q_OK);
+ osalThreadDequeueNextI(&iqp->q_waiting, Q_OK);
return Q_OK;
}
@@ -149,7 +149,7 @@ msg_t iqGetTimeout(input_queue_t *iqp, systime_t time) {
while (iqIsEmptyI(iqp)) {
msg_t msg;
- if ((msg = osalQueueGoSleepTimeoutS(&iqp->q_waiting, time)) < Q_OK) {
+ if ((msg = osalThreadEnqueueTimeoutS(&iqp->q_waiting, time)) < Q_OK) {
osalSysUnlock();
return msg;
}
@@ -201,7 +201,7 @@ size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp,
nfy(iqp);
while (iqIsEmptyI(iqp)) {
- if (osalQueueGoSleepTimeoutS(&iqp->q_waiting, time) != Q_OK) {
+ if (osalThreadEnqueueTimeoutS(&iqp->q_waiting, time) != Q_OK) {
osalSysUnlock();
return r;
}
@@ -240,7 +240,7 @@ size_t iqReadTimeout(input_queue_t *iqp, uint8_t *bp,
void oqObjectInit(output_queue_t *oqp, uint8_t *bp, size_t size,
qnotify_t onfy, void *link) {
- osalQueueObjectInit(&oqp->q_waiting);
+ osalThreadQueueObjectInit(&oqp->q_waiting);
oqp->q_counter = size;
oqp->q_buffer = oqp->q_rdptr = oqp->q_wrptr = bp;
oqp->q_top = bp + size;
@@ -265,7 +265,7 @@ void oqResetI(output_queue_t *oqp) {
oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer;
oqp->q_counter = qSizeI(oqp);
- osalQueueWakeupAllI(&oqp->q_waiting, Q_RESET);
+ osalThreadDequeueAllI(&oqp->q_waiting, Q_RESET);
}
/**
@@ -296,7 +296,7 @@ msg_t oqPutTimeout(output_queue_t *oqp, uint8_t b, systime_t time) {
while (oqIsFullI(oqp)) {
msg_t msg;
- if ((msg = osalQueueGoSleepTimeoutS(&oqp->q_waiting, time)) < Q_OK) {
+ if ((msg = osalThreadEnqueueTimeoutS(&oqp->q_waiting, time)) < Q_OK) {
osalSysUnlock();
return msg;
}
@@ -337,7 +337,7 @@ msg_t oqGetI(output_queue_t *oqp) {
if (oqp->q_rdptr >= oqp->q_top)
oqp->q_rdptr = oqp->q_buffer;
- osalQueueWakeupOneI(&oqp->q_waiting, Q_OK);
+ osalThreadDequeueNextI(&oqp->q_waiting, Q_OK);
return b;
}
@@ -376,7 +376,7 @@ size_t oqWriteTimeout(output_queue_t *oqp, const uint8_t *bp,
osalSysLock();
while (TRUE) {
while (oqIsFullI(oqp)) {
- if (osalQueueGoSleepTimeoutS(&oqp->q_waiting, time) != Q_OK) {
+ if (osalThreadEnqueueTimeoutS(&oqp->q_waiting, time) != Q_OK) {
osalSysUnlock();
return w;
}
diff --git a/os/nil/osal/osal.c b/os/nil/osal/osal.c
index 05443d465..564ee369d 100644
--- a/os/nil/osal/osal.c
+++ b/os/nil/osal/osal.c
@@ -60,7 +60,7 @@
*
* @iclass
*/
-void osalQueueWakeupOneI(threads_queue_t *tqp, msg_t msg) {
+void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) {
semaphore_t *sp = &tqp->sem;
if (chSemGetCounterI(&tqp->sem) < 0) {
@@ -90,7 +90,7 @@ void osalQueueWakeupOneI(threads_queue_t *tqp, msg_t msg) {
*
* @iclass
*/
-void osalQueueWakeupAllI(threads_queue_t *tqp, msg_t msg) {
+void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) {
semaphore_t *sp = &tqp->sem;
thread_reference_t tr;
cnt_t cnt;
diff --git a/os/nil/osal/osal.h b/os/nil/osal/osal.h
index 93483e6f0..2c0980ead 100644
--- a/os/nil/osal/osal.h
+++ b/os/nil/osal/osal.h
@@ -347,8 +347,8 @@ typedef struct {
#ifdef __cplusplus
extern "C" {
#endif
- void osalQueueWakeupOneI(threads_queue_t *tqp, msg_t msg);
- void osalQueueWakeupAllI(threads_queue_t *tqp, msg_t msg);
+ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg);
+ void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg);
#ifdef __cplusplus
}
#endif
@@ -647,7 +647,7 @@ static inline void osalThreadResumeS(thread_reference_t *trp, msg_t msg) {
*
* @init
*/
-static inline void osalQueueObjectInit(threads_queue_t *tqp) {
+static inline void osalThreadQueueObjectInit(threads_queue_t *tqp) {
chSemObjectInit(&tqp->sem, 0);
}
@@ -675,8 +675,8 @@ static inline void osalQueueObjectInit(threads_queue_t *tqp) {
*
* @sclass
*/
-static inline msg_t osalQueueGoSleepTimeoutS(threads_queue_t *tqp,
- systime_t time) {
+static inline msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp,
+ systime_t time) {
return chSemWaitTimeout(&tqp->sem, time);
}
diff --git a/os/rt/include/ch.h b/os/rt/include/ch.h
index c1360d4c4..11c75c407 100644
--- a/os/rt/include/ch.h
+++ b/os/rt/include/ch.h
@@ -66,7 +66,7 @@
typedef struct thread thread_t;
typedef struct virtual_timer virtual_timer_t;
-/* Inclusion of all the kernel sub-headers.*/
+/* Core headers.*/
#include "chtypes.h"
#include "chconf.h"
#include "chcore.h"
@@ -77,6 +77,8 @@ typedef struct virtual_timer virtual_timer_t;
#include "chsys.h"
#include "chvt.h"
#include "chthreads.h"
+
+/* Optional subsystems headers.*/
#include "chregistry.h"
#include "chsem.h"
#include "chbsem.h"
diff --git a/os/rt/osal/osal.h b/os/rt/osal/osal.h
index b3335ccfd..4569d7c4f 100644
--- a/os/rt/osal/osal.h
+++ b/os/rt/osal/osal.h
@@ -664,7 +664,7 @@ static inline void osalThreadQueueObjectInit(threads_queue_t *tqp) {
* @sclass
*/
static inline msg_t osalThreadEnqueueTimeoutS(threads_queue_t *tqp,
- systime_t time) {
+ systime_t time) {
return chThdEnqueueTimeoutS(tqp, time);
}