Skip to content

Commit

Permalink
arm64: debug: Treat the BRPs/WRPs as unsigned
Browse files Browse the repository at this point in the history
IDAA64DFR0_EL1: BRPs and WRPs are unsigned values. Use
the appropriate helpers to extract those fields.

Cc: Ard Biesheuvel <[email protected]>
Reported-by: AKASHI Takahiro <[email protected]>
Acked-by: Will Deacon <[email protected]>
Signed-off-by: Suzuki K. Poulose <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
  • Loading branch information
Suzuki K. Poulose authored and ctmarinas committed Nov 26, 2015
1 parent 4f0a606 commit 1944bf8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/arm64/include/asm/hw_breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,18 @@ extern struct pmu perf_ops_bp;
/* Determine number of BRP registers available. */
static inline int get_num_brps(void)
{
u64 dfr0 = read_system_reg(SYS_ID_AA64DFR0_EL1);
return 1 +
cpuid_feature_extract_field(read_system_reg(SYS_ID_AA64DFR0_EL1),
cpuid_feature_extract_unsigned_field(dfr0,
ID_AA64DFR0_BRPS_SHIFT);
}

/* Determine number of WRP registers available. */
static inline int get_num_wrps(void)
{
u64 dfr0 = read_system_reg(SYS_ID_AA64DFR0_EL1);
return 1 +
cpuid_feature_extract_field(read_system_reg(SYS_ID_AA64DFR0_EL1),
cpuid_feature_extract_unsigned_field(dfr0,
ID_AA64DFR0_WRPS_SHIFT);
}

Expand Down

0 comments on commit 1944bf8

Please sign in to comment.