From 15a7b737082df748de0aff2d2a3efdd7c8dd1e0c Mon Sep 17 00:00:00 2001 From: TRodziewicz Date: Wed, 16 Jun 2021 11:22:53 +0200 Subject: [PATCH] Documentation rewording Signed-off-by: TRodziewicz --- ChangeLog.d/issue4083.txt | 7 +++---- ...art_of_timing_module_out_of_the_library.md | 7 ++----- include/mbedtls/config.h | 3 +-- include/mbedtls/timing.h | 20 +------------------ library/timing.c | 19 ++++++++++++++++++ 5 files changed, 26 insertions(+), 30 deletions(-) diff --git a/ChangeLog.d/issue4083.txt b/ChangeLog.d/issue4083.txt index f3f7e31b0..845733702 100644 --- a/ChangeLog.d/issue4083.txt +++ b/ChangeLog.d/issue4083.txt @@ -1,5 +1,4 @@ -Changes - * Remove the following functions: mbedtls_timing_self_test() and - mbedtls_hardclock_poll(). Move the following functions to the benchmark.c - file and make them static: mbedtls_timing_hardclock() and +Removals + * Remove the following functions: mbedtls_timing_self_test(), + mbedtls_hardclock_poll(), mbedtls_timing_hardclock() and mbedtls_set_alarm(). Fixes #4083. diff --git a/docs/3.0-migration-guide.d/move_part_of_timing_module_out_of_the_library.md b/docs/3.0-migration-guide.d/move_part_of_timing_module_out_of_the_library.md index f0b539c8f..fa61e274b 100644 --- a/docs/3.0-migration-guide.d/move_part_of_timing_module_out_of_the_library.md +++ b/docs/3.0-migration-guide.d/move_part_of_timing_module_out_of_the_library.md @@ -5,8 +5,5 @@ The change affects users who use any of the following functions: `mbedtls_timing_self_test()`, `mbedtls_hardclock_poll()`, `mbedtls_timing_hardclock()` and `mbedtls_set_alarm()`. -This change is the first step of a plan of removal of the `timing.c` from the -library. The plan is to move all the timing functions to the `platform.c` file. - -For users who still need removed functions the migration path is to re-implement -them as a platform support code. +If you were relying on these functions, you'll now need to change to using your +platform's corresponding functions directly. diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index 74b82221d..4a98c5dda 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -1013,8 +1013,7 @@ /** * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES * - * Do not add default entropy sources. These are the platform specific - * poll function. + * Do not add default entropy sources in mbedtls_entropy_init(). * * This is useful to have more control over the added entropy sources in an * application. diff --git a/include/mbedtls/timing.h b/include/mbedtls/timing.h index 9ea5c2966..5289889f9 100644 --- a/include/mbedtls/timing.h +++ b/include/mbedtls/timing.h @@ -63,25 +63,7 @@ typedef struct mbedtls_timing_delay_context extern volatile int mbedtls_timing_alarmed; -/** - * \brief Return the elapsed time in milliseconds - * - * \warning May change without notice - * - * \param val points to a timer structure - * \param reset If 0, query the elapsed time. Otherwise (re)start the timer. - * - * \return Elapsed time since the previous reset in ms. When - * restarting, this is always 0. - * - * \note To initialize a timer, call this function with reset=1. - * - * Determining the elapsed time and resetting the timer is not - * atomic on all platforms, so after the sequence - * `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 = - * get_timer(0) }` the value time1+time2 is only approximately - * the delay since the first reset. - */ +/* Internal use */ unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset ); /** diff --git a/library/timing.c b/library/timing.c index d87d8b6ca..e6dfc72d1 100644 --- a/library/timing.c +++ b/library/timing.c @@ -83,6 +83,25 @@ unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int #else /* _WIN32 && !EFIX64 && !EFI32 */ +/** + * \brief Return the elapsed time in milliseconds + * + * \warning May change without notice + * + * \param val points to a timer structure + * \param reset If 0, query the elapsed time. Otherwise (re)start the timer. + * + * \return Elapsed time since the previous reset in ms. When + * restarting, this is always 0. + * + * \note To initialize a timer, call this function with reset=1. + * + * Determining the elapsed time and resetting the timer is not + * atomic on all platforms, so after the sequence + * `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 = + * get_timer(0) }` the value time1+time2 is only approximately + * the delay since the first reset. + */ unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset ) { struct _hr_time *t = (struct _hr_time *) val;