X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fthreads%2Fintr-stubs.pl;h=c333260eef7a812e4262e783e968fa0a342fe99c;hb=00bb787f8b81b6ff3664869fbc0073f9b16c7a84;hp=ea20e9668ede5de1669138957c5e205079c6e3f4;hpb=1824e4d39b4f042474d29ac91ee59b326ab00da1;p=pintos-anon diff --git a/src/threads/intr-stubs.pl b/src/threads/intr-stubs.pl index ea20e96..c333260 100755 --- a/src/threads/intr-stubs.pl +++ b/src/threads/intr-stubs.pl @@ -1,9 +1,10 @@ #! /usr/bin/perl print <<'EOF'; -#include "mmu.h" +#include "threads/loader.h" - .globl intr_stubs + .data +.globl intr_stubs intr_stubs: EOF @@ -11,11 +12,15 @@ 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 @@ -26,7 +31,6 @@ for $i (0...255) { print <<'EOF'; intr_entry: - # FIXME: build a fake stack frame to improve backtraces. # Save caller's registers. pushl %ds pushl %es @@ -38,19 +42,20 @@ intr_entry: movl %eax, %ds movl %eax, %es - # Call handler. + # Call interrupt handler. pushl %esp - .globl intr_handler +.globl intr_handler call intr_handler - - .globl intr_exit -intr_exit: addl $4, %esp +.globl intr_exit +intr_exit: # Restore caller's registers. popal popl %es popl %ds addl $8, %esp + + # Return to caller. iret EOF