]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/X64/EbcSupport.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / X64 / EbcSupport.c
index 3f99a1a6e296776bd18999c3697d97960a9539c3..15429209e56f4c895bb0c353e197ed814c88bddd 100644 (file)
@@ -2,7 +2,7 @@
   This module contains EBC support routines that are customized based on\r
   the target x64 processor.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
@@ -15,6 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "EbcInt.h"\r
 #include "EbcExecute.h"\r
+#include "EbcDebuggerHook.h"\r
 \r
 //\r
 // NOTE: This is the stack size allocated for the interpreter\r
@@ -43,7 +44,7 @@ UINT8  mInstructionBufferTemplate[] = {
   // These 8 bytes of the thunk entry is the address of the EBC\r
   // entry point.\r
   //\r
-  0x49, 0xBA, \r
+  0x49, 0xBA,\r
     (UINT8)(EBC_ENTRYPOINT_SIGNATURE & 0xFF),\r
     (UINT8)((EBC_ENTRYPOINT_SIGNATURE >> 8) & 0xFF),\r
     (UINT8)((EBC_ENTRYPOINT_SIGNATURE >> 16) & 0xFF),\r
@@ -215,7 +216,7 @@ EbcInterpret (
   //\r
   // Align the stack on a natural boundary.\r
   //\r
-  VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);\r
+  VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof (UINTN) - 1);\r
 \r
   //\r
   // Put a magic value in the stack gap, then adjust down again.\r
@@ -278,10 +279,11 @@ EbcInterpret (
   //\r
   // Begin executing the EBC code\r
   //\r
+  EbcDebuggerHookEbcInterpret (&VmContext);\r
   EbcExecute (&VmContext);\r
 \r
   //\r
-  // Return the value in R[7] unless there was an error\r
+  // Return the value in Gpr[7] unless there was an error\r
   //\r
   ReturnEBCStack(StackIndex);\r
   return (UINT64) VmContext.Gpr[7];\r
@@ -359,7 +361,7 @@ ExecuteEbcImageEntryPoint (
 \r
   //\r
   // Align the stack on a natural boundary\r
-  VmContext.Gpr[0] &= ~(sizeof(UINTN) - 1);\r
+  VmContext.Gpr[0] &= ~(VM_REGISTER)(sizeof(UINTN) - 1);\r
   //\r
   VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
 \r
@@ -389,10 +391,11 @@ ExecuteEbcImageEntryPoint (
   //\r
   // Begin executing the EBC code\r
   //\r
+  EbcDebuggerHookExecuteEbcImageEntryPoint (&VmContext);\r
   EbcExecute (&VmContext);\r
 \r
   //\r
-  // Return the value in R[7] unless there was an error\r
+  // Return the value in Gpr[7] unless there was an error\r
   //\r
   ReturnEBCStack(StackIndex);\r
   return (UINT64) VmContext.Gpr[7];\r
@@ -438,7 +441,7 @@ EbcCreateThunks (
 \r
   ThunkSize = sizeof(mInstructionBufferTemplate);\r
 \r
-  Ptr = AllocatePool (sizeof(mInstructionBufferTemplate));\r
+  Ptr = EbcAllocatePoolForThunk (sizeof(mInstructionBufferTemplate));\r
 \r
   if (Ptr == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r