summaryrefslogtreecommitdiffstats
path: root/dung-3.4.25-m2/common/interrupt-count.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dung-3.4.25-m2/common/interrupt-count.sh')
-rwxr-xr-xdung-3.4.25-m2/common/interrupt-count.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/dung-3.4.25-m2/common/interrupt-count.sh b/dung-3.4.25-m2/common/interrupt-count.sh
new file mode 100755
index 0000000..ab5c16a
--- /dev/null
+++ b/dung-3.4.25-m2/common/interrupt-count.sh
@@ -0,0 +1,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