freebsd-src/tests/sys/compat32/aarch64/swp_test.sh
Kyle Evans ccb59683b9 arm64: add tests for swp/swpb emulation
One test is suitable to be hooked up to the build, so I've done this
here.  The other test lives in tools/regression because failure is a
bit more subjective -- generally, one runs it for some unbounded amount
of time and observe if it eventually exits because two threads acquired
the same mutex.

Reviewed by:	imp, mmel
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D39668
2023-05-15 10:42:16 -05:00

15 lines
391 B
Bash

#!/bin/sh
scriptdir=$(dirname $(realpath "$0"))
. ${scriptdir}/common.sh
# Ensure emul_swp is enabled just for this test; we'll turn it back off if
# it wasn't enabled before the test.
emul_swpval=$(sysctl -n compat.arm.emul_swp)
sysctl compat.arm.emul_swp=1 >/dev/null
${scriptdir}/swp_test_impl
if [ "$emul_swpval" -ne 1 ]; then
sysctl compat.arm.emul_swp="$emul_swpval" >/dev/null
fi