Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/kernel/arch/amd64 Fix more issues with compat to i386 ...



details:   https://anonhg.NetBSD.org/src/rev/36023abe4903
branches:  trunk
changeset: 821873:36023abe4903
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Feb 20 05:47:59 2017 +0000

description:
Fix more issues with compat to i386 in arch/amd64 tests for Debug Registers

Stop compating the number of available registers with 16, it's amd64
specific. i386 ships with 8 Debug Registers.

Sponsored by <The NetBSD Foundation>

diffstat:

 tests/kernel/arch/amd64/t_ptrace_wait.c |  88 +--------------------------------
 1 files changed, 2 insertions(+), 86 deletions(-)

diffs (222 lines):

diff -r 2cf496903663 -r 36023abe4903 tests/kernel/arch/amd64/t_ptrace_wait.c
--- a/tests/kernel/arch/amd64/t_ptrace_wait.c   Mon Feb 20 05:46:12 2017 +0000
+++ b/tests/kernel/arch/amd64/t_ptrace_wait.c   Mon Feb 20 05:47:59 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.20 2017/02/20 05:40:51 kamil Exp $ */
+/*     $NetBSD: t_ptrace_wait.c,v 1.21 2017/02/20 05:47:59 kamil Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.20 2017/02/20 05:40:51 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.21 2017/02/20 05:47:59 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -245,16 +245,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -329,16 +322,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -413,16 +399,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -497,16 +476,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -582,16 +554,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -672,16 +637,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -762,16 +720,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -852,16 +803,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -942,16 +886,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -1038,16 +975,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -1134,16 +1064,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {
@@ -1230,16 +1153,9 @@
 #endif
        struct dbreg r1;
        struct dbreg r2;
-       /* Number of available CPU Debug Registers on AMD64 */
-       const size_t len = 16;
        size_t i;
        int watchme;
 
-       printf("Assert that known number of Debug Registers (%zu) is valid\n",
-           len);
-       ATF_REQUIRE_EQ(__arraycount(r1.dr), len);
-       ATF_REQUIRE_EQ(__arraycount(r2.dr), len);
-
        printf("Before forking process PID=%d\n", getpid());
        ATF_REQUIRE((child = fork()) != -1);
        if (child == 0) {



Home | Main Index | Thread Index | Old Index