summaryrefslogtreecommitdiff
path: root/programs/calcgoo/calcgoo.in
blob: 0d383d173e6a83bbd0c66d487d4672a14222ba8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl

$MODULE_GOO_LIST="@MODULE_GOO_LIST@";

@goo = split(/\s+/,$MODULE_GOO_LIST);

$sep="(";
$goore=" ";

#print "GOO: ",join('|',@goo),"\n";

foreach $sym (@goo) {
	$goore=${goore}.${sep}.${sym};
	$sep="|";
}
$goore=${goore}.")_R(smp_){0,1}([0-9A-F]{8})";

#print "GOORE: $goore\n";

while(<>) {
  chomp;
  if(/$goore/io) {
    $sym=$1;
    $goosym=$3;
    $bingoo=hex($goosym);
    if($2 eq "smp_") {
      $bingoo++;
    }
    #print STDERR "Processing $goosym (from $_)\n";
    $bingoo{$sym}=$bingoo;
  }
}
$wholegoo=0;
foreach $sym (keys %bingoo) {
  $wholegoo=$wholegoo ^ $bingoo{$sym};
}
print sprintf("%08x", $wholegoo)."\n";

# Local variables::
# mode: perl
# End variables::