]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/common/hw-tree.h
This commit was generated by cvs2svn to track changes on a CVS vendor
[thirdparty/binutils-gdb.git] / sim / common / hw-tree.h
1 /* This file is part of the program psim.
2
3 Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
4
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.
9
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.
14
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.
18
19 */
20
21
22 #ifndef HW_TREE
23 #define HW_TREE
24
25
26 struct hw *hw_tree_create
27 (SIM_DESC sd,
28 const char *device);
29
30 void hw_tree_delete
31 (struct hw *root);
32
33 struct hw *hw_tree_parse
34 (struct hw *root,
35 const char *fmt,
36 ...) __attribute__ ((format (printf, 2, 3)));
37
38 struct hw *hw_tree_vparse
39 (struct hw *root,
40 const char *fmt,
41 va_list ap);
42
43
44 void hw_tree_finish
45 (struct hw *root);
46
47 typedef void (hw_tree_print_callback)
48 (void *,
49 const char *fmt,
50 ...);
51
52 void hw_tree_print
53 (struct hw *root,
54 hw_tree_print_callback *print,
55 void *file);
56
57
58 /* Tree traversal::
59
60 The entire device tree can be traversed using the
61 <<device_tree_traverse()>> function. The traversal can be in
62 either prefix or postfix order.
63
64 */
65
66 typedef void (hw_tree_traverse_function)
67 (struct hw *device,
68 void *data);
69
70 void hw_tree_traverse
71 (struct hw *root,
72 hw_tree_traverse_function *prefix,
73 hw_tree_traverse_function *postfix,
74 void *data);
75
76
77 /* Tree lookup::
78
79 The function <<hw_tree_find_device()>> will attempt to locate the
80 specified device within the tree. If the device is not found a
81 NULL device is returned.
82
83 */
84
85 struct hw * hw_tree_find_device
86 (struct hw *root,
87 const char *path);
88
89
90 const struct hw_property *hw_tree_find_property
91 (struct hw *root,
92 const char *path_to_property);
93
94 int hw_tree_find_boolean_property
95 (struct hw *root,
96 const char *path_to_property);
97
98 signed_cell hw_tree_find_integer_property
99 (struct hw *root,
100 const char *path_to_property);
101
102 #if NOT_YET
103 device_instance *hw_tree_find_ihandle_property
104 (struct hw *root,
105 const char *path_to_property);
106 #endif
107
108 const char *hw_tree_find_string_property
109 (struct hw *root,
110 const char *path_to_property);
111
112
113 /* Perform a soft reset on the created tree. */
114
115 void hw_tree_reset
116 (struct hw *root);
117
118
119 #endif