Skip to content

Commit 80652cc

Browse files
jgoulyctmarinas
authored andcommitted
selftests/arm64: add HWCAP2_LRCPC3 test
Add a test for the newly added HWCAP2_LRCPC3. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20230919162757.2707023-3-joey.gouly@arm.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 338a835 commit 80652cc

File tree

1 file changed

+20
-0
lines changed
  • tools/testing/selftests/arm64/abi

1 file changed

+20
-0
lines changed

tools/testing/selftests/arm64/abi/hwcap.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,19 @@ static void uscat_sigbus(void)
295295
asm volatile(".inst 0xb820003f" : : : );
296296
}
297297

298+
static void lrcpc3_sigill(void)
299+
{
300+
int data[2] = { 1, 2 };
301+
302+
register int *src asm ("x0") = data;
303+
register int data0 asm ("w2") = 0;
304+
register int data1 asm ("w3") = 0;
305+
306+
/* LDIAPP w2, w3, [x0] */
307+
asm volatile(".inst 0x99431802"
308+
: "=r" (data0), "=r" (data1) : "r" (src) :);
309+
}
310+
298311
static const struct hwcap_data {
299312
const char *name;
300313
unsigned long at_hwcap;
@@ -354,6 +367,13 @@ static const struct hwcap_data {
354367
.cpuinfo = "ilrcpc",
355368
.sigill_fn = ilrcpc_sigill,
356369
},
370+
{
371+
.name = "LRCPC3",
372+
.at_hwcap = AT_HWCAP2,
373+
.hwcap_bit = HWCAP2_LRCPC3,
374+
.cpuinfo = "lrcpc3",
375+
.sigill_fn = lrcpc3_sigill,
376+
},
357377
{
358378
.name = "LSE",
359379
.at_hwcap = AT_HWCAP,

0 commit comments

Comments
 (0)