blob: dea8b91b6960f35e408f49b00ce6fa60f77153ad [file] [log] [blame]
David S. Miller657f2012008-12-04 20:12:20 -08001#ifndef __PROM_H
2#define __PROM_H
3
4#include <linux/spinlock.h>
5#include <asm/prom.h>
6
7extern struct device_node *allnodes; /* temporary while merging */
8extern rwlock_t devtree_lock; /* temporary while merging */
9
David S. Millerefeac2f2008-12-05 00:40:43 -080010extern void * prom_early_alloc(unsigned long size);
11
David S. Miller5fce09c2008-12-05 00:43:03 -080012#ifdef CONFIG_SPARC64
13extern void irq_trans_init(struct device_node *dp);
14#endif
15
David S. Millere5ff0fe2008-12-05 00:50:22 -080016extern unsigned int prom_unique_id;
17
David S. Miller65240362008-12-05 01:21:41 -080018static inline int is_root_node(const struct device_node *dp)
19{
20 if (!dp)
21 return 0;
David S. Millerb9e55672008-12-05 01:00:46 -080022
David S. Miller65240362008-12-05 01:21:41 -080023 return (dp->parent == NULL);
24}
25
26extern char *build_path_component(struct device_node *dp);
27
28extern struct device_node * __init prom_create_node(phandle node,
29 struct device_node *parent);
30
31extern struct device_node * __init prom_build_tree(struct device_node *parent,
32 phandle node,
33 struct device_node ***nextp);
David S. Miller657f2012008-12-04 20:12:20 -080034#endif /* __PROM_H */