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