Skip to content

Commit a3d8369

Browse files
committed
core: arm: refactor feat_crc32_implemented
1. Add support for checking CRC32 HW instruction in aarch32. 2. Use newly defined masks for aarch64. Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
1 parent a4bb1d4 commit a3d8369

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

core/arch/arm/include/arm.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,9 @@ static inline unsigned int feat_pan_implemented(void)
181181
static inline bool feat_crc32_implemented(void)
182182
{
183183
#ifdef ARM32
184-
return false;
184+
return read_id_isar5() & ID_ISAR5_CRC32;
185185
#else
186-
return ((read_id_aa64isar0_el1() >> ID_AA64ISAR0_EL1_CRC32_SHIFT) &
187-
ID_AA64ISAR0_EL1_CRC32_MASK) == FEAT_CRC32_IMPLEMENTED;
186+
return read_id_aa64isar0_el1() & ID_AA64ISAR0_CRC32;
188187
#endif
189188
}
190189

core/arch/arm/include/arm64.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,6 @@
257257
#define FEAT_PAN2_IMPLEMENTED U(0x2)
258258
#define FEAT_PAN3_IMPLEMENTED U(0x3)
259259

260-
#define ID_AA64ISAR0_EL1_CRC32_MASK UL(0xf)
261-
#define ID_AA64ISAR0_EL1_CRC32_SHIFT U(16)
262-
#define FEAT_CRC32_NOT_IMPLEMENTED U(0x0)
263-
#define FEAT_CRC32_IMPLEMENTED U(0x1)
264-
265260
#define ID_AA64ISAR1_GPI_SHIFT U(28)
266261
#define ID_AA64ISAR1_GPI_MASK U(0xf)
267262
#define ID_AA64ISAR1_GPI_NI U(0x0)

0 commit comments

Comments
 (0)