Lines Matching +full:a +full:- +full:child +full:- +full:node +full:- +full:property
19 static phandle prom_node_to_node(const char *type, phandle node) in prom_node_to_node() argument
26 args[3] = (unsigned int) node; in prom_node_to_node()
27 args[4] = (unsigned long) -1; in prom_node_to_node()
34 /* Return the child of node 'node' or zero if no this node has no
37 inline phandle __prom_getchild(phandle node) in __prom_getchild() argument
39 return prom_node_to_node("child", node); in __prom_getchild()
42 inline phandle prom_getchild(phandle node) in prom_getchild() argument
46 if ((s32)node == -1) in prom_getchild()
48 cnode = __prom_getchild(node); in prom_getchild()
49 if ((s32)cnode == -1) in prom_getchild()
55 inline phandle prom_getparent(phandle node) in prom_getparent() argument
59 if ((s32)node == -1) in prom_getparent()
61 cnode = prom_node_to_node("parent", node); in prom_getparent()
62 if ((s32)cnode == -1) in prom_getparent()
67 /* Return the next sibling of node 'node' or zero if no more siblings
70 inline phandle __prom_getsibling(phandle node) in __prom_getsibling() argument
72 return prom_node_to_node(prom_peer_name, node); in __prom_getsibling()
75 inline phandle prom_getsibling(phandle node) in prom_getsibling() argument
79 if ((s32)node == -1) in prom_getsibling()
81 sibnode = __prom_getsibling(node); in prom_getsibling()
82 if ((s32)sibnode == -1) in prom_getsibling()
89 /* Return the length in bytes of property 'prop' at node 'node'.
90 * Return -1 on error.
92 inline int prom_getproplen(phandle node, const char *prop) in prom_getproplen() argument
96 if (!node || !prop) in prom_getproplen()
97 return -1; in prom_getproplen()
102 args[3] = (unsigned int) node; in prom_getproplen()
104 args[5] = (unsigned long) -1; in prom_getproplen()
112 /* Acquire a property 'prop' at node 'node' and place it in
113 * 'buffer' which has a size of 'bufsize'. If the acquisition
114 * was successful the length will be returned, else -1 is returned.
116 inline int prom_getproperty(phandle node, const char *prop, in prom_getproperty() argument
122 plen = prom_getproplen(node, prop); in prom_getproperty()
123 if ((plen > bufsize) || (plen == 0) || (plen == -1)) in prom_getproperty()
124 return -1; in prom_getproperty()
129 args[3] = (unsigned int) node; in prom_getproperty()
133 args[7] = (unsigned long) -1; in prom_getproperty()
141 /* Acquire an integer property and return its value. Returns -1
144 inline int prom_getint(phandle node, const char *prop) in prom_getint() argument
148 if (prom_getproperty(node, prop, (char *) &intprop, sizeof(int)) != -1) in prom_getint()
151 return -1; in prom_getint()
155 /* Acquire an integer property, upon error return the passed default
159 int prom_getintdefault(phandle node, const char *property, int deflt) in prom_getintdefault() argument
163 retval = prom_getint(node, property); in prom_getintdefault()
164 if (retval == -1) in prom_getintdefault()
171 /* Acquire a boolean property, 1=TRUE 0=FALSE. */
172 int prom_getbool(phandle node, const char *prop) in prom_getbool() argument
176 retval = prom_getproplen(node, prop); in prom_getbool()
177 if (retval == -1) in prom_getbool()
183 /* Acquire a property whose value is a string, returns a null
187 void prom_getstring(phandle node, const char *prop, char *user_buf, in prom_getstring() argument
192 len = prom_getproperty(node, prop, user_buf, ubuf_size); in prom_getstring()
193 if (len != -1) in prom_getstring()
199 /* Does the device at node 'node' have name 'name'?
202 int prom_nodematch(phandle node, const char *name) in prom_nodematch() argument
205 prom_getproperty(node, "name", namebuf, sizeof(namebuf)); in prom_nodematch()
211 /* Search siblings at 'node_start' for a node with name
212 * 'nodename'. Return node if successful, zero if not.
225 if(error == -1) continue; in prom_searchsiblings()
235 /* Return the first property type for node 'node'.
238 inline char *prom_firstprop(phandle node, char *buffer) in prom_firstprop() argument
243 if ((s32)node == -1) in prom_firstprop()
249 args[3] = (unsigned int) node; in prom_firstprop()
252 args[6] = (unsigned long) -1; in prom_firstprop()
260 /* Return the property type string after property type 'oprop'
261 * at node 'node' . Returns NULL string if no more
262 * property types for this node.
264 inline char *prom_nextprop(phandle node, const char *oprop, char *buffer) in prom_nextprop() argument
269 if ((s32)node == -1) { in prom_nextprop()
281 args[3] = (unsigned int) node; in prom_nextprop()
284 args[6] = (unsigned long) -1; in prom_nextprop()
302 args[4] = (unsigned long) -1; in prom_finddevice()
310 int prom_node_has_property(phandle node, const char *prop) in prom_node_has_property() argument
316 prom_nextprop(node, buf, buf); in prom_node_has_property()
324 /* Set property 'pname' at node 'node' to value 'value' which has a length
328 prom_setprop(phandle node, const char *pname, char *value, int size) in prom_setprop() argument
346 args[3] = (unsigned int) node; in prom_setprop()
350 args[7] = (unsigned long) -1; in prom_setprop()
361 phandle node; in prom_inst2pkg() local
363 args[0] = (unsigned long) "instance-to-package"; in prom_inst2pkg()
367 args[4] = (unsigned long) -1; in prom_inst2pkg()
371 node = (int) args[4]; in prom_inst2pkg()
372 if ((s32)node == -1) in prom_inst2pkg()
374 return node; in prom_inst2pkg()
381 args[0] = (unsigned long) "instance-to-path"; in prom_ihandle2path()
387 args[6] = (unsigned long) -1; in prom_ihandle2path()