blob: 7a2690e97b0e886695e301b0fed3ab94a693e7ef [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Copyright (C) 1999 Cort Dougan <cort@cs.nmt.edu>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 */
Kumar Galab671ad22005-09-21 16:52:55 -05005#ifndef _ASM_POWERPC_HW_IRQ_H
6#define _ASM_POWERPC_HW_IRQ_H
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <linux/errno.h>
Paul Mackerrasd04c56f2006-10-04 16:47:49 +100011#include <linux/compiler.h>
Kumar Galab671ad22005-09-21 16:52:55 -050012#include <asm/ptrace.h>
13#include <asm/processor.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +110015#ifdef CONFIG_PPC64
16
17/*
18 * PACA flags in paca->irq_happened.
19 *
20 * This bits are set when interrupts occur while soft-disabled
Nicholas Piggin13799742021-06-18 01:51:11 +100021 * and allow a proper replay.
22 *
23 * The PACA_IRQ_HARD_DIS is set whenever we hard disable. It is almost
24 * always in synch with the MSR[EE] state, except:
25 * - A window in interrupt entry, where hardware disables MSR[EE] and that
26 * must be "reconciled" with the soft mask state.
27 * - NMI interrupts that hit in awkward places, until they fix the state.
28 * - When local irqs are being enabled and state is being fixed up.
29 * - When returning from an interrupt there are some windows where this
30 * can become out of synch, but gets fixed before the RFI or before
31 * executing the next user instruction (see arch/powerpc/kernel/interrupt.c).
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +110032 */
33#define PACA_IRQ_HARD_DIS 0x01
34#define PACA_IRQ_DBELL 0x02
35#define PACA_IRQ_EE 0x04
36#define PACA_IRQ_DEC 0x08 /* Or FIT */
Nicholas Piggin012a9a92020-09-15 21:46:47 +100037#define PACA_IRQ_HMI 0x10
38#define PACA_IRQ_PMI 0x20
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +110039
Madhavan Srinivasanc2e480b2017-12-20 09:25:42 +053040/*
Nicholas Piggin6cc3f912018-02-03 17:17:50 +100041 * Some soft-masked interrupts must be hard masked until they are replayed
42 * (e.g., because the soft-masked handler does not clear the exception).
43 */
44#ifdef CONFIG_PPC_BOOK3S
45#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE|PACA_IRQ_PMI)
46#else
47#define PACA_IRQ_MUST_HARD_MASK (PACA_IRQ_EE)
48#endif
49
Christophe Leroyfb5608f2021-02-08 15:10:24 +000050#endif /* CONFIG_PPC64 */
51
Nicholas Piggin6cc3f912018-02-03 17:17:50 +100052/*
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +053053 * flags for paca->irq_soft_mask
Madhavan Srinivasanc2e480b2017-12-20 09:25:42 +053054 */
Madhavan Srinivasan01417c62017-12-20 09:25:49 +053055#define IRQS_ENABLED 0
Madhavan Srinivasanf442d002017-12-20 09:25:53 +053056#define IRQS_DISABLED 1 /* local_irq_disable() interrupts */
57#define IRQS_PMI_DISABLED 2
58#define IRQS_ALL_DISABLED (IRQS_DISABLED | IRQS_PMI_DISABLED)
Madhavan Srinivasanc2e480b2017-12-20 09:25:42 +053059
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +110060#ifndef __ASSEMBLY__
61
Christophe Leroy08353772021-02-08 15:10:25 +000062static inline void __hard_irq_enable(void)
63{
Christophe Leroy047a6fd2021-10-19 09:29:25 +020064 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
Christophe Leroy08353772021-02-08 15:10:25 +000065 wrtee(MSR_EE);
66 else if (IS_ENABLED(CONFIG_PPC_8xx))
67 wrtspr(SPRN_EIE);
68 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
69 __mtmsrd(MSR_EE | MSR_RI, 1);
70 else
71 mtmsr(mfmsr() | MSR_EE);
72}
73
74static inline void __hard_irq_disable(void)
75{
Christophe Leroy047a6fd2021-10-19 09:29:25 +020076 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
Christophe Leroy08353772021-02-08 15:10:25 +000077 wrtee(0);
78 else if (IS_ENABLED(CONFIG_PPC_8xx))
79 wrtspr(SPRN_EID);
80 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
81 __mtmsrd(MSR_RI, 1);
82 else
83 mtmsr(mfmsr() & ~MSR_EE);
84}
85
86static inline void __hard_EE_RI_disable(void)
87{
Christophe Leroy047a6fd2021-10-19 09:29:25 +020088 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
Christophe Leroy08353772021-02-08 15:10:25 +000089 wrtee(0);
90 else if (IS_ENABLED(CONFIG_PPC_8xx))
91 wrtspr(SPRN_NRI);
92 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
93 __mtmsrd(0, 1);
94 else
95 mtmsr(mfmsr() & ~(MSR_EE | MSR_RI));
96}
97
98static inline void __hard_RI_enable(void)
99{
Christophe Leroy047a6fd2021-10-19 09:29:25 +0200100 if (IS_ENABLED(CONFIG_BOOKE_OR_40x))
Christophe Leroy08353772021-02-08 15:10:25 +0000101 return;
102
103 if (IS_ENABLED(CONFIG_PPC_8xx))
104 wrtspr(SPRN_EID);
105 else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
106 __mtmsrd(MSR_RI, 1);
107 else
108 mtmsr(mfmsr() | MSR_RI);
109}
110
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000111#ifdef CONFIG_PPC64
112#include <asm/paca.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530114static inline notrace unsigned long irq_soft_mask_return(void)
Madhavan Srinivasane0b56872017-12-20 09:25:46 +0530115{
116 unsigned long flags;
117
118 asm volatile(
119 "lbz %0,%1(13)"
120 : "=r" (flags)
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530121 : "i" (offsetof(struct paca_struct, irq_soft_mask)));
Madhavan Srinivasane0b56872017-12-20 09:25:46 +0530122
123 return flags;
124}
125
Madhavan Srinivasan0b63acf2017-12-20 09:25:45 +0530126/*
127 * The "memory" clobber acts as both a compiler barrier
128 * for the critical section and as a clobber because
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530129 * we changed paca->irq_soft_mask
Madhavan Srinivasan0b63acf2017-12-20 09:25:45 +0530130 */
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530131static inline notrace void irq_soft_mask_set(unsigned long mask)
Madhavan Srinivasan0b63acf2017-12-20 09:25:45 +0530132{
Madhavan Srinivasan9aa88182017-12-20 09:25:54 +0530133#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530134 /*
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530135 * The irq mask must always include the STD bit if any are set.
136 *
137 * and interrupts don't get replayed until the standard
138 * interrupt (local_irq_disable()) is unmasked.
139 *
140 * Other masks must only provide additional masking beyond
141 * the standard, and they are also not replayed until the
142 * standard interrupt becomes unmasked.
143 *
144 * This could be changed, but it will require partial
145 * unmasks to be replayed, among other things. For now, take
146 * the simple approach.
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530147 */
148 WARN_ON(mask && !(mask & IRQS_DISABLED));
149#endif
150
Madhavan Srinivasan0b63acf2017-12-20 09:25:45 +0530151 asm volatile(
152 "stb %0,%1(13)"
153 :
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530154 : "r" (mask),
155 "i" (offsetof(struct paca_struct, irq_soft_mask))
Madhavan Srinivasan0b63acf2017-12-20 09:25:45 +0530156 : "memory");
157}
158
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530159static inline notrace unsigned long irq_soft_mask_set_return(unsigned long mask)
Madhavan Srinivasana67c5432017-12-20 09:25:47 +0530160{
161 unsigned long flags;
162
Madhavan Srinivasan9aa88182017-12-20 09:25:54 +0530163#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530164 WARN_ON(mask && !(mask & IRQS_DISABLED));
165#endif
166
Madhavan Srinivasana67c5432017-12-20 09:25:47 +0530167 asm volatile(
168 "lbz %0,%1(13); stb %2,%1(13)"
169 : "=&r" (flags)
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530170 : "i" (offsetof(struct paca_struct, irq_soft_mask)),
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530171 "r" (mask)
Madhavan Srinivasana67c5432017-12-20 09:25:47 +0530172 : "memory");
173
174 return flags;
175}
176
Madhavan Srinivasanc6424382017-12-20 09:25:55 +0530177static inline notrace unsigned long irq_soft_mask_or_return(unsigned long mask)
178{
179 unsigned long flags, tmp;
180
181 asm volatile(
182 "lbz %0,%2(13); or %1,%0,%3; stb %1,%2(13)"
183 : "=&r" (flags), "=r" (tmp)
184 : "i" (offsetof(struct paca_struct, irq_soft_mask)),
185 "r" (mask)
186 : "memory");
187
188#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
189 WARN_ON((mask | flags) && !((mask | flags) & IRQS_DISABLED));
190#endif
191
192 return flags;
193}
194
David Howellsdf9ee292010-10-07 14:08:55 +0100195static inline unsigned long arch_local_save_flags(void)
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000196{
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530197 return irq_soft_mask_return();
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000198}
199
Madhavan Srinivasanb5c1bd62017-12-20 09:25:44 +0530200static inline void arch_local_irq_disable(void)
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000201{
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530202 irq_soft_mask_set(IRQS_DISABLED);
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000203}
204
David Howellsdf9ee292010-10-07 14:08:55 +0100205extern void arch_local_irq_restore(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
David Howellsdf9ee292010-10-07 14:08:55 +0100207static inline void arch_local_irq_enable(void)
208{
Madhavan Srinivasanc2e480b2017-12-20 09:25:42 +0530209 arch_local_irq_restore(IRQS_ENABLED);
David Howellsdf9ee292010-10-07 14:08:55 +0100210}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211
David Howellsdf9ee292010-10-07 14:08:55 +0100212static inline unsigned long arch_local_irq_save(void)
213{
Madhavan Srinivasan4e26bc42017-12-20 09:25:50 +0530214 return irq_soft_mask_set_return(IRQS_DISABLED);
David Howellsdf9ee292010-10-07 14:08:55 +0100215}
216
217static inline bool arch_irqs_disabled_flags(unsigned long flags)
218{
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530219 return flags & IRQS_DISABLED;
David Howellsdf9ee292010-10-07 14:08:55 +0100220}
221
222static inline bool arch_irqs_disabled(void)
223{
224 return arch_irqs_disabled_flags(arch_local_save_flags());
225}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226
Athira Rajeev2c9ac512021-07-21 01:48:29 -0400227static inline void set_pmi_irq_pending(void)
228{
229 /*
230 * Invoked from PMU callback functions to set PMI bit in the paca.
231 * This has to be called with irq's disabled (via hard_irq_disable()).
232 */
233 if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
234 WARN_ON_ONCE(mfmsr() & MSR_EE);
235
236 get_paca()->irq_happened |= PACA_IRQ_PMI;
237}
238
239static inline void clear_pmi_irq_pending(void)
240{
241 /*
242 * Invoked from PMU callback functions to clear the pending PMI bit
243 * in the paca.
244 */
245 if (IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG))
246 WARN_ON_ONCE(mfmsr() & MSR_EE);
247
248 get_paca()->irq_happened &= ~PACA_IRQ_PMI;
249}
250
251static inline bool pmi_irq_pending(void)
252{
253 /*
254 * Invoked from PMU callback functions to check if there is a pending
255 * PMI bit in the paca.
256 */
257 if (get_paca()->irq_happened & PACA_IRQ_PMI)
258 return true;
259
260 return false;
261}
262
Madhavan Srinivasanc6424382017-12-20 09:25:55 +0530263#ifdef CONFIG_PPC_BOOK3S
264/*
265 * To support disabling and enabling of irq with PMI, set of
266 * new powerpc_local_irq_pmu_save() and powerpc_local_irq_restore()
267 * functions are added. These macros are implemented using generic
268 * linux local_irq_* code from include/linux/irqflags.h.
269 */
270#define raw_local_irq_pmu_save(flags) \
271 do { \
272 typecheck(unsigned long, flags); \
273 flags = irq_soft_mask_or_return(IRQS_DISABLED | \
274 IRQS_PMI_DISABLED); \
275 } while(0)
276
277#define raw_local_irq_pmu_restore(flags) \
278 do { \
279 typecheck(unsigned long, flags); \
280 arch_local_irq_restore(flags); \
281 } while(0)
282
283#ifdef CONFIG_TRACE_IRQFLAGS
284#define powerpc_local_irq_pmu_save(flags) \
285 do { \
286 raw_local_irq_pmu_save(flags); \
Nicholas Piggin044d0d62020-07-23 20:56:14 +1000287 if (!raw_irqs_disabled_flags(flags)) \
288 trace_hardirqs_off(); \
Madhavan Srinivasanc6424382017-12-20 09:25:55 +0530289 } while(0)
290#define powerpc_local_irq_pmu_restore(flags) \
291 do { \
Nicholas Piggin044d0d62020-07-23 20:56:14 +1000292 if (!raw_irqs_disabled_flags(flags)) \
Madhavan Srinivasanc6424382017-12-20 09:25:55 +0530293 trace_hardirqs_on(); \
Nicholas Piggin044d0d62020-07-23 20:56:14 +1000294 raw_local_irq_pmu_restore(flags); \
Madhavan Srinivasanc6424382017-12-20 09:25:55 +0530295 } while(0)
296#else
297#define powerpc_local_irq_pmu_save(flags) \
298 do { \
299 raw_local_irq_pmu_save(flags); \
300 } while(0)
301#define powerpc_local_irq_pmu_restore(flags) \
302 do { \
303 raw_local_irq_pmu_restore(flags); \
304 } while (0)
305#endif /* CONFIG_TRACE_IRQFLAGS */
306
307#endif /* CONFIG_PPC_BOOK3S */
308
Madhavan Srinivasanf442d002017-12-20 09:25:53 +0530309#define hard_irq_disable() do { \
310 unsigned long flags; \
311 __hard_irq_disable(); \
312 flags = irq_soft_mask_set_return(IRQS_ALL_DISABLED); \
313 local_paca->irq_happened |= PACA_IRQ_HARD_DIS; \
Michael Ellerman7b087292018-05-02 23:07:26 +1000314 if (!arch_irqs_disabled_flags(flags)) { \
315 asm ("stdx %%r1, 0, %1 ;" \
316 : "=m" (local_paca->saved_r1) \
317 : "b" (&local_paca->saved_r1)); \
Madhavan Srinivasanf442d002017-12-20 09:25:53 +0530318 trace_hardirqs_off(); \
Michael Ellerman7b087292018-05-02 23:07:26 +1000319 } \
Benjamin Herrenschmidt57377892013-05-06 21:04:02 +0000320} while(0)
Paul Mackerrasf9485012012-06-15 14:51:39 +1000321
Michael Ellerman00943682020-05-03 00:33:16 +1000322static inline bool __lazy_irq_pending(u8 irq_happened)
323{
324 return !!(irq_happened & ~PACA_IRQ_HARD_DIS);
325}
326
327/*
328 * Check if a lazy IRQ is pending. Should be called with IRQs hard disabled.
329 */
Anton Blanchard0b17ba72012-06-27 13:13:52 +0000330static inline bool lazy_irq_pending(void)
331{
Michael Ellerman00943682020-05-03 00:33:16 +1000332 return __lazy_irq_pending(get_paca()->irq_happened);
333}
334
335/*
336 * Check if a lazy IRQ is pending, with no debugging checks.
337 * Should be called with IRQs hard disabled.
338 * For use in RI disabled code or other constrained situations.
339 */
340static inline bool lazy_irq_pending_nocheck(void)
341{
342 return __lazy_irq_pending(local_paca->irq_happened);
Anton Blanchard0b17ba72012-06-27 13:13:52 +0000343}
344
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100345/*
346 * This is called by asynchronous interrupts to conditionally
Nicholas Piggin9b81c022018-06-03 22:24:32 +1000347 * re-enable hard interrupts after having cleared the source
348 * of the interrupt. They are kept disabled if there is a different
349 * soft-masked interrupt pending that requires hard masking.
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100350 */
351static inline void may_hard_irq_enable(void)
352{
Nicholas Piggin9b81c022018-06-03 22:24:32 +1000353 if (!(get_paca()->irq_happened & PACA_IRQ_MUST_HARD_MASK)) {
354 get_paca()->irq_happened &= ~PACA_IRQ_HARD_DIS;
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100355 __hard_irq_enable();
Nicholas Piggin9b81c022018-06-03 22:24:32 +1000356 }
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100357}
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000358
Benjamin Herrenschmidta5464982012-03-07 16:48:45 +1100359static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
360{
Madhavan Srinivasan01417c62017-12-20 09:25:49 +0530361 return (regs->softe & IRQS_DISABLED);
Benjamin Herrenschmidta5464982012-03-07 16:48:45 +1100362}
363
Benjamin Herrenschmidtbe2cf202012-07-10 18:36:40 +1000364extern bool prep_irq_for_idle(void);
Nicholas Piggin2201f992017-06-13 23:05:45 +1000365extern bool prep_irq_for_idle_irqsoff(void);
Nicholas Piggin771d4302017-06-13 23:05:47 +1000366extern void irq_set_pending_from_srr1(unsigned long srr1);
Nicholas Piggin2201f992017-06-13 23:05:45 +1000367
368#define fini_irq_for_idle_irqsoff() trace_hardirqs_off();
Benjamin Herrenschmidtbe2cf202012-07-10 18:36:40 +1000369
Benjamin Herrenschmidt1d607bb2016-07-08 16:37:07 +1000370extern void force_external_irq_replay(void);
371
Christophe Leroyfb5608f2021-02-08 15:10:24 +0000372static inline void irq_soft_mask_regs_set_state(struct pt_regs *regs, unsigned long val)
373{
374 regs->softe = val;
375}
David Howellsdf9ee292010-10-07 14:08:55 +0100376#else /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377
Christophe Leroy6650c472021-02-08 15:10:26 +0000378static inline notrace unsigned long irq_soft_mask_return(void)
379{
380 return 0;
381}
382
David Howellsdf9ee292010-10-07 14:08:55 +0100383static inline unsigned long arch_local_save_flags(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384{
David Howellsdf9ee292010-10-07 14:08:55 +0100385 return mfmsr();
386}
Paul Mackerras4c75f842009-06-12 02:00:50 +0000387
David Howellsdf9ee292010-10-07 14:08:55 +0100388static inline void arch_local_irq_restore(unsigned long flags)
389{
Christophe Leroyb020aa92019-08-29 08:45:13 +0000390 if (IS_ENABLED(CONFIG_BOOKE))
391 wrtee(flags);
392 else
393 mtmsr(flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394}
395
David Howellsdf9ee292010-10-07 14:08:55 +0100396static inline unsigned long arch_local_irq_save(void)
397{
398 unsigned long flags = arch_local_save_flags();
Christophe Leroyb020aa92019-08-29 08:45:13 +0000399
400 if (IS_ENABLED(CONFIG_BOOKE))
401 wrtee(0);
402 else if (IS_ENABLED(CONFIG_PPC_8xx))
403 wrtspr(SPRN_EID);
404 else
405 mtmsr(flags & ~MSR_EE);
406
David Howellsdf9ee292010-10-07 14:08:55 +0100407 return flags;
408}
409
410static inline void arch_local_irq_disable(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411{
Christophe Leroy08353772021-02-08 15:10:25 +0000412 __hard_irq_disable();
David Howellsdf9ee292010-10-07 14:08:55 +0100413}
Paul Mackerras4c75f842009-06-12 02:00:50 +0000414
David Howellsdf9ee292010-10-07 14:08:55 +0100415static inline void arch_local_irq_enable(void)
416{
Christophe Leroy08353772021-02-08 15:10:25 +0000417 __hard_irq_enable();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418}
419
David Howellsdf9ee292010-10-07 14:08:55 +0100420static inline bool arch_irqs_disabled_flags(unsigned long flags)
Steven Rostedte0eca072008-05-14 23:49:43 -0400421{
422 return (flags & MSR_EE) == 0;
423}
424
David Howellsdf9ee292010-10-07 14:08:55 +0100425static inline bool arch_irqs_disabled(void)
426{
427 return arch_irqs_disabled_flags(arch_local_save_flags());
428}
429
430#define hard_irq_disable() arch_local_irq_disable()
431
Benjamin Herrenschmidta5464982012-03-07 16:48:45 +1100432static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
433{
434 return !(regs->msr & MSR_EE);
435}
436
Nicholas Piggin59dc5bf2021-06-18 01:51:03 +1000437static inline bool may_hard_irq_enable(void)
438{
439 return false;
440}
441
442static inline void do_hard_irq_enable(void)
443{
444 BUILD_BUG();
445}
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100446
Athira Rajeev2c9ac512021-07-21 01:48:29 -0400447static inline void clear_pmi_irq_pending(void) { }
448static inline void set_pmi_irq_pending(void) { }
449static inline bool pmi_irq_pending(void) { return false; }
450
Christophe Leroyfb5608f2021-02-08 15:10:24 +0000451static inline void irq_soft_mask_regs_set_state(struct pt_regs *regs, unsigned long val)
452{
453}
Paul Mackerrasd04c56f2006-10-04 16:47:49 +1000454#endif /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455
Thomas Gleixner089fb442011-01-21 06:12:28 +0000456#define ARCH_IRQ_INIT_FLAGS IRQ_NOREQUEST
457
Benjamin Herrenschmidt7230c562012-03-06 18:27:59 +1100458#endif /* __ASSEMBLY__ */
Kumar Galab671ad22005-09-21 16:52:55 -0500459#endif /* __KERNEL__ */
460#endif /* _ASM_POWERPC_HW_IRQ_H */