changeset 458:1c767b68d936

add ovly table tag modified
author kono@localhost.localdomain
date Sun, 27 Sep 2009 17:57:33 +0900
parents 611c6f0d94a9
children 01e929f10b96
files TaskManager/kernel/schedule/Scheduler.cc example/get_segment/spe/ovly_table.pl
diffstat 2 files changed, 61 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/schedule/Scheduler.cc	Sat Sep 26 02:55:41 2009 +0900
+++ b/TaskManager/kernel/schedule/Scheduler.cc	Sun Sep 27 17:57:33 2009 +0900
@@ -491,9 +491,10 @@
 uint32
 Scheduler::get_tag()
 {
-    static int tag = 0;
-    tag = tag++ & 0x0f;
-    return tag;
+    static int tag = 16;
+    tag ++;
+    tag &= 0x0f;
+    return tag+16;
 }
 
 /*!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/get_segment/spe/ovly_table.pl	Sun Sep 27 17:57:33 2009 +0900
@@ -0,0 +1,57 @@
+#!/usr/bin/perl
+# //    from readelf -all spu/spe_main
+# //   [12] .data             PROGBITS        00000f20 0011a0 000384 00  WA  0   0 16
+# //      109: 00001260    64 OBJECT  GLOBAL DEFAULT   12 _ovly_table
+
+use strict;
+
+my $debug = 0;
+my $section_header;
+my $symbol_table;
+my %section;
+my %symbol;
+
+
+open(ELF, "readelf -all $ARGV[0] |");
+while(<ELF>) {
+	if(/^Section Headers:/) { $section_header = 1 ; $symbol_table = 0; }
+	elsif(/^Symbol table/) { $section_header = 0 ; $symbol_table = 1; }
+	elsif(/^[A-Z]/) { $section_header = 0 ; $symbol_table = 0; }
+        if ($section_header) {
+		if (/\[\s*(\d+)\]\s+(\.\w+)\s+(\w+)\s+([\da-f]+)\s+([\da-f]+)\s+([\da-f]+)\s/) {
+		$section{$1} = {nr=>$1,name=>$2,type=>$3,addr=>$4,offset=>$5,size=>$6};
+		}
+        }
+        if ($symbol_table) {
+		if(/^\s+(\d+):\s([\da-f]+)\s+([\da-f]+)\s+(\w+)\s+(\w+)\s+(\w+)\s+(\w+)\s+([\w\.\_]+)/) {
+		$symbol{$8} = {num=>$1,value=>$2,size=>$3,type=>$4,bind=>$5,vis=>$6,ndx=>$7,name=>$8};
+		}
+	}
+
+}
+
+if ($debug) {
+	print "seciton:\n";
+	foreach my $key ( keys %section) {
+	    foreach my $i ( keys %{$section{$key}}) {
+	       print "$i=>$section{$key}->{$i} ";
+	    }
+	    print "\n";
+	}
+
+	print "symbol:\n";
+	foreach my $key ( keys %symbol) {
+	    foreach my $i ( keys %{$symbol{$key}}) {
+	       print "$i=>$symbol{$key}->{$i} ";
+	    }
+	    print "\n";
+	}
+}
+
+my $ovly_table = $symbol{'_ovly_table'};
+my $ovly_sec = $section{$ovly_table->{'ndx'}};
+
+print "#define ovly_table_offset (0x$ovly_sec->{'offset'}+0x$ovly_table->{'value'}-0x$ovly_sec->{'addr'})\n";
+print "#define ovly_table_size ($ovly_table->{'size'}/16)\n";
+
+