mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 08:55:47 +08:00
Insert mode argument to _Watchdog_Insert removed. Now are watchdog timers
are automatically activated upon insertion.
This commit is contained in:
@@ -252,11 +252,7 @@ unsigned int sleep(
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_seconds(
|
||||
&_Thread_Executing->Timer,
|
||||
seconds,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds );
|
||||
_Thread_Enable_dispatch();
|
||||
return 0; /* XXX should account for signal */
|
||||
}
|
||||
|
||||
@@ -186,11 +186,7 @@ void _Event_Seize(
|
||||
executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks(
|
||||
&executing->Timer,
|
||||
ticks,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &executing->Timer, ticks );
|
||||
}
|
||||
|
||||
_Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
|
||||
|
||||
@@ -277,8 +277,7 @@ rtems_status_code rtems_rate_monotonic_period(
|
||||
id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_period->Timer, length );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
|
||||
@@ -292,8 +291,7 @@ rtems_status_code rtems_rate_monotonic_period(
|
||||
/* has expired -- fall into next case */
|
||||
case RATE_MONOTONIC_EXPIRED:
|
||||
the_period->state = RATE_MONOTONIC_ACTIVE;
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_period->Timer, length );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_TIMEOUT;
|
||||
}
|
||||
|
||||
@@ -242,8 +242,7 @@ rtems_status_code rtems_timer_fire_after(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_INTERVAL;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker,
|
||||
ticks, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
@@ -298,8 +297,10 @@ rtems_status_code rtems_timer_fire_when(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_TIME_OF_DAY;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_seconds( &the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_seconds(
|
||||
&the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -987,8 +987,7 @@ rtems_status_code rtems_task_wake_after(
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks( &_Thread_Executing->Timer,
|
||||
ticks, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
|
||||
_Thread_Enable_dispatch();
|
||||
}
|
||||
return RTEMS_SUCCESSFUL;
|
||||
@@ -1036,8 +1035,10 @@ rtems_time_of_day *time_buffer
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_seconds( &_Thread_Executing->Timer,
|
||||
seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_seconds(
|
||||
&_Thread_Executing->Timer,
|
||||
seconds - _TOD_Seconds_since_epoch
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -242,8 +242,7 @@ rtems_status_code rtems_timer_fire_after(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_INTERVAL;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker,
|
||||
ticks, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
@@ -298,8 +297,10 @@ rtems_status_code rtems_timer_fire_when(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_TIME_OF_DAY;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_seconds( &the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_seconds(
|
||||
&the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -48,18 +48,6 @@ typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
|
||||
|
||||
#define WATCHDOG_NO_TIMEOUT 0
|
||||
|
||||
/*
|
||||
* The following enumerated type details the modes in which the
|
||||
* Watchdog_Insert routine may operate. The watchdog may be
|
||||
* activated automatically at insert time or later, explicitly
|
||||
* by the caller.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
WATCHDOG_ACTIVATE_NOW, /* activate watchdog as part of insertion */
|
||||
WATCHDOG_NO_ACTIVATE /* watchdog will be explicitly activated */
|
||||
} Watchdog_Insert_modes;
|
||||
|
||||
/*
|
||||
* The following enumerated type lists the states in which a
|
||||
* watchdog timer may be at any given time.
|
||||
@@ -238,8 +226,7 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void );
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -256,8 +243,7 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -391,8 +377,7 @@ void _Watchdog_Adjust (
|
||||
|
||||
void _Watchdog_Insert (
|
||||
Chain_Control *header,
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Control *the_watchdog
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -48,18 +48,6 @@ typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
|
||||
|
||||
#define WATCHDOG_NO_TIMEOUT 0
|
||||
|
||||
/*
|
||||
* The following enumerated type details the modes in which the
|
||||
* Watchdog_Insert routine may operate. The watchdog may be
|
||||
* activated automatically at insert time or later, explicitly
|
||||
* by the caller.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
WATCHDOG_ACTIVATE_NOW, /* activate watchdog as part of insertion */
|
||||
WATCHDOG_NO_ACTIVATE /* watchdog will be explicitly activated */
|
||||
} Watchdog_Insert_modes;
|
||||
|
||||
/*
|
||||
* The following enumerated type lists the states in which a
|
||||
* watchdog timer may be at any given time.
|
||||
@@ -238,8 +226,7 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void );
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -256,8 +243,7 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -391,8 +377,7 @@ void _Watchdog_Adjust (
|
||||
|
||||
void _Watchdog_Insert (
|
||||
Chain_Control *header,
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Control *the_watchdog
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -61,11 +61,7 @@ STATIC INLINE void _TOD_Activate(
|
||||
Watchdog_Interval ticks
|
||||
)
|
||||
{
|
||||
_Watchdog_Insert_ticks(
|
||||
&_TOD_Seconds_watchdog,
|
||||
ticks,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,14 +115,13 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void )
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -134,14 +133,13 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -190,11 +188,7 @@ STATIC INLINE void _Watchdog_Reset(
|
||||
|
||||
(void) _Watchdog_Remove( the_watchdog );
|
||||
|
||||
_Watchdog_Insert(
|
||||
&_Watchdog_Ticks_chain,
|
||||
the_watchdog,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -61,11 +61,7 @@ STATIC INLINE void _TOD_Activate(
|
||||
Watchdog_Interval ticks
|
||||
)
|
||||
{
|
||||
_Watchdog_Insert_ticks(
|
||||
&_TOD_Seconds_watchdog,
|
||||
ticks,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,14 +115,13 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void )
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -134,14 +133,13 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -190,11 +188,7 @@ STATIC INLINE void _Watchdog_Reset(
|
||||
|
||||
(void) _Watchdog_Remove( the_watchdog );
|
||||
|
||||
_Watchdog_Insert(
|
||||
&_Watchdog_Ticks_chain,
|
||||
the_watchdog,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,5 @@ void _TOD_Tickle(
|
||||
}
|
||||
|
||||
_Watchdog_Tickle_seconds();
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second,
|
||||
WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
|
||||
}
|
||||
|
||||
@@ -109,11 +109,7 @@ void _Thread_queue_Enqueue(
|
||||
NULL
|
||||
);
|
||||
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_thread->Timer,
|
||||
timeout,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &the_thread->Timer, timeout );
|
||||
}
|
||||
|
||||
switch( the_thread_queue->discipline ) {
|
||||
|
||||
@@ -231,6 +231,5 @@ void _TOD_Tickle(
|
||||
}
|
||||
|
||||
_Watchdog_Tickle_seconds();
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second,
|
||||
WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
|
||||
}
|
||||
|
||||
@@ -140,8 +140,7 @@ void _Watchdog_Adjust(
|
||||
|
||||
void _Watchdog_Insert(
|
||||
Chain_Control *header,
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Control *the_watchdog
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
@@ -174,10 +173,10 @@ restart:
|
||||
delta_interval -= after->delta_interval;
|
||||
|
||||
/*
|
||||
* If you experience problems comment out the _ISR_Flash line. This
|
||||
* (3.2.0) is the first release with this critical section redesigned.
|
||||
* If you experience problems comment out the _ISR_Flash line.
|
||||
* 3.2.0 was the first release with this critical section redesigned.
|
||||
* Under certain circumstances, the PREVIOUS critical section algorithm
|
||||
* used around this flash point allows interrupts to execute
|
||||
* used around this flash point allowed interrupts to execute
|
||||
* which violated the design assumptions. The critical section
|
||||
* mechanism used here WAS redesigned to address this.
|
||||
*/
|
||||
@@ -195,8 +194,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
if ( insert_mode == WATCHDOG_ACTIVATE_NOW )
|
||||
_Watchdog_Activate( the_watchdog );
|
||||
_Watchdog_Activate( the_watchdog );
|
||||
|
||||
the_watchdog->delta_interval = delta_interval;
|
||||
|
||||
|
||||
@@ -252,11 +252,7 @@ unsigned int sleep(
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_seconds(
|
||||
&_Thread_Executing->Timer,
|
||||
seconds,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds );
|
||||
_Thread_Enable_dispatch();
|
||||
return 0; /* XXX should account for signal */
|
||||
}
|
||||
|
||||
@@ -186,11 +186,7 @@ void _Event_Seize(
|
||||
executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks(
|
||||
&executing->Timer,
|
||||
ticks,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &executing->Timer, ticks );
|
||||
}
|
||||
|
||||
_Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
|
||||
|
||||
@@ -277,8 +277,7 @@ rtems_status_code rtems_rate_monotonic_period(
|
||||
id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_period->Timer, length );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
|
||||
@@ -292,8 +291,7 @@ rtems_status_code rtems_rate_monotonic_period(
|
||||
/* has expired -- fall into next case */
|
||||
case RATE_MONOTONIC_EXPIRED:
|
||||
the_period->state = RATE_MONOTONIC_ACTIVE;
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_period->Timer, length, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_period->Timer, length );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_TIMEOUT;
|
||||
}
|
||||
|
||||
@@ -242,8 +242,7 @@ rtems_status_code rtems_timer_fire_after(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_INTERVAL;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker,
|
||||
ticks, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &the_timer->Ticker, ticks );
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
@@ -298,8 +297,10 @@ rtems_status_code rtems_timer_fire_when(
|
||||
(void) _Watchdog_Remove( &the_timer->Ticker );
|
||||
the_timer->the_class = TIMER_TIME_OF_DAY;
|
||||
_Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data );
|
||||
_Watchdog_Insert_seconds( &the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_seconds(
|
||||
&the_timer->Ticker,
|
||||
seconds - _TOD_Seconds_since_epoch
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -987,8 +987,7 @@ rtems_status_code rtems_task_wake_after(
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_ticks( &_Thread_Executing->Timer,
|
||||
ticks, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks );
|
||||
_Thread_Enable_dispatch();
|
||||
}
|
||||
return RTEMS_SUCCESSFUL;
|
||||
@@ -1036,8 +1035,10 @@ rtems_time_of_day *time_buffer
|
||||
_Thread_Executing->Object.id,
|
||||
NULL
|
||||
);
|
||||
_Watchdog_Insert_seconds( &_Thread_Executing->Timer,
|
||||
seconds - _TOD_Seconds_since_epoch, WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_seconds(
|
||||
&_Thread_Executing->Timer,
|
||||
seconds - _TOD_Seconds_since_epoch
|
||||
);
|
||||
_Thread_Enable_dispatch();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -48,18 +48,6 @@ typedef Watchdog_Service_routine ( *Watchdog_Service_routine_entry )(
|
||||
|
||||
#define WATCHDOG_NO_TIMEOUT 0
|
||||
|
||||
/*
|
||||
* The following enumerated type details the modes in which the
|
||||
* Watchdog_Insert routine may operate. The watchdog may be
|
||||
* activated automatically at insert time or later, explicitly
|
||||
* by the caller.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
WATCHDOG_ACTIVATE_NOW, /* activate watchdog as part of insertion */
|
||||
WATCHDOG_NO_ACTIVATE /* watchdog will be explicitly activated */
|
||||
} Watchdog_Insert_modes;
|
||||
|
||||
/*
|
||||
* The following enumerated type lists the states in which a
|
||||
* watchdog timer may be at any given time.
|
||||
@@ -238,8 +226,7 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void );
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -256,8 +243,7 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
);
|
||||
|
||||
/*
|
||||
@@ -391,8 +377,7 @@ void _Watchdog_Adjust (
|
||||
|
||||
void _Watchdog_Insert (
|
||||
Chain_Control *header,
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Control *the_watchdog
|
||||
);
|
||||
|
||||
/*
|
||||
|
||||
@@ -61,11 +61,7 @@ STATIC INLINE void _TOD_Activate(
|
||||
Watchdog_Interval ticks
|
||||
)
|
||||
{
|
||||
_Watchdog_Insert_ticks(
|
||||
&_TOD_Seconds_watchdog,
|
||||
ticks,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, ticks );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -115,14 +115,13 @@ STATIC INLINE void _Watchdog_Tickle_seconds( void )
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -134,14 +133,13 @@ STATIC INLINE void _Watchdog_Insert_ticks(
|
||||
|
||||
STATIC INLINE void _Watchdog_Insert_seconds(
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Interval units,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Interval units
|
||||
)
|
||||
{
|
||||
|
||||
the_watchdog->initial = units;
|
||||
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog, insert_mode );
|
||||
_Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
@@ -190,11 +188,7 @@ STATIC INLINE void _Watchdog_Reset(
|
||||
|
||||
(void) _Watchdog_Remove( the_watchdog );
|
||||
|
||||
_Watchdog_Insert(
|
||||
&_Watchdog_Ticks_chain,
|
||||
the_watchdog,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -231,6 +231,5 @@ void _TOD_Tickle(
|
||||
}
|
||||
|
||||
_Watchdog_Tickle_seconds();
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second,
|
||||
WATCHDOG_ACTIVATE_NOW );
|
||||
_Watchdog_Insert_ticks( &_TOD_Seconds_watchdog, _TOD_Ticks_per_second );
|
||||
}
|
||||
|
||||
@@ -109,11 +109,7 @@ void _Thread_queue_Enqueue(
|
||||
NULL
|
||||
);
|
||||
|
||||
_Watchdog_Insert_ticks(
|
||||
&the_thread->Timer,
|
||||
timeout,
|
||||
WATCHDOG_ACTIVATE_NOW
|
||||
);
|
||||
_Watchdog_Insert_ticks( &the_thread->Timer, timeout );
|
||||
}
|
||||
|
||||
switch( the_thread_queue->discipline ) {
|
||||
|
||||
@@ -140,8 +140,7 @@ void _Watchdog_Adjust(
|
||||
|
||||
void _Watchdog_Insert(
|
||||
Chain_Control *header,
|
||||
Watchdog_Control *the_watchdog,
|
||||
Watchdog_Insert_modes insert_mode
|
||||
Watchdog_Control *the_watchdog
|
||||
)
|
||||
{
|
||||
ISR_Level level;
|
||||
@@ -174,10 +173,10 @@ restart:
|
||||
delta_interval -= after->delta_interval;
|
||||
|
||||
/*
|
||||
* If you experience problems comment out the _ISR_Flash line. This
|
||||
* (3.2.0) is the first release with this critical section redesigned.
|
||||
* If you experience problems comment out the _ISR_Flash line.
|
||||
* 3.2.0 was the first release with this critical section redesigned.
|
||||
* Under certain circumstances, the PREVIOUS critical section algorithm
|
||||
* used around this flash point allows interrupts to execute
|
||||
* used around this flash point allowed interrupts to execute
|
||||
* which violated the design assumptions. The critical section
|
||||
* mechanism used here WAS redesigned to address this.
|
||||
*/
|
||||
@@ -195,8 +194,7 @@ restart:
|
||||
}
|
||||
}
|
||||
|
||||
if ( insert_mode == WATCHDOG_ACTIVATE_NOW )
|
||||
_Watchdog_Activate( the_watchdog );
|
||||
_Watchdog_Activate( the_watchdog );
|
||||
|
||||
the_watchdog->delta_interval = delta_interval;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user