18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _SPARC64_PIL_H
38c2ecf20Sopenharmony_ci#define _SPARC64_PIL_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/* To avoid some locking problems, we hard allocate certain PILs
68c2ecf20Sopenharmony_ci * for SMP cross call messages that must do a etrap/rtrap.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * A local_irq_disable() does not block the cross call delivery, so
98c2ecf20Sopenharmony_ci * when SMP locking is an issue we reschedule the event into a PIL
108c2ecf20Sopenharmony_ci * interrupt which is blocked by local_irq_disable().
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * In fact any XCALL which has to etrap/rtrap has a problem because
138c2ecf20Sopenharmony_ci * it is difficult to prevent rtrap from running BH's, and that would
148c2ecf20Sopenharmony_ci * need to be done if the XCALL arrived while %pil==PIL_NORMAL_MAX.
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci * Finally, in order to handle profiling events even when a
178c2ecf20Sopenharmony_ci * local_irq_disable() is in progress, we only disable up to level 14
188c2ecf20Sopenharmony_ci * interrupts.  Profile counter overflow interrupts arrive at level
198c2ecf20Sopenharmony_ci * 15.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_ci#define PIL_SMP_CALL_FUNC	1
228c2ecf20Sopenharmony_ci#define PIL_SMP_RECEIVE_SIGNAL	2
238c2ecf20Sopenharmony_ci#define PIL_SMP_CAPTURE		3
248c2ecf20Sopenharmony_ci#define PIL_DEVICE_IRQ		5
258c2ecf20Sopenharmony_ci#define PIL_SMP_CALL_FUNC_SNGL	6
268c2ecf20Sopenharmony_ci#define PIL_DEFERRED_PCR_WORK	7
278c2ecf20Sopenharmony_ci#define PIL_KGDB_CAPTURE	8
288c2ecf20Sopenharmony_ci#define PIL_NORMAL_MAX		14
298c2ecf20Sopenharmony_ci#define PIL_NMI			15
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#endif /* !(_SPARC64_PIL_H) */
32