xref: /freebsd/sys/kern/pic_if.m (revision 49b49cda41feabe3439f7318e8bf40e3896c7bf4)
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
65METHOD int register {
66	device_t		dev;
67	struct intr_irqsrc	*isrc;
68	boolean_t		*is_percpu;
69};
70
71METHOD int unregister {
72	device_t		dev;
73	struct intr_irqsrc	*isrc;
74};
75
76METHOD void disable_intr {
77	device_t		dev;
78	struct intr_irqsrc	*isrc;
79} DEFAULT null_pic_disable_intr;
80
81METHOD void disable_source {
82	device_t		dev;
83	struct intr_irqsrc	*isrc;
84};
85
86METHOD void enable_source {
87	device_t		dev;
88	struct intr_irqsrc	*isrc;
89};
90
91METHOD void enable_intr {
92	device_t		dev;
93	struct intr_irqsrc	*isrc;
94} DEFAULT null_pic_enable_intr;
95
96METHOD void pre_ithread {
97	device_t		dev;
98	struct intr_irqsrc	*isrc;
99};
100
101METHOD void post_ithread {
102	device_t		dev;
103	struct intr_irqsrc	*isrc;
104};
105
106METHOD void post_filter {
107	device_t		dev;
108	struct intr_irqsrc	*isrc;
109};
110
111METHOD int bind {
112	device_t		dev;
113	struct intr_irqsrc	*isrc;
114} DEFAULT null_pic_bind;
115
116METHOD void init_secondary {
117	device_t	dev;
118} DEFAULT null_pic_init_secondary;
119
120METHOD void ipi_send {
121	device_t		dev;
122	struct intr_irqsrc	*isrc;
123	cpuset_t		cpus;
124} DEFAULT null_pic_ipi_send;
125