/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/promif_impl.h>
#ifdef _KMDB
#else
#endif
/*
* Routines for walking the PROMs devinfo tree
*/
#ifdef _KMDB
void
{
chosennode = chosen;
}
int
promif_finddevice(void *p)
{
char *path;
} else {
/* only supports known nodes */
ASSERT(0);
}
return (0);
}
#else
int
promif_finddevice(void *p)
{
/*
* We are passing the cpu pointer (CPU->cpu_id) explicitly to
* thread_affinity_set() so that we don't attempt to grab the
* cpu_lock internally in thread_affinity_set() and may sleep
* as a result.
* It is safe to pass CPU->cpu_id and it will always be valid.
*/
return (0);
}
#endif
int
promif_nextnode(void *p)
{
return (0);
}
int
promif_childnode(void *p)
{
return (0);
}
int
promif_parentnode(void *p)
{
return (0);
}
#ifndef _KMDB
/*
* Get a token from a prom pathname, collecting everything
* until a non-comma, non-colon separator is found. Any
* options, including the ':' option separator, on the end
* of the token are removed.
*/
static char *
{
for (;;) {
*token = '\0';
continue;
}
break;
}
/* strip off any options from the token */
return (tp);
}
/*
* Retrieve the unit address for a node by looking it up
* in the corresponding dip. -1 is returned if no unit
* address can be determined.
*/
static int
{
char *addr;
return (-1);
}
return (-1);
}
return (0);
}
/*
* Get node id of node in prom tree that path identifies
*/
static pnode_t
{
char *tp;
np = prom_rootnode();
/* must be a fully specified path */
if (*tp++ != '/')
goto done;
for (;;) {
/* get the name from the path */
if (*name == '\0')
break;
/* get the address from the path */
if (*tp == '@') {
tp++;
} else {
addr[0] = '\0';
}
break;
while (np != OBP_NONODE) {
/* get the name from the current node */
goto done;
/* get the address from the current node */
paddr[0] = '\0';
/* compare the names and addresses */
CIF_DBG_NODE("found dev: %s%s%s (0x%x)\n",
break;
} else {
CIF_DBG_NODE(" no match: %s%s%s vs %s%s%s\n",
}
}
/* path does not map to a node */
if (np == OBP_NONODE)
break;
if (*tp == '\0') {
/* found a matching node */
break;
}
/*
* Continue the loop with the
* next component of the path.
*/
tp++;
}
done:
if (device == OBP_BADNODE) {
CIF_DBG_NODE("device not found\n\n");
} else {
}
return (device);
}
#endif