Fix locking issue in epoch_watchdog()

The _Watchdog_Per_CPU_insert_ticks() assumes that interrupts are
disabled.
This commit is contained in:
Sebastian Huber 2018-11-15 08:23:17 +01:00
parent 9f87c4586b
commit 9f2c3ceebe

View File

@ -91,10 +91,13 @@ static void
epoch_watchdog(Watchdog_Control *wdg)
{
struct epoch_pcpu *epcpu;
ISR_Level level;
epcpu = __containerof(wdg, struct epoch_pcpu, wdg);
_ISR_Local_disable(level);
_Watchdog_Per_CPU_insert_ticks(&epcpu->wdg,
_Watchdog_Get_CPU(&epcpu->wdg), 1);
_ISR_Local_enable(level);
if (RTEMS_PREDICT_FALSE(epcpu->cb_count != 0)) {
rtems_interrupt_server_request_submit(&epcpu->irq_srv_req);