kernel: timer: update k_timer API for const correctness
API that takes k_timer structures but doesn't change data in them is updated to const-qualify the underlying object, allowing information to be retrieved from contexts where the containing object is immutable. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
parent
16a4081520
commit
f1b86caff3
|
@ -2024,9 +2024,9 @@ static inline void z_impl_k_timer_user_data_set(struct k_timer *timer,
|
|||
*
|
||||
* @return The user data.
|
||||
*/
|
||||
__syscall void *k_timer_user_data_get(struct k_timer *timer);
|
||||
__syscall void *k_timer_user_data_get(const struct k_timer *timer);
|
||||
|
||||
static inline void *z_impl_k_timer_user_data_get(struct k_timer *timer)
|
||||
static inline void *z_impl_k_timer_user_data_get(const struct k_timer *timer)
|
||||
{
|
||||
return timer->user_data;
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ static inline k_ticks_t z_vrfy_k_timer_expires_ticks(struct k_timer *timer)
|
|||
}
|
||||
#include <syscalls/k_timer_expires_ticks_mrsh.c>
|
||||
|
||||
static inline void *z_vrfy_k_timer_user_data_get(struct k_timer *timer)
|
||||
static inline void *z_vrfy_k_timer_user_data_get(const struct k_timer *timer)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||
return z_impl_k_timer_user_data_get(timer);
|
||||
|
|
Loading…
Reference in a new issue