lib: utils/fdt: Add fdt_get_address_rw() helper

Help tracking the lifecycle of the FDT blob by indicating which parts of
the firmware modify it, and thus invalidate any previously-obtained
offsets or pointers to data inside the blob.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Samuel Holland
2024-07-30 21:58:57 -07:00
committed by Anup Patel
parent c36801841e
commit 8cb7f89d7c
6 changed files with 13 additions and 8 deletions

View File

@@ -114,7 +114,12 @@ int fdt_parse_plicsw_node(const void *fdt, int nodeoffset, unsigned long *plicsw
int fdt_parse_compat_addr(const void *fdt, uint64_t *addr,
const char *compatible);
static inline void *fdt_get_address(void)
static inline const void *fdt_get_address(void)
{
return (const void *)root.next_arg1;
}
static inline void *fdt_get_address_rw(void)
{
return (void *)root.next_arg1;
}