]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: Support building OVMF's ResetVector during the EDK II build
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 18 Aug 2014 23:03:53 +0000 (23:03 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 18 Aug 2014 23:03:53 +0000 (23:03 +0000)
Using NASM we build OVMF's ResetVector as part of the EDK II build
process.

v2:
 * Use EDK II extension of .nasmb rather than .nasmbin

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15823 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/ResetVector/ResetVector.inf [new file with mode: 0644]
OvmfPkg/ResetVector/ResetVector.nasmb [new file with mode: 0644]

diff --git a/OvmfPkg/ResetVector/ResetVector.inf b/OvmfPkg/ResetVector/ResetVector.inf
new file mode 100644 (file)
index 0000000..46610d2
--- /dev/null
@@ -0,0 +1,37 @@
+## @file\r
+#  Reset Vector\r
+#\r
+#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#\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
+#  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
+[Defines]\r
+  INF_VERSION                    = 0x00010005\r
+  BASE_NAME                      = ResetVector\r
+  FILE_GUID                      = 1BA0062E-C779-4582-8566-336AE8F78F09\r
+  MODULE_TYPE                    = SEC\r
+  VERSION_STRING                 = 1.1\r
+\r
+#\r
+# The following information is for reference only and not required by the build tools.\r
+#\r
+#  VALID_ARCHITECTURES           = IA32 X64\r
+#\r
+\r
+[Sources]\r
+  ResetVector.nasmb\r
+\r
+[Packages]\r
+  MdePkg/MdePkg.dec\r
+  UefiCpuPkg/UefiCpuPkg.dec\r
+\r
+[BuildOptions]\r
+   *_*_IA32_NASMB_FLAGS = -I$(WORKSPACE)/UefiCpuPkg/ResetVector/Vtf0/\r
+   *_*_X64_NASMB_FLAGS = -I$(WORKSPACE)/UefiCpuPkg/ResetVector/Vtf0/\r
diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
new file mode 100644 (file)
index 0000000..31ac06a
--- /dev/null
@@ -0,0 +1,66 @@
+;------------------------------------------------------------------------------\r
+; @file\r
+; This file includes all other code files to assemble the reset vector code\r
+;\r
+; Copyright (c) 2008 - 2013, 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
+;\r
+; If neither ARCH_IA32 nor ARCH_X64 are defined, then try to include\r
+; Base.h to use the C pre-processor to determine the architecture.\r
+;\r
+%ifndef ARCH_IA32\r
+  %ifndef ARCH_X64\r
+    #include <Base.h>\r
+    #if defined (MDE_CPU_IA32)\r
+      %define ARCH_IA32\r
+    #elif defined (MDE_CPU_X64)\r
+      %define ARCH_X64\r
+    #endif\r
+  %endif\r
+%endif\r
+\r
+%ifdef ARCH_IA32\r
+  %ifdef ARCH_X64\r
+    %error "Only one of ARCH_IA32 or ARCH_X64 can be defined."\r
+  %endif\r
+%elifdef ARCH_X64\r
+%else\r
+  %error "Either ARCH_IA32 or ARCH_X64 must be defined."\r
+%endif\r
+\r
+%include "CommonMacros.inc"\r
+\r
+%include "PostCodes.inc"\r
+\r
+%ifdef DEBUG_PORT80\r
+  %include "Port80Debug.asm"\r
+%elifdef DEBUG_SERIAL\r
+  %include "SerialDebug.asm"\r
+%else\r
+  %include "DebugDisabled.asm"\r
+%endif\r
+\r
+%include "Ia32/SearchForBfvBase.asm"\r
+%include "Ia32/SearchForSecEntry.asm"\r
+\r
+%ifdef ARCH_X64\r
+%include "Ia32/Flat32ToFlat64.asm"\r
+%include "Ia32/PageTables64.asm"\r
+%endif\r
+\r
+%include "Ia16/Real16ToFlat32.asm"\r
+%include "Ia16/Init16.asm"\r
+\r
+%include "Main.asm"\r
+\r
+%include "Ia16/ResetVectorVtf0.asm"\r
+\r