aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/mdesc.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 13:45:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 13:45:23 -0400
commit02b2318e07f98a7cdf7089a4457a8d62424aa824 (patch)
treeb40353a9ee6b034e21192ceb5df445fbc5fbdd32 /include/asm-sparc64/mdesc.h
parentb91cba52e9b7b3f1c0037908a192d93a869ca9e5 (diff)
parentd54bc2793ec3405c6b8f217568a82b87bd8a591b (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: (26 commits) [SPARC64]: Fix UP build. [SPARC64]: dr-cpu unconfigure support. [SERIAL]: Fix console write locking in sparc drivers. [SPARC64]: Give more accurate errors in dr_cpu_configure(). [SPARC64]: Clear cpu_{core,sibling}_map[] in smp_fill_in_sib_core_maps() [SPARC64]: Fix leak when DR added cpu does not bootup. [SPARC64]: Add ->set_affinity IRQ handlers. [SPARC64]: Process dr-cpu events in a kthread instead of workqueue. [SPARC64]: More sensible udelay implementation. [SPARC64]: SMP build fixes. [SPARC64]: mdesc.c needs linux/mm.h [SPARC64]: Fix build regressions added by dr-cpu changes. [SPARC64]: Unconditionally register vio_bus_type. [SPARC64]: Initial LDOM cpu hotplug support. [SPARC64]: Fix setting of variables in LDOM guest. [SPARC64]: Fix MD property lifetime bugs. [SPARC64]: Abstract out mdesc accesses for better MD update handling. [SPARC64]: Use more mearningful names for IRQ registry. [SPARC64]: Initial domain-services driver. [SPARC64]: Export powerd facilities for external entities. ...
Diffstat (limited to 'include/asm-sparc64/mdesc.h')
-rw-r--r--include/asm-sparc64/mdesc.h88
1 files changed, 58 insertions, 30 deletions
diff --git a/include/asm-sparc64/mdesc.h b/include/asm-sparc64/mdesc.h
index c6383982b53d..e97c43133752 100644
--- a/include/asm-sparc64/mdesc.h
+++ b/include/asm-sparc64/mdesc.h
@@ -2,38 +2,66 @@
2#define _SPARC64_MDESC_H 2#define _SPARC64_MDESC_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/cpumask.h>
5#include <asm/prom.h> 6#include <asm/prom.h>
6 7
7struct mdesc_node; 8struct mdesc_handle;
8struct mdesc_arc { 9
9 const char *name; 10/* Machine description operations are to be surrounded by grab and
10 struct mdesc_node *arc; 11 * release calls. The mdesc_handle returned from the grab is
11}; 12 * the first argument to all of the operational calls that work
12 13 * on mdescs.
13struct mdesc_node { 14 */
14 const char *name; 15extern struct mdesc_handle *mdesc_grab(void);
15 u64 node; 16extern void mdesc_release(struct mdesc_handle *);
16 unsigned int unique_id; 17
17 unsigned int num_arcs; 18#define MDESC_NODE_NULL (~(u64)0)
18 unsigned int irqs[2]; 19
19 struct property *properties; 20extern u64 mdesc_node_by_name(struct mdesc_handle *handle,
20 struct mdesc_node *hash_next; 21 u64 from_node, const char *name);
21 struct mdesc_node *allnodes_next; 22#define mdesc_for_each_node_by_name(__hdl, __node, __name) \
22 struct mdesc_arc arcs[0]; 23 for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \
23}; 24 (__node) != MDESC_NODE_NULL; \
24 25 __node = mdesc_node_by_name(__hdl, __node, __name))
25extern struct mdesc_node *md_find_node_by_name(struct mdesc_node *from, 26
26 const char *name); 27/* Access to property values returned from mdesc_get_property() are
27#define md_for_each_node_by_name(__mn, __name) \ 28 * only valid inside of a mdesc_grab()/mdesc_release() sequence.
28 for (__mn = md_find_node_by_name(NULL, __name); __mn; \ 29 * Once mdesc_release() is called, the memory backed up by these
29 __mn = md_find_node_by_name(__mn, __name)) 30 * pointers may reference freed up memory.
30 31 *
31extern struct property *md_find_property(const struct mdesc_node *mp, 32 * Therefore callers must make copies of any property values
32 const char *name, 33 * they need.
33 int *lenp); 34 *
34extern const void *md_get_property(const struct mdesc_node *mp, 35 * These same rules apply to mdesc_node_name().
35 const char *name, 36 */
36 int *lenp); 37extern const void *mdesc_get_property(struct mdesc_handle *handle,
38 u64 node, const char *name, int *lenp);
39extern const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);
40
41/* MD arc iteration, the standard sequence is:
42 *
43 * unsigned long arc;
44 * mdesc_for_each_arc(arc, handle, node, MDESC_ARC_TYPE_{FWD,BACK}) {
45 * unsigned long target = mdesc_arc_target(handle, arc);
46 * ...
47 * }
48 */
49
50#define MDESC_ARC_TYPE_FWD "fwd"
51#define MDESC_ARC_TYPE_BACK "back"
52
53extern u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from,
54 const char *arc_type);
55#define mdesc_for_each_arc(__arc, __hdl, __node, __type) \
56 for (__arc = mdesc_next_arc(__hdl, __node, __type); \
57 (__arc) != MDESC_NODE_NULL; \
58 __arc = mdesc_next_arc(__hdl, __arc, __type))
59
60extern u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc);
61
62extern void mdesc_update(void);
63
64extern void mdesc_fill_in_cpu_data(cpumask_t mask);
37 65
38extern void sun4v_mdesc_init(void); 66extern void sun4v_mdesc_init(void);
39 67