[PATCH v2] Add TOD Hooks to allow BSP to take action when TOD is set

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 15 05:59:32 UTC 2019



On 14/11/2019 21:44, Joel Sherrill wrote:
> +bool _TOD_Hook_Register(
> +  TOD_Hook *hook
> +)
> +{
> +  ISR_lock_Context lock_context;
> +
> +  /*
> +   * At this time, this method does NOT have a Classic or POSIX API
> +   * that exports it. Any use of this method will be a direct call.
> +   * It should only be called while NOT holding the TOD lock.
> +   */
> +  _Assert( !_TOD_Is_owner() );
> +
> +  if ( hook == NULL ) {
> +    return FALSE;
> +  }
> +
> +  _TOD_Lock();
> +  _TOD_Acquire( &lock_context );
> +  _Chain_Append_unprotected( &_TOD_Hooks, &hook->Node );
> +  _TOD_Unlock();
> +  return true;
> +}

Where is the _TOD_Release()? This function should not test for a NULL 
hook and return void. Such kind of error handling should be done by 
upper layer functions and not at the lowest level.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


More information about the devel mailing list