|
21 | 21 | #define INIT_PSTATE_EL2 \ |
22 | 22 | (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT | PSR_MODE_EL2h) |
23 | 23 |
|
24 | | -/* |
25 | | - * PMR values used to mask/unmask interrupts. |
26 | | - * |
27 | | - * GIC priority masking works as follows: if an IRQ's priority is a higher value |
28 | | - * than the value held in PMR, that IRQ is masked. Lowering the value of PMR |
29 | | - * means masking more IRQs (or at least that the same IRQs remain masked). |
30 | | - * |
31 | | - * To mask interrupts, we clear the most significant bit of PMR. |
32 | | - * |
33 | | - * Some code sections either automatically switch back to PSR.I or explicitly |
34 | | - * require to not use priority masking. If bit GIC_PRIO_PSR_I_SET is included |
35 | | - * in the priority mask, it indicates that PSR.I should be set and |
36 | | - * interrupt disabling temporarily does not rely on IRQ priorities. |
37 | | - */ |
38 | | -#define GIC_PRIO_IRQON 0xe0 |
39 | | -#define __GIC_PRIO_IRQOFF (GIC_PRIO_IRQON & ~0x80) |
40 | | -#define __GIC_PRIO_IRQOFF_NS 0xa0 |
41 | | -#define GIC_PRIO_PSR_I_SET (1 << 4) |
42 | | - |
43 | | -#define GIC_PRIO_IRQOFF \ |
44 | | - ({ \ |
45 | | - extern struct static_key_false gic_nonsecure_priorities;\ |
46 | | - u8 __prio = __GIC_PRIO_IRQOFF; \ |
47 | | - \ |
48 | | - if (static_branch_unlikely(&gic_nonsecure_priorities)) \ |
49 | | - __prio = __GIC_PRIO_IRQOFF_NS; \ |
50 | | - \ |
51 | | - __prio; \ |
52 | | - }) |
| 24 | +#include <linux/irqchip/arm-gic-v3-prio.h> |
| 25 | + |
| 26 | +#define GIC_PRIO_IRQON GICV3_PRIO_UNMASKED |
| 27 | +#define GIC_PRIO_IRQOFF GICV3_PRIO_IRQ |
| 28 | + |
| 29 | +#define GIC_PRIO_PSR_I_SET GICV3_PRIO_PSR_I_SET |
53 | 30 |
|
54 | 31 | /* Additional SPSR bits not exposed in the UABI */ |
55 | 32 | #define PSR_MODE_THREAD_BIT (1 << 0) |
|
0 commit comments