summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_intrmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_intrmap.c')
-rw-r--r--sys/kern/kern_intrmap.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/kern/kern_intrmap.c b/sys/kern/kern_intrmap.c
index 183531e20b1..4207456090c 100644
--- a/sys/kern/kern_intrmap.c
+++ b/sys/kern/kern_intrmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_intrmap.c,v 1.2 2020/06/17 03:01:26 dlg Exp $ */
+/* $OpenBSD: kern_intrmap.c,v 1.3 2020/06/23 01:40:03 dlg Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -345,3 +345,17 @@ intrmap_cpu(const struct intrmap *im, unsigned int ring)
" (intrmap %p)", icpu, ring, im);
return (ic->ic_cpumap[icpu]);
}
+
+struct cpu_info *
+intrmap_one(const struct device *dv)
+{
+ unsigned int unit = dv->dv_unit;
+ struct intrmap_cpus *ic;
+ struct cpu_info *ci;
+
+ ic = intrmap_cpus_get();
+ ci = ic->ic_cpumap[unit % ic->ic_count];
+ intrmap_cpus_put(ic);
+
+ return (ci);
+}