]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/AsmEsalServiceLib.s
Add DxeDebugLibSerialPort that provides a debug library that layers directly on top...
[mirror_edk2.git] / EdkModulePkg / Library / EdkDxeRuntimeSalLib / Ipf / AsmEsalServiceLib.s
diff --git a/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/AsmEsalServiceLib.s b/EdkModulePkg/Library/EdkDxeRuntimeSalLib/Ipf/AsmEsalServiceLib.s
new file mode 100644 (file)
index 0000000..c5cb881
--- /dev/null
@@ -0,0 +1,149 @@
+//++\r
+// Copyright (c) 2006, Intel Corporation                                                         \r
+// All rights reserved. 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
+//  Module Name:\r
+//\r
+//    EsalLib.s\r
+//\r
+//  Abstract:\r
+//\r
+//\r
+// Revision History:\r
+//\r
+//--\r
+\r
+.file  "EsalLib.s"\r
+\r
+#include  "IpfMacro.i"\r
+\r
+//\r
+// Exports\r
+//\r
+.globl GetEsalEntryPoint\r
+\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
+\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
+\r
+//-----------------------------------------------------------------------------\r
+//++\r
+// SetEsalVirtualEntryPoint\r
+//\r
+// Register physical address of Esal globals.\r
+//\r
+// On Entry :\r
+//  in0 = Virtual address of Esal Dispatcher\r
+//  in1 = Virtual GP\r
+//\r
+// Return Value: \r
+//  r8 = EFI_SAL_ERROR\r
+// \r
+// As per static calling conventions. \r
+// \r
+//--\r
+//---------------------------------------------------------------------------\r
+PROCEDURE_ENTRY (SetEsalVirtualEntryPoint)\r
+\r
+      NESTED_SETUP (2,8,0,0)\r
+\r
+EsalCalcStart2:\r
+      mov   r8   = ip;;\r
+      add   r8   = (EsalEntryPoint - EsalCalcStart2), r8;;\r
+      add   r8   = 0x10, 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 (SetEsalVirtualEntryPoint)\r
+\r
+\r
+\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
+\r
+\r