1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_OBPDEFS_H 28 #define _SYS_OBPDEFS_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 /* 35 * This file is intended as standalone inclusion by non-prom library 36 * functions that need it. 37 */ 38 39 typedef int ihandle_t; /* 1275 device instance number */ 40 typedef int phandle_t; /* 1275 device tree node ptr */ 41 typedef phandle_t pnode_t; 42 43 /* 44 * Device type matching 45 */ 46 47 #define OBP_NONODE ((pnode_t)0) 48 #define OBP_BADNODE ((pnode_t)-1) 49 50 /* 51 * Property Defines 52 */ 53 54 #define OBP_NAME "name" 55 #define OBP_REG "reg" 56 #define OBP_INTR "intr" 57 #define OBP_RANGES "ranges" 58 #define OBP_INTERRUPTS "interrupts" 59 #define OBP_COMPATIBLE "compatible" 60 #define OBP_STATUS "status" 61 #define OBP_BOARDNUM "board#" 62 63 #define OBP_MAC_ADDR "mac-address" 64 #define OBP_STDINPATH "stdin-path" 65 #define OBP_STDOUTPATH "stdout-path" 66 #define OBP_IDPROM "idprom" 67 68 #define OBP_DEVICETYPE "device_type" 69 #define OBP_DISPLAY "display" 70 #define OBP_NETWORK "network" 71 #define OBP_BYTE "byte" 72 #define OBP_BLOCK "block" 73 #define OBP_SERIAL "serial" 74 #define OBP_HIERARCHICAL "hierarchical" 75 #define OBP_CPU "cpu" 76 #define OBP_ADDRESS "address" 77 78 /* 79 * OBP status values defines 80 */ 81 #define OBP_ST_OKAY "okay" 82 #define OBP_ST_DISABLED "disabled" 83 #define OBP_ST_FAIL "fail" 84 85 /* 86 * Max size of a path component and a property name (not value) 87 * These are standard definitions. 88 */ 89 #define OBP_MAXDRVNAME 32 /* defined in P1275 */ 90 #define OBP_MAXPROPNAME 32 /* defined in P1275 */ 91 92 /* 93 * 94 * NB: Max pathname length is a platform-dependent parameter. 95 */ 96 #define OBP_MAXPATHLEN 256 /* Platform dependent */ 97 98 /* 99 * Every OBP node must have a `/' followed by at least 2 chars, 100 * so we can deduce the maxdepth of any OBP tree to be 101 * OBP_MAXPATHNAME/3. This is a good first swag. 102 */ 103 104 #define OBP_STACKDEPTH (OBP_MAXPATHLEN/3) 105 106 #ifdef __cplusplus 107 } 108 #endif 109 110 #endif /* _SYS_OBPDEFS_H */ 111