]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg DxeIplPeim: Convert Ia32/IdtVectorAsm.asm to NASM
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 31 Oct 2014 08:18:48 +0000 (01:18 -0700)
committerLiming Gao <liming.gao@intel.com>
Tue, 28 Jun 2016 01:51:55 +0000 (09:51 +0800)
The BaseTools/Scripts/ConvertMasmToNasm.py script was used to convert
Ia32/IdtVectorAsm.asm to Ia32/IdtVectorAsm.nasm

Note: Manually updated code storing @VectorTemplateBase address

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.nasm [new file with mode: 0644]

index 79f70d1a7c3c665e90bcafceb095d09e30194dc4..6275ccebbd8853e15a1727f466edd2d2e031f88a 100644 (file)
@@ -40,6 +40,7 @@
   X64/VirtualMemory.h  ||||gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
   X64/VirtualMemory.c  ||||gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
   Ia32/DxeLoadFunc.c\r
+  Ia32/IdtVectorAsm.nasm||||gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
   Ia32/IdtVectorAsm.asm||||gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
   Ia32/IdtVectorAsm.S  ||||gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode\r
 \r
diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.nasm b/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.nasm
new file mode 100644 (file)
index 0000000..99a0bbe
--- /dev/null
@@ -0,0 +1,77 @@
+;/** @file\r
+;\r
+;    IDT vector entry.\r
+;\r
+;  Copyright (c) 2007 - 2016, 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
+;\r
+;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;**/\r
+\r
+    SECTION .text\r
+\r
+;\r
+;------------------------------------------------------------------------------\r
+;  Generic IDT Vector Handlers for the Host.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+ALIGN   8\r
+global ASM_PFX(AsmGetVectorTemplatInfo)\r
+global ASM_PFX(AsmVectorFixup)\r
+\r
+@VectorTemplateBase:\r
+        push  eax\r
+        db    0x6a       ; push #VectorNumber\r
+@VectorNum:\r
+        db    0\r
+        mov   eax, CommonInterruptEntry\r
+        jmp   eax\r
+@VectorTemplateEnd:\r
+\r
+global ASM_PFX(AsmGetVectorTemplatInfo)\r
+ASM_PFX(AsmGetVectorTemplatInfo):\r
+        mov   ecx, [esp + 4]\r
+        mov   dword [ecx], @VectorTemplateBase\r
+        mov   eax, (@VectorTemplateEnd - @VectorTemplateBase)\r
+        ret\r
+\r
+global ASM_PFX(AsmVectorFixup)\r
+ASM_PFX(AsmVectorFixup):\r
+        mov   eax, dword [esp + 8]\r
+        mov   ecx, [esp + 4]\r
+        mov   [ecx + (@VectorNum - @VectorTemplateBase)], al\r
+        ret\r
+\r
+;---------------------------------------;\r
+; CommonInterruptEntry                  ;\r
+;---------------------------------------;\r
+; The follow algorithm is used for the common interrupt routine.\r
+\r
+;\r
+; +---------------------+ <-- 16-byte aligned ensured by processor\r
+; +    Old SS           +\r
+; +---------------------+\r
+; +    Old RSP          +\r
+; +---------------------+\r
+; +    RFlags           +\r
+; +---------------------+\r
+; +    CS               +\r
+; +---------------------+\r
+; +    RIP              +\r
+; +---------------------+\r
+; +    Error Code       +\r
+; +---------------------+\r
+; +    Vector Number    +\r
+; +---------------------+\r
+\r
+CommonInterruptEntry:\r
+  cli\r
+\r
+  jmp $\r
+\r