xref: /freebsd/sys/kern/pic_if.m (revision 6b7b2d80ed4d728d3ffd12c422e57798c1b63a84)
1#-
2# Copyright (c) 2012 Jakub Wojciech Klama <jceel@FreeBSD.org>
3# Copyright (c) 2015 Svatopluk Kraus
4# Copyright (c) 2015 Michal Meloun
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions
9# are met:
10# 1. Redistributions of source code must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright
13#    notice, this list of conditions and the following disclaimer in the
14#    documentation and/or other materials provided with the distribution.
15#
16# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26# SUCH DAMAGE.
27#
28# $FreeBSD$
29#
30
31#include <sys/bus.h>
32#include <sys/cpuset.h>
33#include <machine/frame.h>
34#include <machine/intr.h>
35
36INTERFACE pic;
37
38CODE {
39	static int null_pic_bind(device_t dev, struct intr_irqsrc *isrc)
40	{
41		return (EOPNOTSUPP);
42	}
43
44	static void null_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc)
45	{
46		return;
47	}
48
49	static void null_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc)
50	{
51		return;
52	}
53
54	static void null_pic_init_secondary(device_t dev)
55	{
56		return;
57	}
58
59	static void null_pic_ipi_send(device_t dev, cpuset_t cpus, u_int ipi)
60	{
61		return;
62	}
63
64	static int
65	dflt_pic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc *isrc)
66	{
67
68		return (EOPNOTSUPP);
69	}
70};
71
72METHOD int register {
73	device_t		dev;
74	struct intr_irqsrc	*isrc;
75	boolean_t		*is_percpu;
76};
77
78METHOD int unregister {
79	device_t		dev;
80	struct intr_irqsrc	*isrc;
81};
82
83METHOD void disable_intr {
84	device_t		dev;
85	struct intr_irqsrc	*isrc;
86} DEFAULT null_pic_disable_intr;
87
88METHOD void disable_source {
89	device_t		dev;
90	struct intr_irqsrc	*isrc;
91};
92
93METHOD void enable_source {
94	device_t		dev;
95	struct intr_irqsrc	*isrc;
96};
97
98METHOD void enable_intr {
99	device_t		dev;
100	struct intr_irqsrc	*isrc;
101} DEFAULT null_pic_enable_intr;
102
103METHOD void pre_ithread {
104	device_t		dev;
105	struct intr_irqsrc	*isrc;
106};
107
108METHOD void post_ithread {
109	device_t		dev;
110	struct intr_irqsrc	*isrc;
111};
112
113METHOD void post_filter {
114	device_t		dev;
115	struct intr_irqsrc	*isrc;
116};
117
118METHOD int bind {
119	device_t		dev;
120	struct intr_irqsrc	*isrc;
121} DEFAULT null_pic_bind;
122
123METHOD void init_secondary {
124	device_t	dev;
125} DEFAULT null_pic_init_secondary;
126
127METHOD void ipi_send {
128	device_t		dev;
129	struct intr_irqsrc	*isrc;
130	cpuset_t		cpus;
131} DEFAULT null_pic_ipi_send;
132
133METHOD int ipi_setup {
134	device_t		dev;
135	u_int			ipi;
136	struct intr_irqsrc	*isrc;
137} DEFAULT dflt_pic_ipi_setup;
138