From 61598093bbdd283a7edc367d900f223070ead8d2 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:43:03 +0000 Subject: [PATCH] add ax88772C AX88772C_eeprom_tools --- kernel/drivers/gpu/arm/mali400/mali/common/mali_osk.h | 47 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 37 insertions(+), 10 deletions(-) diff --git a/kernel/drivers/gpu/arm/mali400/mali/common/mali_osk.h b/kernel/drivers/gpu/arm/mali400/mali/common/mali_osk.h index 5a180e5..9ade362 100755 --- a/kernel/drivers/gpu/arm/mali400/mali/common/mali_osk.h +++ b/kernel/drivers/gpu/arm/mali400/mali/common/mali_osk.h @@ -950,24 +950,23 @@ /** @brief Initialize a timer * - * Initializes a given timer instance. - * This does not start the timer. - - * @param tim the timer to init. - * @param callback the callback that would be called when 'tim' times out. + * Allocates resources for a new timer, and initializes them. This does not + * start the timer. + * + * @return a pointer to the allocated timer object, or NULL on failure. */ -void _mali_osk_timer_init(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback); +_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback); /** @brief Start a timer * * It is an error to start a timer without setting the callback via - * _mali_osk_timer_init(). + * _mali_osk_timer_setcallback(). * * It is an error to use this to start an already started timer. * * The timer will expire in \a ticks_to_expire ticks, at which point, the * callback function will be invoked with the callback-specific data, - * as registered by _mali_osk_timer_init(). + * as registered by _mali_osk_timer_setcallback(). * * @param tim the timer to start * @param ticks_to_expire the amount of time in ticks for the timer to run @@ -981,11 +980,11 @@ * stopped. If \a ticks_to_expire 0 the timer fires immediately. * * It is an error to modify a timer without setting the callback via - * _mali_osk_timer_init(). + * _mali_osk_timer_setcallback(). * * The timer will expire at \a ticks_to_expire from the time of the call, at * which point, the callback function will be invoked with the - * callback-specific data, as set by _mali_osk_timer_init(). + * callback-specific data, as set by _mali_osk_timer_setcallback(). * * @param tim the timer to modify, and start if necessary * @param ticks_to_expire the \em absolute time in ticks at which this timer @@ -1035,6 +1034,34 @@ */ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); +/** @brief Set a timer's callback parameters. + * + * This must be called at least once before a timer is started/modified. + * + * After a timer has been stopped or expires, the callback remains set. This + * means that restarting the timer will call the same function with the same + * parameters on expiry. + * + * @param tim the timer to set callback on. + * @param callback Function to call when timer expires + * @param data Function-specific data to supply to the function on expiry. + */ +void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data); + +/** @brief Terminate a timer, and deallocate resources. + * + * The timer must first be stopped by calling _mali_osk_timer_del(). + * + * It is a programming error for _mali_osk_timer_term() to be called on: + * - timer that is currently running + * - a timer that is currently executing its callback. + * + * @param tim the timer to deallocate. + */ +void _mali_osk_timer_term(_mali_osk_timer_t *tim); +/** @} */ /* end group _mali_osk_timer */ + + /** @defgroup _mali_osk_time OSK Time functions * * \ref _mali_osk_time use the OS's representation of time, which are -- Gitblit v1.6.2