-/* $OpenBSD: fdt.c,v 1.26 2020/12/30 06:06:31 gkoehler Exp $ */
+/* $OpenBSD: fdt.c,v 1.27 2021/05/06 19:45:16 kettenis Exp $ */
/*
* Copyright (c) 2009 Dariusz Swiderski <sfires@sfires.net>
return len;
}
+int
+OF_getpropbool(int handle, char *prop)
+{
+ void *node = (char *)tree.header + handle;
+ char *data;
+
+ return (fdt_node_property(node, prop, &data) >= 0);
+}
+
uint32_t
OF_getpropint(int handle, char *prop, uint32_t defval)
{
-/* $OpenBSD: openfirm.h,v 1.17 2020/12/30 06:06:31 gkoehler Exp $ */
+/* $OpenBSD: openfirm.h,v 1.18 2021/05/06 19:45:16 kettenis Exp $ */
/* $NetBSD: openfirm.h,v 1.1 1996/09/30 16:35:10 ws Exp $ */
/*
int OF_instance_to_package(int ihandle);
int OF_getproplen(int handle, char *prop);
int OF_getprop(int handle, char *prop, void *buf, int buflen);
+int OF_getpropbool(int handle, char *);
uint32_t OF_getpropint(int handle, char *, uint32_t);
int OF_getpropintarray(int, char *, uint32_t *, int);
uint64_t OF_getpropint64(int handle, char *, uint64_t);