linux/tools/testing/selftests/powerpc/ptrace/ptrace-gpr.h
Thomas Gleixner 2874c5fd28 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license or at
  your option any later version

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-30 11:26:32 -07: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 0x3f50624de0000000
#define FPR_2_REP 0x3f60624de0000000
#define FPR_3_REP 0x3f689374c0000000
#define FPR_4_REP 0x3f70624de0000000
/* 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(unsigned long *fpr, unsigned long val)
{
int i, found = 1;
for (i = 0; i < 32; i++) {
if (fpr[i] != val) {
printf("FPR[%d]: %lx Expected: %lx\n", i, fpr[i], val);
found = 0;
}
}
if (!found)
return TEST_FAIL;
return TEST_PASS;
}
/* Buffer must have 32 elements */
int validate_fpr_float(float *fpr, float 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;
}