~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/firmware/rombios/makesym.perl

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#
 
3
# $Id: makesym.perl,v 1.1 2002/11/24 22:45:40 bdenney Exp $
 
4
#
 
5
# Read output file from as86 (e.g. rombios.txt) and write out a symbol 
 
6
# table suitable for the Bochs debugger.
 
7
#
 
8
 
 
9
$WHERE_BEFORE_SYM_TABLE = 0;
 
10
$WHERE_IN_SYM_TABLE = 1;
 
11
$WHERE_AFTER_SYM_TABLE = 2;
 
12
 
 
13
$where = $WHERE_BEFORE_SYM_TABLE;
 
14
while (<STDIN>) {
 
15
  chop;
 
16
  if ($where == WHERE_BEFORE_SYM_TABLE && /^Symbols:/) {
 
17
    $where = $WHERE_IN_SYM_TABLE;
 
18
  } elsif ($where == $WHERE_IN_SYM_TABLE && /^$/) {
 
19
    $where = $WHERE_AFTER_SYM_TABLE;
 
20
  }
 
21
  if ($where == $WHERE_IN_SYM_TABLE) {
 
22
    @F = split (/\s+/);
 
23
    ($name[0], $junk, $addr[0], $junk, $name[1], $junk, $addr[1]) = @F;
 
24
    foreach $col (0,1) {
 
25
      next if length $addr[$col] < 1;
 
26
      $addr[$col] =~ tr/A-Z/a-z/;
 
27
      $addr[$col] = "000f" . $addr[$col];
 
28
      print "$addr[$col] $name[$col]\n";
 
29
    }
 
30
  }
 
31
}