X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fintr-stubs.pl;h=6ac5a8df527c2a4f7951774d1af7dfedfbbae439;hb=8c943ff5ffb0121878d1866e56905b9e8be5d95c;hp=45f4fa320de011addd823ec6c354b45d95530ec6;hpb=750d21936d284127e265d050ccbce76fca1ece1a;p=pintos-anon diff --git a/src/threads/intr-stubs.pl b/src/threads/intr-stubs.pl index 45f4fa3..6ac5a8d 100755 --- a/src/threads/intr-stubs.pl +++ b/src/threads/intr-stubs.pl @@ -3,7 +3,8 @@ print <<'EOF'; #include "mmu.h" - .globl intr_stubs + .data +.globl intr_stubs intr_stubs: EOF @@ -11,19 +12,26 @@ for $i (0...255) { $x = sprintf ("%02x", $i); print "\t.long intr${x}_stub\n"; } -print "\n"; + +print <<'EOF'; + + .text +EOF for $i (0...255) { $x = sprintf ("%02x", $i); - print "\t.globl intr${x}_stub\n"; + print ".globl intr${x}_stub\n"; print "intr${x}_stub:\n"; - print "\tpushl \$0\n" if $i != 8 && $i != 10 && $i != 11 && $i != 13 && $i != 14 && $i != 17; + print "\tpushl \$0\n" + if ($i != 8 && $i != 10 && $i != 11 + && $i != 13 && $i != 14 && $i != 17); print "\tpushl \$0x$x\n"; print "\tjmp intr_entry\n"; } print <<'EOF'; intr_entry: + # FIXME: build a fake stack frame to improve backtraces. # Save caller's registers. pushl %ds pushl %es @@ -37,10 +45,12 @@ intr_entry: # Call handler. pushl %esp - .globl intr_handler +.globl intr_handler call intr_handler addl $4, %esp +.globl intr_exit +intr_exit: # Restore caller's registers. popal popl %es