Rev 1894 | Rev 1896 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1894 | Rev 1895 | ||
|---|---|---|---|
| Line 28... | Line 28... | ||
| 28 | 28 | ||
| 29 | #ifndef KERN_OFW_TREE_H_ |
29 | #ifndef KERN_OFW_TREE_H_ |
| 30 | #define KERN_OFW_TREE_H_ |
30 | #define KERN_OFW_TREE_H_ |
| 31 | 31 | ||
| 32 | #include <arch/types.h> |
32 | #include <arch/types.h> |
| - | 33 | #include <typedefs.h> |
|
| 33 | 34 | ||
| 34 | #define OFW_TREE_PROPERTY_MAX_NAMELEN 32 |
35 | #define OFW_TREE_PROPERTY_MAX_NAMELEN 32 |
| 35 | 36 | ||
| 36 | typedef struct ofw_tree_node ofw_tree_node_t; |
37 | typedef struct ofw_tree_node ofw_tree_node_t; |
| 37 | typedef struct ofw_tree_property ofw_tree_property_t; |
38 | typedef struct ofw_tree_property ofw_tree_property_t; |
| Line 40... | Line 41... | ||
| 40 | struct ofw_tree_node { |
41 | struct ofw_tree_node { |
| 41 | ofw_tree_node_t *parent; |
42 | ofw_tree_node_t *parent; |
| 42 | ofw_tree_node_t *peer; |
43 | ofw_tree_node_t *peer; |
| 43 | ofw_tree_node_t *child; |
44 | ofw_tree_node_t *child; |
| 44 | 45 | ||
| - | 46 | char *da_name; /**< Disambigued name. */ |
|
| - | 47 | ||
| 45 | unsigned properties; /**< Number of properties. */ |
48 | unsigned properties; /**< Number of properties. */ |
| 46 | ofw_tree_property_t *property; |
49 | ofw_tree_property_t *property; |
| 47 | }; |
50 | }; |
| 48 | 51 | ||
| 49 | /** Memory representation of OpenFirmware device tree node property. */ |
52 | /** Memory representation of OpenFirmware device tree node property. */ |
| 50 | struct ofw_tree_property { |
53 | struct ofw_tree_property { |
| 51 | char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; |
54 | char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; |
| 52 | size_t size; |
55 | size_t size; |
| 53 | void *value; |
56 | void *value; |
| 54 | }; |
57 | }; |
| 55 | 58 | ||
| - | 59 | extern void ofw_tree_init(ofw_tree_node_t *root); |
|
| - | 60 | extern void ofw_tree_print(void); |
|
| - | 61 | extern const char *ofw_tree_node_name(const ofw_tree_node_t *node); |
|
| - | 62 | extern ofw_tree_node_t *ofw_tree_lookup(const char *path); |
|
| - | 63 | ||
| 56 | #endif |
64 | #endif |