git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8647 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Giovanni Di Sirio 2015-12-26 13:16:24 +00:00
parent 672c4381f5
commit ae70b0edce
11 changed files with 65 additions and 63 deletions

View File

@ -260,8 +260,8 @@ typedef struct {
* @brief Sets a bits mask on a I/O port.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -283,8 +283,8 @@ typedef struct {
* @brief Clears a bits mask on a I/O port.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -306,8 +306,8 @@ typedef struct {
* @brief Toggles a bits mask on a I/O port.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -414,8 +414,8 @@ typedef struct {
* @brief Writes a logic state on an output pad.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -442,8 +442,8 @@ typedef struct {
* @brief Sets a pad logic state to @p PAL_HIGH.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -465,8 +465,8 @@ typedef struct {
* @brief Clears a pad logic state to @p PAL_LOW.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -488,8 +488,8 @@ typedef struct {
* @brief Toggles a pad logic state.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.

View File

@ -111,9 +111,9 @@ static void set_error(SerialDriver *sdp, IOREG32 err) {
sts |= SD_FRAMING_ERROR;
if (err & LSR_BREAK)
sts |= SD_BREAK_DETECTED;
chSysLockFromISR();
osalSysLockFromISR();
chnAddFlagsI(sdp, sts);
chSysUnlockFromISR();
osalSysUnlockFromISR();
}
/**
@ -135,15 +135,15 @@ static void serve_interrupt(SerialDriver *sdp) {
break;
case IIR_SRC_TIMEOUT:
case IIR_SRC_RX:
chSysLockFromISR();
osalSysLockFromISR();
if (chIQIsEmptyI(&sdp->iqueue))
chnAddFlagsI(sdp, CHN_INPUT_AVAILABLE);
chSysUnlockFromISR();
osalSysUnlockFromISR();
while (u->UART_LSR & LSR_RBR_FULL) {
chSysLockFromISR();
osalSysLockFromISR();
if (chIQPutI(&sdp->iqueue, u->UART_RBR) < Q_OK)
chnAddFlagsI(sdp, SD_OVERRUN_ERROR);
chSysUnlockFromISR();
osalSysUnlockFromISR();
}
break;
case IIR_SRC_TX:
@ -152,14 +152,14 @@ static void serve_interrupt(SerialDriver *sdp) {
do {
msg_t b;
chSysLockFromISR();
osalSysLockFromISR();
b = chOQGetI(&sdp->oqueue);
chSysUnlockFromISR();
osalSysUnlockFromISR();
if (b < Q_OK) {
u->UART_IER &= ~IER_THRE;
chSysLockFromISR();
osalSysLockFromISR();
chnAddFlagsI(sdp, CHN_OUTPUT_EMPTY);
chSysUnlockFromISR();
osalSysUnlockFromISR();
break;
}
u->UART_THR = b;

View File

@ -61,7 +61,7 @@
* @details The default action is to stop the system.
*/
#if !defined(LPC214x_SPI_SSP_ERROR_HOOK) || defined(__DOXYGEN__)
#define LPC214x_SPI_SSP_ERROR_HOOK() chSysHalt()
#define LPC214x_SPI_SSP_ERROR_HOOK() osalSysHalt()
#endif
/*===========================================================================*/

View File

@ -139,7 +139,7 @@
* error can only happen because programming errors.
*/
#if !defined(STM32_I2C_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) chSysHalt("DMA failure")
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
#endif
#if STM32_ADVANCED_DMA || defined(__DOXYGEN__)

View File

@ -266,7 +266,7 @@ void mac_lld_init(void) {
/* PHY soft reset procedure.*/
mii_write(&ETHD1, MII_BMCR, BMCR_RESET);
#if defined(BOARD_PHY_RESET_DELAY)
chSysPolledDelayX(BOARD_PHY_RESET_DELAY);
osalSysPolledDelayX(BOARD_PHY_RESET_DELAY);
#endif
while (mii_read(&ETHD1, MII_BMCR) & BMCR_RESET)
;

View File

@ -196,7 +196,7 @@ void rtc_lld_set_prescaler(void) {
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
rtc_acquire_access();
RTC->PRLH = (uint16_t)((STM32_RTCCLK - 1) >> 16) & 0x000F;
@ -204,7 +204,7 @@ void rtc_lld_set_prescaler(void) {
rtc_release_access();
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -290,7 +290,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
(void)alarm_number;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
rtc_acquire_access();
if (alarmspec != NULL) {
@ -304,7 +304,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
rtc_release_access();
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -327,7 +327,7 @@ void rtc_lld_get_alarm(RTCDriver *rtcp,
(void)alarm_number;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
/* Required because access to ALR.*/
rtc_apb1_sync();
@ -335,7 +335,7 @@ void rtc_lld_get_alarm(RTCDriver *rtcp,
alarmspec->tv_sec = ((rtcp->rtc->ALRH << 16) + rtcp->rtc->ALRL);
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -353,7 +353,7 @@ void rtc_lld_set_callback(RTCDriver *rtcp, rtccb_t callback) {
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
if (callback != NULL) {
@ -373,7 +373,7 @@ void rtc_lld_set_callback(RTCDriver *rtcp, rtccb_t callback) {
}
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -394,7 +394,7 @@ void rtcSTM32GetSecMsec(RTCDriver *rtcp, uint32_t *tv_sec, uint32_t *tv_msec) {
osalDbgCheck((NULL != tv_sec) && (NULL != rtcp));
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
/* Required because access to CNT and DIV.*/
rtc_apb1_sync();
@ -406,7 +406,7 @@ void rtcSTM32GetSecMsec(RTCDriver *rtcp, uint32_t *tv_sec, uint32_t *tv_msec) {
} while ((*tv_sec) != (((uint32_t)(rtcp->rtc->CNTH) << 16) + rtcp->rtc->CNTL));
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
if (NULL != tv_msec)
*tv_msec = (((uint32_t)STM32_RTCCLK - 1 - time_frac) * 1000) / STM32_RTCCLK;
@ -427,7 +427,7 @@ void rtcSTM32SetSec(RTCDriver *rtcp, uint32_t tv_sec) {
osalDbgCheck(NULL != rtcp);
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
rtc_acquire_access();
rtcp->rtc->CNTH = (uint16_t)(tv_sec >> 16);
@ -435,7 +435,7 @@ void rtcSTM32SetSec(RTCDriver *rtcp, uint32_t tv_sec) {
rtc_release_access();
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
#endif /* HAL_USE_RTC */

View File

@ -339,7 +339,7 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) {
dr = rtc_encode_date(timespec);
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
/* Writing the registers.*/
rtc_enter_init();
@ -348,7 +348,7 @@ void rtc_lld_set_time(RTCDriver *rtcp, const RTCDateTime *timespec) {
rtc_exit_init();
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -369,7 +369,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
/* Synchronization with the RTC and reading the registers, note
DR must be read last.*/
@ -383,7 +383,7 @@ void rtc_lld_get_time(RTCDriver *rtcp, RTCDateTime *timespec) {
rtcp->rtc->ISR &= ~RTC_ISR_RSF;
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
/* Decoding day time, this starts the atomic read sequence, see "Reading
the calendar" in the RTC documentation.*/
@ -421,7 +421,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
if (alarm == 0) {
if (alarmspec != NULL) {
@ -455,7 +455,7 @@ void rtc_lld_set_alarm(RTCDriver *rtcp,
#endif /* RTC_ALARMS > 1 */
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -496,7 +496,7 @@ void rtcSTM32SetPeriodicWakeup(RTCDriver *rtcp, const RTCWakeup *wakeupspec) {
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
if (wakeupspec != NULL) {
osalDbgCheck(wakeupspec->wutr != 0x30000);
@ -515,7 +515,7 @@ void rtcSTM32SetPeriodicWakeup(RTCDriver *rtcp, const RTCWakeup *wakeupspec) {
}
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
/**
@ -532,14 +532,14 @@ void rtcSTM32GetPeriodicWakeup(RTCDriver *rtcp, RTCWakeup *wakeupspec) {
syssts_t sts;
/* Entering a reentrant critical zone.*/
sts = chSysGetStatusAndLockX();
sts = osalSysGetStatusAndLockX();
wakeupspec->wutr = 0;
wakeupspec->wutr |= rtcp->rtc->WUTR;
wakeupspec->wutr |= (((uint32_t)rtcp->rtc->CR) & 0x7) << 16;
/* Leaving a reentrant critical zone.*/
chSysRestoreStatusX(sts);
osalSysRestoreStatusX(sts);
}
#endif /* STM32_RTC_HAS_PERIODIC_WAKEUPS */

View File

@ -175,9 +175,9 @@ msg_t ibqGetFullBufferTimeout(input_buffers_queue_t *ibqp,
systime_t timeout) {
msg_t msg;
chSysLock();
osalSysLock();
msg = ibqGetFullBufferTimeoutS(ibqp, timeout);
chSysUnlock();
osalSysUnlock();
return msg;
}
@ -233,9 +233,9 @@ msg_t ibqGetFullBufferTimeout(input_buffers_queue_t *ibqp,
*/
void ibqReleaseEmptyBuffer(input_buffers_queue_t *ibqp) {
chSysLock();
osalSysLock();
ibqReleaseEmptyBufferS(ibqp);
chSysUnlock();
osalSysUnlock();
}
/**
@ -545,9 +545,9 @@ msg_t obqGetEmptyBufferTimeout(output_buffers_queue_t *obqp,
systime_t timeout) {
msg_t msg;
chSysLock();
osalSysLock();
msg = obqGetEmptyBufferTimeoutS(obqp, timeout);
chSysUnlock();
osalSysUnlock();
return msg;
}

View File

@ -50,8 +50,8 @@
* @brief Read from an I/O bus.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The function internally uses the @p palReadGroup() macro. The use
* of this function is preferred when you value code size, readability
* and error checking over speed.
@ -73,8 +73,8 @@ ioportmask_t palReadBus(IOBus *bus) {
* @brief Write to an I/O bus.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.
@ -98,8 +98,8 @@ void palWriteBus(IOBus *bus, ioportmask_t bits) {
* @brief Programs a bus with the specified mode.
* @note The operation is not guaranteed to be atomic on all the
* architectures, for atomicity and/or portability reasons you may
* need to enclose port I/O operations between @p chSysLock() and
* @p chSysUnlock().
* need to enclose port I/O operations between @p osalSysLock() and
* @p osalSysUnlock().
* @note The default implementation is non atomic and not necessarily
* optimal. Low level drivers may optimize the function by using
* specific hardware or coding.

View File

@ -146,6 +146,8 @@
- HAL: Updated STM32F0xx headers to STM32CubeF0 version 1.3.0. Added support
for STM32F030xC, STM32F070x6, STM32F070xB, STM32F091xC,
STM32F098xx devices.
- HAL: Fixed HAL drivers still calling RT functions (bug #686)(backported
to 3.0.5).
- HAL: Fixed chprintf() still calling RT functions (bug #684)(backported
to 3.0.5).
- HAL: Fixed STM32 ICU driver uses chSysLock and chSysUnlock (bug #681)

View File

@ -113,11 +113,11 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) {
while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) {
#if 1
/* Writing in channel mode.*/
chnWrite(&SDU1, buf, sizeof buf - 1);
chnWrite(&SDU2, buf, sizeof buf - 1);
#else
/* Writing in buffer mode.*/
(void) obqGetEmptyBufferTimeout(&SDU1.obqueue, TIME_INFINITE);
memcpy(SDU1.obqueue.ptr, buf, SERIAL_USB_BUFFERS_SIZE);
memcpy(SDU2.obqueue.ptr, buf, SERIAL_USB_BUFFERS_SIZE);
obqPostFullBuffer(&SDU1.obqueue, SERIAL_USB_BUFFERS_SIZE);
#endif
}