]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/X64/EbcSupport.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / X64 / EbcSupport.c
index 3f84bcc49633e9047ba7e3ce79d70538baa059c7..5266122b76608855eab192463686d4c2a94197c2 100644 (file)
@@ -2,8 +2,8 @@
   This module contains EBC support routines that are customized based on\r
   the target x64 processor.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, 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
@@ -45,8 +45,8 @@ PushU64 (
   // Advance the VM stack down, and then copy the argument to the stack.\r
   // Hope it's aligned.\r
   //\r
-  VmPtr->R[0] -= sizeof (UINT64);\r
-  *(UINT64 *) VmPtr->R[0] = Arg;\r
+  VmPtr->Gpr[0] -= sizeof (UINT64);\r
+  *(UINT64 *) VmPtr->Gpr[0] = Arg;\r
   return;\r
 }\r
 \r
@@ -140,25 +140,25 @@ EbcInterpret (
     return Status;\r
   }\r
   VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
-  VmContext.R[0] = (UINT64) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
-  VmContext.HighStackBottom = (UINTN) VmContext.R[0];\r
-  VmContext.R[0] -= sizeof (UINTN);\r
+  VmContext.Gpr[0] = (UINT64) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
+  VmContext.HighStackBottom = (UINTN) VmContext.Gpr[0];\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
 \r
   //\r
   // Align the stack on a natural boundary.\r
   //\r
-  VmContext.R[0] &= ~(sizeof (UINTN) - 1);\r
+  VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);\r
 \r
   //\r
   // Put a magic value in the stack gap, then adjust down again.\r
   //\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) VM_STACK_KEY_VALUE;\r
