utils: add start, stop commands

These scripts issue the proper commands via the /sys interface to
start and stop the EVL core.

Signed-off-by: Philippe Gerum <rpm@xenomai.org>
This commit is contained in:
Philippe Gerum 2021-09-19 12:37:13 +02:00
parent eb605ec762
commit 50d5fb12eb
3 changed files with 62 additions and 0 deletions

View File

@ -11,6 +11,8 @@ COMMANDS = evl
HELPER_SCRIPTS = \
evl-gdb \
evl-help \
evl-start \
evl-stop \
evl-test \
evl-trace \
trace.evl \

30
utils/evl-start Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# SPDX-License-Identifier: MIT
if test \! -w $EVL_SYSDIR/evl/control/state; then
echo >&2 "no EVL core in kernel"
exit 2
fi
usage() {
echo >&2 "usage: $(basename $1)"
}
args=$(getopt -n $(basename $0) '@' "$@")
if [ $? -ne 0 ]; then
usage $0
exit 1
fi
set -- $args
for opt
do
case "$opt" in
-@) echo "start EVL core"
exit 0;;
esac
done
echo start > $EVL_SYSDIR/evl/control/state
exit 0

30
utils/evl-stop Executable file
View File

@ -0,0 +1,30 @@
#! /bin/sh
# SPDX-License-Identifier: MIT
if test \! -w $EVL_SYSDIR/evl/control/state; then
echo >&2 "no EVL core in kernel"
exit 2
fi
usage() {
echo >&2 "usage: $(basename $1)"
}
args=$(getopt -n $(basename $0) '@' "$@")
if [ $? -ne 0 ]; then
usage $0
exit 1
fi
set -- $args
for opt
do
case "$opt" in
-@) echo "stop EVL core"
exit 0;;
esac
done
echo stop > $EVL_SYSDIR/evl/control/state
exit 0