xref: /freebsd/share/man/man9/resource_int_value.9 (revision 3a9fd8242b35884921dfc4e886f284a75870a536)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 2001 M. Warner Losh <imp@FreeBSD.org>
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd March 1, 2001
28.Dt RESOURCE_INT_VALUE 9
29.Os
30.Sh NAME
31.Nm resource_int_value , resource_long_value , resource_string_value
32.Nd get a value from the hints mechanism
33.Sh SYNOPSIS
34.In sys/param.h
35.In sys/bus.h
36.Ft int
37.Fn resource_int_value "const char *name" "int unit" "const char *resname" "int *result"
38.Ft int
39.Fn resource_long_value "const char *name" "int unit" "const char *resname" "long *result"
40.Ft int
41.Fn resource_string_value "const char *name" "int unit" "const char *resname" "const char **result"
42.Sh DESCRIPTION
43These functions fetch a value from the
44.Dq hints
45mechanism.
46.Pp
47The functions take the following arguments:
48.Bl -tag -width "resname"
49.It Fa name
50The name of the device to get the resource value from.
51.It Fa unit
52The unit number of the device.
53\-1 is special and is used for wildcard entries.
54.It Fa resname
55The resource name.
56.It Fa result
57A pointer to memory in which to store the resource value.
58.El
59.Sh RETURN VALUES
60If successful, the functions return 0.
61Otherwise, a non\-zero error code is returned.
62.Sh ERRORS
63The functions will fail if:
64.Bl -tag -width Er
65.It Bq Er ENOENT
66The resource could not be found.
67.It Bq Er EFTYPE
68Inappropriate resource type.
69.El
70.Sh SEE ALSO
71.Xr device 9 ,
72.Xr driver 9
73.Sh AUTHORS
74This manual page was written by
75.An Warner Losh Aq Mt imp@FreeBSD.org .
76