From 89b3be7db2b51c7d0924de1c1a472def682cf6cd Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 7 May 2017 11:25:59 +0000 Subject: Sync FDT code with arm64. --- sys/arch/armv7/stand/efiboot/fdt.c | 8 ++++---- sys/arch/armv7/stand/efiboot/fdt.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/arch/armv7/stand/efiboot/fdt.c b/sys/arch/armv7/stand/efiboot/fdt.c index 8d95817a075..7c1ba49f249 100644 --- a/sys/arch/armv7/stand/efiboot/fdt.c +++ b/sys/arch/armv7/stand/efiboot/fdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdt.c,v 1.4 2016/05/19 19:32:07 kettenis Exp $ */ +/* $OpenBSD: fdt.c,v 1.5 2017/05/07 11:25:58 kettenis Exp $ */ /* * Copyright (c) 2009 Dariusz Swiderski @@ -219,7 +219,7 @@ fdt_node_property(void *node, char *name, char **out) } int -fdt_node_set_property(void *node, char *name, char *data, int len) +fdt_node_set_property(void *node, char *name, void *data, int len) { uint32_t *ptr, *next; uint32_t nameid; @@ -245,7 +245,7 @@ fdt_node_set_property(void *node, char *name, char *data, int len) curlen = betoh32(*(ptr + 1)); delta = roundup(len, sizeof(uint32_t)) - roundup(curlen, sizeof(uint32_t)); - memmove((char *)next + delta, next, + memmove((char *)next + delta, next, tree.end - (char *)next); tree.struct_size += delta; if (tree.strings > tree.tree) @@ -263,7 +263,7 @@ fdt_node_set_property(void *node, char *name, char *data, int len) } int -fdt_node_add_property(void *node, char *name, char *data, int len) +fdt_node_add_property(void *node, char *name, void *data, int len) { char *dummy; diff --git a/sys/arch/armv7/stand/efiboot/fdt.h b/sys/arch/armv7/stand/efiboot/fdt.h index eb030d2bd60..747cf7c29ed 100644 --- a/sys/arch/armv7/stand/efiboot/fdt.h +++ b/sys/arch/armv7/stand/efiboot/fdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fdt.h,v 1.2 2016/05/17 22:41:20 kettenis Exp $ */ +/* $OpenBSD: fdt.h,v 1.3 2017/05/07 11:25:58 kettenis Exp $ */ /* * Copyright (c) 2009 Dariusz Swiderski @@ -57,8 +57,8 @@ void *fdt_child_node(void *); char *fdt_node_name(void *); void *fdt_find_node(char *); int fdt_node_property(void *, char *, char **); -int fdt_node_set_property(void *, char *, char *, int); -int fdt_node_add_property(void *, char *, char *, int); +int fdt_node_set_property(void *, char *, void *, int); +int fdt_node_add_property(void *, char *, void *, int); void *fdt_parent_node(void *); int fdt_node_is_compatible(void *, const char *); #ifdef DEBUG -- cgit v1.2.3