From: Simon Glass <simon.glass@canonical.com> Create include/linux/hrtimer.h with high-resolution timer definitions. This includes the hrtimer_mode enum values and schedule_hrtimeout() stub, matching Linux kernel organisation. These are stubs since U-Boot does not support high-resolution timers. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- fs/ext4l/ext4_uboot.h | 5 ++--- include/linux/hrtimer.h | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 include/linux/hrtimer.h diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 58479ccb2fe..89d1296c18b 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -839,9 +839,8 @@ static inline unsigned long memweight(const void *ptr, size_t bytes) /* ktime functions - use linux/ktime.h */ #include <linux/ktime.h> -/* hrtimer stubs */ -#define HRTIMER_MODE_ABS 0 -#define schedule_hrtimeout(exp, mode) ({ (void)(exp); (void)(mode); 0; }) +/* hrtimer - use linux/hrtimer.h */ +#include <linux/hrtimer.h> /* write lock variants */ #define write_trylock(lock) ({ (void)(lock); 1; }) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h new file mode 100644 index 00000000000..98178498b2d --- /dev/null +++ b/include/linux/hrtimer.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * High-resolution timer definitions for U-Boot + * + * Based on Linux hrtimer.h - high resolution timers. + * U-Boot stub - high-resolution timers not supported. + */ +#ifndef _LINUX_HRTIMER_H +#define _LINUX_HRTIMER_H + +/* High-resolution timer modes */ +enum hrtimer_mode { + HRTIMER_MODE_ABS = 0x00, + HRTIMER_MODE_REL = 0x01, + HRTIMER_MODE_PINNED = 0x02, + HRTIMER_MODE_SOFT = 0x04, + HRTIMER_MODE_HARD = 0x08, + + HRTIMER_MODE_ABS_PINNED = HRTIMER_MODE_ABS | HRTIMER_MODE_PINNED, + HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL | HRTIMER_MODE_PINNED, + HRTIMER_MODE_ABS_SOFT = HRTIMER_MODE_ABS | HRTIMER_MODE_SOFT, + HRTIMER_MODE_REL_SOFT = HRTIMER_MODE_REL | HRTIMER_MODE_SOFT, + HRTIMER_MODE_ABS_HARD = HRTIMER_MODE_ABS | HRTIMER_MODE_HARD, + HRTIMER_MODE_REL_HARD = HRTIMER_MODE_REL | HRTIMER_MODE_HARD, +}; + +/** + * schedule_hrtimeout() - sleep until timeout with high-resolution timer + * @expires: timeout value (ktime_t) + * @mode: timer mode + * + * U-Boot stub - returns immediately. + * + * Return: 0 + */ +#define schedule_hrtimeout(expires, mode) \ + ({ (void)(expires); (void)(mode); 0; }) + +#endif /* _LINUX_HRTIMER_H */ -- 2.43.0