-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathAppleDeviceTree.h
61 lines (42 loc) · 1.03 KB
/
AppleDeviceTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright (c) 2005 Apple Computer, Inc. All Rights Reserved.
*/
#ifndef __DEVICE_TREE_H
#define __DEVICE_TREE_H
#include <stdbool.h>
#include <stdint.h>
typedef struct _Property {
char * name;
uint32_t length;
void * value;
struct _Property * next;
} Property;
typedef struct _Node {
struct _Property * properties;
struct _Property * last_prop;
struct _Node * children;
struct _Node * next;
} Node;
extern Property *
DT__AddProperty(Node *node, char *name, uint32_t length, void *value);
extern Node *
DT__AddChild(Node *parent, char *name);
Node *
DT__FindNode(char *path, bool createIfMissing);
extern void
DT__FreeProperty(Property *prop);
extern void
DT__FreeNode(Node *node);
extern char *
DT__GetName(Node *node);
void
DT__Initialize(void);
/*
* Free up memory used by in-memory representation
* of device tree.
*/
extern void
DT__Finalize(void);
void
DT__FlattenDeviceTree(void **result, uint32_t *length);
#endif /* __DEVICE_TREE_H */