From 836026dbba64793afc0d2591ffdb6fb39b696977 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 21 May 2022 15:04:01 +0300 Subject: implement timers better --- include/libfdt.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/libfdt.h') diff --git a/include/libfdt.h b/include/libfdt.h index ffe979d..63e96fd 100644 --- a/include/libfdt.h +++ b/include/libfdt.h @@ -20,8 +20,11 @@ void __dbg_fdt(const void *fdt, int node_offset, int depth); #define dbg_fdt(...) #endif +#define fdt_load_int32_ptr(p) fdt32_to_cpu(get_unaligned((uint32_t *)p)) + +#define fdt_load_int64_ptr(p) fdt64_to_cpu(get_unaligned((uint64_t *)p)) + #define fdt_load_int_ptr(c, p) \ - ((c) == 2 ? fdt64_to_cpu(get_unaligned((uint64_t *)p)) : \ - fdt32_to_cpu(get_unaligned((uint32_t *)p))) + ((c) == 2 ? fdt_load_int64_ptr(p) : fdt_load_int32_ptr(p)) #endif -- cgit v1.3