diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/ipxe/src/util/romcheck.pl | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/ipxe/src/util/romcheck.pl')
-rwxr-xr-x | qemu/roms/ipxe/src/util/romcheck.pl | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/qemu/roms/ipxe/src/util/romcheck.pl b/qemu/roms/ipxe/src/util/romcheck.pl deleted file mode 100755 index f47bb07e8..000000000 --- a/qemu/roms/ipxe/src/util/romcheck.pl +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use warnings; - -use constant DEVICES => "/proc/bus/pci/devices"; - -open my $fh, DEVICES - or die "Could not open ".DEVICES.": $!"; - -while ( ( my $line = <$fh> ) ) { - - # Parse line from /proc/bus/pci/devices - chomp $line; - ( my $bus, my $devfn, my $vendor, my $device, my $irq, my $bars, my $lengths, - my $driver ) - = ( $line =~ /^ ([0-9a-f]{2}) ([0-9a-f]{2}) \s+ - ([0-9a-f]{4}) ([0-9a-f]{4}) \s+ ([0-9a-f]+) \s+ - ((?:[0-9a-f]+\s+){7}) ((?:[0-9a-f]+\s+){7}) - (.+)?$/x ) - or die "Invalid line \"".$line."\"\n"; - ( $bus, $devfn, $vendor, $device, $irq ) = - map { hex ( $_ ) } ( $bus, $devfn, $vendor, $device, $irq ); - my $dev = ( $devfn >> 3 ); - my $fn = ( $devfn & 0x7 ); - $bars = [ map { hex ( $_ ) } split ( /\s+/, $bars ) ]; - $lengths = [ map { hex ( $_ ) } split ( /\s+/, $lengths ) ]; - - # Calculate expansion ROM BAR presence and length - my $rom_length = $lengths->[6]; - - # Look for a BAR that could support a .mrom - my $mrom_ok; - if ( $rom_length ) { - for ( my $bar = 0 ; $bar < 7 ; $bar++ ) { - # Skip I/O BARs - next if $bars->[$bar] & 0x01; - # Skip low half of 64-bit BARs - $bar++ if $bars->[$bar] & 0x04; - # Skip 64-bit BARs with high dword set - next if $bars->[$bar] >> 32; - # Skip BARs smaller than the expansion ROM BAR - next if $lengths->[$bar] < $rom_length; - # This BAR is usable! - $mrom_ok = 1; - last; - } - } - - printf "%02x:%02x.%x (%04x:%04x)", $bus, $dev, $fn, $vendor, $device; - printf " supports a %dkB .rom", ( $rom_length / 1024 ) if $rom_length; - printf " or .mrom" if $mrom_ok; - printf "\n"; -} |