promif_stree.c revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/promif_impl.h>
#include <sys/machsystm.h>
/*
* A property attached to a node in the kernel's
* shadow copy of the PROM device tree.
*/
typedef struct prom_prop {
char *pp_name;
int pp_len;
void *pp_val;
} prom_prop_t;
/*
* A node in the kernel's shadow copy of the PROM
* device tree.
*/
typedef struct prom_node {
struct prom_node *pn_sibling;
} prom_node_t;
static prom_node_t *promif_root;
#ifndef _KMDB
#endif
/*
* Hooks for kmdb for accessing the PROM shadow tree. The driver portion
* of kmdb will retrieve the root of the tree and pass it down to the
* debugger portion of kmdb. As the kmdb debugger is standalone, it has
* its own promif_root pointer that it will be set to the value passed by
* the driver so that kmdb points to the shadow tree maintained by the kernel.
* So the "get" function is in the kernel while the "set" function is in kmdb.
*/
#ifdef _KMDB
void
promif_stree_setroot(void *root)
{
}
#else
void *
promif_stree_getroot(void)
{
return (promif_root);
}
#endif
/*
* Interfaces used internally by promif functions.
* These hide all accesses to the shadow tree.
*/
{
}
return (OBP_NONODE);
}
{
return (OBP_NONODE);
}
{
/*
* Note: next(0) returns the root node
*/
return (OBP_NONODE);
}
int
{
return (-1);
}
int
{
void *prop;
int len;
prom_printf("find_node: no node?\n");
return (-1);
}
if (len > 0) {
} else {
}
return (len);
}
char *
{
char *propname;
next[0] = '\0';
return (NULL);
return (next);
return (next);
}
static prom_node_t *
{
return (np);
return (nnp);
if (np->pn_sibling)
return (nnp);
return (NULL);
}
static prom_node_t *
{
if (nodeid == OBP_NONODE)
return (promif_root);
if (promif_root == NULL)
return (NULL);
}
static int
{
return (-1);
}
static void *
{
return (NULL);
}
static char *
{
/*
* getting next of NULL or a null string returns the first prop name
*/
return (NULL);
}
#ifndef _KMDB
int
{
prom_printf("find_node: no node?\n");
return (-1);
}
/*
* If a property with this name exists, replace the existing
* value.
*/
if (len > 0) {
}
return (len);
}
return (-1);
}
/*
* Create a promif private copy of boot's device tree.
*/
void
promif_stree_init(void)
{
node = prom_rootnode();
}
static void
{
while (1) {
if (child == 0)
break;
continue;
}
}
}
static void
{
while (1) {
if (peer == 0)
break;
continue;
}
}
}
static prom_node_t *
{
char prvname[OBP_MAXPROPNAME];
char propname[OBP_MAXPROPNAME];
int proplen;
void *propval;
prvname[0] = '\0';
while (1) {
if (prom_strlen(propname) == 0)
break;
continue;
if (proplen != 0) {
}
}
return (pnp);
}
static void
{
return;
}
/* move to the end of the prop list */
/* empty */;
/* append the new prop */
}
static void
{
int i;
static int level = 0;
return;
for (i = 0; i < level; i++) {
prom_printf(" ");
}
level++;
level--;
}
}
#endif