// SPDX-License-Identifier: GPL-2.0 /* * tree.c: Basic device tree traversal/scanning for the Linux * prom library. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
*/
/* Internal version of prom_getchild that does not alter return values. */ static phandle __prom_getchild(phandle node)
{ unsignedlong flags;
phandle cnode;
/* Internal version of prom_getsibling that does not alter return values. */ static phandle __prom_getsibling(phandle node)
{ unsignedlong flags;
phandle cnode;
/* Return the next sibling of node 'node' or zero if no more siblings * at this level of depth in the tree.
*/
phandle prom_getsibling(phandle node)
{
phandle sibnode;
/* Return the length in bytes of property 'prop' at node 'node'. * Return -1 on error.
*/ int prom_getproplen(phandle node, constchar *prop)
{ int ret; unsignedlong flags;
/* Acquire a property 'prop' at node 'node' and place it in * 'buffer' which has a size of 'bufsize'. If the acquisition * was successful the length will be returned, else -1 is returned.
*/ int prom_getproperty(phandle node, constchar *prop, char *buffer, int bufsize)
{ int plen, ret; unsignedlong flags;
/* Acquire an integer property, upon error return the passed default * integer.
*/ int prom_getintdefault(phandle node, char *property, int deflt)
{ int retval;
/* Acquire a property whose value is a string, returns a null * string on error. The char pointer is the user supplied string * buffer.
*/ void prom_getstring(phandle node, char *prop, char *user_buf, int ubuf_size)
{ int len;
/* Search siblings at 'node_start' for a node with name * 'nodename'. Return node if successful, zero if not.
*/
phandle prom_searchsiblings(phandle node_start, char *nodename)
{
/* Interal version of nextprop that does not alter return values. */ staticchar *__prom_nextprop(phandle node, char * oprop)
{ unsignedlong flags; char *prop;
/* Return the property type string after property type 'oprop' * at node 'node' . Returns empty string if no more * property types for this node.
*/ char *prom_nextprop(phandle node, char *oprop, char *buffer)
{ if (node == 0 || (s32)node == -1) return"";
/* Set property 'pname' at node 'node' to value 'value' which has a length * of 'size' bytes. Return the number of bytes the prom accepted.
*/ int prom_setprop(phandle node, constchar *pname, char *value, int size)
{ unsignedlong flags; int ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.