summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_intr.c
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2012-03-09 22:30:54 +0000
committerjmallett <jmallett@FreeBSD.org>2012-03-09 22:30:54 +0000
commitd25fa497f7ba5000bd6ced7ccca372e10c6f7366 (patch)
treea55362267afc270c4c75c6c3c2cc8b138ac0c5cd /sys/kern/kern_intr.c
parentc84e05a07c264e6a9d31253b0dda946c9f94c230 (diff)
downloadFreeBSD-src-d25fa497f7ba5000bd6ced7ccca372e10c6f7366.zip
FreeBSD-src-d25fa497f7ba5000bd6ced7ccca372e10c6f7366.tar.gz
Export intrcnt correctly when running under 32-bit compatibility.
Reviewed by: gonzo, nwhitehorn
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r--sys/kern/kern_intr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 72313b5..a578084 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -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));
}
OpenPOWER on IntegriCloud