Module Name: src
Committed By: knakahara
Date: Mon Aug 17 06:42:46 UTC 2015
Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/distrib/sets/lists/debug: mi
src/sbin/sysctl: sysctl.c
src/usr.sbin: Makefile
Added Files:
src/usr.sbin/intrctl: Makefile intrctl.c intrctl_io.c intrctl_io.h
Log Message:
Add intrctl(8).
To generate a diff of this commit:
cvs rdiff -u -r1.1109 -r1.1110 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1980 -r1.1981 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.126 -r1.127 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.155 -r1.156 src/sbin/sysctl/sysctl.c
cvs rdiff -u -r1.270 -r1.271 src/usr.sbin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/intrctl/Makefile \
src/usr.sbin/intrctl/intrctl.c src/usr.sbin/intrctl/intrctl_io.c \
src/usr.sbin/intrctl/intrctl_io.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1109 src/distrib/sets/lists/base/mi:1.1110
--- src/distrib/sets/lists/base/mi:1.1109 Mon Aug 10 02:44:36 2015
+++ src/distrib/sets/lists/base/mi Mon Aug 17 06:42:45 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1109 2015/08/10 02:44:36 mrg Exp $
+# $NetBSD: mi,v 1.1110 2015/08/17 06:42:45 knakahara Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -1641,6 +1641,7 @@
./usr/sbin/ifwatchd base-netutil-bin
./usr/sbin/inetd base-netutil-bin
./usr/sbin/installboot base-sysutil-bin
+./usr/sbin/intrctl base-sysutil-bin
./usr/sbin/iopctl base-sysutil-bin
./usr/sbin/iostat base-sysutil-bin
./usr/sbin/ipfs base-ipf-bin ipfilter
Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1980 src/distrib/sets/lists/comp/mi:1.1981
--- src/distrib/sets/lists/comp/mi:1.1980 Mon Aug 17 06:28:11 2015
+++ src/distrib/sets/lists/comp/mi Mon Aug 17 06:42:45 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1980 2015/08/17 06:28:11 knakahara Exp $
+# $NetBSD: mi,v 1.1981 2015/08/17 06:42:45 knakahara Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2791,6 +2791,8 @@
./usr/include/sys/gpio.h comp-c-include
./usr/include/sys/hash.h comp-c-include
./usr/include/sys/ieee754.h comp-c-include
+./usr/include/sys/intr.h comp-c-include
+./usr/include/sys/intrio.h comp-c-include
./usr/include/sys/inttypes.h comp-c-include
./usr/include/sys/ioccom.h comp-c-include
./usr/include/sys/ioctl.h comp-c-include
Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.126 src/distrib/sets/lists/debug/mi:1.127
--- src/distrib/sets/lists/debug/mi:1.126 Mon Aug 10 03:21:44 2015
+++ src/distrib/sets/lists/debug/mi Mon Aug 17 06:42:46 2015
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.126 2015/08/10 03:21:44 mrg Exp $
+# $NetBSD: mi,v 1.127 2015/08/17 06:42:46 knakahara Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
@@ -1053,6 +1053,7 @@
./usr/libdata/debug/usr/sbin/ifwatchd.debug comp-netutil-debug debug
./usr/libdata/debug/usr/sbin/inetd.debug comp-netutil-debug debug
./usr/libdata/debug/usr/sbin/installboot.debug comp-sysutil-debug debug
+./usr/libdata/debug/usr/sbin/intrctl.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/iopctl.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/iostat.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/ipfs.debug comp-ipf-debug ipfilter,debug
Index: src/sbin/sysctl/sysctl.c
diff -u src/sbin/sysctl/sysctl.c:1.155 src/sbin/sysctl/sysctl.c:1.156
--- src/sbin/sysctl/sysctl.c:1.155 Sun Nov 9 22:50:38 2014
+++ src/sbin/sysctl/sysctl.c Mon Aug 17 06:42:46 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctl.c,v 1.155 2014/11/09 22:50:38 christos Exp $ */
+/* $NetBSD: sysctl.c,v 1.156 2015/08/17 06:42:46 knakahara Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
#if 0
static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: sysctl.c,v 1.155 2014/11/09 22:50:38 christos Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.156 2015/08/17 06:42:46 knakahara Exp $");
#endif
#endif /* not lint */
@@ -197,6 +197,11 @@ static const struct handlespec {
{ "/kern/coredump/setid/mode", mode_bits, mode_bits, NULL },
{ "/kern/drivers", kern_drivers, NULL, NULL },
+ { "/kern/intr/list", printother, NULL, "intrctl" },
+ { "/kern/intr/affinity", printother, NULL, "intrctl" },
+ { "/kern/intr/intr", printother, NULL, "intrctl" },
+ { "/kern/intr/nointr", printother, NULL, "intrctl" },
+
{ "/vm/vmmeter", printother, NULL,
"vmstat' or 'systat" },
{ "/vm/loadavg", vm_loadavg, NULL, NULL },
Index: src/usr.sbin/Makefile
diff -u src/usr.sbin/Makefile:1.270 src/usr.sbin/Makefile:1.271
--- src/usr.sbin/Makefile:1.270 Sun Mar 22 09:57:42 2015
+++ src/usr.sbin/Makefile Mon Aug 17 06:42:46 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.270 2015/03/22 09:57:42 ast Exp $
+# $NetBSD: Makefile,v 1.271 2015/08/17 06:42:46 knakahara Exp $
# from: @(#)Makefile 5.20 (Berkeley) 6/12/93
.include <bsd.own.mk>
@@ -11,7 +11,7 @@ SUBDIR= ac accton acpitools altq apm apm
flashctl fssconfig fusermount fwctl \
gpioctl grfconfig gspa \
hdaudioctl \
- i2cscan ifwatchd inetd installboot iopctl iostat ipwctl irdaattach \
+ i2cscan ifwatchd inetd installboot intrctl iopctl iostat ipwctl irdaattach \
isdn isibootd iteconfig iwictl \
kgmon \
lastlogin ldpd link lmcconfig lockstat lpr \
Added files:
Index: src/usr.sbin/intrctl/Makefile
diff -u /dev/null src/usr.sbin/intrctl/Makefile:1.1
--- /dev/null Mon Aug 17 06:42:46 2015
+++ src/usr.sbin/intrctl/Makefile Mon Aug 17 06:42:46 2015
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2015/08/17 06:42:46 knakahara Exp $
+
+.include <bsd.own.mk>
+
+PROG= intrctl
+MAN= intrctl.8
+SRCS= intrctl.c intrctl_io.c
+
+.include <bsd.prog.mk>
Index: src/usr.sbin/intrctl/intrctl.c
diff -u /dev/null src/usr.sbin/intrctl/intrctl.c:1.1
--- /dev/null Mon Aug 17 06:42:46 2015
+++ src/usr.sbin/intrctl/intrctl.c Mon Aug 17 06:42:46 2015
@@ -0,0 +1,271 @@
+/* $NetBSD: intrctl.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $ */
+
+/*
+ * Copyright (c) 2015 Internet Initiative Japan Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: intrctl.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $");
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/intrio.h>
+#include <sys/types.h>
+
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <paths.h>
+#include <sched.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "intrctl_io.h"
+
+__dead static void usage(void);
+
+int verbose;
+
+static void intrctl_list(int, char **);
+static void intrctl_affinity(int, char **);
+static void intrctl_intr(int, char **);
+static void intrctl_nointr(int, char **);
+
+static struct cmdtab {
+ const char *label;
+ void (*func)(int, char **);
+} const intrctl_cmdtab[] = {
+ { "list", intrctl_list },
+ { "affinity", intrctl_affinity },
+ { "intr", intrctl_intr },
+ { "nointr", intrctl_nointr },
+ { NULL, NULL },
+};
+
+int
+main(int argc, char **argv)
+{
+ const struct cmdtab *ct;
+ char *cmdname;
+
+ if (argc < 2)
+ usage();
+
+ cmdname = argv[1];
+ argv += 1;
+ argc -= 1;
+
+ for (ct = intrctl_cmdtab; ct->label != NULL; ct++) {
+ if (strcmp(cmdname, ct->label) == 0) {
+ break;
+ }
+ }
+ if (ct->label == NULL)
+ errx(EXIT_FAILURE, "unknown command ``%s''", cmdname);
+
+ (*ct->func)(argc, argv);
+ exit(EXIT_SUCCESS);
+ /* NOTREACHED */
+}
+
+static void
+usage(void)
+{
+ const char *progname = getprogname();
+
+ fprintf(stderr, "usage: %s list\n", progname);
+ fprintf(stderr, " %s affinity -i interrupt_name -c cpu_index\n", progname);
+ fprintf(stderr, " %s intr -c cpu_index\n", progname);
+ fprintf(stderr, " %s nointr -c cpu_index\n", progname);
+ exit(EXIT_FAILURE);
+ /* NOTREACHED */
+}
+
+static int intrctl_io_alloc_retry_count = 4;
+
+static void
+intrctl_list(int argc, char **argv)
+{
+ struct intrio_list_line *illine;
+ int i, ncpus;
+ void *handle;
+
+ handle = intrctl_io_alloc(intrctl_io_alloc_retry_count);
+ if (handle == NULL)
+ err(EXIT_FAILURE, "intrctl_io_alloc");
+
+ /* header */
+ ncpus = intrctl_io_ncpus(handle);
+ printf("interrupt id\t");
+ for (i = 0; i < ncpus; i++) {
+ printf(" CPU#%02u\t", i);
+ }
+ printf("device name(s)\n");
+
+ /* body */
+ illine = intrctl_io_firstline(handle);
+ for (; illine != NULL; illine = intrctl_io_nextline(handle, illine)) {
+ printf("%s\t", illine->ill_intrid);
+ for (i = 0; i < ncpus; i++) {
+ struct intrio_list_line_cpu *illc = &illine->ill_cpu[i];
+ printf("%8" PRIu64 "%c\t", illc->illc_count,
+ illc->illc_assigned ? '*' : ' ');
+ }
+
+ printf("%s\n", illine->ill_xname);
+ }
+
+ intrctl_io_free(handle);
+}
+
+static void
+intrctl_affinity(int argc, char **argv)
+{
+ struct intrio_set iset;
+ cpuset_t *cpuset;
+ unsigned long index;
+ int ch, error;
+
+ index = ULONG_MAX;
+ memset(&iset.intrid, 0, sizeof(iset.intrid));
+
+ while ((ch = getopt(argc, argv, "c:i:")) != -1) {
+ switch (ch) {
+ case 'c':
+ index = strtoul(optarg, NULL, 10);
+ break;
+ case 'i':
+ if (strnlen(optarg, ARG_MAX) > INTRIDBUF)
+ usage();
+ strlcpy(iset.intrid, optarg, INTRIDBUF);
+ break;
+ default:
+ usage();
+ }
+ }
+
+ if (iset.intrid[0] == '\0' || index == ULONG_MAX)
+ usage();
+
+ if (index >= (u_long)sysconf(_SC_NPROCESSORS_CONF))
+ err(EXIT_FAILURE, "invalid cpu index");
+
+ cpuset = cpuset_create();
+ if (cpuset == NULL)
+ err(EXIT_FAILURE, "create_cpuset()");
+
+ cpuset_zero(cpuset);
+ cpuset_set(index, cpuset);
+ iset.cpuset = cpuset;
+ iset.cpuset_size = cpuset_size(cpuset);
+ error = sysctlbyname("kern.intr.affinity", NULL, NULL, &iset, sizeof(iset));
+ cpuset_destroy(cpuset);
+ if (error < 0)
+ err(EXIT_FAILURE, "sysctl kern.intr.affinity");
+}
+
+static void
+intrctl_intr(int argc, char **argv)
+{
+ struct intrio_set iset;
+ cpuset_t *cpuset;
+ unsigned long index;
+ int ch, error;
+
+ index = ULONG_MAX;
+
+ while ((ch = getopt(argc, argv, "c:")) != -1) {
+ switch (ch) {
+ case 'c':
+ index = strtoul(optarg, NULL, 10);
+ break;
+ default:
+ usage();
+ }
+ }
+
+ if (index == ULONG_MAX)
+ usage();
+
+ if (index >= (u_long)sysconf(_SC_NPROCESSORS_CONF))
+ err(EXIT_FAILURE, "invalid cpu index");
+
+ cpuset = cpuset_create();
+ if (cpuset == NULL)
+ err(EXIT_FAILURE, "create_cpuset()");
+
+ cpuset_zero(cpuset);
+ cpuset_set(index, cpuset);
+ iset.cpuset = cpuset;
+ iset.cpuset_size = cpuset_size(cpuset);
+ error = sysctlbyname("kern.intr.intr", NULL, NULL, &iset, sizeof(iset));
+ cpuset_destroy(cpuset);
+ if (error < 0)
+ err(EXIT_FAILURE, "sysctl kern.intr.intr");
+}
+
+static void
+intrctl_nointr(int argc, char **argv)
+{
+ struct intrio_set iset;
+ cpuset_t *cpuset;
+ unsigned long index;
+ int ch, error;
+
+ index = ULONG_MAX;
+
+ while ((ch = getopt(argc, argv, "c:")) != -1) {
+ switch (ch) {
+ case 'c':
+ index = strtoul(optarg, NULL, 10);
+ break;
+ default:
+ usage();
+ }
+ }
+
+ if (index == ULONG_MAX)
+ usage();
+
+ if (index >= (u_long)sysconf(_SC_NPROCESSORS_CONF))
+ err(EXIT_FAILURE, "invalid cpu index");
+
+ cpuset = cpuset_create();
+ if (cpuset == NULL)
+ err(EXIT_FAILURE, "create_cpuset()");
+
+ cpuset_zero(cpuset);
+ cpuset_set(index, cpuset);
+ iset.cpuset = cpuset;
+ iset.cpuset_size = cpuset_size(cpuset);
+ error = sysctlbyname("kern.intr.nointr", NULL, NULL, &iset, sizeof(iset));
+ cpuset_destroy(cpuset);
+ if (error < 0)
+ err(EXIT_FAILURE, "sysctl kern.intr.nointr");
+}
Index: src/usr.sbin/intrctl/intrctl_io.c
diff -u /dev/null src/usr.sbin/intrctl/intrctl_io.c:1.1
--- /dev/null Mon Aug 17 06:42:46 2015
+++ src/usr.sbin/intrctl/intrctl_io.c Mon Aug 17 06:42:46 2015
@@ -0,0 +1,131 @@
+/* $NetBSD: intrctl_io.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $ */
+
+/*
+ * Copyright (c) 2015 Internet Initiative Japan Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: intrctl_io.c,v 1.1 2015/08/17 06:42:46 knakahara Exp $");
+
+#include <sys/sysctl.h>
+#include <sys/intrio.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "intrctl_io.h"
+
+/*
+ * To support increasing the number of interrupts (devices are dynamically
+ * attached), retry sysctl(3) "retry" times.
+ */
+void *
+intrctl_io_alloc(int retry)
+{
+ size_t buf_size;
+ int i, error;
+ void *buf;
+
+ error = sysctlbyname("kern.intr.list", NULL, &buf_size, NULL, 0);
+ if (error < 0) {
+ return NULL;
+ }
+
+ buf = malloc(buf_size);
+ if (buf == NULL) {
+ return NULL;
+ }
+
+ for (i = 0; i < retry; i++) {
+ error = sysctlbyname("kern.intr.list", buf, &buf_size, NULL, 0);
+ if (error >= 0)
+ return buf;
+ else if (error == -ENOMEM) {
+ void *temp;
+
+ temp = realloc(buf, buf_size);
+ if (temp == NULL) {
+ free(buf);
+ return NULL;
+ }
+ buf = temp;
+ } else {
+ free(buf);
+ return NULL;
+ }
+ }
+ return NULL;
+}
+
+void
+intrctl_io_free(void *handle)
+{
+
+ free(handle);
+}
+
+int
+intrctl_io_ncpus(void *handle)
+{
+ struct intrio_list *list = handle;
+
+ return list->il_ncpus;
+}
+
+int
+intrctl_io_nintrs(void *handle)
+{
+ struct intrio_list *list = handle;
+
+ return list->il_nintrs;
+}
+
+struct intrio_list_line *
+intrctl_io_firstline(void *handle)
+{
+ struct intrio_list *list = handle;
+
+ return (struct intrio_list_line *)((char *)list + list->il_lineoffset);
+}
+
+struct intrio_list_line *
+intrctl_io_nextline(void *handle, struct intrio_list_line *cur)
+{
+ struct intrio_list *list;
+ struct intrio_list_line *next;
+ size_t line_size;
+ char *buf_end;
+
+ list = handle;
+ buf_end = (char *)list + list->il_bufsize;
+
+ line_size = list->il_linesize;
+ next = (struct intrio_list_line *)((char *)cur + line_size);
+ if ((char *)next >= buf_end)
+ return NULL;
+
+ return next;
+}
Index: src/usr.sbin/intrctl/intrctl_io.h
diff -u /dev/null src/usr.sbin/intrctl/intrctl_io.h:1.1
--- /dev/null Mon Aug 17 06:42:46 2015
+++ src/usr.sbin/intrctl/intrctl_io.h Mon Aug 17 06:42:46 2015
@@ -0,0 +1,44 @@
+/* $NetBSD: intrctl_io.h,v 1.1 2015/08/17 06:42:46 knakahara Exp $ */
+
+/*
+ * Copyright (c) 2015 Internet Initiative Japan Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _INTRCTL_INTRCTL_IO_H_
+#define _INTRCTL_INTRCTL_IO_H_
+
+#include <sys/cdefs.h>
+__RCSID("$NetBSD: intrctl_io.h,v 1.1 2015/08/17 06:42:46 knakahara Exp $");
+
+#include <sys/intrio.h>
+
+void *intrctl_io_alloc(int);
+void intrctl_io_free(void *);
+int intrctl_io_ncpus(void *);
+int intrctl_io_nintrs(void *);
+struct intrio_list_line *intrctl_io_firstline(void *);
+struct intrio_list_line *intrctl_io_nextline(void *, struct intrio_list_line *);
+
+#endif /* !_INTRCTL_INTRCTL_IO_H_ */