17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5a204de77Scth * Common Development and Distribution License (the "License"). 6a204de77Scth * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22a204de77Scth * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_DDIPROPDEFS_H 277c478bd9Sstevel@tonic-gate #define _SYS_DDIPROPDEFS_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #ifdef __cplusplus 307c478bd9Sstevel@tonic-gate extern "C" { 317c478bd9Sstevel@tonic-gate #endif 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate /* 347c478bd9Sstevel@tonic-gate * ddiprops.h: All definitions related to DDI properties. 357c478bd9Sstevel@tonic-gate * Structure definitions are private to the DDI 367c478bd9Sstevel@tonic-gate * implementation. See also, ddipropfuncs.h 377c478bd9Sstevel@tonic-gate */ 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate /* 407c478bd9Sstevel@tonic-gate * ddi_prop_op_t: Enum for prop_op functions 417c478bd9Sstevel@tonic-gate */ 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate typedef enum { 447c478bd9Sstevel@tonic-gate PROP_LEN = 0, /* Get prop len only */ 457c478bd9Sstevel@tonic-gate PROP_LEN_AND_VAL_BUF, /* Get len+val into callers buffer */ 467c478bd9Sstevel@tonic-gate PROP_LEN_AND_VAL_ALLOC, /* Get len+val into alloc-ed buffer */ 477c478bd9Sstevel@tonic-gate PROP_EXISTS /* Does the property exist? */ 487c478bd9Sstevel@tonic-gate } ddi_prop_op_t; 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate /* 517c478bd9Sstevel@tonic-gate * ddi_prop_t: The basic item used to store software defined propeties. 527c478bd9Sstevel@tonic-gate * Note that properties are always stored by reference. 537c478bd9Sstevel@tonic-gate */ 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate typedef struct ddi_prop { 567c478bd9Sstevel@tonic-gate struct ddi_prop *prop_next; 577c478bd9Sstevel@tonic-gate dev_t prop_dev; /* specific match/wildcard */ 587c478bd9Sstevel@tonic-gate char *prop_name; /* Property name */ 597c478bd9Sstevel@tonic-gate int prop_flags; /* See flags below */ 607c478bd9Sstevel@tonic-gate int prop_len; /* Prop length (0 == Bool. prop) */ 617c478bd9Sstevel@tonic-gate caddr_t prop_val; /* ptr to property value */ 627c478bd9Sstevel@tonic-gate } ddi_prop_t; 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate /* 657c478bd9Sstevel@tonic-gate * A referenced property list, used for sharing properties among 667c478bd9Sstevel@tonic-gate * multiple driver instances 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate typedef struct ddi_prop_list { 697c478bd9Sstevel@tonic-gate ddi_prop_t *prop_list; 707c478bd9Sstevel@tonic-gate int prop_ref; 717c478bd9Sstevel@tonic-gate } ddi_prop_list_t; 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate /* 747c478bd9Sstevel@tonic-gate * Handle passed around to encode/decode a property value. 757c478bd9Sstevel@tonic-gate */ 767c478bd9Sstevel@tonic-gate typedef struct ddi_prop_handle { 777c478bd9Sstevel@tonic-gate void *ph_data; /* Encoded data */ 787c478bd9Sstevel@tonic-gate void *ph_cur_pos; /* encode/decode position */ 797c478bd9Sstevel@tonic-gate void *ph_save_pos; /* Save/restore position */ 807c478bd9Sstevel@tonic-gate uint_t ph_size; /* Size of encoded data */ 817c478bd9Sstevel@tonic-gate uint_t ph_flags; /* See below */ 827c478bd9Sstevel@tonic-gate struct prop_handle_ops *ph_ops; /* Encode/decode routines */ 837c478bd9Sstevel@tonic-gate } prop_handle_t; 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate /* 867c478bd9Sstevel@tonic-gate * Property handle encode/decode ops 877c478bd9Sstevel@tonic-gate */ 887c478bd9Sstevel@tonic-gate typedef struct prop_handle_ops { 897c478bd9Sstevel@tonic-gate int (*op_prop_int)(prop_handle_t *ph, uint_t cmd, int *data); 907c478bd9Sstevel@tonic-gate int (*op_prop_str)(prop_handle_t *ph, uint_t cmd, char *data); 917c478bd9Sstevel@tonic-gate int (*op_prop_bytes)(prop_handle_t *ph, uint_t cmd, 927c478bd9Sstevel@tonic-gate uchar_t *data, uint_t size); 937c478bd9Sstevel@tonic-gate int (*op_prop_int64)(prop_handle_t *ph, uint_t cmd, int64_t *data); 947c478bd9Sstevel@tonic-gate } prop_handle_ops_t; 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate /* 977c478bd9Sstevel@tonic-gate * Data passed back to driver. The driver gets a pointer to driver_data. 987c478bd9Sstevel@tonic-gate * When we get it back we do negative indexing to find the size and free 997c478bd9Sstevel@tonic-gate * routine to call 1007c478bd9Sstevel@tonic-gate */ 1017c478bd9Sstevel@tonic-gate struct prop_driver_data { 1027c478bd9Sstevel@tonic-gate size_t pdd_size; 1037c478bd9Sstevel@tonic-gate void (*pdd_prop_free)(struct prop_driver_data *); 1047c478bd9Sstevel@tonic-gate }; 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate /* 1087c478bd9Sstevel@tonic-gate * Macros to call the integer/string/byte OBP 1275 operators 1097c478bd9Sstevel@tonic-gate */ 1107c478bd9Sstevel@tonic-gate #define DDI_PROP_INT(ph, cmd, data) \ 1117c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_int)((ph), (cmd), (data)) 1127c478bd9Sstevel@tonic-gate #define DDI_PROP_STR(ph, cmd, data) \ 1137c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_str)((ph), (cmd), (data)) 1147c478bd9Sstevel@tonic-gate #define DDI_PROP_BYTES(ph, cmd, data, size) \ 1157c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_bytes)((ph), (cmd), (data), (size)) 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate /* 1187c478bd9Sstevel@tonic-gate * Macro to call the 64 bit integer operator 1197c478bd9Sstevel@tonic-gate */ 1207c478bd9Sstevel@tonic-gate #define DDI_PROP_INT64(ph, cmd, data) \ 1217c478bd9Sstevel@tonic-gate (*(ph)->ph_ops->op_prop_int64)((ph), (cmd), (data)) 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate /* 1247c478bd9Sstevel@tonic-gate * Property handle commands 1257c478bd9Sstevel@tonic-gate */ 1267c478bd9Sstevel@tonic-gate typedef enum { 1277c478bd9Sstevel@tonic-gate DDI_PROP_CMD_GET_ESIZE, /* Get encoded size of data */ 1287c478bd9Sstevel@tonic-gate DDI_PROP_CMD_GET_DSIZE, /* Get decoded size of data */ 1297c478bd9Sstevel@tonic-gate DDI_PROP_CMD_DECODE, /* Decode the current data */ 1307c478bd9Sstevel@tonic-gate DDI_PROP_CMD_ENCODE, /* Encode the current data */ 1317c478bd9Sstevel@tonic-gate DDI_PROP_CMD_SKIP /* Skip the current data */ 1327c478bd9Sstevel@tonic-gate } ddi_prop_cmd_t; 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate /* 1357c478bd9Sstevel@tonic-gate * Return values from property handle encode/decode ops 1367c478bd9Sstevel@tonic-gate * Positive numbers are used to return the encoded or 1377c478bd9Sstevel@tonic-gate * decode size of the object, so an ok return must be positive, 1387c478bd9Sstevel@tonic-gate * and all error returns negative. 1397c478bd9Sstevel@tonic-gate */ 1407c478bd9Sstevel@tonic-gate typedef enum { 1417c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_ERROR = -2, /* error in encoding/decoding data */ 1427c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_EOF, /* end of data reached */ 1437c478bd9Sstevel@tonic-gate DDI_PROP_RESULT_OK /* if >= to DDI_PROP_RESULT_OK, */ 1447c478bd9Sstevel@tonic-gate /* operation was successful */ 1457c478bd9Sstevel@tonic-gate } ddi_prop_result_t; 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate /* 1275 property cell */ 1487c478bd9Sstevel@tonic-gate typedef uint32_t prop_1275_cell_t; 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate /* Length of a 1275 property cell */ 1517c478bd9Sstevel@tonic-gate #define PROP_1275_CELL_SIZE sizeof (prop_1275_cell_t) 1527c478bd9Sstevel@tonic-gate #define CELLS_1275_TO_BYTES(n) ((n) * PROP_1275_CELL_SIZE) 1537c478bd9Sstevel@tonic-gate #define BYTES_TO_1275_CELLS(n) ((n) / PROP_1275_CELL_SIZE) 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate /* 1567c478bd9Sstevel@tonic-gate * Property handle flags 1577c478bd9Sstevel@tonic-gate */ 1587c478bd9Sstevel@tonic-gate #define PH_FROM_PROM 0x01 /* Property came from the prom */ 1597c478bd9Sstevel@tonic-gate 1607c478bd9Sstevel@tonic-gate /* 1617c478bd9Sstevel@tonic-gate * Return values from property functions: 1627c478bd9Sstevel@tonic-gate */ 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate #define DDI_PROP_SUCCESS 0 1657c478bd9Sstevel@tonic-gate #define DDI_PROP_NOT_FOUND 1 /* Prop not defined */ 1667c478bd9Sstevel@tonic-gate #define DDI_PROP_UNDEFINED 2 /* Overriden to undefine a prop */ 1677c478bd9Sstevel@tonic-gate #define DDI_PROP_NO_MEMORY 3 /* Unable to allocate/no sleep */ 1687c478bd9Sstevel@tonic-gate #define DDI_PROP_INVAL_ARG 4 /* Invalid calling argument */ 1697c478bd9Sstevel@tonic-gate #define DDI_PROP_BUF_TOO_SMALL 5 /* Callers buf too small */ 1707c478bd9Sstevel@tonic-gate #define DDI_PROP_CANNOT_DECODE 6 /* Could not decode prop */ 1717c478bd9Sstevel@tonic-gate #define DDI_PROP_CANNOT_ENCODE 7 /* Could not encode prop */ 1727c478bd9Sstevel@tonic-gate #define DDI_PROP_END_OF_DATA 8 /* Prop found in an encoded format */ 1737c478bd9Sstevel@tonic-gate 1747c478bd9Sstevel@tonic-gate /* 1757c478bd9Sstevel@tonic-gate * used internally in the framework only 1767c478bd9Sstevel@tonic-gate */ 1777c478bd9Sstevel@tonic-gate #define DDI_PROP_FOUND_1275 255 /* Prop found in OPB 1275 format */ 1787c478bd9Sstevel@tonic-gate 1797c478bd9Sstevel@tonic-gate /* 1807c478bd9Sstevel@tonic-gate * Size of a 1275 int in bytes 1817c478bd9Sstevel@tonic-gate */ 1827c478bd9Sstevel@tonic-gate #define PROP_1275_INT_SIZE 4 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate /* 1857c478bd9Sstevel@tonic-gate * Property flags: 1867c478bd9Sstevel@tonic-gate */ 1877c478bd9Sstevel@tonic-gate 1887c478bd9Sstevel@tonic-gate #define DDI_PROP_DONTPASS 0x0001 /* Don't pass request to parent */ 1897c478bd9Sstevel@tonic-gate #define DDI_PROP_CANSLEEP 0x0002 /* Memory allocation may sleep */ 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gate /* 1927c478bd9Sstevel@tonic-gate * Used internally by the DDI property rountines and masked in DDI(9F) 1937c478bd9Sstevel@tonic-gate * interfaces... 1947c478bd9Sstevel@tonic-gate */ 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate #define DDI_PROP_SYSTEM_DEF 0x0004 /* System defined property */ 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate /* 1997c478bd9Sstevel@tonic-gate * Used in framework only, to inhibit certain pre-defined s/w property 2007c478bd9Sstevel@tonic-gate * names from coming from the prom. 2017c478bd9Sstevel@tonic-gate */ 2027c478bd9Sstevel@tonic-gate #define DDI_PROP_NOTPROM 0x0008 /* Don't look at prom properties */ 2037c478bd9Sstevel@tonic-gate 2047c478bd9Sstevel@tonic-gate /* 2057c478bd9Sstevel@tonic-gate * Used interally by the DDI property routines to implement the old 2067c478bd9Sstevel@tonic-gate * depricated functions with the new functions 2077c478bd9Sstevel@tonic-gate */ 2087c478bd9Sstevel@tonic-gate #define DDI_PROP_DONTSLEEP 0x0010 /* Memory allocation may not sleep */ 2097c478bd9Sstevel@tonic-gate #define DDI_PROP_STACK_CREATE 0x0020 /* Do a LIFO stack of properties */ 2107c478bd9Sstevel@tonic-gate #define DDI_PROP_UNDEF_IT 0x0040 /* Undefine a property */ 2117c478bd9Sstevel@tonic-gate #define DDI_PROP_HW_DEF 0x0080 /* Hardware defined property */ 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate /* 2147c478bd9Sstevel@tonic-gate * Type of data property contains 2157c478bd9Sstevel@tonic-gate */ 2167c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_INT 0x0100 2177c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_STRING 0x0200 2187c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_BYTE 0x0400 2197c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_COMPOSITE 0x0800 2207c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_INT64 0x1000 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_ANY (DDI_PROP_TYPE_INT | \ 2237c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_STRING | \ 2247c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_BYTE | \ 2257c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_COMPOSITE) 2267c478bd9Sstevel@tonic-gate 2277c478bd9Sstevel@tonic-gate #define DDI_PROP_TYPE_MASK (DDI_PROP_TYPE_INT | \ 2287c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_STRING | \ 2297c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_BYTE | \ 2307c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_COMPOSITE | \ 2317c478bd9Sstevel@tonic-gate DDI_PROP_TYPE_INT64) 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate /* 2347c478bd9Sstevel@tonic-gate * This flag indicates that the LDI lookup routine 2357c478bd9Sstevel@tonic-gate * should match the request regardless of the actual 2367c478bd9Sstevel@tonic-gate * dev_t with which the property was created. In other 2377c478bd9Sstevel@tonic-gate * words, any dev_t value found on the property list 2387c478bd9Sstevel@tonic-gate * is an acceptable part of the match criteria. 2397c478bd9Sstevel@tonic-gate */ 2407c478bd9Sstevel@tonic-gate #define LDI_DEV_T_ANY 0x2000 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate /* 2437c478bd9Sstevel@tonic-gate * Private flag that should ONLY be used by the LDI Framework 2447c478bd9Sstevel@tonic-gate * to indicate a property search of an unbound dlpi2 dip. 2457c478bd9Sstevel@tonic-gate * The LDI property lookup interfaces will set this flag if 2467c478bd9Sstevel@tonic-gate * it is determined that the dip representing a dlpi-style2 2477c478bd9Sstevel@tonic-gate * driver is currently unbound (dip == NULL) at the time of 2487c478bd9Sstevel@tonic-gate * the property lookup request. 2497c478bd9Sstevel@tonic-gate */ 2507c478bd9Sstevel@tonic-gate #define DDI_UNBND_DLPI2 0x4000 2517c478bd9Sstevel@tonic-gate 2527c478bd9Sstevel@tonic-gate /* 2537c478bd9Sstevel@tonic-gate * Private flag that indicates that a typed interface that predates typed 2547c478bd9Sstevel@tonic-gate * properties is being used - the framework should set additional typed flags 2557c478bd9Sstevel@tonic-gate * (DDI_PROP_TYPE_INT64) when expanding search to DDI_PROP_TYPE_ANY. 2567c478bd9Sstevel@tonic-gate */ 2577c478bd9Sstevel@tonic-gate #define DDI_PROP_CONSUMER_TYPED 0x8000 2587c478bd9Sstevel@tonic-gate 2597c478bd9Sstevel@tonic-gate /* 2607c478bd9Sstevel@tonic-gate * Private flag that indicates that the ldi is doing a driver prop_op 2617c478bd9Sstevel@tonic-gate * call to check for driver dynamic properties. This request should 2627c478bd9Sstevel@tonic-gate * not be passed onto the common property lookup framework since all 2637c478bd9Sstevel@tonic-gate * the ldi property interface are typed and driver prop_op lookups are 2647c478bd9Sstevel@tonic-gate * not. 2657c478bd9Sstevel@tonic-gate */ 2667c478bd9Sstevel@tonic-gate #define DDI_PROP_DYNAMIC 0x10000 2677c478bd9Sstevel@tonic-gate 268*65cf7c95SVikram Hegde /* 269*65cf7c95SVikram Hegde * Private flag used to lookup global properties specified in rootnex.conf file 270*65cf7c95SVikram Hegde */ 271*65cf7c95SVikram Hegde #define DDI_PROP_ROOTNEX_GLOBAL 0x20000 272*65cf7c95SVikram Hegde 2737c478bd9Sstevel@tonic-gate 2747c478bd9Sstevel@tonic-gate /* 2757c478bd9Sstevel@tonic-gate * DDI_DEV_T_NONE: When creating, property is not associated with 2767c478bd9Sstevel@tonic-gate * particular dev_t. 2777c478bd9Sstevel@tonic-gate * DDI_DEV_T_ANY: Wildcard dev_t when searching properties. 278a204de77Scth */ 279a204de77Scth #define DDI_DEV_T_NONE ((dev_t)-1) 280a204de77Scth #define DDI_DEV_T_ANY ((dev_t)-2) 281a204de77Scth /* 2827c478bd9Sstevel@tonic-gate * DDI_MAJOR_T_UNKNOWN Used when a driver does not know its dev_t during 2837c478bd9Sstevel@tonic-gate * a property create. 284a204de77Scth * DDI_MAJOR_T_NONE Used when a driver does not have a major number. 2857c478bd9Sstevel@tonic-gate */ 2867c478bd9Sstevel@tonic-gate #define DDI_MAJOR_T_UNKNOWN ((major_t)0) 287a204de77Scth #define DDI_MAJOR_T_NONE ((major_t)-1) 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gate /* 2907c478bd9Sstevel@tonic-gate * Some DDI property names... 2917c478bd9Sstevel@tonic-gate */ 2927c478bd9Sstevel@tonic-gate 2937c478bd9Sstevel@tonic-gate /* 2947c478bd9Sstevel@tonic-gate * One of the following boolean properties shall be defined in the 2957c478bd9Sstevel@tonic-gate * root node, and defines the addressing mode understood by the root 2967c478bd9Sstevel@tonic-gate * node of the implementation.... 2977c478bd9Sstevel@tonic-gate */ 2987c478bd9Sstevel@tonic-gate 2997c478bd9Sstevel@tonic-gate #define DDI_RELATIVE_ADDRESSING "relative-addressing" 3007c478bd9Sstevel@tonic-gate #define DDI_GENERIC_ADDRESSING "generic-addressing" 3017c478bd9Sstevel@tonic-gate 3027c478bd9Sstevel@tonic-gate /* 3037c478bd9Sstevel@tonic-gate * Common property encoded data search routine. Returns the encoded data 3047c478bd9Sstevel@tonic-gate * in valuep. Match is done on dip, dev, data type (in flags), and name. 3057c478bd9Sstevel@tonic-gate */ 3067c478bd9Sstevel@tonic-gate int ddi_prop_search_common(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, 3077c478bd9Sstevel@tonic-gate uint_t flags, char *name, void *valuep, uint_t *lengthp); 3087c478bd9Sstevel@tonic-gate 3097c478bd9Sstevel@tonic-gate 3107c478bd9Sstevel@tonic-gate /* 3117c478bd9Sstevel@tonic-gate * Property debugging support in kernel... 3127c478bd9Sstevel@tonic-gate */ 3137c478bd9Sstevel@tonic-gate 3147c478bd9Sstevel@tonic-gate /* 3157c478bd9Sstevel@tonic-gate * Property debugging support... Be careful about enabling this when 3167c478bd9Sstevel@tonic-gate * you are tipping in to the console. Undefine PROP_DEBUG to remove 3177c478bd9Sstevel@tonic-gate * all support from the code. (c.f. autoconf.c and zs_common.c) 3187c478bd9Sstevel@tonic-gate * 3197c478bd9Sstevel@tonic-gate * It does no good to enable this if the rest of the kernel was built with 3207c478bd9Sstevel@tonic-gate * this disabled (specifically, the core kernel module.) 3217c478bd9Sstevel@tonic-gate * 3227c478bd9Sstevel@tonic-gate * #define DDI_PROP_DEBUG 1 3237c478bd9Sstevel@tonic-gate */ 3247c478bd9Sstevel@tonic-gate 3257c478bd9Sstevel@tonic-gate #ifdef DDI_PROP_DEBUG 3267c478bd9Sstevel@tonic-gate #define ddi_prop_printf if (ddi_prop_debug_flag != 0) printf 3277c478bd9Sstevel@tonic-gate 3287c478bd9Sstevel@tonic-gate /* 3297c478bd9Sstevel@tonic-gate * Returns prev value of debugging flag, non-zero enables debug printf's 3307c478bd9Sstevel@tonic-gate */ 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate int ddi_prop_debug(int enable); 3337c478bd9Sstevel@tonic-gate 3347c478bd9Sstevel@tonic-gate #endif /* DDI_PROP_DEBUG */ 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3377c478bd9Sstevel@tonic-gate } 3387c478bd9Sstevel@tonic-gate #endif 3397c478bd9Sstevel@tonic-gate 3407c478bd9Sstevel@tonic-gate #endif /* _SYS_DDIPROPDEFS_H */ 341