]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / Ia32 / EbcSupport.c
index 787f5ee88540edc2c8956843efaccb7fa9ddc139..3205d8fc8ab2f40262d5f25eaaf924281d9aaf10 100644 (file)
@@ -2,8 +2,8 @@
   This module contains EBC support routines that are customized based on\r
   the target processor.\r
 \r
-Copyright (c) 2006, Intel Corporation\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
@@ -108,11 +108,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) (UINTN) (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) (UINTN) (VmPtr->Ip + Size));\r
 \r
     VmPtr->Ip = (VMIP) (UINTN) TargetEbcAddr;\r
   } else {\r
@@ -124,7 +124,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
@@ -159,7 +159,6 @@ Action:
   @return The value returned by the EBC application we're going to run.\r
 \r
 **/\r
-STATIC\r
 UINT64\r
 EbcInterpret (\r
   IN OUT UINTN      Arg1,\r
@@ -219,55 +218,55 @@ EbcInterpret (
     return Status;\r
   }\r
   VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
-  VmContext.R[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
-  VmContext.HighStackBottom = (UINTN)VmContext.R[0];\r
-  VmContext.R[0] &= ~(sizeof (UINTN) - 1);\r
-  VmContext.R[0] -= sizeof (UINTN);\r
+  VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
+  VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];\r
+  VmContext.Gpr[0] &= ~(sizeof (UINTN) - 1);\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\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
-  VmContext.LowStackTop   = (UINTN) VmContext.R[0];\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) VM_STACK_KEY_VALUE;\r
+  VmContext.StackMagicPtr             = (UINTN *) (UINTN) VmContext.Gpr[0];\r
+  VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // For IA32, this is where we say our return address is\r
   //\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg16;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg15;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg14;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg13;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg12;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg11;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg10;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg9;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg8;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg7;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg6;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg5;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg4;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg3;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg2;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) Arg1;\r
-  VmContext.R[0] -= 16;\r
-  VmContext.StackRetAddr  = (UINT64) VmContext.R[0];\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg16;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg15;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg14;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg13;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg12;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg11;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg10;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg9;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg8;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg7;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg6;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg5;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg4;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg3;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg2;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) Arg1;\r
+  VmContext.Gpr[0] -= 16;\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
@@ -292,7 +291,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
@@ -308,7 +307,6 @@ EbcInterpret (
   @return The value returned by the EBC application we're going to run.\r
 \r
 **/\r
-STATIC\r
 UINT64\r
 ExecuteEbcImageEntryPoint (\r
   IN EFI_HANDLE           ImageHandle,\r
@@ -362,28 +360,28 @@ ExecuteEbcImageEntryPoint (
     return Status;\r
   }\r
   VmContext.StackTop = (UINT8*)VmContext.StackPool + (STACK_REMAIN_SIZE);\r
-  VmContext.R[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
-  VmContext.HighStackBottom = (UINTN)VmContext.R[0];\r
-  VmContext.R[0] -= sizeof (UINTN);\r
+  VmContext.Gpr[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);\r
+  VmContext.HighStackBottom = (UINTN)VmContext.Gpr[0];\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\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.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) SystemTable;\r
-  VmContext.R[0] -= sizeof (UINTN);\r
-  *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) ImageHandle;\r
+  VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) SystemTable;\r
+  VmContext.Gpr[0] -= sizeof (UINTN);\r
+  *(UINTN *) (UINTN) (VmContext.Gpr[0]) = (UINTN) ImageHandle;\r
 \r
-  VmContext.R[0] -= 16;\r
-  VmContext.StackRetAddr  = (UINT64) VmContext.R[0];\r
+  VmContext.Gpr[0] -= 16;\r
+  VmContext.StackRetAddr  = (UINT64) VmContext.Gpr[0];\r
   //\r
   // VM pushes 16-bytes for return address. Simulate that here.\r
   //\r
@@ -396,7 +394,7 @@ ExecuteEbcImageEntryPoint (
   //\r
   // Return the value in R[7] unless there was an error\r
   //\r
-  return (UINT64) VmContext.R[7];\r
+  return (UINT64) VmContext.Gpr[7];\r
 }\r
 \r
 \r