Module Name: src Committed By: kamil Date: Thu Dec 15 08:57:24 UTC 2016
Modified Files: src/tests/kernel: t_ptrace_wait.h Log Message: 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> To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/kernel/t_ptrace_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/kernel/t_ptrace_wait.h diff -u src/tests/kernel/t_ptrace_wait.h:1.2 src/tests/kernel/t_ptrace_wait.h:1.3 --- src/tests/kernel/t_ptrace_wait.h:1.2 Mon Dec 5 20:10:10 2016 +++ src/tests/kernel/t_ptrace_wait.h Thu Dec 15 08:57:24 2016 @@ -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 @@ dsum(unsigned n) 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 @@ check_happy(unsigned n) #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