Files
cubelinux-kernel/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.h
T
Greg Kroah-Hartman 598cf27219 Linux 6.19.3
Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Brett A C Sheffield <bacs@librecast.net>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-19 16:33:27 +01:00

71 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2015 Anshuman Khandual, IBM Corporation.
*/
#define GPR_1 1
#define GPR_2 2
#define GPR_3 3
#define GPR_4 4
#define FPR_1 0.001
#define FPR_2 0.002
#define FPR_3 0.003
#define FPR_4 0.004
#define FPR_1_REP 0x3f50624dd2f1a9fcull
#define FPR_2_REP 0x3f60624dd2f1a9fcull
#define FPR_3_REP 0x3f689374bc6a7efaull
#define FPR_4_REP 0x3f70624dd2f1a9fcull
/* Buffer must have 18 elements */
int validate_gpr(unsigned long *gpr, unsigned long val)
{
int i, found = 1;
for (i = 0; i < 18; i++) {
if (gpr[i] != val) {
printf("GPR[%d]: %lx Expected: %lx\n",
i+14, gpr[i], val);
found = 0;
}
}
if (!found)
return TEST_FAIL;
return TEST_PASS;
}
/* Buffer must have 32 elements */
int validate_fpr(__u64 *fpr, __u64 val)
{
int i, found = 1;
for (i = 0; i < 32; i++) {
if (fpr[i] != val) {
printf("FPR[%d]: %llx Expected: %llx\n", i, fpr[i], val);
found = 0;
}
}
if (!found)
return TEST_FAIL;
return TEST_PASS;
}
/* Buffer must have 32 elements */
int validate_fpr_double(double *fpr, double val)
{
int i, found = 1;
for (i = 0; i < 32; i++) {
if (fpr[i] != val) {
printf("FPR[%d]: %f Expected: %f\n", i, fpr[i], val);
found = 0;
}
}
if (!found)
return TEST_FAIL;
return TEST_PASS;
}