From 68e709cb296e23b3c827e705d6328cd2261a1d71 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 31 Jan 2018 18:03:40 +0000 Subject: [PATCH] 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 --- .../netbsd-tests/lib/libc/sys/t_getcontext.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c index 102c79fc787..39f5f18c2c7 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c @@ -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);