* "objcopy -O binary" warning tweak, suggested by dmoseley
[binutils-gdb.git] / sim / common / hw-tree.h
blob3a8caffae6c02eb659b525ce049436217f85e1c3
1 /* This file is part of the program psim.
3 Copyright (C) 1994-1997, 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.
22 #ifndef HW_TREE
23 #define HW_TREE
26 struct hw *hw_tree_create
27 (SIM_DESC sd,
28 const char *device);
30 struct hw *hw_tree_parse
31 (struct hw *root,
32 const char *fmt,
33 ...) __attribute__ ((format (printf, 2, 3)));
35 void hw_tree_finish
36 (struct hw *root);
38 void hw_tree_print
39 (struct hw *root);
42 /* Tree traversal::
44 The entire device tree can be traversed using the
45 <<device_tree_traverse()>> function. The traversal can be in
46 either prefix or postfix order.
50 typedef void (hw_tree_traverse_function)
51 (struct hw *device,
52 void *data);
54 void hw_tree_traverse
55 (struct hw *root,
56 hw_tree_traverse_function *prefix,
57 hw_tree_traverse_function *postfix,
58 void *data);
61 /* Tree lookup::
63 The function <<hw_tree_find_device()>> will attempt to locate the
64 specified device within the tree. If the device is not found a
65 NULL device is returned.
69 struct hw * hw_tree_find_device
70 (struct hw *root,
71 const char *path);
74 const struct hw_property *hw_tree_find_property
75 (struct hw *root,
76 const char *path_to_property);
78 int hw_tree_find_boolean_property
79 (struct hw *root,
80 const char *path_to_property);
82 signed_cell hw_tree_find_integer_property
83 (struct hw *root,
84 const char *path_to_property);
86 #if NOT_YET
87 device_instance *hw_tree_find_ihandle_property
88 (struct hw *root,
89 const char *path_to_property);
90 #endif
92 const char *hw_tree_find_string_property
93 (struct hw *root,
94 const char *path_to_property);
97 /* Perform a soft reset on the created tree. */
99 void hw_tree_reset
100 (struct hw *root);
103 #endif