Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / tools / testing / selftests / powerpc / ptrace / ptrace-gpr.h
blobe30fef63824c914c8567452c76c945e44d2ec8a8
1 /*
2 * Copyright (C) 2015 Anshuman Khandual, IBM Corporation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9 #define GPR_1 1
10 #define GPR_2 2
11 #define GPR_3 3
12 #define GPR_4 4
14 #define FPR_1 0.001
15 #define FPR_2 0.002
16 #define FPR_3 0.003
17 #define FPR_4 0.004
19 #define FPR_1_REP 0x3f50624de0000000
20 #define FPR_2_REP 0x3f60624de0000000
21 #define FPR_3_REP 0x3f689374c0000000
22 #define FPR_4_REP 0x3f70624de0000000
24 /* Buffer must have 18 elements */
25 int validate_gpr(unsigned long *gpr, unsigned long val)
27 int i, found = 1;
29 for (i = 0; i < 18; i++) {
30 if (gpr[i] != val) {
31 printf("GPR[%d]: %lx Expected: %lx\n",
32 i+14, gpr[i], val);
33 found = 0;
37 if (!found)
38 return TEST_FAIL;
39 return TEST_PASS;
42 /* Buffer must have 32 elements */
43 int validate_fpr(unsigned long *fpr, unsigned long val)
45 int i, found = 1;
47 for (i = 0; i < 32; i++) {
48 if (fpr[i] != val) {
49 printf("FPR[%d]: %lx Expected: %lx\n", i, fpr[i], val);
50 found = 0;
54 if (!found)
55 return TEST_FAIL;
56 return TEST_PASS;
59 /* Buffer must have 32 elements */
60 int validate_fpr_float(float *fpr, float val)
62 int i, found = 1;
64 for (i = 0; i < 32; i++) {
65 if (fpr[i] != val) {
66 printf("FPR[%d]: %f Expected: %f\n", i, fpr[i], val);
67 found = 0;
71 if (!found)
72 return TEST_FAIL;
73 return TEST_PASS;