Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_IRQ_H
0003 #define _ASM_IRQ_H
0004 
0005 #define EXT_INTERRUPT   0
0006 #define IO_INTERRUPT    1
0007 #define THIN_INTERRUPT  2
0008 
0009 #define NR_IRQS_BASE    3
0010 
0011 #define NR_IRQS NR_IRQS_BASE
0012 #define NR_IRQS_LEGACY NR_IRQS_BASE
0013 
0014 /* External interruption codes */
0015 #define EXT_IRQ_INTERRUPT_KEY   0x0040
0016 #define EXT_IRQ_CLK_COMP    0x1004
0017 #define EXT_IRQ_CPU_TIMER   0x1005
0018 #define EXT_IRQ_WARNING_TRACK   0x1007
0019 #define EXT_IRQ_MALFUNC_ALERT   0x1200
0020 #define EXT_IRQ_EMERGENCY_SIG   0x1201
0021 #define EXT_IRQ_EXTERNAL_CALL   0x1202
0022 #define EXT_IRQ_TIMING_ALERT    0x1406
0023 #define EXT_IRQ_MEASURE_ALERT   0x1407
0024 #define EXT_IRQ_SERVICE_SIG 0x2401
0025 #define EXT_IRQ_CP_SERVICE  0x2603
0026 #define EXT_IRQ_IUCV        0x4000
0027 
0028 #ifndef __ASSEMBLY__
0029 
0030 #include <linux/hardirq.h>
0031 #include <linux/percpu.h>
0032 #include <linux/cache.h>
0033 #include <linux/types.h>
0034 
0035 enum interruption_class {
0036     IRQEXT_CLK,
0037     IRQEXT_EXC,
0038     IRQEXT_EMS,
0039     IRQEXT_TMR,
0040     IRQEXT_TLA,
0041     IRQEXT_PFL,
0042     IRQEXT_DSD,
0043     IRQEXT_VRT,
0044     IRQEXT_SCP,
0045     IRQEXT_IUC,
0046     IRQEXT_CMS,
0047     IRQEXT_CMC,
0048     IRQEXT_FTP,
0049     IRQIO_CIO,
0050     IRQIO_DAS,
0051     IRQIO_C15,
0052     IRQIO_C70,
0053     IRQIO_TAP,
0054     IRQIO_VMR,
0055     IRQIO_LCS,
0056     IRQIO_CTC,
0057     IRQIO_ADM,
0058     IRQIO_CSC,
0059     IRQIO_VIR,
0060     IRQIO_QAI,
0061     IRQIO_APB,
0062     IRQIO_PCF,
0063     IRQIO_PCD,
0064     IRQIO_MSI,
0065     IRQIO_VAI,
0066     IRQIO_GAL,
0067     NMI_NMI,
0068     CPU_RST,
0069     NR_ARCH_IRQS
0070 };
0071 
0072 struct irq_stat {
0073     unsigned int irqs[NR_ARCH_IRQS];
0074 };
0075 
0076 DECLARE_PER_CPU_SHARED_ALIGNED(struct irq_stat, irq_stat);
0077 
0078 static __always_inline void inc_irq_stat(enum interruption_class irq)
0079 {
0080     __this_cpu_inc(irq_stat.irqs[irq]);
0081 }
0082 
0083 struct ext_code {
0084     union {
0085         struct {
0086             unsigned short subcode;
0087             unsigned short code;
0088         };
0089         unsigned int int_code;
0090     };
0091 };
0092 
0093 typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long);
0094 
0095 int register_external_irq(u16 code, ext_int_handler_t handler);
0096 int unregister_external_irq(u16 code, ext_int_handler_t handler);
0097 
0098 enum irq_subclass {
0099     IRQ_SUBCLASS_MEASUREMENT_ALERT = 5,
0100     IRQ_SUBCLASS_SERVICE_SIGNAL = 9,
0101 };
0102 
0103 #define CR0_IRQ_SUBCLASS_MASK                     \
0104     ((1UL << (63 - 30))  /* Warning Track */        | \
0105      (1UL << (63 - 48))  /* Malfunction Alert */        | \
0106      (1UL << (63 - 49))  /* Emergency Signal */     | \
0107      (1UL << (63 - 50))  /* External Call */        | \
0108      (1UL << (63 - 52))  /* Clock Comparator */     | \
0109      (1UL << (63 - 53))  /* CPU Timer */            | \
0110      (1UL << (63 - 54))  /* Service Signal */       | \
0111      (1UL << (63 - 57))  /* Interrupt Key */        | \
0112      (1UL << (63 - 58))  /* Measurement Alert */        | \
0113      (1UL << (63 - 59))  /* Timing Alert */         | \
0114      (1UL << (63 - 62))) /* IUCV */
0115 
0116 void irq_subclass_register(enum irq_subclass subclass);
0117 void irq_subclass_unregister(enum irq_subclass subclass);
0118 
0119 #define irq_canonicalize(irq)  (irq)
0120 
0121 #endif /* __ASSEMBLY__ */
0122 
0123 #endif /* _ASM_IRQ_H */