Skip to content

Commit e99da7c

Browse files
Julien Thierryctmarinas
authored andcommitted
arm/arm64: gic-v3: Add PMR and RPR accessors
Add helper functions to access system registers related to interrupt priorities: PMR and RPR. Signed-off-by: Julien Thierry <[email protected]> Reviewed-by: Mark Rutland <[email protected]> Acked-by: Catalin Marinas <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Russell King <[email protected]> Cc: Will Deacon <[email protected]> Cc: Marc Zyngier <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent b90d2b2 commit e99da7c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

arch/arm/include/asm/arch_gicv3.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#define ICC_SRE __ACCESS_CP15(c12, 0, c12, 5)
3535
#define ICC_IGRPEN1 __ACCESS_CP15(c12, 0, c12, 7)
3636
#define ICC_BPR1 __ACCESS_CP15(c12, 0, c12, 3)
37+
#define ICC_RPR __ACCESS_CP15(c12, 0, c11, 3)
3738

3839
#define __ICC_AP0Rx(x) __ACCESS_CP15(c12, 0, c8, 4 | x)
3940
#define ICC_AP0R0 __ICC_AP0Rx(0)
@@ -245,6 +246,21 @@ static inline void gic_write_bpr1(u32 val)
245246
write_sysreg(val, ICC_BPR1);
246247
}
247248

249+
static inline u32 gic_read_pmr(void)
250+
{
251+
return read_sysreg(ICC_PMR);
252+
}
253+
254+
static inline void gic_write_pmr(u32 val)
255+
{
256+
write_sysreg(val, ICC_PMR);
257+
}
258+
259+
static inline u32 gic_read_rpr(void)
260+
{
261+
return read_sysreg(ICC_RPR);
262+
}
263+
248264
/*
249265
* Even in 32bit systems that use LPAE, there is no guarantee that the I/O
250266
* interface provides true 64bit atomic accesses, so using strd/ldrd doesn't

arch/arm64/include/asm/arch_gicv3.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ static inline void gic_write_bpr1(u32 val)
114114
write_sysreg_s(val, SYS_ICC_BPR1_EL1);
115115
}
116116

117+
static inline u32 gic_read_pmr(void)
118+
{
119+
return read_sysreg_s(SYS_ICC_PMR_EL1);
120+
}
121+
122+
static inline void gic_write_pmr(u32 val)
123+
{
124+
write_sysreg_s(val, SYS_ICC_PMR_EL1);
125+
}
126+
127+
static inline u32 gic_read_rpr(void)
128+
{
129+
return read_sysreg_s(SYS_ICC_RPR_EL1);
130+
}
131+
117132
#define gic_read_typer(c) readq_relaxed(c)
118133
#define gic_write_irouter(v, c) writeq_relaxed(v, c)
119134
#define gic_read_lpir(c) readq_relaxed(c)

0 commit comments

Comments
 (0)