pdevinfo_sun4v.c revision 2
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * CDDL HEADER START
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * The contents of this file are subject to the terms of the
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Common Development and Distribution License (the "License").
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * You may not use this file except in compliance with the License.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * or http://www.opensolaris.org/os/licensing.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * See the License for the specific language governing permissions
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * and limitations under the License.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * When distributing Covered Code, include this CDDL HEADER in each
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * If applicable, add the following below this CDDL HEADER, with the
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * fields enclosed by brackets "[]" replaced with your own identifying
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * information: Portions Copyright [yyyy] [name of copyright owner]
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * CDDL HEADER END
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Use is subject to license terms.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases#pragma ident "%Z%%M% %I% %E% SMI"
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * Global variables
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * This file represents the splitting out of some functionality
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * of prtdiag due to the port to the sun4v platform. The PROM
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * tree-walking functions which contain sun4v specifics were moved
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * into this module.
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe/* Function prototypes */
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweProm_node *sun4v_walk(Sys_tree *, Prom_node *, int);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasespicl_errno_t sun4v_get_node_by_name(picl_nodehdl_t, char *, picl_nodehdl_t *);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * do_prominfo() is called from main() in usr/src/cmd/prtdiag/main.c
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * This is the starting point for all platforms. However, this function
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * can be overlayed by writing a do_prominfo() function
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases * in the libprtdiag_psr for a particular platform.
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesdo_prominfo(int syserrlog, char *pgname, int log_flag, int prt_flag)
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases Prom_node *root_node; /* root node of OBP device tree */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases picl_nodehdl_t rooth; /* root PICL node for IO display */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases picl_nodehdl_t plafh; /* Platform PICL node for IO display */
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayases (void) fprintf(stderr, EM_INIT_FAIL, picl_strerror(err));
if (is_openprom() == 0) {
if (next(0) == 0) {
promclose();
return (err);
register int curnode;
char *name;
char *type;
char *compatible;
int board_node = 0;
NULL) {
#ifdef DEBUG
#ifdef DEBUG
#ifdef DEBUG
#ifdef DEBUG
if (board_node) {
if (board_node) {
return (NULL);
return (pnode);
int err;
char *nodename;
return (PICL_FAILURE);
sizeof (picl_nodehdl_t));
return (PICL_SUCCESS);
return (err);
#ifdef lint