-/* $OpenBSD: fdt.c,v 1.21 2017/11/17 20:30:43 kettenis Exp $ */
+/* $OpenBSD: fdt.c,v 1.22 2017/12/27 11:40:14 kettenis Exp $ */
/*
* Copyright (c) 2009 Dariusz Swiderski <sfires@sfires.net>
return len;
}
+uint64_t
+OF_getpropint64(int handle, char *prop, uint64_t defval)
+{
+ uint64_t val;
+ int len;
+
+ len = OF_getprop(handle, prop, &val, sizeof(val));
+ if (len != sizeof(val))
+ return defval;
+
+ return betoh64(val);
+}
+
int
OF_nextprop(int handle, char *prop, void *nextprop)
{
-/* $OpenBSD: openfirm.h,v 1.14 2017/03/12 11:44:42 kettenis Exp $ */
+/* $OpenBSD: openfirm.h,v 1.15 2017/12/27 11:40:14 kettenis Exp $ */
/* $NetBSD: openfirm.h,v 1.1 1996/09/30 16:35:10 ws Exp $ */
/*
int OF_getprop(int handle, char *prop, void *buf, int buflen);
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);
int OF_setprop(int, char *, const void *, int);
int OF_nextprop(int, char *, void *);
int OF_finddevice(char *name);