#------------------------------------------------------------------------------\r
#*\r
-#* Copyright 2006, Intel Corporation \r
-#* All rights reserved. This program and the accompanying materials \r
+#* Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+#* This program and the accompanying materials \r
#* are licensed and made available under the terms and conditions of the BSD License \r
#* which accompanies this distribution. The full text of the license may be found at \r
#* http://opensource.org/licenses/bsd-license.php \r
#EXTERN ExceptionHandler: NEAR\r
#EXTERN mTimerVector: DWORD\r
\r
- .data\r
- ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
+ .data\r
+ ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
ASM_PFX(mExceptionCodeSize): .long 9\r
\r
- .text\r
- ASM_GLOBAL ASM_PFX(InitDescriptor)\r
+ .text\r
+ ASM_GLOBAL ASM_PFX(InitDescriptor)\r
\r
ASM_PFX(InitDescriptor):\r
movl $GDT_BASE,%eax # EAX=PHYSICAL address of gdt\r
# UINTN Vector,\r
# VOID (*Handler)(VOID)\r
# )\r
- ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
+ ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
ASM_PFX(InstallInterruptHandler):\r
# Vector:DWORD @ 4(%esp)\r
# Handler:DWORD @ 8(%esp)\r
pop %edi\r
ret\r
\r
- .macro JmpCommonIdtEntry\r
+ .macro JmpCommonIdtEntry\r
# jmp commonIdtEntry - this must be hand coded to keep the assembler from\r
# using a 8 bit reletive jump when the entries are\r
# within 255 bytes of the common entry. This must\r
# of entry points...\r
.byte 0xe9 # jmp 16 bit reletive \r
.long commonIdtEntry - . - 4 # offset to jump to\r
- .endm\r
+ .endm\r
\r
.p2align 1\r
- ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
ASM_PFX(SystemExceptionHandler):\r
INT0:\r
pushl $0x0 # push error code place holder on the stack\r
JmpCommonIdtEntry\r
\r
INTUnknown:\r
- .rept (32 - 20)\r
+ # The following segment repeats (32 - 20) times:\r
+ # No. 1\r
pushl $0x0 # push error code place holder on the stack\r
# push xxh # push vector number\r
.byte 0x6a\r
.byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
JmpCommonIdtEntry\r
- .endr\r
+ # No. 2\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 3\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 4\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 5\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 6\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 7\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 8\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 9\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 10\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 11\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+ # No. 12\r
+ pushl $0x0 # push error code place holder on the stack\r
+# push xxh # push vector number\r
+ .byte 0x6a\r
+ .byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
+ JmpCommonIdtEntry\r
+\r
\r
- ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
ASM_PFX(SystemTimerHandler):\r
pushl $0\r
pushl $ASM_PFX(mTimerVector)\r
# data\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
\r
- .data\r
+ .data\r
.p2align 2\r
\r
-gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
+gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
.long 0 # (GDT base gets set above)\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
# global descriptor table (GDT)\r
\r
\r
\r
-idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
+idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
.long 0 # (IDT base gets set above)\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
# interrupt descriptor table (IDT)\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .rept (32 - 20)\r
+ # The following segment repeats (32 - 20) times:\r
+ # No. 1\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 2\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 3\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 4\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 5\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 6\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 7\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 8\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 9\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 10\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 11\r
+ .short 0 # offset 15:0\r
+ .short SYS_CODE_SEL # selector 15:0\r
+ .byte 0 # 0 for interrupt gate\r
+ .byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
+ .short 0 # offset 31:16\r
+ # No. 12\r
.short 0 # offset 15:0\r
.short SYS_CODE_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
- .endr\r
+\r
\r
# 72 unspecified descriptors\r
- .rept 72 * 8\r
- .byte 0\r
- .endr\r
+ .fill 72 * 8, 1, 0\r
\r
# IRQ 0 (System timer) - (INT 0x68)\r
IRQ0_SEL = .-IDT_BASE\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .rept 1 * 8\r
- .byte 0\r
- .endr\r
+ .fill 1 * 8, 1, 0\r
\r
IDT_END:\r
\r