1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Export intrcnt correctly when running under 32-bit compatibility.

Reviewed by:	gonzo, nwhitehorn
This commit is contained in:
Juli Mallett 2012-03-09 22:30:54 +00:00
parent 39e77c4c50
commit 85729c2c44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232751

View File

@ -1881,6 +1881,24 @@ SYSCTL_PROC(_hw, OID_AUTO, intrnames, CTLTYPE_OPAQUE | CTLFLAG_RD,
static int
sysctl_intrcnt(SYSCTL_HANDLER_ARGS)
{
#ifdef SCTL_MASK32
uint32_t *intrcnt32;
unsigned i;
int error;
if (req->flags & SCTL_MASK32) {
if (!req->oldptr)
return (sysctl_handle_opaque(oidp, NULL, sintrcnt / 2, req));
intrcnt32 = malloc(sintrcnt / 2, M_TEMP, M_NOWAIT);
if (intrcnt32 == NULL)
return (ENOMEM);
for (i = 0; i < sintrcnt / sizeof (u_long); i++)
intrcnt32[i] = intrcnt[i];
error = sysctl_handle_opaque(oidp, intrcnt32, sintrcnt / 2, req);
free(intrcnt32, M_TEMP);
return (error);
}
#endif
return (sysctl_handle_opaque(oidp, intrcnt, sintrcnt, req));
}