]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcInt.h
MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcInt.h
index 98ba7e66f34629cb02f2d3691161edb2dff4e583..16f5ed4eb1a516e8e97ac1163c72e7cb55fb9aef 100644 (file)
@@ -3,13 +3,7 @@
   main interpreter routines.\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
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -23,9 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/Ebc.h>\r
 #include <Protocol/EbcVmTest.h>\r
 #include <Protocol/EbcSimpleDebugger.h>\r
+#include <Protocol/PeCoffImageEmulator.h>\r
 \r
 #include <Library/BaseLib.h>\r
+#include <Library/CacheMaintenanceLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/PeCoffLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
@@ -33,13 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 extern VM_CONTEXT                    *mVmPtr;\r
 \r
-//\r
-// Bits of exception flags field of VM context\r
-//\r
-#define EXCEPTION_FLAG_FATAL    0x80000000  // can't continue\r
-#define EXCEPTION_FLAG_ERROR    0x40000000  // bad, but try to continue\r
-#define EXCEPTION_FLAG_WARNING  0x20000000  // harmless problem\r
-#define EXCEPTION_FLAG_NONE     0x00000000  // for normal return\r
 //\r
 // Flags passed to the internal create-thunks function.\r
 //\r
@@ -96,28 +86,6 @@ EbcAddImageThunk (
   IN UINT32          ThunkSize\r
   );\r
 \r
-//\r
-// The interpreter calls these when an exception is detected,\r
-// or as a periodic callback.\r
-//\r
-/**\r
-  The VM interpreter calls this function when an exception is detected.\r
-\r
-  @param  ExceptionType          Specifies the processor exception detected.\r
-  @param  ExceptionFlags         Specifies the exception context.\r
-  @param  VmPtr                  Pointer to a VM context for passing info to the\r
-                                 EFI debugger.\r
-\r
-  @retval EFI_SUCCESS            This function completed successfully.\r
-\r
-**/\r
-EFI_STATUS\r
-EbcDebugSignalException (\r
-  IN EFI_EXCEPTION_TYPE                   ExceptionType,\r
-  IN EXCEPTION_FLAGS                      ExceptionFlags,\r
-  IN VM_CONTEXT                           *VmPtr\r
-  );\r
-\r
 //\r
 // Define a constant of how often to call the debugger periodic callback\r
 // function.\r
@@ -145,21 +113,6 @@ EbcLLGetEbcEntryPoint (
   VOID\r
   );\r
 \r
-/**\r
-  Returns the caller's value of the stack pointer.\r
-\r
-  We adjust it by 4 here because when they called us, the return address\r
-  is put on the stack, thereby lowering it by 4 bytes.\r
-\r
-  @return The current value of the stack pointer for the caller.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-EbcLLGetStackPointer (\r
-  VOID\r
-  );\r
-\r
 /**\r
   This function is called to execute an EBC CALLEX instruction.\r
   This instruction requires that we thunk out to external native\r
@@ -172,8 +125,10 @@ EbcLLGetStackPointer (
   @param  EbcSp        The new EBC stack pointer.\r
   @param  FramePtr     The frame pointer.\r
 \r
+  @return The unmodified value returned by the native code.\r
+\r
 **/\r
-VOID\r
+INT64\r
 EFIAPI\r
 EbcLLCALLEXNative (\r
   IN UINTN        CallAddr,\r
@@ -205,21 +160,6 @@ EbcLLCALLEX (
   IN UINT8        Size\r
   );\r
 \r
-/**\r
-  When EBC calls native, on return the VM has to stuff the return\r
-  value into a VM register. It's assumed here that the value is still\r
-  in the register, so simply return and the caller should get the\r
-  return result properly.\r
-\r
-  @return The unmodified value returned by the native code.\r
-\r
-**/\r
-INT64\r
-EFIAPI\r
-EbcLLGetReturnValue (\r
-  VOID\r
-  );\r
-\r
 /**\r
   Returns the stack index and buffer assosicated with the Handle parameter.\r
 \r
@@ -303,4 +243,18 @@ typedef struct {
       CR(a, EBC_PROTOCOL_PRIVATE_DATA, EbcProtocol, EBC_PROTOCOL_PRIVATE_DATA_SIGNATURE)\r
 \r
 \r
+/**\r
+  Allocates a buffer of type EfiBootServicesCode.\r
+\r
+  @param  AllocationSize        The number of bytes to allocate.\r
+\r
+  @return A pointer to the allocated buffer or NULL if allocation fails.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+EbcAllocatePoolForThunk (\r
+  IN UINTN  AllocationSize\r
+  );\r
+\r
 #endif // #ifndef _EBC_INT_H_\r