Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2018 18:03:40 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328634 - head/contrib/netbsd-tests/lib/libc/sys
Message-ID:  <201801311803.w0VI3eFV040225@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jan 31 18:03:40 2018
New Revision: 328634
URL: https://svnweb.freebsd.org/changeset/base/328634

Log:
  Update limits on makecontext() arguments in the setcontext_link test.
  
  sparc64 and riscv do not support 10 arguments, but MIPS now does.
  While here, combine clauses for architectures that support the same
  number of arguments to reduce duplication.
  
  Sponsored by:	DARPA / AFRL

Modified:
  head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c

Modified: head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Wed Jan 31 18:02:02 2018	(r328633)
+++ head/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c	Wed Jan 31 18:03:40 2018	(r328634)
@@ -52,12 +52,10 @@ run(int n, ...)
 
 	va_start(va, n);
 #ifdef __FreeBSD__
-#if defined(__amd64__)
+#if defined(__amd64__) || defined(__sparc64__)
 	for (i = 0; i < 5; i++) {
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || defined(__riscv__)
 	for (i = 0; i < 7; i++) {
-#elif defined(__mips__)
-	for (i = 0; i < 5; i++) {
 #else
 	for (i = 0; i < 9; i++) {
 #endif
@@ -121,18 +119,20 @@ ATF_TC_BODY(setcontext_link, tc)
 		uc[i].uc_link = (i > 0) ? &uc[i - 1] : &save;
 
 #ifdef __FreeBSD__
-#if defined(__amd64__)
-		/* FreeBSD/amd64 only permits up to 6 arguments. */
+#if defined(__amd64__) || defined(__sparc64__)
+		/*
+		 * FreeBSD/amd64 and FreeBSD/sparc64 only permit up to
+		 * 6 arguments.
+		 */
 		makecontext(&uc[i], (void *)run, 6, i,
 			0, 1, 2, 3, 4);
-#elif defined(__aarch64__)
-		/* FreeBSD/arm64 only permits up to 8 arguments. */
+#elif defined(__aarch64__) || defined(__riscv__)
+		/*
+		 * FreeBSD/arm64 and FreeBSD/riscv64 only permit up to
+		 * 8 arguments.
+		 */
 		makecontext(&uc[i], (void *)run, 8, i,
 			0, 1, 2, 3, 4, 5, 6);
-#elif defined(__mips__)
-		/* FreeBSD/mips only permits up to 6 arguments. */
-		makecontext(&uc[i], (void *)run, 6, i,
-			0, 1, 2, 3, 4);
 #else
 		makecontext(&uc[i], (void *)run, 10, i,
 			0, 1, 2, 3, 4, 5, 6, 7, 8);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801311803.w0VI3eFV040225>