[PATCH 2/3] Add hook for BSP to act when time is set

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Oct 4 05:10:07 UTC 2019


On 04/10/2019 04:44, Chris Johns wrote:
> Is this only useful for virtual BSPs and is it always a requirement to implement
> this call in those environments?
> 
> Would this call be useful to a non-virtual BSP, for example one with a battery
> backed RTC device?
> 
> Would a hook API along the lines of ....
> 
> typedef int (*_TOD_Set_Handler)(const struct timespec *tod);
>   _TOD_Set_Handler _TOD_Set_hook(_TOD_Set_Handler handler);
> 
> ... be more flexible?

Yes, I think this should be generalized to allow RTC drivers to use this 
API as well. I think it should be possible to install (and remove) more 
than one hook, e.g.

typedef enum {
   TOD_ACTION_SET_CLOCK
} TOD_Action;

typedef struct TOD_Hook {
   Chain_Node Node;
   int (*handler)(struct TOD_Handler *, TOD_Action, const struct 
timespec *);
} TOD_Hook;

-- 
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