summaryrefslogtreecommitdiffstats
path: root/dung-3.4.25-m2/common/interrupt-count.sh
blob: ab5c16abde5ef21ed019a620dcc11cf64eb24860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# count interrupt of device

set -e
#set -x

if [ $# -ne 1 ]; then
        echo "usage: $(basename $0) PATTERN" >& 2
        exit 1
fi

IRQ=""

$(dirname $0)/../common/proc-interrupts.sh "$1" > irq_temp

# Filter interrupt number
read IRQ < irq_temp
IRQ=${IRQ%% [A-Za-z]*}
IRQ=${IRQ#* }
echo $IRQ