[RTEMS Project] #3436: Remove clock driver Clock_driver_support_shutdown_hardware() hook

RTEMS trac trac at rtems.org
Fri May 25 12:32:59 UTC 2018

#3436: Remove clock driver Clock_driver_support_shutdown_hardware() hook
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  enhancement      |     Status:  assigned
  Priority:  normal           |  Milestone:  5.1
 Component:  dev              |    Version:  5
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
 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
  *  disabling the clock's counter.
 void Clock_exit( void )

   /* do not restore old vector */
 #ifdef Clock_driver_support_shutdown_hardware
   atexit( Clock_exit );
 The aim is to stop clock tick interrupts at some late point in the exit()

 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.

Ticket URL: <http://devel.rtems.org/ticket/3436>
RTEMS Project <http://www.rtems.org/>
RTEMS Project

More information about the bugs mailing list