ArmPkg: Fix the return type of the ReadCCSIDR function

When CCIDX is supported, the Current Cache Size ID Register contains
data above 32 bits: namely the number of sets. Avoid truncating this
by returning a UINTN instead of UINT32. On AARCH32, the expanded
number of sets data can be read via the CCSIDR2 register.

Also, add Doxygen comments for the function.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
This commit is contained in:
Rebecca Cran 2021-02-07 17:52:39 -07:00 committed by mergify[bot]
parent 827a71cc9e
commit 93ff7a4e8e
4 changed files with 11 additions and 4 deletions

View File

@ -84,7 +84,7 @@ ASM_FUNC(ArmDisableAllExceptions)
ret
// UINT32
// UINTN
// ReadCCSIDR (
// IN UINT32 CSSELR
// )

View File

@ -64,7 +64,7 @@ ASM_FUNC(ArmReadIdMmfr4)
mrc p15,0,r0,c0,c2,6 @ Read ID_MMFR4 Register
bx lr
// UINT32
// UINTN
// ReadCCSIDR (
// IN UINT32 CSSELR
// )

View File

@ -68,7 +68,7 @@
mrc p15,0,r0,c0,c2,6 ; Read ID_MMFR4 Register
bx LR
// UINT32
// UINTN
// ReadCCSIDR (
// IN UINT32 CSSELR
// )

View File

@ -61,7 +61,14 @@ CPSRRead (
VOID
);
UINT32
/** Reads the CCSIDR register for the specified cache.
@param CSSELR The CSSELR cache selection register value.
@return The contents of the CCSIDR_EL1 register for the specified cache, when in AARCH64 mode.
Returns the contents of the CCSIDR register in AARCH32 mode.
**/
UINTN
ReadCCSIDR (
IN UINT32 CSSELR
);