summaryrefslogtreecommitdiffstats
path: root/cpukit/dtc/libfdt/libfdt_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/dtc/libfdt/libfdt_internal.h')
-rw-r--r--cpukit/dtc/libfdt/libfdt_internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/cpukit/dtc/libfdt/libfdt_internal.h b/cpukit/dtc/libfdt/libfdt_internal.h
index d4e0bd49c0..8b580aa507 100644
--- a/cpukit/dtc/libfdt/libfdt_internal.h
+++ b/cpukit/dtc/libfdt/libfdt_internal.h
@@ -46,6 +46,25 @@ static inline struct fdt_reserve_entry *fdt_mem_rsv_w_(void *fdt, int n)
return (void *)(uintptr_t)fdt_mem_rsv_(fdt, n);
}
+/*
+ * Internal helpers to access tructural elements of the device tree blob
+ * (rather than for exaple reading integers from within property values). We
+ * assume that we are either given a naturally aligned address for the platform
+ * or if we are not, we are on a platform where unaligned memory reads will be
+ * handled in a graceful manner. If this is not the case there are _unaligned
+ * versions of these functions that follow and can be used.
+ *
+ */
+static inline uint32_t fdt32_ld_(const fdt32_t *p)
+{
+ return fdt32_to_cpu(*p);
+}
+
+static inline uint64_t fdt64_ld_(const fdt64_t *p)
+{
+ return fdt64_to_cpu(*p);
+}
+
#define FDT_SW_MAGIC (~FDT_MAGIC)
/**********************************************************************/