10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 230Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 280Sstevel@tonic-gate 290Sstevel@tonic-gate #include <sys/promif.h> 300Sstevel@tonic-gate #include <sys/promimpl.h> 310Sstevel@tonic-gate #include <sys/prom_emul.h> 320Sstevel@tonic-gate #include <sys/kmem.h> 330Sstevel@tonic-gate 340Sstevel@tonic-gate /* 350Sstevel@tonic-gate * Routines for walking the PROMs devinfo tree 360Sstevel@tonic-gate * The prom tree is for /dev/openprom compatibility only, 370Sstevel@tonic-gate * so we fail all calls except those needed by /dev/openprom 380Sstevel@tonic-gate */ 390Sstevel@tonic-gate 400Sstevel@tonic-gate /* 410Sstevel@tonic-gate * Return the root nodeid. 420Sstevel@tonic-gate * Calling prom_nextnode(0) returns the root nodeid. 430Sstevel@tonic-gate */ 44*789Sahrens pnode_t prom_rootnode(void)450Sstevel@tonic-gateprom_rootnode(void) 460Sstevel@tonic-gate { 47*789Sahrens static pnode_t rootnode; 480Sstevel@tonic-gate 490Sstevel@tonic-gate return (rootnode ? rootnode : (rootnode = prom_nextnode(OBP_NONODE))); 500Sstevel@tonic-gate } 510Sstevel@tonic-gate 52*789Sahrens pnode_t prom_nextnode(pnode_t nodeid)53*789Sahrensprom_nextnode(pnode_t nodeid) 540Sstevel@tonic-gate { 550Sstevel@tonic-gate return (promif_nextnode(nodeid)); 560Sstevel@tonic-gate } 570Sstevel@tonic-gate 58*789Sahrens pnode_t prom_childnode(pnode_t nodeid)59*789Sahrensprom_childnode(pnode_t nodeid) 600Sstevel@tonic-gate { 610Sstevel@tonic-gate 620Sstevel@tonic-gate return (promif_childnode(nodeid)); 630Sstevel@tonic-gate } 640Sstevel@tonic-gate 650Sstevel@tonic-gate /* 660Sstevel@tonic-gate * disallow searching 670Sstevel@tonic-gate */ 680Sstevel@tonic-gate /*ARGSUSED*/ 69*789Sahrens pnode_t prom_findnode_byname(pnode_t n,char * name)70*789Sahrensprom_findnode_byname(pnode_t n, char *name) 710Sstevel@tonic-gate { 720Sstevel@tonic-gate return (OBP_NONODE); 730Sstevel@tonic-gate } 740Sstevel@tonic-gate 75*789Sahrens pnode_t prom_chosennode(void)760Sstevel@tonic-gateprom_chosennode(void) 770Sstevel@tonic-gate { 780Sstevel@tonic-gate return (OBP_NONODE); 790Sstevel@tonic-gate } 800Sstevel@tonic-gate 81*789Sahrens pnode_t prom_optionsnode(void)820Sstevel@tonic-gateprom_optionsnode(void) 830Sstevel@tonic-gate { 840Sstevel@tonic-gate return (OBP_NONODE); 850Sstevel@tonic-gate } 860Sstevel@tonic-gate 870Sstevel@tonic-gate /*ARGSUSED*/ 88*789Sahrens pnode_t prom_finddevice(char * path)890Sstevel@tonic-gateprom_finddevice(char *path) 900Sstevel@tonic-gate { 910Sstevel@tonic-gate return (OBP_BADNODE); 920Sstevel@tonic-gate } 930Sstevel@tonic-gate 94*789Sahrens pnode_t prom_alias_node(void)950Sstevel@tonic-gateprom_alias_node(void) 960Sstevel@tonic-gate { 970Sstevel@tonic-gate return (OBP_BADNODE); 980Sstevel@tonic-gate } 990Sstevel@tonic-gate 1000Sstevel@tonic-gate /*ARGSUSED*/ 1010Sstevel@tonic-gate void prom_pathname(char * buf)1020Sstevel@tonic-gateprom_pathname(char *buf) 1030Sstevel@tonic-gate { 1040Sstevel@tonic-gate /* nothing, just to get consconfig_dacf to compile */ 1050Sstevel@tonic-gate } 106