+/*
+ * Structures for a Flattened Device Tree
+ */
+
+#define kPropNameLength 32
+
+typedef struct DeviceTreeNodeProperty {
+ char name[kPropNameLength];// NUL terminated property name
+ uint32_t length; // Length (bytes) of folloing prop value
+// unsigned long value[1]; // Variable length value of property
+ // Padded to a multiple of a longword?
+} DeviceTreeNodeProperty;
+
+typedef struct OpaqueDTEntry {
+ uint32_t nProperties;// Number of props[] elements (0 => end)
+ uint32_t nChildren; // Number of children[] elements
+// DeviceTreeNodeProperty props[];// array size == nProperties
+// DeviceTreeNode children[]; // array size == nChildren
+} DeviceTreeNode;
+
+typedef const DeviceTreeNode *RealDTEntry;
+
+typedef struct DTSavedScope {
+ struct DTSavedScope * nextScope;
+ RealDTEntry scope;
+ RealDTEntry entry;
+ unsigned long index;
+} *DTSavedScopePtr;
+
+/* Entry Iterator*/
+typedef struct OpaqueDTEntryIterator {
+ RealDTEntry outerScope;
+ RealDTEntry currentScope;
+ RealDTEntry currentEntry;
+ DTSavedScopePtr savedScope;
+ unsigned long currentIndex;
+} OpaqueDTEntryIterator, *DTEntryIterator;
+
+/* Property Iterator*/
+typedef struct OpaqueDTPropertyIterator {
+ RealDTEntry entry;
+ DeviceTreeNodeProperty const *currentProperty;
+ unsigned long currentIndex;
+} OpaqueDTPropertyIterator, *DTPropertyIterator;