]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.asm
Enable the 0-31 temporary IDT entries prior to activate the LongMode. If not enable...
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ia32 / IdtVectorAsm.asm
1 ;-------------------------------------------------------------------------------
2 ;
3 ; Copyright (c) 2007, Intel Corporation
4 ; All rights reserved. This program and the accompanying materials
5 ; are licensed and made available under the terms and conditions of the BSD License
6 ; which accompanies this distribution. The full text of the license may be found at
7 ; http://opensource.org/licenses/bsd-license.php
8
9 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 ;
12 ;
13 ; Module Name:
14 ;
15 ; IdtVectorAsm.asm
16 ;
17 ; Abstract:
18 ;
19 ;
20 ;-------------------------------------------------------------------------------
21
22
23 .686p
24 .model flat,C
25 .code
26
27 ;
28 ;------------------------------------------------------------------------------
29 ; Generic IDT Vector Handlers for the Host.
30 ;
31 ;------------------------------------------------------------------------------
32
33 ALIGN 8
34 PUBLIC AsmGetVectorTemplatInfo
35 PUBLIC AsmVectorFixup
36
37 PUBLIC AsmVectorFixup
38
39 @VectorTemplateBase:
40 push eax
41 db 6ah ; push #VectorNumber
42 @VectorNum:
43 db 0
44 mov eax, CommonInterruptEntry
45 jmp eax
46 @VectorTemplateEnd:
47
48
49 AsmGetVectorTemplatInfo PROC
50 mov ecx, [esp + 4]
51 mov [ecx], @VectorTemplateBase
52 mov eax, (@VectorTemplateEnd - @VectorTemplateBase)
53 ret
54 AsmGetVectorTemplatInfo ENDP
55
56
57 AsmVectorFixup PROC
58 mov eax, dword ptr [esp + 8]
59 mov ecx, [esp + 4]
60 mov [ecx + (@VectorNum - @VectorTemplateBase)], al
61 ret
62 AsmVectorFixup ENDP
63
64
65 ;---------------------------------------;
66 ; CommonInterruptEntry ;
67 ;---------------------------------------;
68 ; The follow algorithm is used for the common interrupt routine.
69
70 ;
71 ; +---------------------+ <-- 16-byte aligned ensured by processor
72 ; + Old SS +
73 ; +---------------------+
74 ; + Old RSP +
75 ; +---------------------+
76 ; + RFlags +
77 ; +---------------------+
78 ; + CS +
79 ; +---------------------+
80 ; + RIP +
81 ; +---------------------+
82 ; + Error Code +
83 ; +---------------------+
84 ; + Vector Number +
85 ; +---------------------+
86
87 CommonInterruptEntry PROC
88 cli
89
90 jmp $
91 CommonInterruptEntry ENDP
92
93 END
94
95