Fix IDT limit.

svn path=/trunk/; revision=42566
This commit is contained in:
Dmitry Gorbachev 2009-08-09 14:40:05 +00:00
parent 46ad3be153
commit 5f73e1c2bc
2 changed files with 20 additions and 20 deletions

View file

@ -27,91 +27,91 @@
.p2align 2 /* force 4-byte alignment */
EXTERN(i386idt)
/* Exception 0 - Divide By Zero */
.word i386DivideByZero /* Offset 0 - 15 */
.word i386DivideByZero /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Flags, Zero Byte */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 1 - Debug Exception */
.word i386DebugException /* Offset 0 - 15 */
.word i386DebugException /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 2 - NMI */
.word i386NMIException /* Offset 0 - 15 */
.word i386NMIException /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 3 - Breakpoint (INT 3) */
.word i386Breakpoint /* Offset 0 - 15 */
.word i386Breakpoint /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 4 - Overflow (INTO with EFLAGS[OF] set) */
.word i386Overflow /* Offset 0 - 15 */
.word i386Overflow /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 5 - Bound Exception */
.word i386BoundException /* Offset 0 - 15 */
.word i386BoundException /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 6 - Invalid Opcode */
.word i386InvalidOpcode /* Offset 0 - 15 */
.word i386InvalidOpcode /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 7 - FPU Not Available */
.word i386FPUNotAvailable /* Offset 0 - 15 */
.word i386FPUNotAvailable /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 8 - Double Fault */
.word i386DoubleFault /* Offset 0 - 15 */
.word i386DoubleFault /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 9 - Coprocessor Segment Overrun */
.word i386CoprocessorSegment /* Offset 0 - 15 */
.word i386CoprocessorSegment /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 10 (0x0A) - Invalid TSS */
.word i386InvalidTSS /* Offset 0 - 15 */
.word i386InvalidTSS /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 11 (0x0B) - Segment Not Present */
.word i386SegmentNotPresent /* Offset 0 - 15 */
.word i386SegmentNotPresent /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 12 (0x0C) - Stack Exception */
.word i386StackException /* Offset 0 - 15 */
.word i386StackException /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 13 (0x0D) - General Protection Fault */
.word i386GeneralProtectionFault /* Offset 0 - 15 */
.word i386GeneralProtectionFault /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 14 (0x0E) - Page Fault */
.word i386PageFault /* Offset 0 - 15 */
.word i386PageFault /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
@ -123,19 +123,19 @@ EXTERN(i386idt)
.word 0x0000 /* Offset 16 - 31 */
/* Exception 16 (0x10) - Coprocessor Error */
.word i386CoprocessorError /* Offset 0 - 15 */
.word i386CoprocessorError /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 17 (0x11) - Alignment Check */
.word i386AlignmentCheck /* Offset 0 - 15 */
.word i386AlignmentCheck /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
/* Exception 18 (0x12) - Machine Check */
.word i386MachineCheck /* Offset 0 - 15 */
.word i386MachineCheck /* Offset 0 - 15 */
.word 0x0008 /* Selector */
.word 0x8e00 /* Zero byte, flags */
.word 0x0000 /* Offset 16 - 31 */
@ -220,5 +220,5 @@ EXTERN(i386idt)
/* IDT table pointer */
EXTERN(i386idtptr)
.word (i386idtptr-i386idt) /* Limit */
.word (i386idtptr - i386idt - 1) /* Limit */
.long i386idt /* Base Address */

View file

@ -912,7 +912,7 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss)
//
// Copy the old IDT
RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit);
RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit + 1);
// Mask interrupts
//asm("cli\n"); // they are already masked before enabling paged mode