kern/156130: hints read: resource_longlong_value and
resource_uintmax_value
Rozhuk Ivan
Rozhuk_I at mail.ru
Sun Apr 3 14:30:15 UTC 2011
The following reply was made to PR kern/156130; it has been noted by GNATS.
From: "Rozhuk Ivan" <Rozhuk_I at mail.ru>
To: <bug-followup at FreeBSD.org>
Cc:
Subject: Re: kern/156130: hints read: resource_longlong_value and resource_uintmax_value
Date: Sun, 3 Apr 2011 23:08:54 +0900
This is a multi-part message in MIME format.
------=_NextPart_000_006B_01CBF254.1B3F50A0
Content-Type: text/plain;
charset="windows-1251"
Content-Transfer-Encoding: quoted-printable
Original patch has errors, this final version.
=A0
--
Rozhuk Ivan
=A0=20
------=_NextPart_000_006B_01CBF254.1B3F50A0
Content-Type: text/plain;
name="subr_hints.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="subr_hints.txt"
--- /usr/src/sys/kern/subr_hints_orig.c 2009-08-03 17:13:06.000000000 =
+0900
+++ /usr/src/sys/kern/subr_hints.c 2011-04-03 18:10:57.000000000 =
+0900
@@ -273,6 +273,30 @@
return 0;
}
=20
+
+int
+resource_quad_t_value(const char *name, int unit, const char *resname, =
quad_t *result)
+{
+ int error;
+ const char *str;
+ char *op;
+ quad_t val;
+ int line;
+
+ line =3D 0;
+ error =3D resource_find(&line, NULL, name, &unit, resname, NULL,
+ NULL, NULL, NULL, NULL, NULL, &str);
+ if (error)
+ return error;
+ if (*str =3D=3D '\0')=20
+ return EFTYPE;
+ val =3D strtoq(str, &op, 0);
+ if (*op !=3D '\0')=20
+ return EFTYPE;
+ *result =3D val;
+ return 0;
+}
+
int
resource_string_value(const char *name, int unit, const char *resname,
const char **result)
--- /usr/src/sys/sys/bus.h_orig 2011-02-09 06:08:00.000000000 +0800
+++ /usr/src/sys/sys/bus.h 2011-04-03 18:13:07.000000000 +0900
@@ -470,6 +470,8 @@
int *result);
int resource_long_value(const char *name, int unit, const char =
*resname,
long *result);
+int resource_quad_t_value(const char *name, int unit, const char =
*resname,
+ quad_t *result);
int resource_string_value(const char *name, int unit, const char =
*resname,
const char **result);
int resource_disabled(const char *name, int unit);
------=_NextPart_000_006B_01CBF254.1B3F50A0--
More information about the freebsd-bugs
mailing list