xref: /f-stack/lib/ff_kern_intr.c (revision 2317ada5)
1a9643ea8Slogwang /*
2a9643ea8Slogwang  * Copyright (c) 2010 Kip Macy All rights reserved.
3a9643ea8Slogwang  * Copyright (c) 2013 Patrick Kelsey. All rights reserved.
4*2317ada5Sfengbojiang  * Copyright (C) 2017-2021 THL A29 Limited, a Tencent company.
5a9643ea8Slogwang  * All rights reserved.
6a9643ea8Slogwang  *
7a9643ea8Slogwang  * Redistribution and use in source and binary forms, with or without
8a9643ea8Slogwang  * modification, are permitted provided that the following conditions are met:
9a9643ea8Slogwang  *
10a9643ea8Slogwang  * 1. Redistributions of source code must retain the above copyright notice, this
11a9643ea8Slogwang  *   list of conditions and the following disclaimer.
12a9643ea8Slogwang  * 2. Redistributions in binary form must reproduce the above copyright notice,
13a9643ea8Slogwang  *   this list of conditions and the following disclaimer in the documentation
14a9643ea8Slogwang  *   and/or other materials provided with the distribution.
15a9643ea8Slogwang  *
16a9643ea8Slogwang  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17a9643ea8Slogwang  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18a9643ea8Slogwang  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19a9643ea8Slogwang  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20a9643ea8Slogwang  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21a9643ea8Slogwang  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22a9643ea8Slogwang  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23a9643ea8Slogwang  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24a9643ea8Slogwang  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25a9643ea8Slogwang  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26a9643ea8Slogwang  *
27a9643ea8Slogwang  * Derived in part from libuinet's uinet_kern_intr.c.
28a9643ea8Slogwang  */
29a9643ea8Slogwang 
30a9643ea8Slogwang #include <sys/cdefs.h>
31a9643ea8Slogwang __FBSDID("$FreeBSD$");
32a9643ea8Slogwang 
33a9643ea8Slogwang #include "opt_ddb.h"
34a9643ea8Slogwang 
35a9643ea8Slogwang #include <sys/param.h>
36a9643ea8Slogwang #include <sys/bus.h>
37a9643ea8Slogwang #include <sys/conf.h>
38a9643ea8Slogwang #include <sys/cpuset.h>
39a9643ea8Slogwang #include <sys/rtprio.h>
40a9643ea8Slogwang #include <sys/systm.h>
41a9643ea8Slogwang #include <sys/interrupt.h>
42a9643ea8Slogwang #include <sys/kernel.h>
43a9643ea8Slogwang #include <sys/kthread.h>
44a9643ea8Slogwang #include <sys/ktr.h>
45a9643ea8Slogwang #include <sys/limits.h>
46a9643ea8Slogwang #include <sys/lock.h>
47a9643ea8Slogwang #include <sys/malloc.h>
48a9643ea8Slogwang #include <sys/mutex.h>
49a9643ea8Slogwang #include <sys/priv.h>
50a9643ea8Slogwang #include <sys/proc.h>
51a9643ea8Slogwang #include <sys/random.h>
52a9643ea8Slogwang #include <sys/resourcevar.h>
53a9643ea8Slogwang #include <sys/sched.h>
54a9643ea8Slogwang #include <sys/smp.h>
55a9643ea8Slogwang #include <sys/sysctl.h>
56a9643ea8Slogwang #include <sys/syslog.h>
57a9643ea8Slogwang #include <sys/unistd.h>
58a9643ea8Slogwang #include <sys/vmmeter.h>
59a9643ea8Slogwang #include <machine/atomic.h>
60a9643ea8Slogwang #include <machine/cpu.h>
61a9643ea8Slogwang #include <machine/md_var.h>
62a9643ea8Slogwang #include <machine/stdarg.h>
63a9643ea8Slogwang #ifdef DDB
64a9643ea8Slogwang #include <ddb/ddb.h>
65a9643ea8Slogwang #include <ddb/db_sym.h>
66a9643ea8Slogwang #endif
67a9643ea8Slogwang 
68a9643ea8Slogwang struct intr_event *clk_intr_event;
69a9643ea8Slogwang 
7022ce4affSfengbojiang #if 0
71a9643ea8Slogwang void
72a9643ea8Slogwang critical_enter(void)
73a9643ea8Slogwang {
74a9643ea8Slogwang 
75a9643ea8Slogwang }
76a9643ea8Slogwang 
77a9643ea8Slogwang void
78a9643ea8Slogwang critical_exit(void)
79a9643ea8Slogwang {
80a9643ea8Slogwang 
81a9643ea8Slogwang }
8222ce4affSfengbojiang #endif
83a9643ea8Slogwang 
84a9643ea8Slogwang int
swi_add(struct intr_event ** eventp,const char * name,driver_intr_t handler,void * arg,int pri,enum intr_type flags,void ** cookiep)85a9643ea8Slogwang swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
86a9643ea8Slogwang         void *arg, int pri, enum intr_type flags, void **cookiep)
87a9643ea8Slogwang {
88a9643ea8Slogwang     return 0;
89a9643ea8Slogwang }
90a9643ea8Slogwang 
91a9643ea8Slogwang void
swi_sched(void * cookie,int flags)92a9643ea8Slogwang swi_sched(void *cookie, int flags)
93a9643ea8Slogwang {
94a9643ea8Slogwang 
95a9643ea8Slogwang }
96a9643ea8Slogwang 
97a9643ea8Slogwang int
swi_remove(void * cookie)98a9643ea8Slogwang swi_remove(void *cookie)
99a9643ea8Slogwang {
100a9643ea8Slogwang     return 0;
101a9643ea8Slogwang }
102a9643ea8Slogwang 
103a9643ea8Slogwang int
intr_event_bind(struct intr_event * ie,int cpu)104a9643ea8Slogwang intr_event_bind(struct intr_event *ie, int cpu)
105a9643ea8Slogwang {
106a9643ea8Slogwang     return (EOPNOTSUPP);
107a9643ea8Slogwang }
108a9643ea8Slogwang 
109