]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/DxeExtendedSalLib/Ipf/AsmExtendedSalLib.s
Add ESAL support libraries to MdePkg
[mirror_edk2.git] / MdePkg / Library / DxeExtendedSalLib / Ipf / AsmExtendedSalLib.s
diff --git a/MdePkg/Library/DxeExtendedSalLib/Ipf/AsmExtendedSalLib.s b/MdePkg/Library/DxeExtendedSalLib/Ipf/AsmExtendedSalLib.s
new file mode 100644 (file)
index 0000000..f1c4366
--- /dev/null
@@ -0,0 +1,97 @@
+/// @file\r
+///  Assembly procedures to get and set ESAL entry point.\r
+///\r
+/// Copyright (c) 2006 - 2011, 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
+.auto\r
+.text\r
+\r
+#include  "IpfMacro.i"\r
+\r
+//\r
+// Exports\r
+//\r
+ASM_GLOBAL GetEsalEntryPoint\r
+\r
+//-----------------------------------------------------------------------------\r
+//++\r
+// GetEsalEntryPoint\r
+//\r
+// Return Esal global and PSR register.\r
+//\r
+// On Entry :\r
+//\r
+//\r
+// Return Value:\r
+//        r8  = EFI_SAL_SUCCESS\r
+//        r9  = Physical Plabel\r
+//        r10 = Virtual Plabel\r
+//        r11 = psr\r
+// \r
+// As per static calling conventions. \r
+// \r
+//--\r
+//---------------------------------------------------------------------------\r
+PROCEDURE_ENTRY (GetEsalEntryPoint)\r
+\r
+      NESTED_SETUP (0,8,0,0)\r
+\r
+EsalCalcStart:\r
+      mov   r8  = ip;;\r
+      add   r8  = (EsalEntryPoint - EsalCalcStart), r8;;\r
+      mov   r9  = r8;;\r
+      add   r10 = 0x10, r8;;\r
+      mov   r11 = psr;;\r
+      mov   r8  = r0;;\r
+\r
+      NESTED_RETURN\r
+\r
+PROCEDURE_EXIT (GetEsalEntryPoint)\r
+\r
+//-----------------------------------------------------------------------------\r
+//++\r
+// SetEsalPhysicalEntryPoint\r
+//\r
+// Set the dispatcher entry point\r
+//\r
+// On Entry:\r
+//  in0 = Physical address of Esal Dispatcher\r
+//  in1 = Physical GP\r
+//\r
+// Return Value: \r
+//   r8 = EFI_SAL_SUCCESS\r
+// \r
+// As per static calling conventions. \r
+// \r
+//--\r
+//---------------------------------------------------------------------------\r
+PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint)\r
+\r
+      NESTED_SETUP (2,8,0,0)\r
+\r
+EsalCalcStart1:\r
+      mov   r8   = ip;;\r
+      add   r8   = (EsalEntryPoint - EsalCalcStart1), r8;;\r
+      st8   [r8] = in0;;\r
+      add   r8   = 0x08, r8;;\r
+      st8   [r8] = in1;;\r
+      mov   r8   = r0;;\r
+\r
+      NESTED_RETURN\r
+\r
+PROCEDURE_EXIT (SetEsalPhysicalEntryPoint)\r
+\r
+.align 32\r
+EsalEntryPoint: \r
+    data8 0   // Physical Entry\r
+    data8 0   //         GP\r
+    data8 0   // Virtual Entry\r
+    data8 0   //         GP\r