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