]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcExecute.c
apply for doxgen format.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcExecute.c
index 174e774de3087d81f3be5529346f88093b5ca1a7..d44892e84af3b6be9f0b5d3f74db81fb19830f72 100644 (file)
@@ -1,23 +1,16 @@
-/*++\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
-  EbcExecute.c\r
+/** @file\r
+  Contains code that implements the virtual machine.\r
 \r
-Abstract:\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
-  Contains code that implements the virtual machine.\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
 \r
 #include "EbcInt.h"\r
 #include "EbcExecute.h"\r
@@ -573,31 +566,25 @@ static CONST UINT8                    mJMPLen[] = { 2, 2, 6, 10 };
 //\r
 EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;\r
 \r
-EFI_STATUS\r
-EbcExecuteInstructions (\r
-  IN EFI_EBC_VM_TEST_PROTOCOL *This,\r
-  IN VM_CONTEXT               *VmPtr,\r
-  IN OUT UINTN                *InstructionCount\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Given a pointer to a new VM context, execute one or more instructions. This\r
   function is only used for test purposes via the EBC VM test protocol.\r
 \r
-Arguments:\r
-\r
-  This              - pointer to protocol interface\r
-  VmPtr             - pointer to a VM context\r
-  InstructionCount  - how many instructions to execute. 0 if don't count.\r
+  @param  This              pointer to protocol interface\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  InstructionCount  how many instructions to execute. 0 if don't count.\r
 \r
-Returns:\r
+  @return EFI_UNSUPPORTED\r
+  @return EFI_SUCCESS\r
 \r
-  EFI_UNSUPPORTED\r
-  EFI_SUCCESS\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EbcExecuteInstructions (\r
+  IN EFI_EBC_VM_TEST_PROTOCOL *This,\r
+  IN VM_CONTEXT               *VmPtr,\r
+  IN OUT UINTN                *InstructionCount\r
+  )\r
 {\r
   UINTN       ExecFunc;\r
   EFI_STATUS  Status;\r
@@ -641,25 +628,19 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-EbcExecute (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Execute an EBC image from an entry point or from a published protocol.\r
 \r
-Arguments:\r
-\r
-  VmPtr - pointer to prepared VM context.\r
+  @param  VmPtr             pointer to prepared VM context.\r
 \r
-Returns:\r
+  @return Standard EBC status.\r
 \r
-  Standard EBC status.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+EbcExecute (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINTN                             ExecFunc;\r
   UINT8                             StackCorrupted;\r
@@ -770,39 +751,28 @@ Done:
   return Status;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteMOVxx (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Execute the MOVxx instructions.\r
 \r
-Arguments:\r
-\r
-  VmPtr - pointer to a VM context.\r
-\r
-Returns:\r
+  @param  VmPtr             pointer to a VM context.\r
 \r
-  EFI_UNSUPPORTED\r
-  EFI_SUCCESS\r
+  @return EFI_UNSUPPORTED\r
+  @return EFI_SUCCESS\r
+  @return Instruction format:\r
+  @return MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}\r
+  @return MOVqq {@}R1 {Index64}, {@}R2 {Index64}\r
+  @return Copies contents of [R2] -> [R1], zero extending where required.\r
+  @return First character indicates the size of the move.\r
+  @return Second character indicates the size of the index(s).\r
+  @return Invalid to have R1 direct with index.\r
 \r
-Instruction format:\r
-  \r
-  MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}\r
-  MOVqq {@}R1 {Index64}, {@}R2 {Index64}\r
-\r
-  Copies contents of [R2] -> [R1], zero extending where required.\r
-\r
-  First character indicates the size of the move.\r
-  Second character indicates the size of the index(s).\r
-\r
-  Invalid to have R1 direct with index.\r
-  \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteMOVxx (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   OpcMasked;\r
@@ -1059,27 +1029,21 @@ Instruction format:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteBREAK (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Execute the EBC BREAK instruction\r
 \r
-Arguments:\r
-\r
-  VmPtr - pointer to current VM context\r
+  @param  VmPtr             pointer to current VM context\r
 \r
-Returns:\r
+  @return EFI_UNSUPPORTED\r
+  @return EFI_SUCCESS\r
 \r
-  EFI_UNSUPPORTED\r
-  EFI_SUCCESS\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteBREAK (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8       Operands;\r
   VOID        *EbcEntryPoint;\r
@@ -1175,39 +1139,30 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Execute the JMP instruction\r
+\r
+  @param  VmPtr             pointer to VM context\r
+\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return JMP64{cs|cc} Immed64\r
+  @return JMP32{cs|cc} {@}R1 {Immed32|Index32}\r
+  @return Encoding:\r
+  @retval b0.7              immediate data present\r
+  @retval b0.6              1 = 64 bit immediate data 0 = 32 bit immediate data\r
+  @retval b1.7              1 = conditional b1.6    1 = CS (condition set) 0 = CC\r
+                            (condition clear) b1.4    1 = relative address 0 =\r
+                            absolute address b1.3    1 = operand1 indirect b1.2-0\r
+                            operand 1\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteJMP (\r
   IN VM_CONTEXT *VmPtr\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the JMP instruction\r
-\r
-Arguments:\r
-  VmPtr      - pointer to VM context\r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
-  JMP64{cs|cc} Immed64\r
-  JMP32{cs|cc} {@}R1 {Immed32|Index32}\r
-\r
-Encoding:\r
-  b0.7 -  immediate data present\r
-  b0.6 -  1 = 64 bit immediate data\r
-          0 = 32 bit immediate data\r
-  b1.7 -  1 = conditional\r
-  b1.6    1 = CS (condition set)\r
-          0 = CC (condition clear)\r
-  b1.4    1 = relative address\r
-          0 = absolute address\r
-  b1.3    1 = operand1 indirect\r
-  b1.2-0  operand 1\r
-\r
---*/\r
 {\r
   UINT8   Opcode;\r
   UINT8   CompareSet;\r
@@ -1354,26 +1309,22 @@ Encoding:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteJMP8 (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC JMP8 instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Instruction syntax:\r
-  JMP8{cs|cc}  Offset/2\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return JMP8{cs|cc}  Offset/2\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteJMP8 (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Opcode;\r
   UINT8 ConditionFlag;\r
@@ -1408,38 +1359,27 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC MOVI\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
+  @return First variable character specifies the move size\r
+  @return Second variable character specifies size of the immediate data\r
+  @return Sign-extend the immediate data to the size of the operation, and zero-extend\r
+  @return if storing to a register.\r
+  @return Operand1 direct with index/immed is invalid.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVI (\r
   IN VM_CONTEXT *VmPtr\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Execute the EBC MOVI \r
-\r
-Arguments:\r
-\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-\r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
-\r
-  MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
-\r
-  First variable character specifies the move size\r
-  Second variable character specifies size of the immediate data\r
-\r
-  Sign-extend the immediate data to the size of the operation, and zero-extend\r
-  if storing to a register.\r
-\r
-  Operand1 direct with index/immed is invalid.\r
-    \r
---*/\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -1539,31 +1479,23 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteMOVIn (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Execute the EBC MOV immediate natural. This instruction moves an immediate\r
   index value into a register or memory location.\r
 \r
-Arguments:\r
-\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-\r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-  MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteMOVIn (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -1647,31 +1579,23 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteMOVREL (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   Execute the EBC MOVREL instruction.\r
   Dest <- Ip + ImmData\r
 \r
-Arguments:\r
-\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
 \r
-Instruction syntax:\r
-\r
-  MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteMOVREL (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -1754,36 +1678,27 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteMOVsnw (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
-  Execute the EBC MOVsnw instruction. This instruction loads a signed \r
+/**\r
+  Execute the EBC MOVsnw instruction. This instruction loads a signed\r
   natural value from memory or register to another memory or register. On\r
   32-bit machines, the value gets sign-extended to 64 bits if the destination\r
   is a register.\r
 \r
-Arguments:\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-  VmPtr   - pointer to a VM context  \r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}\r
+  @return 0:7 1=>operand1 index present\r
+  @return 0:6 1=>operand2 index present\r
 \r
-Returns:\r
-\r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
-\r
-  MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}\r
-\r
-  0:7 1=>operand1 index present\r
-  0:6 1=>operand2 index present\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteMOVsnw (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -1853,36 +1768,27 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteMOVsnd (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
-  Execute the EBC MOVsnw instruction. This instruction loads a signed \r
+/**\r
+  Execute the EBC MOVsnw instruction. This instruction loads a signed\r
   natural value from memory or register to another memory or register. On\r
   32-bit machines, the value gets sign-extended to 64 bits if the destination\r
   is a register.\r
 \r
-Arguments:\r
-\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}\r
+  @return 0:7 1=>operand1 index present\r
+  @return 0:6 1=>operand2 index present\r
 \r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
-\r
-  MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}\r
-\r
-  0:7 1=>operand1 index present\r
-  0:6 1=>operand2 index present\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteMOVsnd (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -1952,26 +1858,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecutePUSHn (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC PUSHn instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return PUSHn {@}R1 {Index16|Immed16}\r
 \r
-Instruction syntax:\r
-   PUSHn {@}R1 {Index16|Immed16}\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecutePUSHn (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Opcode;\r
   UINT8 Operands;\r
@@ -2015,26 +1917,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecutePUSH (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC PUSH instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Instruction syntax:\r
-   PUSH[32|64] {@}R1 {Index16|Immed16}\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return PUSH[32|64] {@}R1 {Index16|Immed16}\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecutePUSH (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -2095,26 +1993,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecutePOPn (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC POPn instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return POPn {@}R1 {Index16|Immed16}\r
 \r
-Instruction syntax:\r
-   POPn {@}R1 {Index16|Immed16}\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecutePOPn (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Opcode;\r
   UINT8 Operands;\r
@@ -2158,26 +2052,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecutePOP (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC POP instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Instruction syntax:\r
-  POP {@}R1 {Index16|Immed16}\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return POP {@}R1 {Index16|Immed16}\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecutePOP (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -2241,32 +2131,26 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteCALL (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Implements the EBC CALL instruction.\r
-\r
-  Instruction format:  \r
-\r
-    CALL64 Immed64\r
-    CALL32 {@}R1 {Immed32|Index32}\r
-    CALLEX64 Immed64\r
-    CALLEX16 {@}R1 {Immed32}\r
-\r
+  Instruction format:\r
+  CALL64 Immed64\r
+  CALL32 {@}R1 {Immed32|Index32}\r
+  CALLEX64 Immed64\r
+  CALLEX16 {@}R1 {Immed32}\r
   If Rx == R0, then it's a PC relative call to PC = PC + imm32.\r
-  \r
-Arguments:\r
-  VmPtr - pointer to a VM context.\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context.\r
+\r
+  @return Standard EFI_STATUS\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteCALL (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Opcode;\r
   UINT8 Operands;\r
@@ -2384,26 +2268,22 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteRET (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC RET instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return RET\r
 \r
-Instruction syntax:\r
-   RET\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteRET (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   //\r
   // If we're at the top of the stack, then simply set the done\r
@@ -2435,26 +2315,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteCMP (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC CMP instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Instruction syntax:\r
-   CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteCMP (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -2599,26 +2475,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteCMPI (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC CMPI instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32\r
 \r
-Instruction syntax:\r
-   CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteCMPI (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8   Opcode;\r
   UINT8   Operands;\r
@@ -2781,6 +2653,19 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC NOT instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return ~Op2\r
+  @return Instruction syntax:\r
+  @return NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteNOT (\r
@@ -2788,27 +2673,23 @@ ExecuteNOT (
   IN UINT64         Op1,\r
   IN UINT64         Op2\r
   )\r
-/*++\r
+{\r
+  return ~Op2;\r
+}\r
 \r
-Routine Description:\r
-  Execute the EBC NOT instruction\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
+/**\r
+  Execute the EBC NEG instruction\r
 \r
-Returns:\r
-  ~Op2\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
-Instruction syntax:\r
-  NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-  \r
---*/\r
-{\r
-  return ~Op2;\r
-}\r
+  @return Op2 * -1\r
+  @return Instruction syntax:\r
+  @return NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteNEG (\r
@@ -2816,27 +2697,23 @@ ExecuteNEG (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
+{\r
+  return ~Op2 + 1;\r
+}\r
 \r
-Routine Description:\r
-  Execute the EBC NEG instruction\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
+/**\r
+  Execute the EBC ADD instruction\r
 \r
-Returns:\r
-  Op2 * -1\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
-Instruction syntax:\r
-  NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
-{\r
-  return ~Op2 + 1;\r
-}\r
+  @return Op1 + Op2\r
+  @return Instruction syntax:\r
+  @return ADD[32|64] {@}R1, {@}R2 {Index16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteADD (\r
@@ -2844,28 +2721,23 @@ ExecuteADD (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
+{\r
+  return Op1 + Op2;\r
+}\r
 \r
-Routine Description:\r
-  \r
-  Execute the EBC ADD instruction\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
+/**\r
+  Execute the EBC SUB instruction\r
 \r
-Returns:\r
-  Op1 + Op2\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
-Instruction syntax:\r
-   ADD[32|64] {@}R1, {@}R2 {Index16}\r
-\r
---*/\r
-{\r
-  return Op1 + Op2;\r
-}\r
+  @retval Op1               Op2 Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSUB (\r
@@ -2873,24 +2745,6 @@ ExecuteSUB (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC SUB instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 - Op2\r
-  Standard EFI_STATUS\r
-\r
-Instruction syntax:\r
-  SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return (UINT64) ((INT64) ((INT64) Op1 - (INT64) Op2));\r
@@ -2899,6 +2753,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC MUL instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 * Op2\r
+  @return Instruction syntax:\r
+  @return MUL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMUL (\r
@@ -2906,24 +2773,6 @@ ExecuteMUL (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Execute the EBC MUL instruction\r
-\r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 * Op2\r
-\r
-Instruction syntax:\r
-  MUL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return MultS64x64 ((INT64)Op1, (INT64)Op2);\r
@@ -2932,6 +2781,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC MULU instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return (unsigned)Op1 * (unsigned)Op2\r
+  @return Instruction syntax:\r
+  @return MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMULU (\r
@@ -2939,23 +2801,6 @@ ExecuteMULU (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC MULU instruction\r
-\r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  (unsigned)Op1 * (unsigned)Op2 \r
-\r
-Instruction syntax:\r
-  MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return MultU64x64 (Op1, Op2);\r
@@ -2964,6 +2809,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC DIV instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1/Op2\r
+  @return Instruction syntax:\r
+  @return DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteDIV (\r
@@ -2971,24 +2829,6 @@ ExecuteDIV (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Execute the EBC DIV instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1/Op2\r
-\r
-Instruction syntax:\r
-  DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   INT64   Remainder;\r
 \r
@@ -3012,6 +2852,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC DIVU instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return (unsigned)Op1 / (unsigned)Op2\r
+  @return Instruction syntax:\r
+  @return DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteDIVU (\r
@@ -3019,23 +2872,6 @@ ExecuteDIVU (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC DIVU instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  (unsigned)Op1 / (unsigned)Op2\r
-\r
-Instruction syntax:\r
-  DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   UINT64  Remainder;\r
 \r
@@ -3061,6 +2897,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC MOD instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 MODULUS Op2\r
+  @return Instruction syntax:\r
+  @return MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMOD (\r
@@ -3068,23 +2917,6 @@ ExecuteMOD (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC MOD instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 MODULUS Op2\r
-\r
-Instruction syntax:\r
-  MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   INT64   Remainder;\r
 \r
@@ -3104,6 +2936,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC MODU instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 UNSIGNED_MODULUS Op2\r
+  @return Instruction syntax:\r
+  @return MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMODU (\r
@@ -3111,23 +2956,6 @@ ExecuteMODU (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC MODU instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 UNSIGNED_MODULUS Op2\r
-\r
-Instruction syntax:\r
-  MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-  \r
---*/\r
 {\r
   UINT64  Remainder;\r
 \r
@@ -3147,6 +2975,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC AND instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 AND Op2\r
+  @return Instruction syntax:\r
+  @return AND[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteAND (\r
@@ -3154,27 +2995,23 @@ ExecuteAND (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
+{\r
+  return Op1 & Op2;\r
+}\r
 \r
-Routine Description:\r
-  Execute the EBC AND instruction\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
+/**\r
+  Execute the EBC OR instruction\r
 \r
-Returns:\r
-  Op1 AND Op2\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
-Instruction syntax:\r
-  AND[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
-{\r
-  return Op1 & Op2;\r
-}\r
+  @return Op1 OR Op2\r
+  @return Instruction syntax:\r
+  @return OR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteOR (\r
@@ -3182,27 +3019,23 @@ ExecuteOR (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC OR instruction\r
+{\r
+  return Op1 | Op2;\r
+}\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
 \r
-Returns:\r
-  Op1 OR Op2\r
+/**\r
+  Execute the EBC XOR instruction\r
 \r
-Instruction syntax:\r
-  OR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
---*/\r
-{\r
-  return Op1 | Op2;\r
-}\r
+  @return Op1 XOR Op2\r
+  @return Instruction syntax:\r
+  @return XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteXOR (\r
@@ -3210,27 +3043,23 @@ ExecuteXOR (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC XOR instruction\r
+{\r
+  return Op1 ^ Op2;\r
+}\r
 \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
 \r
-Returns:\r
-  Op1 XOR Op2\r
+/**\r
+  Execute the EBC SHL shift left instruction\r
 \r
-Instruction syntax:\r
-  XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
 \r
---*/\r
-{\r
-  return Op1 ^ Op2;\r
-}\r
+  @return Op1 << Op2\r
+  @return Instruction syntax:\r
+  @return SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSHL (\r
@@ -3238,24 +3067,6 @@ ExecuteSHL (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Execute the EBC SHL shift left instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 << Op2\r
-\r
-Instruction syntax:\r
-  SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return LShiftU64 (Op1, (UINTN)Op2);\r
@@ -3264,6 +3075,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC SHR instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 >> Op2  (unsigned operands)\r
+  @return Instruction syntax:\r
+  @return SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSHR (\r
@@ -3271,23 +3095,6 @@ ExecuteSHR (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC SHR instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 >> Op2  (unsigned operands)\r
-\r
-Instruction syntax:\r
-  SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return RShiftU64 (Op1, (UINTN)Op2);\r
@@ -3296,6 +3103,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC ASHR instruction\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return Op1 >> Op2 (signed)\r
+  @return Instruction syntax:\r
+  @return ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteASHR (\r
@@ -3303,23 +3123,6 @@ ExecuteASHR (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC ASHR instruction\r
-\r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  Op1 >> Op2 (signed)\r
-\r
-Instruction syntax:\r
-  ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
---*/\r
 {\r
   if (*VmPtr->Ip & DATAMANIP_M_64) {\r
     return ARShiftU64 (Op1, (UINTN)Op2);\r
@@ -3328,6 +3131,19 @@ Instruction syntax:
   }\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC EXTNDB instruction to sign-extend a byte value.\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return (INT64)(INT8)Op2\r
+  @return Instruction syntax:\r
+  @return EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDB (\r
@@ -3335,24 +3151,6 @@ ExecuteEXTNDB (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC EXTNDB instruction to sign-extend a byte value.\r
-  \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  (INT64)(INT8)Op2\r
-\r
-Instruction syntax:\r
-  EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
-  \r
---*/\r
 {\r
   INT8  Data8;\r
   INT64 Data64;\r
@@ -3366,6 +3164,19 @@ Instruction syntax:
   return (UINT64) Data64;\r
 }\r
 \r
+\r
+/**\r
+  Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return (INT64)(INT16)Op2\r
+  @return Instruction syntax:\r
+  @return EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDW (\r
@@ -3373,24 +3184,6 @@ ExecuteEXTNDW (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.\r
-  \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  (INT64)(INT16)Op2\r
-\r
-Instruction syntax:\r
-  EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
-  \r
---*/\r
 {\r
   INT16 Data16;\r
   INT64 Data64;\r
@@ -3411,6 +3204,19 @@ Instruction syntax:
 //\r
 // Operation:  Dest <- SignExtended((DWORD)Source))\r
 //\r
+\r
+/**\r
+  Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.\r
+\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Op1               Operand 1 from the instruction\r
+  @param  Op2               Operand 2 from the instruction\r
+\r
+  @return (INT64)(INT32)Op2\r
+  @return Instruction syntax:\r
+  @return EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDD (\r
@@ -3418,24 +3224,6 @@ ExecuteEXTNDD (
   IN UINT64       Op1,\r
   IN UINT64       Op2\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.\r
-  \r
-Arguments:\r
-  VmPtr     - pointer to a VM context  \r
-  Op1       - Operand 1 from the instruction \r
-  Op2       - Operand 2 from the instruction\r
-\r
-Returns:\r
-  (INT64)(INT32)Op2\r
-\r
-Instruction syntax:\r
-  EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
-\r
-  \r
---*/\r
 {\r
   INT32 Data32;\r
   INT64 Data64;\r
@@ -3475,32 +3263,28 @@ ExecuteUnsignedDataManip (
   return ExecuteDataManip (VmPtr, FALSE);\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteDataManip (\r
-  IN VM_CONTEXT   *VmPtr,\r
-  IN BOOLEAN      IsSignedOp\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  Execute all the EBC data manipulation instructions. \r
-  Since the EBC data manipulation instructions all have the same basic form, \r
+/**\r
+  Execute all the EBC data manipulation instructions.\r
+  Since the EBC data manipulation instructions all have the same basic form,\r
   they can share the code that does the fetch of operands and the write-back\r
   of the result. This function performs the fetch of the operands (even if\r
   both are not needed to be fetched, like NOT instruction), dispatches to the\r
   appropriate subfunction, then writes back the returned result.\r
 \r
-Arguments:\r
-  VmPtr - pointer to VM context\r
+  @param  VmPtr             pointer to VM context\r
 \r
-Returns:\r
-  Standard EBC status\r
+  @return Standard EBC status\r
+  @return Format:\r
+  @return INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
 \r
-Format:  \r
-  INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteDataManip (\r
+  IN VM_CONTEXT   *VmPtr,\r
+  IN BOOLEAN      IsSignedOp\r
+  )\r
 {\r
   UINT8   Opcode;\r
   INT16   Index16;\r
@@ -3632,26 +3416,22 @@ Format:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteLOADSP (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC LOADSP instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return LOADSP  SP1, R2\r
 \r
-Instruction syntax:\r
-  LOADSP  SP1, R2\r
-\r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteLOADSP (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Operands;\r
 \r
@@ -3689,26 +3469,22 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ExecuteSTORESP (\r
-  IN VM_CONTEXT *VmPtr\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   Execute the EBC STORESP instruction\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-\r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
 \r
-Instruction syntax:\r
-   STORESP  Rx, FLAGS|IP\r
+  @return Standard EFI_STATUS\r
+  @return Instruction syntax:\r
+  @return STORESP  Rx, FLAGS|IP\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ExecuteSTORESP (\r
+  IN VM_CONTEXT *VmPtr\r
+  )\r
 {\r
   UINT8 Operands;\r
 \r
@@ -3753,37 +3529,32 @@ Instruction syntax:
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Decode a 16-bit index to determine the offset. Given an index value:\r
+  b15     - sign bit\r
+  b14:12  - number of bits in this index assigned to natural units (=a)\r
+  ba:11   - constant units = C\r
+  b0:a    - natural units = N\r
+  Given this info, the offset can be computed by:\r
+  offset = sign_bit * (C + N * sizeof(UINTN))\r
+  Max offset is achieved with index = 0x7FFF giving an offset of\r
+  0x27B (32-bit machine) or 0x477 (64-bit machine).\r
+  Min offset is achieved with index =\r
+\r
+  @param  VmPtr             pointer to VM context\r
+  @param  CodeOffset        offset from IP of the location of the 16-bit index to\r
+                            decode\r
+\r
+  @return The decoded offset.\r
+\r
+**/\r
 STATIC\r
 INT16\r
 VmReadIndex16 (\r
   IN VM_CONTEXT     *VmPtr,\r
   IN UINT32         CodeOffset\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Decode a 16-bit index to determine the offset. Given an index value:\r
-\r
-    b15     - sign bit\r
-    b14:12  - number of bits in this index assigned to natural units (=a)\r
-    ba:11   - constant units = C\r
-    b0:a    - natural units = N\r
-  \r
-  Given this info, the offset can be computed by:\r
-    offset = sign_bit * (C + N * sizeof(UINTN))\r
-\r
-  Max offset is achieved with index = 0x7FFF giving an offset of\r
-  0x27B (32-bit machine) or 0x477 (64-bit machine).\r
-  Min offset is achieved with index = \r
-  \r
-Arguments:\r
-  VmPtr       - pointer to VM context\r
-  CodeOffset  - offset from IP of the location of the 16-bit index to decode\r
-\r
-Returns:\r
-  The decoded offset.\r
-  \r
---*/\r
 {\r
   UINT16  Index;\r
   INT16   Offset;\r
@@ -3839,25 +3610,23 @@ Returns:
   return Offset;\r
 }\r
 \r
+\r
+/**\r
+  Decode a 32-bit index to determine the offset.\r
+\r
+  @param  VmPtr             pointer to VM context\r
+  @param  CodeOffset        offset from IP of the location of the 32-bit index to\r
+                            decode\r
+\r
+  @return Converted index per EBC VM specification\r
+\r
+**/\r
 STATIC\r
 INT32\r
 VmReadIndex32 (\r
   IN VM_CONTEXT     *VmPtr,\r
   IN UINT32         CodeOffset\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Decode a 32-bit index to determine the offset.\r
-\r
-Arguments:\r
-  VmPtr       - pointer to VM context\r
-  CodeOffset  - offset from IP of the location of the 32-bit index to decode\r
-\r
-Returns:\r
-  Converted index per EBC VM specification\r
-\r
---*/\r
 {\r
   UINT32  Index;\r
   INT32   Offset;\r
@@ -3905,25 +3674,23 @@ Returns:
   return Offset;\r
 }\r
 \r
+\r
+/**\r
+  Decode a 64-bit index to determine the offset.\r
+\r
+  @param  VmPtr             pointer to VM context\r
+  @param  CodeOffset        offset from IP of the location of the 64-bit index to\r
+                            decode\r
+\r
+  @return Converted index per EBC VM specification\r
+\r
+**/\r
 STATIC\r
 INT64\r
 VmReadIndex64 (\r
   IN VM_CONTEXT     *VmPtr,\r
   IN UINT32         CodeOffset\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Decode a 64-bit index to determine the offset.\r
-\r
-Arguments:\r
-  VmPtr       - pointer to VM context\r
-  CodeOffset  - offset from IP of the location of the 64-bit index to decode\r
-\r
-Returns:\r
-  Converted index per EBC VM specification\r
-\r
---*/\r
 {\r
   UINT64  Index;\r
   INT64   Offset;\r
@@ -3971,37 +3738,32 @@ Returns:
   return Offset;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-VmWriteMem8 (\r
-  IN VM_CONTEXT    *VmPtr,\r
-  IN UINTN         Addr,\r
-  IN UINT8         Data\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
+/**\r
   The following VmWriteMem? routines are called by the EBC data\r
   movement instructions that write to memory. Since these writes\r
   may be to the stack, which looks like (high address on top) this,\r
-\r
   [EBC entry point arguments]\r
   [VM stack]\r
   [EBC stack]\r
-\r
   we need to detect all attempts to write to the EBC entry point argument\r
-  stack area and adjust the address (which will initially point into the \r
+  stack area and adjust the address (which will initially point into the\r
   VM stack) to point into the EBC entry point arguments.\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-  Addr    - adddress to write to\r
-  Data    - value to write to Addr\r
-  \r
-Returns:\r
-  Standard EFI_STATUS\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Addr              adddress to write to\r
+  @param  Data              value to write to Addr\r
+\r
+  @return Standard EFI_STATUS\r
 \r
---*/\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+VmWriteMem8 (\r
+  IN VM_CONTEXT    *VmPtr,\r
+  IN UINTN         Addr,\r
+  IN UINT8         Data\r
+  )\r
 {\r
   //\r
   // Convert the address if it's in the stack gap\r
@@ -4166,29 +3928,25 @@ VmWriteMemN (
   return Status;\r
 }\r
 \r
-STATIC\r
-INT8\r
-VmReadImmed8 (\r
-  IN VM_CONTEXT *VmPtr,\r
-  IN UINT32     Offset\r
-  )\r
-/*++\r
 \r
-Routine Description:\r
-  \r
+/**\r
   The following VmReadImmed routines are called by the EBC execute\r
   functions to read EBC immediate values from the code stream.\r
-  Since we can't assume alignment, each tries to read in the biggest \r
+  Since we can't assume alignment, each tries to read in the biggest\r
   chunks size available, but will revert to smaller reads if necessary.\r
 \r
-Arguments:\r
-  VmPtr   - pointer to a VM context  \r
-  Offset  - offset from IP of the code bytes to read.\r
+  @param  VmPtr             pointer to a VM context\r
+  @param  Offset            offset from IP of the code bytes to read.\r
 \r
-Returns:\r
-  Signed data of the requested size from the specified address.\r
+  @return Signed data of the requested size from the specified address.\r
 \r
---*/\r
+**/\r
+STATIC\r
+INT8\r
+VmReadImmed8 (\r
+  IN VM_CONTEXT *VmPtr,\r
+  IN UINT32     Offset\r
+  )\r
 {\r
   //\r
   // Simply return the data in flat memory space\r
@@ -4276,26 +4034,23 @@ VmReadImmed64 (
   return Data64;\r
 }\r
 \r
+\r
+/**\r
+  The following VmReadCode() routines provide the ability to read raw\r
+  unsigned data from the code stream.\r
+\r
+  @param  VmPtr             pointer to VM context\r
+  @param  Offset            offset from current IP to the raw data to read.\r
+\r
+  @return The raw unsigned 16-bit value from the code stream.\r
+\r
+**/\r
 STATIC\r
 UINT16\r
 VmReadCode16 (\r
   IN VM_CONTEXT *VmPtr,\r
   IN UINT32     Offset\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  The following VmReadCode() routines provide the ability to read raw \r
-  unsigned data from the code stream. \r
-  \r
-Arguments:\r
-  VmPtr   - pointer to VM context\r
-  Offset  - offset from current IP to the raw data to read.\r
-\r
-Returns:\r
-  The raw unsigned 16-bit value from the code stream.\r
-  \r
---*/\r
 {\r
   //\r
   // Read direct if aligned\r
@@ -4466,64 +4221,53 @@ VmReadMem64 (
   return Data;\r
 }\r
 \r
-STATIC\r
-UINTN\r
-ConvertStackAddr (\r
-  IN VM_CONTEXT    *VmPtr,\r
-  IN UINTN         Addr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
 \r
+/**\r
   Given an address that EBC is going to read from or write to, return\r
   an appropriate address that accounts for a gap in the stack.\r
-  \r
   The stack for this application looks like this (high addr on top)\r
   [EBC entry point arguments]\r
   [VM stack]\r
   [EBC stack]\r
-\r
   The EBC assumes that its arguments are at the top of its stack, which\r
   is where the VM stack is really. Therefore if the EBC does memory\r
   accesses into the VM stack area, then we need to convert the address\r
   to point to the EBC entry point arguments area. Do this here.\r
 \r
-Arguments:\r
+  @param  VmPtr             pointer to VM context\r
+  @param  Addr              address of interest\r
 \r
-  VmPtr    - pointer to VM context\r
-  Addr  - address of interest\r
+  @return The unchanged address if it's not in the VM stack region. Otherwise,\r
+  @return adjust for the stack gap and return the modified address.\r
 \r
-Returns:\r
-\r
-  The unchanged address if it's not in the VM stack region. Otherwise, \r
-  adjust for the stack gap and return the modified address.\r
-  \r
---*/\r
-{ \r
+**/\r
+STATIC\r
+UINTN\r
+ConvertStackAddr (\r
+  IN VM_CONTEXT    *VmPtr,\r
+  IN UINTN         Addr\r
+  )\r
+{\r
   ASSERT(((Addr < VmPtr->LowStackTop) || (Addr > VmPtr->HighStackBottom)));\r
   return Addr;\r
 }\r
 \r
+\r
+/**\r
+  Read a natural value from memory. May or may not be aligned.\r
+\r
+  @param  VmPtr             current VM context\r
+  @param  Addr              the address to read from\r
+\r
+  @return The natural value at address Addr.\r
+\r
+**/\r
 STATIC\r
 UINTN\r
 VmReadMemN (\r
   IN VM_CONTEXT    *VmPtr,\r
   IN UINTN         Addr\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  Read a natural value from memory. May or may not be aligned.\r
-  \r
-Arguments:\r
-  VmPtr   - current VM context\r
-  Addr    - the address to read from\r
-\r
-Returns:\r
-  The natural value at address Addr.\r
-  \r
---*/\r
 {\r
   UINTN   Data;\r
   volatile UINT32  Size;\r