Linux Audio

Check our new training course

Loading...
v6.2
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifndef _ASM_IRQ_H
  3#define _ASM_IRQ_H
  4
  5#define EXT_INTERRUPT	0
  6#define IO_INTERRUPT	1
  7#define THIN_INTERRUPT	2
  8
  9#define NR_IRQS_BASE	3
 10
 11#define NR_IRQS	NR_IRQS_BASE
 12#define NR_IRQS_LEGACY NR_IRQS_BASE
 13
 14/* External interruption codes */
 15#define EXT_IRQ_INTERRUPT_KEY	0x0040
 16#define EXT_IRQ_CLK_COMP	0x1004
 17#define EXT_IRQ_CPU_TIMER	0x1005
 18#define EXT_IRQ_WARNING_TRACK	0x1007
 19#define EXT_IRQ_MALFUNC_ALERT	0x1200
 20#define EXT_IRQ_EMERGENCY_SIG	0x1201
 21#define EXT_IRQ_EXTERNAL_CALL	0x1202
 22#define EXT_IRQ_TIMING_ALERT	0x1406
 23#define EXT_IRQ_MEASURE_ALERT	0x1407
 24#define EXT_IRQ_SERVICE_SIG	0x2401
 25#define EXT_IRQ_CP_SERVICE	0x2603
 26#define EXT_IRQ_IUCV		0x4000
 27
 28#ifndef __ASSEMBLY__
 29
 30#include <linux/hardirq.h>
 31#include <linux/percpu.h>
 32#include <linux/cache.h>
 33#include <linux/types.h>
 
 34
 35enum interruption_class {
 36	IRQEXT_CLK,
 37	IRQEXT_EXC,
 38	IRQEXT_EMS,
 39	IRQEXT_TMR,
 40	IRQEXT_TLA,
 41	IRQEXT_PFL,
 42	IRQEXT_DSD,
 43	IRQEXT_VRT,
 44	IRQEXT_SCP,
 45	IRQEXT_IUC,
 46	IRQEXT_CMS,
 47	IRQEXT_CMC,
 48	IRQEXT_FTP,
 
 49	IRQIO_CIO,
 50	IRQIO_DAS,
 51	IRQIO_C15,
 52	IRQIO_C70,
 53	IRQIO_TAP,
 54	IRQIO_VMR,
 55	IRQIO_LCS,
 56	IRQIO_CTC,
 57	IRQIO_ADM,
 58	IRQIO_CSC,
 59	IRQIO_VIR,
 60	IRQIO_QAI,
 61	IRQIO_APB,
 62	IRQIO_PCF,
 63	IRQIO_PCD,
 64	IRQIO_MSI,
 65	IRQIO_VAI,
 66	IRQIO_GAL,
 67	NMI_NMI,
 68	CPU_RST,
 69	NR_ARCH_IRQS
 70};
 71
 72struct irq_stat {
 73	unsigned int irqs[NR_ARCH_IRQS];
 74};
 75
 76DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
 77
 78static __always_inline void inc_irq_stat(enum interruption_class irq)
 79{
 80	__this_cpu_inc(irq_stat.irqs[irq]);
 81}
 82
 83struct ext_code {
 84	union {
 85		struct {
 86			unsigned short subcode;
 87			unsigned short code;
 88		};
 89		unsigned int int_code;
 90	};
 91};
 92
 93typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
 94
 95int register_external_irq(u16 code, ext_int_handler_t handler);
 96int unregister_external_irq(u16 code, ext_int_handler_t handler);
 97
 98enum irq_subclass {
 99	IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
100	IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
 
101};
102
103#define CR0_IRQ_SUBCLASS_MASK					  \
104	((1UL << (63 - 30))  /* Warning Track */		| \
105	 (1UL << (63 - 48))  /* Malfunction Alert */		| \
106	 (1UL << (63 - 49))  /* Emergency Signal */		| \
107	 (1UL << (63 - 50))  /* External Call */		| \
108	 (1UL << (63 - 52))  /* Clock Comparator */		| \
109	 (1UL << (63 - 53))  /* CPU Timer */			| \
110	 (1UL << (63 - 54))  /* Service Signal */		| \
111	 (1UL << (63 - 57))  /* Interrupt Key */		| \
112	 (1UL << (63 - 58))  /* Measurement Alert */		| \
113	 (1UL << (63 - 59))  /* Timing Alert */			| \
114	 (1UL << (63 - 62))) /* IUCV */
115
116void irq_subclass_register(enum irq_subclass subclass);
117void irq_subclass_unregister(enum irq_subclass subclass);
118
119#define irq_canonicalize(irq)  (irq)
120
121#endif /* __ASSEMBLY__ */
122
123#endif /* _ASM_IRQ_H */
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifndef _ASM_IRQ_H
  3#define _ASM_IRQ_H
  4
  5#define EXT_INTERRUPT	0
  6#define IO_INTERRUPT	1
  7#define THIN_INTERRUPT	2
  8
  9#define NR_IRQS_BASE	3
 10
 11#define NR_IRQS	NR_IRQS_BASE
 12#define NR_IRQS_LEGACY NR_IRQS_BASE
 13
 14/* External interruption codes */
 15#define EXT_IRQ_INTERRUPT_KEY	0x0040
 16#define EXT_IRQ_CLK_COMP	0x1004
 17#define EXT_IRQ_CPU_TIMER	0x1005
 18#define EXT_IRQ_WARNING_TRACK	0x1007
 19#define EXT_IRQ_MALFUNC_ALERT	0x1200
 20#define EXT_IRQ_EMERGENCY_SIG	0x1201
 21#define EXT_IRQ_EXTERNAL_CALL	0x1202
 22#define EXT_IRQ_TIMING_ALERT	0x1406
 23#define EXT_IRQ_MEASURE_ALERT	0x1407
 24#define EXT_IRQ_SERVICE_SIG	0x2401
 25#define EXT_IRQ_CP_SERVICE	0x2603
 26#define EXT_IRQ_IUCV		0x4000
 27
 28#ifndef __ASSEMBLY__
 29
 30#include <linux/hardirq.h>
 31#include <linux/percpu.h>
 32#include <linux/cache.h>
 33#include <linux/types.h>
 34#include <asm/ctlreg.h>
 35
 36enum interruption_class {
 37	IRQEXT_CLK,
 38	IRQEXT_EXC,
 39	IRQEXT_EMS,
 40	IRQEXT_TMR,
 41	IRQEXT_TLA,
 42	IRQEXT_PFL,
 43	IRQEXT_DSD,
 44	IRQEXT_VRT,
 45	IRQEXT_SCP,
 46	IRQEXT_IUC,
 47	IRQEXT_CMS,
 48	IRQEXT_CMC,
 49	IRQEXT_FTP,
 50	IRQEXT_WTI,
 51	IRQIO_CIO,
 52	IRQIO_DAS,
 53	IRQIO_C15,
 54	IRQIO_C70,
 55	IRQIO_TAP,
 56	IRQIO_VMR,
 57	IRQIO_LCS,
 58	IRQIO_CTC,
 59	IRQIO_ADM,
 60	IRQIO_CSC,
 61	IRQIO_VIR,
 62	IRQIO_QAI,
 63	IRQIO_APB,
 64	IRQIO_PCF,
 65	IRQIO_PCD,
 66	IRQIO_MSI,
 67	IRQIO_VAI,
 68	IRQIO_GAL,
 69	NMI_NMI,
 70	CPU_RST,
 71	NR_ARCH_IRQS
 72};
 73
 74struct irq_stat {
 75	unsigned int irqs[NR_ARCH_IRQS];
 76};
 77
 78DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
 79
 80static __always_inline void inc_irq_stat(enum interruption_class irq)
 81{
 82	__this_cpu_inc(irq_stat.irqs[irq]);
 83}
 84
 85struct ext_code {
 86	union {
 87		struct {
 88			unsigned short subcode;
 89			unsigned short code;
 90		};
 91		unsigned int int_code;
 92	};
 93};
 94
 95typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
 96
 97int register_external_irq(u16 code, ext_int_handler_t handler);
 98int unregister_external_irq(u16 code, ext_int_handler_t handler);
 99
100enum irq_subclass {
101	IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
102	IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
103	IRQ_SUBCLASS_WARNING_TRACK = 33,
104};
105
106#define CR0_IRQ_SUBCLASS_MASK					  \
107	(CR0_WARNING_TRACK					| \
108	 CR0_MALFUNCTION_ALERT_SUBMASK				| \
109	 CR0_EMERGENCY_SIGNAL_SUBMASK				| \
110	 CR0_EXTERNAL_CALL_SUBMASK				| \
111	 CR0_CLOCK_COMPARATOR_SUBMASK				| \
112	 CR0_CPU_TIMER_SUBMASK					| \
113	 CR0_SERVICE_SIGNAL_SUBMASK				| \
114	 CR0_INTERRUPT_KEY_SUBMASK				| \
115	 CR0_MEASUREMENT_ALERT_SUBMASK				| \
116	 CR0_ETR_SUBMASK					| \
117	 CR0_IUCV)
118
119void irq_subclass_register(enum irq_subclass subclass);
120void irq_subclass_unregister(enum irq_subclass subclass);
121
122#define irq_canonicalize(irq)  (irq)
123
124#endif /* __ASSEMBLY__ */
125
126#endif /* _ASM_IRQ_H */