-  VmContext.StackMagicPtr             = (UINTN *) (UINTN) VmContext.R[0];\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) VM_STACK_KEY_VALUE;\r
+  VmContext.StackMagicPtr             = (UINTN *) (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // The stack upper to LowStackTop is belong to the VM.\r
   //\r
-  VmContext.LowStackTop   = (UINTN) VmContext.R[0];\r
+  VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // For the worst case, assume there are 4 arguments passed in registers, store\r
@@ -191,7 +191,7 @@ EbcInterpret (
   //\r
   // For x64, this is where we say our return address is\r
   //\r
-  VmContext.StackRetAddr  = (UINT64) VmContext.R[0];\r
+  VmContext.StackRetAddr  = (UINT64) VmContext.Gpr[0];\r
 \r
   //\r
   // We need to keep track of where the EBC stack starts. This way, if the EBC\r
@@ -216,7 +216,7 @@ EbcInterpret (
   // Return the value in R[7] unless there was an error\r
   //\r
   ReturnEBCStack(StackIndex);\r
-  return (UINT64) VmContext.R[7];\r
+  return (UINT64) VmContext.Gpr[7];\r
 }\r
 \r
 \r
@@ -280,22 +280,22 @@ ExecuteEbcImageEntryPoint (
     return Status;\r
   }\r
   VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
-  VmContext.R[0] = (UINT64) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
-  VmContext.HighStackBottom = (UINTN) VmContext.R[0];\r
-  VmContext.R[0] -= sizeof (UINTN);\r
+  VmContext.Gpr[0] = (UINT64) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
+  VmContext.HighStackBottom = (UINTN) VmContext.Gpr[0];\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
 \r
 \r
   //\r
   // Put a magic value in the stack gap, then adjust down again\r
   //\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) VM_STACK_KEY_VALUE;\r
-  VmContext.StackMagicPtr             = (UINTN *) (UINTN) VmContext.R[0];\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) VM_STACK_KEY_VALUE;\r
+  VmContext.StackMagicPtr             = (UINTN *) (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // Align the stack on a natural boundary\r
-  VmContext.R[0] &= ~(sizeof(UINTN) - 1);\r
+  VmContext.Gpr[0] &= ~(sizeof(UINTN) - 1);\r
   //\r
-  VmContext.LowStackTop   = (UINTN) VmContext.R[0];\r
+  VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // Simply copy the image handle and system table onto the EBC stack.\r
@@ -313,7 +313,7 @@ ExecuteEbcImageEntryPoint (
   //\r
   // For x64, this is where we say our return address is\r
   //\r
-  VmContext.StackRetAddr  = (UINT64) VmContext.R[0];\r
+  VmContext.StackRetAddr  = (UINT64) VmContext.Gpr[0];\r
 \r
   //\r
   // Entry function needn't access high stack context, simply\r
@@ -329,7 +329,7 @@ ExecuteEbcImageEntryPoint (
   // Return the value in R[7] unless there was an error\r
   //\r
   ReturnEBCStack(StackIndex);\r
-  return (UINT64) VmContext.R[7];\r
+  return (UINT64) VmContext.Gpr[7];\r
 }\r
 \r
 \r
@@ -412,14 +412,14 @@ EbcCreateThunks (
 \r
   //\r
   // Add code bytes to load up a processor register with the EBC entry point.\r
-  // mov rax, 123456789abcdef0h  => 48 B8 F0 DE BC 9A 78 56 34 12\r
+  // mov r10, 123456789abcdef0h  => 49 BA F0 DE BC 9A 78 56 34 12\r
   // The first 8 bytes of the thunk entry is the address of the EBC\r
   // entry point.\r
   //\r
-  *Ptr = 0x48;\r
+  *Ptr = 0x49;\r
   Ptr++;\r
   Size--;\r
-  *Ptr = 0xB8;\r
+  *Ptr = 0xBA;\r
   Ptr++;\r
   Size--;\r
   Addr = (UINT64) EbcEntryPoint;\r
@@ -559,11 +559,11 @@ EbcLLCALLEX (
     IsThunk = 0;\r
     goto Action;\r
   }\r
-  if (*((UINT8 *)FuncAddr + 10) != 0x48)  {\r
+  if (*((UINT8 *)FuncAddr + 10) != 0x49)  {\r
     IsThunk = 0;\r
     goto Action;\r
   }\r
-  if (*((UINT8 *)FuncAddr + 11) != 0xB8)  {\r
+  if (*((UINT8 *)FuncAddr + 11) != 0xBA)  {\r
     IsThunk = 0;\r
     goto Action;\r
   }\r
@@ -577,11 +577,11 @@ Action:
     // put our return address and frame pointer on the VM stack.\r
     // Then set the VM's IP to new EBC code.\r
     //\r
-    VmPtr->R[0] -= 8;\r
-    VmWriteMemN (VmPtr, (UINTN) VmPtr->R[0], (UINTN) FramePtr);\r
-    VmPtr->FramePtr = (VOID *) (UINTN) VmPtr->R[0];\r
-    VmPtr->R[0] -= 8;\r
-    VmWriteMem64 (VmPtr, (UINTN) VmPtr->R[0], (UINT64) (VmPtr->Ip + Size));\r
+    VmPtr->Gpr[0] -= 8;\r
+    VmWriteMemN (VmPtr, (UINTN) VmPtr->Gpr[0], (UINTN) FramePtr);\r
+    VmPtr->FramePtr = (VOID *) (UINTN) VmPtr->Gpr[0];\r
+    VmPtr->Gpr[0] -= 8;\r
+    VmWriteMem64 (VmPtr, (UINTN) VmPtr->Gpr[0], (UINT64) (VmPtr->Ip + Size));\r
 \r
     VmPtr->Ip = (VMIP) (UINTN) TargetEbcAddr;\r
   } else {\r
@@ -593,7 +593,7 @@ Action:
     //\r
     // Get return value and advance the IP.\r
     //\r
-    VmPtr->R[7] = EbcLLGetReturnValue ();\r
+    VmPtr->Gpr[7] = EbcLLGetReturnValue ();\r
     VmPtr->Ip += Size;\r
   }\r
 }\r