mirror of
https://github.com/speed47/spectre-meltdown-checker
synced 2025-01-05 02:48:41 +01:00
chore: adjust some comments, add 2 missing inits
This commit is contained in:
parent
4747b932e7
commit
92d59cbdc1
@ -150,12 +150,12 @@ if which printf >/dev/null 2>&1; then
|
|||||||
elif which echo >/dev/null 2>&1; then
|
elif which echo >/dev/null 2>&1; then
|
||||||
echo_cmd=$(which echo)
|
echo_cmd=$(which echo)
|
||||||
else
|
else
|
||||||
# which command is broken?
|
# maybe the `which` command is broken?
|
||||||
[ -x /bin/echo ] && echo_cmd=/bin/echo
|
[ -x /bin/echo ] && echo_cmd=/bin/echo
|
||||||
# for Android
|
# for Android
|
||||||
[ -x /system/bin/echo ] && echo_cmd=/system/bin/echo
|
[ -x /system/bin/echo ] && echo_cmd=/system/bin/echo
|
||||||
fi
|
fi
|
||||||
# still empty ? fallback to builtin
|
# still empty? fallback to builtin
|
||||||
[ -z "$echo_cmd" ] && echo_cmd=echo
|
[ -z "$echo_cmd" ] && echo_cmd=echo
|
||||||
__echo()
|
__echo()
|
||||||
{
|
{
|
||||||
@ -245,15 +245,13 @@ is_cpu_vulnerable_cached=0
|
|||||||
_is_cpu_vulnerable_cached()
|
_is_cpu_vulnerable_cached()
|
||||||
{
|
{
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
{
|
||||||
[ "$1" = 1 ] && return $variant1
|
[ "$1" = 1 ] && return $variant1
|
||||||
# shellcheck disable=SC2086
|
|
||||||
[ "$1" = 2 ] && return $variant2
|
[ "$1" = 2 ] && return $variant2
|
||||||
# shellcheck disable=SC2086
|
|
||||||
[ "$1" = 3 ] && return $variant3
|
[ "$1" = 3 ] && return $variant3
|
||||||
# shellcheck disable=SC2086
|
|
||||||
[ "$1" = 3a ] && return $variant3a
|
[ "$1" = 3a ] && return $variant3a
|
||||||
# shellcheck disable=SC2086
|
|
||||||
[ "$1" = 4 ] && return $variant4
|
[ "$1" = 4 ] && return $variant4
|
||||||
|
}
|
||||||
echo "$0: error: invalid variant '$1' passed to is_cpu_vulnerable()" >&2
|
echo "$0: error: invalid variant '$1' passed to is_cpu_vulnerable()" >&2
|
||||||
exit 255
|
exit 255
|
||||||
}
|
}
|
||||||
@ -889,9 +887,7 @@ load_cpuid()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
{
|
|
||||||
EAX=1; EBX=2; ECX=3; EDX=4;
|
EAX=1; EBX=2; ECX=3; EDX=4;
|
||||||
}
|
|
||||||
read_cpuid()
|
read_cpuid()
|
||||||
{
|
{
|
||||||
# leaf is the value of the eax register when calling the cpuid instruction:
|
# leaf is the value of the eax register when calling the cpuid instruction:
|
||||||
@ -1258,6 +1254,8 @@ if [ "$opt_hw_only" = 1 ]; then
|
|||||||
opt_variant1=0
|
opt_variant1=0
|
||||||
opt_variant2=0
|
opt_variant2=0
|
||||||
opt_variant3=0
|
opt_variant3=0
|
||||||
|
opt_variant3a=0
|
||||||
|
opt_variant4=0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user