Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel Prepare t_ptrace_wait.h for hardware watchpoint...



details:   https://anonhg.NetBSD.org/src/rev/d50f6112edb5
branches:  trunk
changeset: 349581:d50f6112edb5
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Dec 15 08:57:24 2016 +0000

description:
Prepare t_ptrace_wait.h for hardware watchpoints API

Add new symbol ATF_TP_ADD_TC_HAVE_PTRACE_WATCHPOINTS() to be protected with
the __HAVE_PTRACE_WATCHPOINTS guard.


XXX:
    Mark check_happy() with __attribute__((optimize("O0"))).
    Disabled optimization is required to make tests for hardware assisted
    traps in .text functional.

    Tested with GCC 5.4 on NetBSD 7.99.47 amd64

Sponsored by <The NetBSD Foundation>

diffstat:

 tests/kernel/t_ptrace_wait.h |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r e2df3d4a8c1c -r d50f6112edb5 tests/kernel/t_ptrace_wait.h
--- a/tests/kernel/t_ptrace_wait.h      Thu Dec 15 07:47:08 2016 +0000
+++ b/tests/kernel/t_ptrace_wait.h      Thu Dec 15 08:57:24 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.h,v 1.2 2016/12/05 20:10:10 christos Exp $       */
+/*     $NetBSD: t_ptrace_wait.h,v 1.3 2016/12/15 08:57:24 kamil Exp $  */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -374,7 +374,13 @@
        return sum;
 }
 
-static int __used
+/*
+ * XXX: Disabled optimization is required to make tests for hardware assisted
+ * traps in .text functional
+ *
+ * Tested with GCC 5.4 on NetBSD 7.99.47 amd64
+ */
+static int __used __attribute__((optimize("O0")))
 check_happy(unsigned n)
 {
        for (;;) {
@@ -418,3 +424,9 @@
 #else
 #define ATF_TP_ADD_TC_PT_STEP(a,b)
 #endif
+
+#if defined(__HAVE_PTRACE_WATCHPOINTS)
+#define ATF_TP_ADD_TC_HAVE_PTRACE_WATCHPOINTS(a,b)     ATF_TP_ADD_TC(a,b)
+#else
+#define ATF_TP_ADD_TC_HAVE_PTRACE_WATCHPOINTS(a,b)
+#endif



Home | Main Index | Thread Index | Old Index