uti: futex call function in mcctrl

Previously, futex code of McKerenl was called by mccontrol,
but there ware some problems with this method.
(Mainly, location of McKernel image on memory)

Call futex code in mcctrl instead of the one in McKernel image,
giving the following benefits:
1. Not relying on shared kernel virtual address space with Linux any more
2. The cpu id store / retrieve is not needed and resulting in the code

Change-Id: Ic40929b64a655b270c435859fa287fedb713ee5c
refe: #1428
This commit is contained in:
Ken Sato
2020-09-18 14:42:26 +09:00
committed by Masamichi Takagi
parent 35296c8210
commit a9973e913d
62 changed files with 4320 additions and 1116 deletions

87
test/issues/1428/C1428.sh Executable file
View File

@ -0,0 +1,87 @@
#/bin/sh
USELTP=1
USEOSTEST=0
. ../../common.sh
issue="1428"
tid=01
arch="`uname -p`"
if [ "${arch}" == "x86_64" ]; then
UTI_TEST_DIR="../../uti"
elif [ "${arch}" == "aarch64" ]; then
UTI_TEST_DIR="../../uti/arm64"
else
echo "Error: ${arch} is unexpected arch"
exit 1
fi
# make uti test
pushd ${UTI_TEST_DIR}
make
popd
for tno in `seq 12 20`
do
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
sudo ${MCEXEC} --enable-uti ${UTI_TEST_DIR}/CT${tno} 2>&1 | tee ./${tname}.txt
rc=$?
ngs=`grep "NG" ./${tname}.txt | wc -l`
if [ ${ngs} -eq 0 ]; then
echo "*** ${tname} PASSED ******************************"
else
echo "*** ${tname} FAILED ******************************"
fi
let tid++
echo ""
done
echo "*** Stop mckernel to exec CT31-34 on Linux"
mcstop
for tno in `seq 31 34`
do
sudo ${UTI_TEST_DIR}/CT${tno} -l &> ./lnx_CT${tno}.txt
done
echo "*** Boot mckernel"
mcreboot
echo ""
for tno in `seq 31 34`
do
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
sudo ${MCEXEC} --enable-uti ${UTI_TEST_DIR}/CT${tno} 2>&1 | tee ./${tname}.txt
rc=$?
ngs=`grep "NG" ./${tname}.txt | wc -l`
echo "** Result on Linux **"
grep "waiter" ./lnx_CT${tno}.txt
if [ ${ngs} -eq 0 ]; then
echo "*** ${tname} PASSED ******************************"
else
echo "*** ${tname} FAILED ******************************"
fi
let tid++
echo ""
done
for tp in futex_wait01 futex_wait02 futex_wait03 futex_wait04 futex_wait_bitset01 futex_wait_bitset02 futex_wake01 futex_wake02 futex_wake03
do
tname=`printf "C${issue}T%02d" ${tid}`
echo "*** ${tname} start *******************************"
sudo $MCEXEC $LTPBIN/$tp 2>&1 | tee $tp.txt
ok=`grep PASS $tp.txt | wc -l`
ng=`grep FAIL $tp.txt | wc -l`
if [ $ng = 0 ]; then
echo "*** ${tname} PASSED ($ok)"
else
echo "*** ${tname} FAILED (ok=$ok ng=$ng)"
fi
let tid++
echo ""
done