9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / ldi_prop_get_int.9f
blob90c2606ac623dd86c63b13e0773ce557efbfa1c1
1 '\" te
2 .\"  Copyright (c) 2003, Sun Microsystems, Inc.,  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH LDI_PROP_GET_INT 9F "Jun 3, 2003"
7 .SH NAME
8 ldi_prop_get_int, ldi_prop_get_int64 \- Lookup integer property
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunldi.h>
14 \fBint\fR \fBldi_prop_get_int\fR(\fBldi_handle_t\fR \fIlh\fR, \fBuint_t\fR \fIflags\fR, \fBchar *\fR\fIname\fR,
15      \fBint\fR \fIdefvalue\fR);
16 .fi
18 .LP
19 .nf
20 \fBint\fR\fB64_t ldi_prop_get_int64\fR(\fBldi_handle_t\fR \fIlh\fR, \fBuint_t\fR \fIflags\fR, \fBchar *\fR\fIname\fR,
21      \fBint64_t \fR\fIdefvalue\fR);
22 .fi
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fIlh\fR \fR
29 .ad
30 .RS 10n
31 Layered handle.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fIflags\fR \fR
38 .ad
39 .RS 10n
40 Possible flag values are some combination of:
41 .sp
42 .ne 2
43 .na
44 \fBLDI_DEV_T_ANY\fR
45 .ad
46 .RS 21n
47 Match the lookup request independent of the actual dev_t value that was used
48 when the property was created. Indicates any dev_t value (including
49 DDI_DEV_T_NONE) associated with a possible property match satisfies the
50 matching criteria.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fBDDI_PROP_DONTPASS\fR
57 .ad
58 .RS 21n
59 Do not pass request to parent device information node if property not found.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fBDDI_PROP_NOTPROM\fR
66 .ad
67 .RS 21n
68 Do not look at PROM properties (ignored on platforms that do not support PROM
69 properties).
70 .RE
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fBname\fR
78 .ad
79 .RS 12n
80 String containing the property name.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fBdefvalue\fR
87 .ad
88 .RS 12n
89 Integer value that is returned if the property is not found.
90 .RE
92 .SH INTERFACE LEVEL
93 .sp
94 .LP
95 Solaris DDI specific (Solaris DDI)
96 .SH DESCRIPTION
97 .sp
98 .LP
99 The \fBldi_prop_get_int()\fR and \fBldi_prop_get_int64()\fR functions search
100 for an integer property associated with a device represented by the layered
101 driver handle. If the integer property is found, the functions return the
102 property value.
105 Properties are searched for based on the dip and dev_t values associated with
106 the layered handle, the property name, and type of the data (integer).
109 The property search order is as follows:
110 .RS +4
113 Search software properties created by the driver.
115 .RS +4
118 Search the software properties created by the system (or nexus nodes in the
119 device info tree).
121 .RS +4
124 Search the driver global properties list.
126 .RS +4
129 If DDI_PROP_NOTPROM is not set, search the PROM properties (if they exist).
131 .RS +4
134 If DDI_PROP_DONTPASS is not set, pass this request to the parent device
135 information node of the device  represented by the layered handle.
137 .RS +4
140 Return defvalue.
144 Typically, the specific dev_t value associated with the device represented by
145 the layered handle (ldi_handle_t) is used as a part of the property match
146 criteria. This association is handled by the layered driver infrastructure on
147 behalf of the consumers of the ldi property look up functions.
150 However, if the LDI_DEV_T_ANY flag is used, the ldi property lookup functions
151 match the request regardless of the dev_t value associated with the property at
152 the time of its creation. If a property was created with a dev_t set to
153 DDI_DEV_T_NONE, the only way to look up this property is with the LDI_DEV_T_ANY
154 flag.  PROM properties are always created with a dev_t set to DDI_DEV_T_NONE.
157 name must always be set to the name of the property being looked up.
160 The return value of the routine is the value of property. If the property is
161 not found, the argument defvalue is returned as the property value.
164 \fBldi_prop_get_int64()\fR does not search the PROM for 64-bit property values.
165 .SH RETURN VALUES
168 \fBldi_prop_get_int()\fR and \fBldi_prop_get_int64()\fR return the property
169 value. If the property is not found, the argument \fBdefvalue\fR is returned.
170 If the property is found, but cannot be decoded into an int or an int64_t,
171 DDI_PROP_NOT_FOUND is returned.
172 .SH CONTEXT
175 \fBldi_prop_get_int()\fR and \fBldi_prop_get_int64()\fR can be called from user
176 or kernel context.
177 .SH EXAMPLES
180 Using\fB ldi_prop_get_int64()\fR.
182 .in +2
184 The following example demonstrates the use of ldi_prop_get_int64().
186        /*
187         * Get the value of the integer "timeout" property, using
188         * our own default if no such property exists
189         */
191        int64_t timeout, defval;
193        timeout = ldi_prop_get_int64(lh, LDI_DEV_T_ANY|DDI_PROP_DONTPASS,
194            propname, defval);
196 .in -2
198 .SH SEE ALSO
201 \fBddi_prop_get_int\fR(9F), \fBddi_prop_get_int64\fR(9F),
202 \fBldi_prop_exists\fR(9F)
205 \fIWriting Device Drivers\fR