]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/Ia32/EbcSupport.c
apply for doxgen format.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / Ia32 / EbcSupport.c
index a534e0078081067386af4b7f1372e03ddcf0a691..1d008ac7822bc3510c9f21b422a4545df2e371e2 100644 (file)
@@ -1,24 +1,17 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation                                                         \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
-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
-\r
-Module Name:\r
-\r
-  EbcSupport.c\r
-\r
-Abstract:\r
-\r
+/** @file\r
   This module contains EBC support routines that are customized based on\r
   the target processor.\r
 \r
---*/\r
+Copyright (c) 2006, Intel Corporation\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
+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
+\r
+**/\r
 \r
 #include "EbcInt.h"\r
 #include "EbcExecute.h"\r
@@ -33,38 +26,33 @@ Abstract:
 #define EBC_THUNK_SIZE  32\r
 \r
 #define STACK_REMAIN_SIZE (1024 * 4)\r
-VOID\r
-EbcLLCALLEX (\r
-  IN VM_CONTEXT   *VmPtr,\r
-  IN UINTN        FuncAddr,\r
-  IN UINTN        NewStackPointer,\r
-  IN VOID         *FramePtr,\r
-  IN UINT8        Size\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
 \r
-  This function is called to execute an EBC CALLEX instruction. \r
+/**\r
+  This function is called to execute an EBC CALLEX instruction.\r
   The function check the callee's content to see whether it is common native\r
   code or a thunk to another piece of EBC code.\r
   If the callee is common native code, use EbcLLCAllEXASM to manipulate,\r
   otherwise, set the VM->IP to target EBC code directly to avoid another VM\r
   be startup which cost time and stack space.\r
-  \r
-Arguments:\r
 \r
-  VmPtr             - Pointer to a VM context.\r
-  FuncAddr          - Callee's address\r
-  NewStackPointer   - New stack pointer after the call\r
-  FramePtr          - New frame pointer after the call\r
-  Size              - The size of call instruction\r
+  @parm VmPtr              Pointer to a VM context.\r
+  @parm FuncAddr           Callee's address\r
+  @parm NewStackPointer    New stack pointer after the call\r
+  @parm FramePtr           New frame pointer after the call\r
+  @parm Size               The size of call instruction\r
 \r
-Returns:\r
+  @return None.\r
 \r
-  None.\r
-  \r
---*/\r
+**/\r
+VOID\r
+EbcLLCALLEX (\r
+  IN VM_CONTEXT   *VmPtr,\r
+  IN UINTN        FuncAddr,\r
+  IN UINTN        NewStackPointer,\r
+  IN VOID         *FramePtr,\r
+  IN UINT8        Size\r
+  )\r
 {\r
   UINTN    IsThunk;\r
   UINTN    TargetEbcAddr;\r
@@ -134,7 +122,7 @@ Action:
     // The callee is not a thunk to EBC, call native code.\r
     //\r
     EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);\r
-    \r
+\r
     //\r
     // Get return value and advance the IP.\r
     //\r
@@ -143,6 +131,19 @@ Action:
   }\r
 }\r
 \r
+\r
+/**\r
+  Begin executing an EBC image. The address of the entry point is passed\r
+  in via a processor register, so we'll need to make a call to get the\r
+  value.\r
+\r
+  None. Since we're called from a fixed up thunk (which we want to keep\r
+  small), our only so-called argument is the EBC entry point passed in\r
+  to us in a processor register.\r
+\r
+  @return The value returned by the EBC application we're going to run.\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 EbcInterpret (\r
@@ -163,25 +164,6 @@ EbcInterpret (
   IN OUT UINTN      Arg15,\r
   IN OUT UINTN      Arg16\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Begin executing an EBC image. The address of the entry point is passed\r
-  in via a processor register, so we'll need to make a call to get the\r
-  value.\r
-  \r
-Arguments:\r
-\r
-  None. Since we're called from a fixed up thunk (which we want to keep\r
-  small), our only so-called argument is the EBC entry point passed in\r
-  to us in a processor register.\r
-\r
-Returns:\r
-\r
-  The value returned by the EBC application we're going to run.\r
-  \r
---*/\r
 {\r
   //\r
   // Create a new VM context on the stack\r
@@ -298,30 +280,24 @@ Returns:
   return (UINT64) VmContext.R[7];\r
 }\r
 \r
-STATIC\r
-UINT64\r
-ExecuteEbcImageEntryPoint (\r
-  IN EFI_HANDLE           ImageHandle,\r
-  IN EFI_SYSTEM_TABLE     *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Begin executing an EBC image. The address of the entry point is passed\r
   in via a processor register, so we'll need to make a call to get the\r
   value.\r
-  \r
-Arguments:\r
 \r
-  ImageHandle   - image handle for the EBC application we're executing\r
-  SystemTable   - standard system table passed into an driver's entry point\r
+  @param  ImageHandle    image handle for the EBC application we're executing\r
+  @param  SystemTable    standard system table passed into an driver's entry point\r
 \r
-Returns:\r
+  @return The value returned by the EBC application we're going to run.\r
 \r
-  The value returned by the EBC application we're going to run.\r
-\r
---*/\r
+**/\r
+STATIC\r
+UINT64\r
+ExecuteEbcImageEntryPoint (\r
+  IN EFI_HANDLE           ImageHandle,\r
+  IN EFI_SYSTEM_TABLE     *SystemTable\r
+  )\r
 {\r
   //\r
   // Create a new VM context on the stack\r
@@ -373,7 +349,7 @@ Returns:
   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
-  \r
+\r
   //\r
   // Put a magic value in the stack gap, then adjust down again\r
   //\r
@@ -390,7 +366,7 @@ Returns:
   VmContext.R[0] -= sizeof (UINTN);\r
   *(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) ImageHandle;\r
 \r
-  VmContext.R[0] -= 16; \r
+  VmContext.R[0] -= 16;\r
   VmContext.StackRetAddr  = (UINT64) VmContext.R[0];\r
   //\r
   // VM pushes 16-bytes for return address. Simulate that here.\r
@@ -407,6 +383,17 @@ Returns:
   return (UINT64) VmContext.R[7];\r
 }\r
 \r
+\r
+/**\r
+  Create an IA32 thunk for the given EBC entry point.\r
+\r
+  @param  ImageHandle    Handle of image for which this thunk is being created\r
+  @param  EbcEntryPoint  Address of the EBC code that the thunk is to call\r
+  @param  Thunk          Returned thunk we create here\r
+\r
+  @return Standard EFI status.\r
+\r
+**/\r
 EFI_STATUS\r
 EbcCreateThunks (\r
   IN EFI_HANDLE           ImageHandle,\r
@@ -414,23 +401,6 @@ EbcCreateThunks (
   OUT VOID                **Thunk,\r
   IN  UINT32              Flags\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create an IA32 thunk for the given EBC entry point.\r
-  \r
-Arguments:\r
-\r
-  ImageHandle     - Handle of image for which this thunk is being created\r
-  EbcEntryPoint   - Address of the EBC code that the thunk is to call\r
-  Thunk           - Returned thunk we create here\r
-\r
-Returns:\r
-\r
-  Standard EFI status.\r
-  \r
---*/\r
 {\r
   UINT8       *Ptr;\r
   UINT8       *ThunkBase;\r