git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6228 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2013-08-26 14:08:25 +00:00
parent b1f3465325
commit 56a9ba32e8
4 changed files with 13 additions and 10 deletions

View File

@ -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 * @details This functions enters into a critical zone and can be called
* from any context. Because its flexibility it is less efficient * from any context. Because its flexibility it is less efficient
* than @p chSysLock() which is preferable when the calling context * than @p chSysLock() which is preferable when the calling context
* is known. * is known.
* @post The system is in a critical zone.
* *
* @return The previous system status, the encoding of this * @return The previous system status, the encoding of this
* status word is architecture-dependent and opaque. * 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. * @param[in] sts the system status to be restored.
* *
* @xclass * @xclass
*/ */
static inline void osalSysRestoreLockAndRescheduleX(syssts_t sts) { static inline void osalSysRestoreStatusX(syssts_t sts) {
chSysRestoreLockAndRescheduleX(sts); chSysRestoreStatusX(sts);
} }
/** /**

View File

@ -253,7 +253,7 @@ static void usb_packet_write_from_queue(stm32_usb_descriptor_t *udp,
oqp->q_counter += n; oqp->q_counter += n;
osalQueueWakeupAllI(&oqp->q_waiting, Q_OK); osalQueueWakeupAllI(&oqp->q_waiting, Q_OK);
osalSysRestoreLockAndRescheduleX(sts); osalSysRestoreStatusX(sts);
} }
/*===========================================================================*/ /*===========================================================================*/

View File

@ -219,7 +219,7 @@ extern "C" {
void chSysHalt(const char *reason); void chSysHalt(const char *reason);
void chSysTimerHandlerI(void); void chSysTimerHandlerI(void);
syssts_t chSysGetStatusAndLockX(void); syssts_t chSysGetStatusAndLockX(void);
void chSysRestoreLockAndRescheduleX(syssts_t sts); void chSysRestoreStatusX(syssts_t sts);
#if CH_PORT_SUPPORTS_RT #if CH_PORT_SUPPORTS_RT
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end); bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end);
void chSysPolledDelayX(rtcnt_t cycles); void chSysPolledDelayX(rtcnt_t cycles);

View File

@ -216,7 +216,7 @@ void chSysTimerHandlerI(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 * @details This functions enters into a critical zone and can be called
* from any context. Because its flexibility it is less efficient * from any context. Because its flexibility it is less efficient
* than @p chSysLock() which is preferable when the calling context * than @p chSysLock() which is preferable when the calling context
@ -241,15 +241,15 @@ syssts_t chSysGetStatusAndLockX(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 * @note A call to @p chSchRescheduleS() is automatically performed
* is exiting the critical zone and if in proper context. * if exiting the critical zone and if not in ISR context.
* *
* @param[in] sts the system status to be restored. * @param[in] sts the system status to be restored.
* *
* @xclass * @xclass
*/ */
void chSysRestoreLockAndRescheduleX(syssts_t sts) { void chSysRestoreStatusX(syssts_t sts) {
if (port_irq_enabled(sts)) { if (port_irq_enabled(sts)) {
if (port_is_isr_context()) if (port_is_isr_context())