]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/Ipf/EbcSupport.c
Improve coding style in MdeModulePkg.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / Ipf / EbcSupport.c
index 46c81b082bc352e3bacaf4a02e697a57ed1bbd32..79c67dc63678180aad306b787aa85002a717d53d 100644 (file)
@@ -2,7 +2,7 @@
   This module contains EBC support routines that are customized based on\r
   the target processor.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>\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
@@ -60,8 +60,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
 }\r
 \r
 /**\r
@@ -176,14 +176,14 @@ 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
   PushU64 (&VmContext, (UINT64) VM_STACK_KEY_VALUE);\r
-  VmContext.StackMagicPtr = (UINTN *) VmContext.R[0];\r
-  VmContext.LowStackTop   = (UINTN) VmContext.R[0];\r
+  VmContext.StackMagicPtr = (UINTN *) VmContext.Gpr[0];\r
+  VmContext.LowStackTop   = (UINTN) VmContext.Gpr[0];\r
   //\r
   // Push the EBC arguments on the stack. Does not matter that they may not\r
   // all be valid.\r
@@ -211,7 +211,7 @@ EbcInterpret (
   //\r
   PushU64 (&VmContext, 0);\r
   PushU64 (&VmContext, 0xDEADBEEFDEADBEEF);\r
-  VmContext.StackRetAddr = (UINT64) VmContext.R[0];\r
+  VmContext.StackRetAddr = (UINT64) VmContext.Gpr[0];\r
   //\r
   // Begin executing the EBC code\r
   //\r
@@ -220,7 +220,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
@@ -283,9 +283,9 @@ 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
@@ -293,7 +293,7 @@ ExecuteEbcImageEntryPoint (
   // at the bottom so we can detect stack corruption.\r
   //\r
   PushU64 (&VmContext, (UINT64) VM_STACK_KEY_VALUE);\r
-  VmContext.StackMagicPtr = (UINTN *) (UINTN) VmContext.R[0];\r
+  VmContext.StackMagicPtr = (UINTN *) (UINTN) VmContext.Gpr[0];\r
 \r
   //\r
   // When we thunk to external native code, we copy the last 8 qwords from\r
@@ -304,15 +304,15 @@ ExecuteEbcImageEntryPoint (
   // Therefore, leave another gap below the magic value. Pick 10 qwords down,\r
   // just as a starting point.\r
   //\r
-  VmContext.R[0] -= 10 * sizeof (UINT64);\r
+  VmContext.Gpr[0] -= 10 * sizeof (UINT64);\r
 \r
   //\r
   // Align the stack pointer such that after pushing the system table,\r
   // image handle, and return address on the stack, it's aligned on a 16-byte\r
   // boundary as required for IPF.\r
   //\r
-  VmContext.R[0] &= (INT64)~0x0f;\r
-  VmContext.LowStackTop = (UINTN) VmContext.R[0];\r
+  VmContext.Gpr[0] &= (INT64)~0x0f;\r
+  VmContext.LowStackTop = (UINTN) VmContext.Gpr[0];\r
   //\r
   // Simply copy the image handle and system table onto the EBC stack.\r
   // Greatly simplifies things by not having to spill the args\r
@@ -327,7 +327,7 @@ ExecuteEbcImageEntryPoint (
   //\r
   PushU64 (&VmContext, (UINT64) 0);\r
   PushU64 (&VmContext, (UINT64) 0x1234567887654321);\r
-  VmContext.StackRetAddr = (UINT64) VmContext.R[0];\r
+  VmContext.StackRetAddr = (UINT64) VmContext.Gpr[0];\r
 \r
   //\r
   // Begin executing the EBC code\r
@@ -338,7 +338,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
@@ -855,11 +855,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
@@ -871,7 +871,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