hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/include/linux/interrupt.h
....@@ -61,6 +61,12 @@
6161 * interrupt handler after suspending interrupts. For system
6262 * wakeup devices users need to implement wakeup detection in
6363 * their interrupt handlers.
64
+ * IRQF_OOB - Interrupt is attached to an out-of-band handler living
65
+ * on the heading stage of the interrupt pipeline
66
+ * (CONFIG_IRQ_PIPELINE). It may be delivered to the
67
+ * handler any time interrupts are enabled in the CPU,
68
+ * regardless of the (virtualized) interrupt state
69
+ * maintained by local_irq_save/disable().
6470 */
6571 #define IRQF_SHARED 0x00000080
6672 #define IRQF_PROBE_SHARED 0x00000100
....@@ -74,6 +80,7 @@
7480 #define IRQF_NO_THREAD 0x00010000
7581 #define IRQF_EARLY_RESUME 0x00020000
7682 #define IRQF_COND_SUSPEND 0x00040000
83
+#define IRQF_OOB 0x00080000
7784
7885 #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
7986
....@@ -514,9 +521,29 @@
514521 * to ensure that after a local_irq_disable(), interrupts have
515522 * really been disabled in hardware. Such architectures need to
516523 * implement the following hook.
524
+ *
525
+ * Those cases also apply when interrupt pipelining is in effect,
526
+ * since we are virtualizing the interrupt disable state here too.
517527 */
518528 #ifndef hard_irq_disable
519
-#define hard_irq_disable() do { } while(0)
529
+#define hard_irq_disable() hard_cond_local_irq_disable()
530
+#endif
531
+
532
+/*
533
+ * Unlike other virtualized interrupt disabling schemes may assume, we
534
+ * can't expect local_irq_restore() to turn hard interrupts on when
535
+ * pipelining. hard_irq_enable() is introduced to be paired with
536
+ * hard_irq_disable(), for unconditionally turning them on. The only
537
+ * sane sequence mixing virtual and real disable state manipulation
538
+ * is:
539
+ *
540
+ * 1. local_irq_save/disable
541
+ * 2. hard_irq_disable
542
+ * 3. hard_irq_enable
543
+ * 4. local_irq_restore/enable
544
+ */
545
+#ifndef hard_irq_enable
546
+#define hard_irq_enable() hard_cond_local_irq_enable()
520547 #endif
521548
522549 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high