16423Sgw25295 /* 26423Sgw25295 * CDDL HEADER START 36423Sgw25295 * 46423Sgw25295 * The contents of this file are subject to the terms of the 56423Sgw25295 * Common Development and Distribution License (the "License"). 66423Sgw25295 * You may not use this file except in compliance with the License. 76423Sgw25295 * 86423Sgw25295 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96423Sgw25295 * or http://www.opensolaris.org/os/licensing. 106423Sgw25295 * See the License for the specific language governing permissions 116423Sgw25295 * and limitations under the License. 126423Sgw25295 * 136423Sgw25295 * When distributing Covered Code, include this CDDL HEADER in each 146423Sgw25295 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156423Sgw25295 * If applicable, add the following below this CDDL HEADER, with the 166423Sgw25295 * fields enclosed by brackets "[]" replaced with your own identifying 176423Sgw25295 * information: Portions Copyright [yyyy] [name of copyright owner] 186423Sgw25295 * 196423Sgw25295 * CDDL HEADER END 206423Sgw25295 */ 216423Sgw25295 226423Sgw25295 /* 236423Sgw25295 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 246423Sgw25295 * Use is subject to license terms. 256423Sgw25295 */ 266423Sgw25295 276423Sgw25295 #pragma ident "%Z%%M% %I% %E% SMI" 286423Sgw25295 296423Sgw25295 #include <sys/spa.h> 306423Sgw25295 #include <sys/bootconf.h> 316423Sgw25295 326423Sgw25295 char * 33*7147Staylor spa_get_bootprop(char *propname) 346423Sgw25295 { 356423Sgw25295 int proplen; 36*7147Staylor char *value; 376423Sgw25295 38*7147Staylor proplen = BOP_GETPROPLEN(bootops, propname); 39*7147Staylor if (proplen <= 0) 406423Sgw25295 return (NULL); 416423Sgw25295 42*7147Staylor value = kmem_zalloc(proplen, KM_SLEEP); 43*7147Staylor if (BOP_GETPROP(bootops, propname, value) == -1) { 44*7147Staylor kmem_free(value, proplen); 456423Sgw25295 return (NULL); 466423Sgw25295 } 476423Sgw25295 48*7147Staylor return (value); 496423Sgw25295 } 506423Sgw25295 516423Sgw25295 void 52*7147Staylor spa_free_bootprop(char *propname) 536423Sgw25295 { 54*7147Staylor kmem_free(propname, strlen(propname) + 1); 556423Sgw25295 } 56