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 2 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, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /* Constructing the device tree:
31 The initial device tree populated with devices and basic properties
32 is created using the function <<device_tree_add_parsed()>>. This
33 function parses a PSIM device specification and uses it to populate
36 This function accepts a printf style formatted string as the
37 argument that describes the entry. Any properties or interrupt
38 connections added to a device tree using this function are marked
39 as having a permenant disposition. When the tree is (re)
40 initialized they will be restored to their initial value.
48 ...) __attribute__ ((format (printf
, 2, 3)));
60 (device_instance
*) tree_instance
62 const char *device_specifier
);
67 The entire device tree can be traversed using the
68 <<device_tree_traverse()>> function. The traversal can be in
69 either pre- or postfix order.
73 typedef void (tree_traverse_function
)
80 tree_traverse_function
*prefix
,
81 tree_traverse_function
*postfix
,
87 The function <<tree_find_device()>> will attempt to locate
88 the specified device within the tree. If the device is not found a
89 NULL device is returned.
94 (device
*) tree_find_device
100 (const device_property
*) tree_find_property
102 const char *path_to_property
);
105 (int) tree_find_boolean_property
107 const char *path_to_property
);
110 (signed_cell
) tree_find_integer_property
112 const char *path_to_property
);
115 (device_instance
*) tree_find_ihandle_property
117 const char *path_to_property
);
120 (const char *) tree_find_string_property
122 const char *path_to_property
);
125 /* Initializing the created tree:
127 Once a device tree has been created the <<device_tree_init()>>
128 function is used to initialize it. The exact sequence of events
129 that occure during initialization are described separatly.
139 #endif /* _TREE_H_ */