1 /* This file is part of the program psim.
3 Copyright (C) 1994-1996, Andrew Cagney <cagney@highland.com.au>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, see <http://www.gnu.org/licenses/>.
28 /* Constructing the device tree:
30 The initial device tree populated with devices and basic properties
31 is created using the function <<device_tree_add_parsed()>>. This
32 function parses a PSIM device specification and uses it to populate
35 This function accepts a printf style formatted string as the
36 argument that describes the entry. Any properties or interrupt
37 connections added to a device tree using this function are marked
38 as having a permenant disposition. When the tree is (re)
39 initialized they will be restored to their initial value.
44 (char*) tree_quote_property
45 (const char *property_value
);
51 ...) ATTRIBUTE_PRINTF_2
;
63 (device_instance
*) tree_instance
65 const char *device_specifier
);
70 The entire device tree can be traversed using the
71 <<device_tree_traverse()>> function. The traversal can be in
72 either pre- or postfix order.
76 typedef void (tree_traverse_function
)
83 tree_traverse_function
*prefix
,
84 tree_traverse_function
*postfix
,
90 The function <<tree_find_device()>> will attempt to locate
91 the specified device within the tree. If the device is not found a
92 NULL device is returned.
97 (device
*) tree_find_device
103 (const device_property
*) tree_find_property
105 const char *path_to_property
);
108 (int) tree_find_boolean_property
110 const char *path_to_property
);
113 (signed_cell
) tree_find_integer_property
115 const char *path_to_property
);
118 (device_instance
*) tree_find_ihandle_property
120 const char *path_to_property
);
123 (const char *) tree_find_string_property
125 const char *path_to_property
);
128 /* Initializing the created tree:
130 Once a device tree has been created the <<device_tree_init()>>
131 function is used to initialize it. The exact sequence of events
132 that occure during initialization are described separatly.
142 #endif /* _TREE_H_ */