mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
NMI handler
This commit is contained in:
parent
28b84f39d8
commit
ce8afc3fee
@ -5,11 +5,9 @@ declare nmi
|
||||
|
||||
function checkNMI {
|
||||
|
||||
nmi=$(cat /proc/interrupts | grep NMI)
|
||||
nmi=$(echo "$nmi" | sed 's/[^0-9]*//g')
|
||||
nmi=$(echo "$nmi" | sed 's/^0*//')
|
||||
nmi=$(awk '/NMI/ {for (i=2; i<=NF; i++) if ($i ~ /^[0-9]+$/) {sum+=$i}} END {print sum}' /proc/interrupts)
|
||||
|
||||
if [ "$nmi" != "" ]; then
|
||||
if [ "$nmi" != "" ] && [ "$nmi" -ne "0" ]; then
|
||||
|
||||
echo "Received shutdown request through NMI.." > /dev/ttyS0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user