The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/pci/locate.pl

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 #!/usr/bin/perl -w
    2 # $FreeBSD$
    3 
    4 use strict;
    5 
    6 if (!defined($ARGV[0])) {
    7     print(
    8 "
    9 Perl script to convert NCR script address into label+offset.
   10 Useful to find the failed NCR instruction ...
   11 
   12 usage: $0 <address>
   13 ");
   14     exit(1);
   15 }
   16 
   17 my $errpos = hex($ARGV[0])/4;
   18 my $ofs=0;
   19 
   20 open (INPUT, "cc -E ncr.c 2>/dev/null |");
   21 
   22 while ($_ = <INPUT>)
   23 {
   24     last if /^struct script \{/;
   25 }
   26 
   27 while ($_ = <INPUT>)
   28 {
   29     last if /^\}\;/;
   30     my ($label, $size) = /ncrcmd\s+(\S+)\s+\[([^]]+)/;
   31     $size = eval($size);
   32     if (defined($label) && $label) {
   33         if ($errpos) {
   34             if ($ofs + $size > $errpos) {
   35                 printf ("%4x: %s\n", $ofs * 4, $label);
   36                 printf ("%4x: %s + %d\n", $errpos * 4, $label, $errpos - $ofs);
   37                 last;
   38             }
   39             $ofs += $size;
   40         } else {
   41             printf ("%4x: %s\n", $ofs * 4, $label);
   42         }
   43     }
   44 }
   45 

Cache object: 56d872509fe18b1b871c0739e3fe9645


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.