Import 2.3.18pre1
[davej-history.git] / include / asm-ppc / prom.h
blob018da94fdee456dd0b65f316297d75eca985b9dc
1 /*
2 * Definitions for talking to the Open Firmware PROM on
3 * Power Macintosh computers.
5 * Copyright (C) 1996 Paul Mackerras.
6 */
8 typedefvoid*phandle;
9 typedefvoid*ihandle;
11 externchar*prom_display_paths[];
12 externunsigned int prom_num_displays;
14 struct address_range {
15 unsigned int space;
16 unsigned int address;
17 unsigned int size;
20 struct interrupt_info {
21 int line;
22 int sense;/* +ve/-ve logic, edge or level, etc. */
25 struct reg_property {
26 unsigned int address;
27 unsigned int size;
30 struct translation_property {
31 unsigned int virt;
32 unsigned int size;
33 unsigned int phys;
34 unsigned int flags;
37 struct property {
38 char*name;
39 int length;
40 unsigned char*value;
41 struct property *next;
44 struct device_node {
45 char*name;
46 char*type;
47 phandle node;
48 int n_addrs;
49 struct address_range *addrs;
50 int n_intrs;
51 struct interrupt_info *intrs;
52 char*full_name;
53 struct property *properties;
54 struct device_node *parent;
55 struct device_node *child;
56 struct device_node *sibling;
57 struct device_node *next;/* next device of same type */
58 struct device_node *allnext;/* next in list of all nodes */
61 struct prom_args;
62 typedefvoid(*prom_entry)(struct prom_args *);
64 /* Prototypes */
65 externvoidabort(void);
66 externvoidprom_init(int,int, prom_entry);
67 externvoidprom_print(const char*msg);
68 externvoidfinish_device_tree(void);
69 externstruct device_node *find_devices(const char*name);
70 externstruct device_node *find_type_devices(const char*type);
71 externstruct device_node *find_path_device(const char*path);
72 externstruct device_node *find_compatible_devices(const char*type,
73 const char*compat);
74 externstruct device_node *find_phandle(phandle);
75 externintdevice_is_compatible(struct device_node *device,const char* compat);
76 externunsigned char*get_property(struct device_node *node,const char*name,
77 int*lenp);
78 externvoidprint_properties(struct device_node *node);
79 externintcall_rtas(const char*service,int nargs,int nret,
80 unsigned long*outputs, ...);
close