aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-26 14:08:25 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-26 14:08:25 +0000
commit56a9ba32e86fe98c173f4278427aa8c56392a8f8 (patch)
tree47e727aa697c36191d0be8600d83e0d8dd6a44aa /os/hal
parentb1f3465325055a224238cd24d2e7c2126f582039 (diff)
downloadChibiOS-56a9ba32e86fe98c173f4278427aa8c56392a8f8.tar.gz
ChibiOS-56a9ba32e86fe98c173f4278427aa8c56392a8f8.tar.bz2
ChibiOS-56a9ba32e86fe98c173f4278427aa8c56392a8f8.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6228 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/osal/chibios/osal.h11
-rw-r--r--os/hal/platforms/STM32/USBv1/usb_lld.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/os/hal/osal/chibios/osal.h b/os/hal/osal/chibios/osal.h
index b03681f09..7ae97f92b 100644
--- a/os/hal/osal/chibios/osal.h
+++ b/os/hal/osal/chibios/osal.h
@@ -397,11 +397,12 @@ static inline void osalSysUnlockFromISR(void) {
}
/**
- * @brief Returns the execution context and enters the kernel lock mode.
+ * @brief Returns the execution status and enters a critical zone.
* @details This functions enters into a critical zone and can be called
* from any context. Because its flexibility it is less efficient
* than @p chSysLock() which is preferable when the calling context
* is known.
+ * @post The system is in a critical zone.
*
* @return The previous system status, the encoding of this
* status word is architecture-dependent and opaque.
@@ -414,15 +415,17 @@ static inline syssts_t osalSysGetStatusAndLockX(void) {
}
/**
- * @brief Restores the specified execution status.
+ * @brief Restores the specified execution status and leaves a critical zone.
+ * @note A call to @p chSchRescheduleS() is automatically performed
+ * if exiting the critical zone and if not in ISR context.
*
* @param[in] sts the system status to be restored.
*
* @xclass
*/
-static inline void osalSysRestoreLockAndRescheduleX(syssts_t sts) {
+static inline void osalSysRestoreStatusX(syssts_t sts) {
- chSysRestoreLockAndRescheduleX(sts);
+ chSysRestoreStatusX(sts);
}
/**
diff --git a/os/hal/platforms/STM32/USBv1/usb_lld.c b/os/hal/platforms/STM32/USBv1/usb_lld.c
index b1e721556..1a44a678f 100644
--- a/os/hal/platforms/STM32/USBv1/usb_lld.c
+++ b/os/hal/platforms/STM32/USBv1/usb_lld.c
@@ -253,7 +253,7 @@ static void usb_packet_write_from_queue(stm32_usb_descriptor_t *udp,
oqp->q_counter += n;
osalQueueWakeupAllI(&oqp->q_waiting, Q_OK);
- osalSysRestoreLockAndRescheduleX(sts);
+ osalSysRestoreStatusX(sts);
}
/*===========================================================================*/