mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-27 06:58:19 +00:00
Remove Clock_driver_support_shutdown_hardware()
The aim of this clock driver hook was to stop clock tick interrupts at some late point in the exit() procedure. The use of atexit() pulls in malloc() which pulls in errno. It is incompatible with the intention of the CONFIGURE_DISABLE_NEWLIB_REENTRANCY configuration option. The exit() function must be called from thread context, so accompanied clock tick interrupts should cause no harm. On the contrary, someone may assume a normal operating system operation, e.g. working timeouts. Remove the Clock_driver_support_shutdown_hardware() clock driver hook. Close #3436.
This commit is contained in:
@@ -11,17 +11,8 @@
|
||||
|
||||
#define CLOCK_VECTOR 0
|
||||
|
||||
volatile bool clock_driver_enabled;
|
||||
|
||||
#define Clock_driver_support_initialize_hardware() \
|
||||
do { \
|
||||
clock_driver_enabled = true; \
|
||||
} while (0)
|
||||
|
||||
#define Clock_driver_support_shutdown_hardware() \
|
||||
do { \
|
||||
clock_driver_enabled = false; \
|
||||
} while (0)
|
||||
do { } while (0)
|
||||
|
||||
#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
|
||||
|
||||
@@ -46,14 +37,12 @@ void *clock_driver_sim_idle_body(
|
||||
)
|
||||
{
|
||||
for( ; ; ) {
|
||||
if ( clock_driver_enabled ) {
|
||||
Per_CPU_Control *cpu = _Thread_Dispatch_disable();
|
||||
_ISR_Nest_level++;
|
||||
rtems_clock_tick();
|
||||
_ISR_Nest_level--;
|
||||
_Thread_Dispatch_enable( cpu );
|
||||
BSP_CLOCK_DRIVER_DELAY();
|
||||
}
|
||||
Per_CPU_Control *cpu = _Thread_Dispatch_disable();
|
||||
_ISR_Nest_level++;
|
||||
rtems_clock_tick();
|
||||
_ISR_Nest_level--;
|
||||
_Thread_Dispatch_enable( cpu );
|
||||
BSP_CLOCK_DRIVER_DELAY();
|
||||
}
|
||||
return 0; /* to avoid warning */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user