#! /usr/bin/perl
print <<'EOF';
-#include "mmu.h"
+#include "threads/loader.h"
.data
- .globl intr_stubs
+.globl intr_stubs
intr_stubs:
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
print <<'EOF';
intr_entry:
- # FIXME: build a fake stack frame to improve backtraces.
# Save caller's registers.
pushl %ds
pushl %es
movl %eax, %ds
movl %eax, %es
- # Call handler.
+ # Call interrupt handler.
pushl %esp
- .globl intr_handler
+.globl intr_handler
call intr_handler
addl $4, %esp
- .globl intr_exit
+.globl intr_exit
intr_exit:
-
# Restore caller's registers.
popal
popl %es
popl %ds
addl $8, %esp
+
+ # Return to caller.
iret
EOF