From 45a34953256b237171a2ceea310b370b309cd29b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 May 2021 08:09:34 +0200 Subject: rtems: Add TOD_Ticks_validation Replace defines with an enum. Update #4406. --- cpukit/include/rtems/rtems/clockimpl.h | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'cpukit/include/rtems/rtems') diff --git a/cpukit/include/rtems/rtems/clockimpl.h b/cpukit/include/rtems/rtems/clockimpl.h index 404b8234ee..c8334afaf3 100644 --- a/cpukit/include/rtems/rtems/clockimpl.h +++ b/cpukit/include/rtems/rtems/clockimpl.h @@ -35,16 +35,22 @@ extern "C" { */ /** - * @brief Using this constant for the ticks mask disables the validation of the - * ticks member in _TOD_Validate(). + * @brief The enumerators of this type determine if the ticks member is + * validated in _TOD_Validate(). */ -#define TOD_DISABLE_TICKS_VALIDATION 0 +typedef enum { + /** + * @brief Use this option to disable the validation of the ticks member in + * _TOD_Validate(). + */ + TOD_DISABLE_TICKS_VALIDATION = 0, -/** - * @brief Using this constant for the ticks mask enables the validation of the - * ticks member in _TOD_Validate(). - */ -#define TOD_ENABLE_TICKS_VALIDATION UINT32_MAX + /** + * @brief Use this option to enable the validation of the ticks member in + * _TOD_Validate(). + */ + TOD_ENABLE_TICKS_VALIDATION = -1 +} TOD_Ticks_validation; /** * @brief Validates the time of day. @@ -52,9 +58,10 @@ extern "C" { * @param the_tod is the reference to the time of day structure to validate or * NULL. * - * @param ticks_mask is the mask for the ticks member of the time of day. Use - * #TOD_ENABLE_TICKS_VALIDATION to validate the ticks member. Use - * #TOD_DISABLE_TICKS_VALIDATION to skip the validation of the ticks member. + * @param ticks_validation indicates if the ticks member of the time of day + * should be validated. Use #TOD_ENABLE_TICKS_VALIDATION to validate the + * ticks member. Use #TOD_DISABLE_TICKS_VALIDATION to skip the validation of + * the ticks member. * * @retval RTEMS_SUCCESSFUL @a the_tod references a valid time of day. * @retval RTEMS_INVALID_CLOCK @a the_tod references an invalid time of day. @@ -62,7 +69,7 @@ extern "C" { */ rtems_status_code _TOD_Validate( const rtems_time_of_day *the_tod, - uint32_t ticks_mask + TOD_Ticks_validation ticks_validation ); /** -- cgit v1.2.3