[Concept,16/16] ext4l: Add asm-generic/timex.h and move get_cycles
Commit Message
From: Simon Glass <simon.glass@canonical.com>
Create include/asm-generic/timex.h with the get_cycles() macro that
returns 0 (U-Boot doesn't have a cycle counter).
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
fs/ext4l/ext4_uboot.h | 4 ++--
include/asm-generic/timex.h | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
create mode 100644 include/asm-generic/timex.h
@@ -1322,8 +1322,8 @@ static inline unsigned long ext4_find_next_bit_le(const void *addr,
/* atomic64 operations are now in asm-generic/atomic.h */
-/* CPU cycle counter stub */
-#define get_cycles() (0ULL)
+/* get_cycles is in asm-generic/timex.h */
+#include <asm-generic/timex.h>
/* folio_address is in linux/pagemap.h */
new file mode 100644
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Generic timex definitions for U-Boot
+ *
+ * Based on Linux asm-generic/timex.h
+ */
+#ifndef _ASM_GENERIC_TIMEX_H
+#define _ASM_GENERIC_TIMEX_H
+
+typedef unsigned long long cycles_t;
+
+/**
+ * get_cycles() - Get CPU cycle counter
+ *
+ * U-Boot doesn't have a cycle counter, so return 0.
+ *
+ * Return: 0 (stub)
+ */
+#define get_cycles() (0ULL)
+
+#endif /* _ASM_GENERIC_TIMEX_H */