X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Fintr-stubs.pl;h=a5ad9b0514bd251f5aec0ab9222d659c503a9c64;hb=7d4e3dda080a47db88616f1c0d975f2091be47f1;hp=d9e0dd35508fee62e9d3f8b758525bf4855c82c6;hpb=c9c283cb3e26a5b6d918ee47dcf8efe28522b18d;p=pintos-anon diff --git a/src/threads/intr-stubs.pl b/src/threads/intr-stubs.pl index d9e0dd3..a5ad9b0 100755 --- a/src/threads/intr-stubs.pl +++ b/src/threads/intr-stubs.pl @@ -1,9 +1,10 @@ #! /usr/bin/perl print <<'EOF'; -#include "gdt.h" +#include "threads/loader.h" .data + .intel_syntax noprefix .globl intr_stubs intr_stubs: EOF @@ -22,38 +23,40 @@ for $i (0...255) { $x = sprintf ("%02x", $i); print ".globl intr${x}_stub\n"; print "intr${x}_stub:\n"; - print "\tpushl \$0\n" + print "\tpush 0\n" if ($i != 8 && $i != 10 && $i != 11 && $i != 13 && $i != 14 && $i != 17); - print "\tpushl \$0x$x\n"; + print "\tpush 0x$x\n"; print "\tjmp intr_entry\n"; } print <<'EOF'; intr_entry: # Save caller's registers. - pushl %ds - pushl %es - pushal + push ds + push es + pusha # Set up kernel environment. cld - movl $SEL_KDSEG, %eax - movl %eax, %ds - movl %eax, %es + mov eax, SEL_KDSEG + mov ds, eax + mov es, eax - # Call handler. - pushl %esp + # Call interrupt handler. + push esp .globl intr_handler call intr_handler - addl $4, %esp + add esp, 4 .globl intr_exit intr_exit: # Restore caller's registers. - popal - popl %es - popl %ds - addl $8, %esp + popa + pop es + pop ds + add esp, 8 + + # Return to caller. iret EOF