OBS-URL: https://build.opensuse.org/package/show/Base:System/procinfo?expand=0&rev=8
61 lines
1.5 KiB
Plaintext
61 lines
1.5 KiB
Plaintext
--- lsdev.pl
|
|
+++ lsdev.pl 2007-04-17 15:21:17.000000000 +0000
|
|
@@ -16,33 +16,42 @@ open (IRQ, "</proc/interrupts") || die "
|
|
while (<IRQ>) {
|
|
next if /^[ \t]*[A-Z]/;
|
|
chop;
|
|
- if (/PIC/) {
|
|
- $n = (@line = split());
|
|
+ s/^ +//g;
|
|
+ if (/-(PIC|edge|level|fasteoi) /) {
|
|
+ $n = (@line = split(/-(PIC|edge|level|fasteoi) /));
|
|
} else {
|
|
$n = (@line = split(' [ +] '));
|
|
}
|
|
$name = $line[$n-1];
|
|
- $device{$name} = $name;
|
|
- @tmp = split(':', $line[0]);
|
|
- $tmp0 = int($tmp[0]);
|
|
- $irq{$name} = "$irq{$name} $tmp0";
|
|
+ foreach $name (split(/,/, $line[$n-1])) {
|
|
+ $name =~ s/^ +//g;
|
|
+ $device{$name} = $name;
|
|
+ @tmp = split(':', $line[0]);
|
|
+ $tmp0 = int($tmp[0]);
|
|
+ $irq{$name} = "$irq{$name} $tmp0";
|
|
+ }
|
|
}
|
|
close (IRQ);
|
|
|
|
-open (DMA, "</proc/dma") || die "can't open /proc/dma";
|
|
-while (<DMA>) {
|
|
- chop;
|
|
- @line = split(': ');
|
|
- @tmp = split (/[ \(]/, $line[1]);
|
|
- $name = $tmp[0];
|
|
- $device{$name} = $name;
|
|
- $dma{$name} = "$dma{$name}$line[0]";
|
|
+# /proc/dma isn't exported for ia64 kernels
|
|
+if ( -r "/proc/dma" ) {
|
|
+ open (DMA, "</proc/dma") || die "can't open /proc/dma";
|
|
+ while (<DMA>) {
|
|
+ chop;
|
|
+ s/^ +//g;
|
|
+ @line = split(': ');
|
|
+ @tmp = split (/[ \(]/, $line[1]);
|
|
+ $name = $tmp[0];
|
|
+ $device{$name} = $name;
|
|
+ $dma{$name} = "$dma{$name}$line[0]";
|
|
+ }
|
|
+ close (DMA);
|
|
}
|
|
-close (DMA);
|
|
|
|
open (IOPORTS, "</proc/ioports") || die "can't open /proc/ioports";
|
|
while (<IOPORTS>) {
|
|
chop;
|
|
+ s/^ +//g;
|
|
@line = split(' : ');
|
|
@tmp = split (/[ \(]/, $line[1]);
|
|
$name = $tmp[0];
|