#3436 closed enhancement (fixed)
Remove clock driver Clock_driver_support_shutdown_hardware() hook
Reported by: | Sebastian Huber | Owned by: | Sebastian Huber |
---|---|---|---|
Priority: | normal | Milestone: | 5.1 |
Component: | dev | Version: | 5 |
Severity: | normal | Keywords: | qualification |
Cc: | Blocked By: | ||
Blocking: |
Description
Most applications use a clock driver and most BSPs use the clock driver framework provided by clockimpl.h. This framework offers a Clock_driver_support_shutdown_hardware() hook which is used like this.
#ifdef Clock_driver_support_shutdown_hardware /** * @brief Clock_exit * * This routine allows the clock driver to exit by masking the interrupt and * disabling the clock's counter. */ void Clock_exit( void ) { Clock_driver_support_shutdown_hardware(); /* do not restore old vector */ } #endif ... #ifdef Clock_driver_support_shutdown_hardware atexit( Clock_exit ); #endif
The aim is 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 superfluous Clock_driver_support_shutdown_hardware() hook.
Change History (4)
comment:1 Changed on 06/29/18 at 08:16:31 by Sebastian Huber <sebastian.huber@…>
comment:2 Changed on 06/29/18 at 09:53:27 by Sebastian Huber <sebastian.huber@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In 7ee59313/rtems:
comment:4 Changed on 06/23/21 at 07:16:03 by Sebastian Huber
Keywords: | qualification added |
---|
In c765aa0/rtems-docs: