blob: c6383982b53ddfcfa4da57ec27a3ddd52de70dd5 [file] [log] [blame]
David S. Miller5cbc3072007-05-25 15:49:59 -07001#ifndef _SPARC64_MDESC_H
2#define _SPARC64_MDESC_H
3
4#include <linux/types.h>
5#include <asm/prom.h>
6
7struct mdesc_node;
8struct mdesc_arc {
9 const char *name;
10 struct mdesc_node *arc;
11};
12
13struct mdesc_node {
14 const char *name;
15 u64 node;
16 unsigned int unique_id;
17 unsigned int num_arcs;
David S. Miller701271d2007-06-26 00:11:56 -070018 unsigned int irqs[2];
David S. Miller5cbc3072007-05-25 15:49:59 -070019 struct property *properties;
20 struct mdesc_node *hash_next;
21 struct mdesc_node *allnodes_next;
22 struct mdesc_arc arcs[0];
23};
24
25extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from,
26 const char *name);
27#define md_for_each_node_by_name(__mn, __name) \
28 for (__mn = md_find_node_by_name(NULL, __name); __mn; \
29 __mn = md_find_node_by_name(__mn, __name))
30
31extern struct property *md_find_property(const struct mdesc_node *mp,
32 const char *name,
33 int *lenp);
34extern const void *md_get_property(const struct mdesc_node *mp,
35 const char *name,
36 int *lenp);
37
38extern void sun4v_mdesc_init(void);
39
40#endif