diff options
Diffstat (limited to 'include/asm-sparc64/mdesc.h')
-rw-r--r-- | include/asm-sparc64/mdesc.h | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h index c6383982b53d..bbb0c0bed486 100644 --- a/include/asm-sparc64/mdesc.h +++ b/include/asm-sparc64/mdesc.h | |||
@@ -4,36 +4,43 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/prom.h> | 5 | #include <asm/prom.h> |
6 | 6 | ||
7 | struct mdesc_node; | 7 | struct mdesc_handle; |
8 | struct mdesc_arc { | 8 | |
9 | const char *name; | 9 | /* Machine description operations are to be surrounded by grab and |
10 | struct mdesc_node *arc; | 10 | * release calls. The mdesc_handle returned from the grab is |
11 | }; | 11 | * the first argument to all of the operational calls that work |
12 | 12 | * on mdescs. | |
13 | struct mdesc_node { | 13 | */ |
14 | const char *name; | 14 | extern struct mdesc_handle *mdesc_grab(void); |
15 | u64 node; | 15 | extern void mdesc_release(struct mdesc_handle *); |
16 | unsigned int unique_id; | 16 | |
17 | unsigned int num_arcs; | 17 | #define MDESC_NODE_NULL (~(u64)0) |
18 | unsigned int irqs[2]; | 18 | |
19 | struct property *properties; | 19 | extern u64 mdesc_node_by_name(struct mdesc_handle *handle, |
20 | struct mdesc_node *hash_next; | 20 | u64 from_node, const char *name); |
21 | struct mdesc_node *allnodes_next; | 21 | #define mdesc_for_each_node_by_name(__hdl, __node, __name) \ |
22 | struct mdesc_arc arcs[0]; | 22 | for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \ |
23 | }; | 23 | (__node) != MDESC_NODE_NULL; \ |
24 | 24 | __node = mdesc_node_by_name(__hdl, __node, __name)) | |
25 | extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from, | 25 | |
26 | const char *name); | 26 | extern const void *mdesc_get_property(struct mdesc_handle *handle, |
27 | #define md_for_each_node_by_name(__mn, __name) \ | 27 | u64 node, const char *name, int *lenp); |
28 | for (__mn = md_find_node_by_name(NULL, __name); __mn; \ | 28 | |
29 | __mn = md_find_node_by_name(__mn, __name)) | 29 | #define MDESC_ARC_TYPE_FWD "fwd" |
30 | 30 | #define MDESC_ARC_TYPE_BACK "back" | |
31 | extern struct property *md_find_property(const struct mdesc_node *mp, | 31 | |
32 | const char *name, | 32 | extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from, |
33 | int *lenp); | 33 | const char *arc_type); |
34 | extern const void *md_get_property(const struct mdesc_node *mp, | 34 | #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \ |
35 | const char *name, | 35 | for (__arc = mdesc_next_arc(__hdl, __node, __type); \ |
36 | int *lenp); | 36 | (__arc) != MDESC_NODE_NULL; \ |
37 | __arc = mdesc_next_arc(__hdl, __arc, __type)) | ||
38 | |||
39 | extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc); | ||
40 | |||
41 | extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node); | ||
42 | |||
43 | extern void mdesc_update(void); | ||
37 | 44 | ||
38 | extern void sun4v_mdesc_init(void); | 45 | extern void sun4v_mdesc_init(void); |
39 | 46 | ||