xref: /src/sys/compat/linuxkpi/common/include/linux/hardirq.h (revision 1d18872c2519d7ca726ddc49735180ab1d8916e0)
1aa0a1e58SJeff Roberson /*-
2aa0a1e58SJeff Roberson  * Copyright (c) 2010 Isilon Systems, Inc.
3aa0a1e58SJeff Roberson  * Copyright (c) 2010 iX Systems, Inc.
4aa0a1e58SJeff Roberson  * Copyright (c) 2010 Panasas, Inc.
5c7818b48SHans Petter Selasky  * Copyright (c) 2013 Mellanox Technologies, Ltd.
6aa0a1e58SJeff Roberson  * All rights reserved.
7aa0a1e58SJeff Roberson  *
8aa0a1e58SJeff Roberson  * Redistribution and use in source and binary forms, with or without
9aa0a1e58SJeff Roberson  * modification, are permitted provided that the following conditions
10aa0a1e58SJeff Roberson  * are met:
11aa0a1e58SJeff Roberson  * 1. Redistributions of source code must retain the above copyright
12aa0a1e58SJeff Roberson  *    notice unmodified, this list of conditions, and the following
13aa0a1e58SJeff Roberson  *    disclaimer.
14aa0a1e58SJeff Roberson  * 2. Redistributions in binary form must reproduce the above copyright
15aa0a1e58SJeff Roberson  *    notice, this list of conditions and the following disclaimer in the
16aa0a1e58SJeff Roberson  *    documentation and/or other materials provided with the distribution.
17aa0a1e58SJeff Roberson  *
18aa0a1e58SJeff Roberson  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19aa0a1e58SJeff Roberson  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20aa0a1e58SJeff Roberson  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21aa0a1e58SJeff Roberson  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22aa0a1e58SJeff Roberson  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23aa0a1e58SJeff Roberson  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24aa0a1e58SJeff Roberson  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25aa0a1e58SJeff Roberson  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26aa0a1e58SJeff Roberson  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27aa0a1e58SJeff Roberson  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28aa0a1e58SJeff Roberson  */
29307f78f3SVladimir Kondratyev #ifndef _LINUXKPI_LINUX_HARDIRQ_H_
30307f78f3SVladimir Kondratyev #define	_LINUXKPI_LINUX_HARDIRQ_H_
31aa0a1e58SJeff Roberson 
32aa0a1e58SJeff Roberson #include <linux/types.h>
33f12af2b3SEmmanuel Vadot #include <linux/lockdep.h>
34*1d18872cSBjoern A. Zeeb #include <linux/preempt.h>
35aa0a1e58SJeff Roberson 
36aa0a1e58SJeff Roberson #include <sys/param.h>
37aa0a1e58SJeff Roberson #include <sys/bus.h>
38aa0a1e58SJeff Roberson #include <sys/interrupt.h>
39aa0a1e58SJeff Roberson 
40aa0a1e58SJeff Roberson #define	synchronize_irq(irq)	_intr_drain((irq))
41aa0a1e58SJeff Roberson 
42a609ed79SJean-Sébastien Pédron /*
43a609ed79SJean-Sébastien Pédron  * FIXME: In the i915 driver's `intel_engine_cs.c` file,
44a609ed79SJean-Sébastien Pédron  * `synchronize_hardirq()` was replaced by `synchronize_rcu()` with the
45a609ed79SJean-Sébastien Pédron  * following comment:
46a609ed79SJean-Sébastien Pédron  *   "Is it enough to wait that all cpu have context-switched?"
47a609ed79SJean-Sébastien Pédron  *
48a609ed79SJean-Sébastien Pédron  * See commit f6d50b7af554e21c380486d6f41c8537b265c777 in drm-kmod.
49a609ed79SJean-Sébastien Pédron  */
50a609ed79SJean-Sébastien Pédron #define	synchronize_hardirq(irq) _intr_drain((irq))
51a609ed79SJean-Sébastien Pédron 
52307f78f3SVladimir Kondratyev #endif	/* _LINUXKPI_LINUX_HARDIRQ_H_ */
53