]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcExecute.c
Add doxygen style comments for functions in EBC module.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcExecute.c
index d44892e84af3b6be9f0b5d3f74db81fb19830f72..c3c7b915f98ea6a5ba0f3edfe0815e1c2ebaaba1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Contains code that implements the virtual machine.\r
 \r
-Copyright (c) 2006, Intel Corporation\r
+Copyright (c) 2006 - 2008, 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
@@ -42,6 +42,28 @@ UINT64
   IN UINT64     Op2\r
   );\r
 \r
+/**\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 = ConstUnits\r
+    b0:a    - natural units = NaturalUnits\r
+  \r
+  Given this info, the offset can be computed by:\r
+    offset = sign_bit * (ConstUnits + NaturalUnits * 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
+  @param  VmPtr             A pointer to VM context.\r
+  @param  CodeOffset        Offset from IP of the location of the 16-bit index\r
+                            to decode.\r
+\r
+  @return The decoded offset.\r
+\r
+**/\r
 STATIC\r
 INT16\r
 VmReadIndex16 (\r
@@ -49,6 +71,16 @@ VmReadIndex16 (
   IN UINT32     CodeOffset\r
   );\r
 \r
+/**\r
+  Decode a 32-bit index to determine the offset.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  CodeOffset        Offset from IP of the location of the 32-bit index\r
+                            to decode.\r
+\r
+  @return Converted index per EBC VM specification.\r
+\r
+**/\r
 STATIC\r
 INT32\r
 VmReadIndex32 (\r
@@ -56,6 +88,16 @@ VmReadIndex32 (
   IN UINT32     CodeOffset\r
   );\r
 \r
+/**\r
+  Decode a 64-bit index to determine the offset.\r
+\r
+  @param  VmPtr             A pointer to VM context.s\r
+  @param  CodeOffset        Offset from IP of the location of the 64-bit index\r
+                            to decode.\r
+\r
+  @return Converted index per EBC VM specification\r
+\r
+**/\r
 STATIC\r
 INT64\r
 VmReadIndex64 (\r
@@ -63,6 +105,15 @@ VmReadIndex64 (
   IN UINT32     CodeOffset\r
   );\r
 \r
+/**\r
+  Reads 8-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 8-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT8\r
 VmReadMem8 (\r
@@ -70,6 +121,15 @@ VmReadMem8 (
   IN UINTN      Addr\r
   );\r
 \r
+/**\r
+  Reads 16-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 16-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT16\r
 VmReadMem16 (\r
@@ -77,6 +137,15 @@ VmReadMem16 (
   IN UINTN      Addr\r
   );\r
 \r
+/**\r
+  Reads 32-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 32-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT32\r
 VmReadMem32 (\r
@@ -84,6 +153,15 @@ VmReadMem32 (
   IN UINTN      Addr\r
   );\r
 \r
+/**\r
+  Reads 64-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 64-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 VmReadMem64 (\r
@@ -91,6 +169,15 @@ VmReadMem64 (
   IN UINTN      Addr\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
@@ -98,30 +185,111 @@ VmReadMemN (
   IN UINTN      Addr\r
   );\r
 \r
+/**\r
+  Writes 8-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 VmWriteMem8 (\r
   IN VM_CONTEXT *VmPtr,\r
-  UINTN         Addr,\r
+  IN UINTN      Addr,\r
   IN UINT8      Data\r
   );\r
 \r
+/**\r
+  Writes 16-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 VmWriteMem16 (\r
   IN VM_CONTEXT *VmPtr,\r
-  UINTN         Addr,\r
+  IN UINTN      Addr,\r
   IN UINT16     Data\r
   );\r
 \r
+/**\r
+  Writes 32-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 VmWriteMem32 (\r
   IN VM_CONTEXT *VmPtr,\r
-  UINTN         Addr,\r
+  IN UINTN      Addr,\r
   IN UINT32     Data\r
   );\r
 \r
+/**\r
+  Reads 16-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
+\r
+  @param  VmPtr             A 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
@@ -129,6 +297,18 @@ VmReadCode16 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 32-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
+\r
+  @param  VmPtr             A pointer to VM context\r
+  @param  Offset            Offset from current IP to the raw data to read.\r
+\r
+  @return The raw unsigned 32-bit value from the code stream.\r
+\r
+**/\r
 STATIC\r
 UINT32\r
 VmReadCode32 (\r
@@ -136,6 +316,18 @@ VmReadCode32 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 64-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
+\r
+  @param  VmPtr             A pointer to VM context\r
+  @param  Offset            Offset from current IP to the raw data to read.\r
+\r
+  @return The raw unsigned 64-bit value from the code stream.\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 VmReadCode64 (\r
@@ -143,6 +335,20 @@ VmReadCode64 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 8-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT8\r
 VmReadImmed8 (\r
@@ -150,6 +356,20 @@ VmReadImmed8 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 16-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT16\r
 VmReadImmed16 (\r
@@ -157,6 +377,20 @@ VmReadImmed16 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 32-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT32\r
 VmReadImmed32 (\r
@@ -164,6 +398,20 @@ VmReadImmed32 (
   IN UINT32     Offset\r
   );\r
 \r
+/**\r
+  Reads 64-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT64\r
 VmReadImmed64 (\r
@@ -171,6 +419,25 @@ VmReadImmed64 (
   IN UINT32     Offset\r
   );\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
+  The stack for this application looks like this (high addr on top)\r
+  [EBC entry point arguments]\r
+  [VM stack]\r
+  [EBC stack]\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
+  @param  VmPtr             A Pointer to VM context.\r
+  @param  Addr              Address of interest\r
+\r
+  @return 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
 STATIC\r
 UINTN\r
 ConvertStackAddr (\r
@@ -178,136 +445,459 @@ ConvertStackAddr (
   IN UINTN        Addr\r
   );\r
 \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
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  IsSignedOp        Indicates whether the operand is signed or not.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteDataManip (\r
   IN VM_CONTEXT   *VmPtr,\r
-  IN BOOLEAN      IsSignedOperation\r
+  IN BOOLEAN      IsSignedOp\r
   );\r
 \r
 //\r
 // Functions that execute VM opcodes\r
 //\r
+/**\r
+  Execute the EBC BREAK instruction.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteBREAK (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the JMP instruction.\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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteJMP (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC JMP8 instruction.\r
+\r
+  Instruction syntax:\r
+    JMP8{cs|cc}  Offset/2\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteJMP8 (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Implements the EBC CALL instruction.\r
+\r
+  Instruction format:\r
+    CALL64 Immed64\r
+    CALL32 {@}R1 {Immed32|Index32}\r
+    CALLEX64 Immed64\r
+    CALLEX16 {@}R1 {Immed32}\r
+\r
+    If Rx == R0, then it's a PC relative call to PC = PC + imm32.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteCALL (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC RET instruction.\r
+\r
+  Instruction syntax:\r
+    RET\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteRET (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC CMP instruction.\r
+\r
+  Instruction syntax:\r
+    CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteCMP (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC CMPI instruction\r
+\r
+  Instruction syntax:\r
+    CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteCMPI (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the MOVxx instructions.\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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVxx (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC MOVI.\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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVI (\r
   IN VM_CONTEXT *VmPtr\r
   );\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
+  Instruction syntax:\r
+  \r
+    MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVIn (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC MOVREL instruction.\r
+  Dest <- Ip + ImmData\r
+\r
+  Instruction syntax:\r
+  \r
+    MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVREL (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC PUSHn instruction\r
+\r
+  Instruction syntax:\r
+    PUSHn {@}R1 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecutePUSHn (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC PUSH instruction.\r
+\r
+  Instruction syntax:\r
+    PUSH[32|64] {@}R1 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecutePUSH (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC POPn instruction.\r
+\r
+  Instruction syntax:\r
+    POPn {@}R1 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecutePOPn (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC POP instruction.\r
+\r
+  Instruction syntax:\r
+    POPn {@}R1 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecutePOP (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute all the EBC signed 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
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteSignedDataManip (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute all the EBC unsigned 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
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteUnsignedDataManip (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC LOADSP instruction.\r
+\r
+  Instruction syntax:\r
+    LOADSP  SP1, R2\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteLOADSP (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \r
+/**\r
+  Execute the EBC STORESP instruction.\r
+\r
+  Instruction syntax:\r
+    STORESP  Rx, FLAGS|IP\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteSTORESP (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \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
+  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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVsnd (\r
   IN VM_CONTEXT *VmPtr\r
   );\r
 \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
+  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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteMOVsnw (\r
@@ -317,6 +907,19 @@ ExecuteMOVsnw (
 //\r
 // Data manipulation subfunctions\r
 //\r
+/**\r
+  Execute the EBC NOT instruction.s\r
+\r
+  Instruction syntax:\r
+    NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteNOT (\r
@@ -325,6 +928,19 @@ ExecuteNOT (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC NEG instruction.\r
+\r
+  Instruction syntax:\r
+    NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 * -1\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteNEG (\r
@@ -333,6 +949,19 @@ ExecuteNEG (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC ADD instruction.\r
+\r
+  Instruction syntax:\r
+    ADD[32|64] {@}R1, {@}R2 {Index16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteADD (\r
@@ -341,6 +970,19 @@ ExecuteADD (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC SUB instruction.\r
+\r
+  Instruction syntax:\r
+    SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSUB (\r
@@ -349,6 +991,19 @@ ExecuteSUB (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC MUL instruction.\r
+\r
+  Instruction syntax:\r
+    SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMUL (\r
@@ -357,6 +1012,19 @@ ExecuteMUL (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC MULU instruction\r
+\r
+  Instruction syntax:\r
+    MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMULU (\r
@@ -365,6 +1033,19 @@ ExecuteMULU (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC DIV instruction.\r
+\r
+  Instruction syntax:\r
+    DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteDIV (\r
@@ -373,6 +1054,19 @@ ExecuteDIV (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC DIVU instruction\r
+\r
+  Instruction syntax:\r
+    DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteDIVU (\r
@@ -381,6 +1075,19 @@ ExecuteDIVU (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC MOD instruction.\r
+\r
+  Instruction syntax:\r
+    MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMOD (\r
@@ -389,6 +1096,19 @@ ExecuteMOD (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC MODU instruction.\r
+\r
+  Instruction syntax:\r
+    MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteMODU (\r
@@ -397,6 +1117,19 @@ ExecuteMODU (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC AND instruction.\r
+\r
+  Instruction syntax:\r
+    AND[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteAND (\r
@@ -405,6 +1138,19 @@ ExecuteAND (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC OR instruction.\r
+\r
+  Instruction syntax:\r
+    OR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 OR Op2\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteOR (\r
@@ -413,6 +1159,19 @@ ExecuteOR (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC XOR instruction.\r
+\r
+  Instruction syntax:\r
+    XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 XOR Op2\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteXOR (\r
@@ -421,6 +1180,19 @@ ExecuteXOR (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC SHL shift left instruction.\r
+\r
+  Instruction syntax:\r
+    SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSHL (\r
@@ -429,6 +1201,19 @@ ExecuteSHL (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC SHR instruction.\r
+\r
+  Instruction syntax:\r
+    SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteSHR (\r
@@ -437,6 +1222,19 @@ ExecuteSHR (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC ASHR instruction.\r
+\r
+  Instruction syntax:\r
+    ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteASHR (\r
@@ -445,6 +1243,19 @@ ExecuteASHR (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC EXTNDB instruction to sign-extend a byte value.\r
+\r
+  Instruction syntax:\r
+    EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDB (\r
@@ -453,6 +1264,19 @@ ExecuteEXTNDB (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.\r
+\r
+  Instruction syntax:\r
+    EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDW (\r
@@ -461,6 +1285,19 @@ ExecuteEXTNDW (
   IN UINT64     Op2\r
   );\r
 \r
+/**\r
+  Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.\r
+\r
+  Instruction syntax:\r
+    EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
+\r
+**/\r
 STATIC\r
 UINT64\r
 ExecuteEXTNDD (\r
@@ -473,7 +1310,7 @@ ExecuteEXTNDD (
 // Once we retrieve the operands for the data manipulation instructions,\r
 // call these functions to perform the operation.\r
 //\r
-static CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] = {\r
+STATIC CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] = {\r
   ExecuteNOT,\r
   ExecuteNEG,\r
   ExecuteADD,\r
@@ -495,7 +1332,7 @@ static CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] = {
   ExecuteEXTNDD,\r
 };\r
 \r
-static CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {\r
+STATIC CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {\r
   { ExecuteBREAK },             // opcode 0x00\r
   { ExecuteJMP },               // opcode 0x01\r
   { ExecuteJMP8 },              // opcode 0x02\r
@@ -559,7 +1396,7 @@ static CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {
 //\r
 // Length of JMP instructions, depending on upper two bits of opcode.\r
 //\r
-static CONST UINT8                    mJMPLen[] = { 2, 2, 6, 10 };\r
+STATIC CONST UINT8                    mJMPLen[] = { 2, 2, 6, 10 };\r
 \r
 //\r
 // Simple Debugger Protocol GUID\r
@@ -571,12 +1408,14 @@ EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;
   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
-  @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
+  @param  This              A pointer to the EFI_EBC_VM_TEST_PROTOCOL structure.\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  InstructionCount  A pointer to a UINTN value holding the number of\r
+                            instructions to execute. If it holds value of 0,\r
+                            then the instruction to be executed is 1.\r
 \r
-  @return EFI_UNSUPPORTED\r
-  @return EFI_SUCCESS\r
+  @retval EFI_UNSUPPORTED   At least one of the opcodes is not supported.\r
+  @retval EFI_SUCCESS       All of the instructions are executed successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -632,9 +1471,10 @@ EbcExecuteInstructions (
 /**\r
   Execute an EBC image from an entry point or from a published protocol.\r
 \r
-  @param  VmPtr             pointer to prepared VM context.\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EBC status.\r
+  @retval EFI_UNSUPPORTED   At least one of the opcodes is not supported.\r
+  @retval EFI_SUCCESS       All of the instructions are executed successfully.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -755,17 +1595,22 @@ Done:
 /**\r
   Execute the MOVxx instructions.\r
 \r
-  @param  VmPtr             pointer to a VM context.\r
-\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
+  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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1031,12 +1876,11 @@ ExecuteMOVxx (
 \r
 \r
 /**\r
-  Execute the EBC BREAK instruction\r
+  Execute the EBC BREAK instruction.\r
 \r
-  @param  VmPtr             pointer to current VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return EFI_UNSUPPORTED\r
-  @return EFI_SUCCESS\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1141,21 +1985,28 @@ ExecuteBREAK (
 \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
+  Execute the JMP instruction.\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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1311,13 +2162,14 @@ ExecuteJMP (
 \r
 \r
 /**\r
-  Execute the EBC JMP8 instruction\r
+  Execute the EBC JMP8 instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    JMP8{cs|cc}  Offset/2\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return JMP8{cs|cc}  Offset/2\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1361,18 +2213,24 @@ ExecuteJMP8 (
 \r
 \r
 /**\r
-  Execute the EBC MOVI\r
+  Execute the EBC MOVI.\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
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1484,11 +2342,14 @@ ExecuteMOVI (
   Execute the EBC MOV immediate natural. This instruction moves an immediate\r
   index value into a register or memory location.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+  \r
+    MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return MOVIn[w|d|q] {@}R1 {Index16}, Index16|32|64\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1584,11 +2445,14 @@ ExecuteMOVIn (
   Execute the EBC MOVREL instruction.\r
   Dest <- Ip + ImmData\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+  \r
+    MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return MOVREL[w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1685,13 +2549,17 @@ ExecuteMOVREL (
   32-bit machines, the value gets sign-extended to 64 bits if the destination\r
   is a register.\r
 \r
-  @param  VmPtr             pointer to a VM context\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
-  @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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1775,13 +2643,17 @@ ExecuteMOVsnw (
   32-bit machines, the value gets sign-extended to 64 bits if the destination\r
   is a register.\r
 \r
-  @param  VmPtr             pointer to a VM context\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
+  @param  VmPtr             A pointer to a VM context.\r
 \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
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1862,11 +2734,12 @@ ExecuteMOVsnd (
 /**\r
   Execute the EBC PUSHn instruction\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    PUSHn {@}R1 {Index16|Immed16}\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return PUSHn {@}R1 {Index16|Immed16}\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1919,13 +2792,14 @@ ExecutePUSHn (
 \r
 \r
 /**\r
-  Execute the EBC PUSH instruction\r
+  Execute the EBC PUSH instruction.\r
+\r
+  Instruction syntax:\r
+    PUSH[32|64] {@}R1 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return PUSH[32|64] {@}R1 {Index16|Immed16}\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -1995,13 +2869,14 @@ ExecutePUSH (
 \r
 \r
 /**\r
-  Execute the EBC POPn instruction\r
+  Execute the EBC POPn instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    POPn {@}R1 {Index16|Immed16}\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return POPn {@}R1 {Index16|Immed16}\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2054,13 +2929,14 @@ ExecutePOPn (
 \r
 \r
 /**\r
-  Execute the EBC POP instruction\r
+  Execute the EBC POP instruction.\r
+\r
+  Instruction syntax:\r
+    POPn {@}R1 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return POP {@}R1 {Index16|Immed16}\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2134,16 +3010,18 @@ ExecutePOP (
 \r
 /**\r
   Implements the EBC CALL instruction.\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
+    CALL64 Immed64\r
+    CALL32 {@}R1 {Immed32|Index32}\r
+    CALLEX64 Immed64\r
+    CALLEX16 {@}R1 {Immed32}\r
+\r
+    If Rx == R0, then it's a PC relative call to PC = PC + imm32.\r
 \r
-  @param  VmPtr             pointer to a VM context.\r
+  @param  VmPtr             pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2270,13 +3148,14 @@ ExecuteCALL (
 \r
 \r
 /**\r
-  Execute the EBC RET instruction\r
+  Execute the EBC RET instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    RET\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return RET\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2317,13 +3196,15 @@ ExecuteRET (
 \r
 \r
 /**\r
-  Execute the EBC CMP instruction\r
+  Execute the EBC CMP instruction.\r
+\r
+  Instruction syntax:\r
+    CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return CMP[32|64][eq|lte|gte|ulte|ugte] R1, {@}R2 {Index16|Immed16}\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2479,11 +3360,13 @@ ExecuteCMP (
 /**\r
   Execute the EBC CMPI instruction\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    CMPI[32|64]{w|d}[eq|lte|gte|ulte|ugte] {@}Rx {Index16}, Immed16|Immed32\r
 \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
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -2655,15 +3538,16 @@ ExecuteCMPI (
 \r
 \r
 /**\r
-  Execute the EBC NOT instruction\r
+  Execute the EBC NOT instruction.s\r
+\r
+  Instruction syntax:\r
+    NOT[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
@@ -2679,15 +3563,16 @@ ExecuteNOT (
 \r
 \r
 /**\r
-  Execute the EBC NEG instruction\r
+  Execute the EBC NEG instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 * -1\r
-  @return Instruction syntax:\r
-  @return NEG[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
 **/\r
 STATIC\r
@@ -2703,15 +3588,16 @@ ExecuteNEG (
 \r
 \r
 /**\r
-  Execute the EBC ADD instruction\r
+  Execute the EBC ADD instruction.\r
+\r
+  Instruction syntax:\r
+    ADD[32|64] {@}R1, {@}R2 {Index16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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 ADD[32|64] {@}R1, {@}R2 {Index16}\r
 \r
 **/\r
 STATIC\r
@@ -2727,15 +3613,16 @@ ExecuteADD (
 \r
 \r
 /**\r
-  Execute the EBC SUB instruction\r
+  Execute the EBC SUB instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
   @param  Op1               Operand 1 from the instruction\r
   @param  Op2               Operand 2 from the instruction\r
 \r
-  @retval Op1               Op2 Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+  @return Op1 - Op2\r
 \r
 **/\r
 STATIC\r
@@ -2755,15 +3642,16 @@ ExecuteSUB (
 \r
 \r
 /**\r
-  Execute the EBC MUL instruction\r
+  Execute the EBC MUL instruction.\r
+\r
+  Instruction syntax:\r
+    SUB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
@@ -2785,13 +3673,14 @@ ExecuteMUL (
 /**\r
   Execute the EBC MULU instruction\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    MULU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -2811,15 +3700,16 @@ ExecuteMULU (
 \r
 \r
 /**\r
-  Execute the EBC DIV instruction\r
+  Execute the EBC DIV instruction.\r
+\r
+  Instruction syntax:\r
+    DIV[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
+  @return Op1 / Op2\r
 \r
 **/\r
 STATIC\r
@@ -2856,13 +3746,14 @@ ExecuteDIV (
 /**\r
   Execute the EBC DIVU instruction\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    DIVU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -2899,15 +3790,16 @@ ExecuteDIVU (
 \r
 \r
 /**\r
-  Execute the EBC MOD instruction\r
+  Execute the EBC MOD instruction.\r
+\r
+  Instruction syntax:\r
+    MOD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
@@ -2938,15 +3830,16 @@ ExecuteMOD (
 \r
 \r
 /**\r
-  Execute the EBC MODU instruction\r
+  Execute the EBC MODU instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    MODU[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -2977,15 +3870,16 @@ ExecuteMODU (
 \r
 \r
 /**\r
-  Execute the EBC AND instruction\r
+  Execute the EBC AND instruction.\r
+\r
+  Instruction syntax:\r
+    AND[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
@@ -3001,15 +3895,16 @@ ExecuteAND (
 \r
 \r
 /**\r
-  Execute the EBC OR instruction\r
+  Execute the EBC OR instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    OR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 OR Op2\r
-  @return Instruction syntax:\r
-  @return OR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
 **/\r
 STATIC\r
@@ -3025,15 +3920,16 @@ ExecuteOR (
 \r
 \r
 /**\r
-  Execute the EBC XOR instruction\r
+  Execute the EBC XOR instruction.\r
+\r
+  Instruction syntax:\r
+    XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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 XOR Op2\r
-  @return Instruction syntax:\r
-  @return XOR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
 **/\r
 STATIC\r
@@ -3049,15 +3945,16 @@ ExecuteXOR (
 \r
 \r
 /**\r
-  Execute the EBC SHL shift left instruction\r
+  Execute the EBC SHL shift left instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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 SHL[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
 **/\r
 STATIC\r
@@ -3077,15 +3974,16 @@ ExecuteSHL (
 \r
 \r
 /**\r
-  Execute the EBC SHR instruction\r
+  Execute the EBC SHR instruction.\r
+\r
+  Instruction syntax:\r
+    SHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A 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
@@ -3105,15 +4003,16 @@ ExecuteSHR (
 \r
 \r
 /**\r
-  Execute the EBC ASHR instruction\r
+  Execute the EBC ASHR instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    ASHR[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -3135,13 +4034,14 @@ ExecuteASHR (
 /**\r
   Execute the EBC EXTNDB instruction to sign-extend a byte value.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    EXTNDB[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -3168,13 +4068,14 @@ ExecuteEXTNDB (
 /**\r
   Execute the EBC EXTNDW instruction to sign-extend a 16-bit value.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    EXTNDW[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -3208,13 +4109,14 @@ ExecuteEXTNDW (
 /**\r
   Execute the EBC EXTNDD instruction to sign-extend a 32-bit value.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    EXTNDD[32|64] {@}R1, {@}R2 {Index16|Immed16}\r
+\r
+  @param  VmPtr             A 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
@@ -3237,6 +4139,24 @@ ExecuteEXTNDD (
   return (UINT64) Data64;\r
 }\r
 \r
+\r
+/**\r
+  Execute all the EBC signed 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
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteSignedDataManip (\r
@@ -3250,6 +4170,24 @@ ExecuteSignedDataManip (
   return ExecuteDataManip (VmPtr, TRUE);\r
 }\r
 \r
+\r
+/**\r
+  Execute all the EBC unsigned 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
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 ExecuteUnsignedDataManip (\r
@@ -3272,11 +4210,14 @@ ExecuteUnsignedDataManip (
   both are not needed to be fetched, like NOT instruction), dispatches to the\r
   appropriate subfunction, then writes back the returned result.\r
 \r
-  @param  VmPtr             pointer to VM context\r
+  Format:\r
+    INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
 \r
-  @return Standard EBC status\r
-  @return Format:\r
-  @return INSTRUCITON[32|64] {@}R1, {@}R2 {Immed16|Index16}\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  IsSignedOp        Indicates whether the operand is signed or not.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -3418,13 +4359,15 @@ ExecuteDataManip (
 \r
 \r
 /**\r
-  Execute the EBC LOADSP instruction\r
+  Execute the EBC LOADSP instruction.\r
+\r
+  Instruction syntax:\r
+    LOADSP  SP1, R2\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return LOADSP  SP1, R2\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -3471,13 +4414,15 @@ ExecuteLOADSP (
 \r
 \r
 /**\r
-  Execute the EBC STORESP instruction\r
+  Execute the EBC STORESP instruction.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  Instruction syntax:\r
+    STORESP  Rx, FLAGS|IP\r
 \r
-  @return Standard EFI_STATUS\r
-  @return Instruction syntax:\r
-  @return STORESP  Rx, FLAGS|IP\r
+  @param  VmPtr             A pointer to a VM context.\r
+\r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
 STATIC\r
@@ -3532,19 +4477,22 @@ ExecuteSTORESP (
 \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
+\r
+    b15     - sign bit\r
+    b14:12  - number of bits in this index assigned to natural units (=a)\r
+    ba:11   - constant units = ConstUnits\r
+    b0:a    - natural units = NaturalUnits\r
+  \r
   Given this info, the offset can be computed by:\r
-  offset = sign_bit * (C + N * sizeof(UINTN))\r
+    offset = sign_bit * (ConstUnits + NaturalUnits * 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
+  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
+  @param  VmPtr             A pointer to VM context.\r
+  @param  CodeOffset        Offset from IP of the location of the 16-bit index\r
+                            to decode.\r
 \r
   @return The decoded offset.\r
 \r
@@ -3558,8 +4506,8 @@ VmReadIndex16 (
 {\r
   UINT16  Index;\r
   INT16   Offset;\r
-  INT16   C;\r
-  INT16   N;\r
+  INT16   ConstUnits;\r
+  INT16   NaturalUnits;\r
   INT16   NBits;\r
   INT16   Mask;\r
 \r
@@ -3569,7 +4517,7 @@ VmReadIndex16 (
   Index = VmReadCode16 (VmPtr, CodeOffset);\r
 \r
   //\r
-  // Get the mask for N. First get the number of bits from the index.\r
+  // Get the mask for NaturalUnits. First get the number of bits from the index.\r
   //\r
   NBits = (INT16) ((Index & 0x7000) >> 12);\r
 \r
@@ -3584,16 +4532,16 @@ VmReadIndex16 (
   Mask = (INT16) ((INT16)~0 << NBits);\r
 \r
   //\r
-  // Now using the mask, extract N from the lower bits of the index.\r
+  // Now using the mask, extract NaturalUnits from the lower bits of the index.\r
   //\r
-  N = (INT16) (Index &~Mask);\r
+  NaturalUnits = (INT16) (Index &~Mask);\r
 \r
   //\r
-  // Now compute C\r
+  // Now compute ConstUnits\r
   //\r
-  C       = (INT16) (((Index &~0xF000) & Mask) >> NBits);\r
+  ConstUnits       = (INT16) (((Index &~0xF000) & Mask) >> NBits);\r
 \r
-  Offset  = (INT16) (N * sizeof (UINTN) + C);\r
+  Offset  = (INT16) (NaturalUnits * sizeof (UINTN) + ConstUnits);\r
 \r
   //\r
   // Now set the sign\r
@@ -3614,11 +4562,11 @@ VmReadIndex16 (
 /**\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
+  @param  VmPtr             A pointer to VM context.\r
+  @param  CodeOffset        Offset from IP of the location of the 32-bit index\r
+                            to decode.\r
 \r
-  @return Converted index per EBC VM specification\r
+  @return Converted index per EBC VM specification.\r
 \r
 **/\r
 STATIC\r
@@ -3630,15 +4578,15 @@ VmReadIndex32 (
 {\r
   UINT32  Index;\r
   INT32   Offset;\r
-  INT32   C;\r
-  INT32   N;\r
+  INT32   ConstUnits;\r
+  INT32   NaturalUnits;\r
   INT32   NBits;\r
   INT32   Mask;\r
 \r
   Index = VmReadImmed32 (VmPtr, CodeOffset);\r
 \r
   //\r
-  // Get the mask for N. First get the number of bits from the index.\r
+  // Get the mask for NaturalUnits. First get the number of bits from the index.\r
   //\r
   NBits = (Index & 0x70000000) >> 28;\r
 \r
@@ -3653,16 +4601,16 @@ VmReadIndex32 (
   Mask = (INT32)~0 << NBits;\r
 \r
   //\r
-  // Now using the mask, extract N from the lower bits of the index.\r
+  // Now using the mask, extract NaturalUnits from the lower bits of the index.\r
   //\r
-  N = Index &~Mask;\r
+  NaturalUnits = Index &~Mask;\r
 \r
   //\r
-  // Now compute C\r
+  // Now compute ConstUnits\r
   //\r
-  C       = ((Index &~0xF0000000) & Mask) >> NBits;\r
+  ConstUnits       = ((Index &~0xF0000000) & Mask) >> NBits;\r
 \r
-  Offset  = N * sizeof (UINTN) + C;\r
+  Offset  = NaturalUnits * sizeof (UINTN) + ConstUnits;\r
 \r
   //\r
   // Now set the sign\r
@@ -3678,9 +4626,9 @@ VmReadIndex32 (
 /**\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
+  @param  VmPtr             A pointer to VM context.s\r
+  @param  CodeOffset        Offset from IP of the location of the 64-bit index\r
+                            to decode.\r
 \r
   @return Converted index per EBC VM specification\r
 \r
@@ -3694,15 +4642,15 @@ VmReadIndex64 (
 {\r
   UINT64  Index;\r
   INT64   Offset;\r
-  INT64   C;\r
-  INT64   N;\r
+  INT64   ConstUnits;\r
+  INT64   NaturalUnits;\r
   INT64   NBits;\r
   INT64   Mask;\r
 \r
   Index = VmReadCode64 (VmPtr, CodeOffset);\r
 \r
   //\r
-  // Get the mask for N. First get the number of bits from the index.\r
+  // Get the mask for NaturalUnits. First get the number of bits from the index.\r
   //\r
   NBits = RShiftU64 ((Index & 0x7000000000000000ULL), 60);\r
 \r
@@ -3717,16 +4665,16 @@ VmReadIndex64 (
   Mask = (LShiftU64 ((UINT64)~0, (UINTN)NBits));\r
 \r
   //\r
-  // Now using the mask, extract N from the lower bits of the index.\r
+  // Now using the mask, extract NaturalUnits from the lower bits of the index.\r
   //\r
-  N = Index &~Mask;\r
+  NaturalUnits = Index &~Mask;\r
 \r
   //\r
-  // Now compute C\r
+  // Now compute ConstUnits\r
   //\r
-  C       = ARShiftU64 (((Index &~0xF000000000000000ULL) & Mask), (UINTN)NBits);\r
+  ConstUnits = ARShiftU64 (((Index &~0xF000000000000000ULL) & Mask), (UINTN)NBits);\r
 \r
-  Offset  = MultU64x64 (N, sizeof (UINTN)) + C;\r
+  Offset  = MultU64x64 (NaturalUnits, sizeof (UINTN)) + ConstUnits;\r
 \r
   //\r
   // Now set the sign\r
@@ -3740,21 +4688,26 @@ VmReadIndex64 (
 \r
 \r
 /**\r
-  The following VmWriteMem? routines are called by the EBC data\r
+  Writes 8-bit data to memory address.\r
+   \r
+  This routine is 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
-  @param  VmPtr             pointer to a VM context\r
-  @param  Addr              adddress to write to\r
-  @param  Data              value to write to Addr\r
+  @param  VmPtr             A 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
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
 STATIC\r
@@ -3773,6 +4726,29 @@ VmWriteMem8 (
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Writes 16-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 VmWriteMem16 (\r
@@ -3813,6 +4789,30 @@ VmWriteMem16 (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Writes 32-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 VmWriteMem32 (\r
@@ -3853,6 +4853,30 @@ VmWriteMem32 (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Writes 64-bit data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 EFI_STATUS\r
 VmWriteMem64 (\r
   IN VM_CONTEXT   *VmPtr,\r
@@ -3894,6 +4918,30 @@ VmWriteMem64 (
   return EFI_SUCCESS;\r
 }\r
 \r
+\r
+/**\r
+  Writes UINTN data to memory address.\r
+   \r
+  This routine is 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
+  VM stack) to point into the EBC entry point arguments.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Addr              Adddress to write to.\r
+  @param  Data              Value to write to Addr.\r
+\r
+  @retval EFI_SUCCESS       The instruction is executed successfully.  \r
+  @retval Other             Some error occurs when writing data to the address.\r
+\r
+**/\r
 EFI_STATUS\r
 VmWriteMemN (\r
   IN VM_CONTEXT   *VmPtr,\r
@@ -3930,12 +4978,14 @@ VmWriteMemN (
 \r
 \r
 /**\r
-  The following VmReadImmed routines are called by the EBC execute\r
+  Reads 8-bit immediate value at the offset.\r
+\r
+  This routine is 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
   chunks size available, but will revert to smaller reads if necessary.\r
 \r
-  @param  VmPtr             pointer to a VM context\r
+  @param  VmPtr             A pointer to a VM context.\r
   @param  Offset            offset from IP of the code bytes to read.\r
 \r
   @return Signed data of the requested size from the specified address.\r
@@ -3954,6 +5004,20 @@ VmReadImmed8 (
   return * (INT8 *) (VmPtr->Ip + Offset);\r
 }\r
 \r
+/**\r
+  Reads 16-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT16\r
 VmReadImmed16 (\r
@@ -3982,6 +5046,21 @@ VmReadImmed16 (
   return (INT16) (*(UINT8 *) (VmPtr->Ip + Offset) + (*(UINT8 *) (VmPtr->Ip + Offset + 1) << 8));\r
 }\r
 \r
+\r
+/**\r
+  Reads 32-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT32\r
 VmReadImmed32 (\r
@@ -4005,6 +5084,21 @@ VmReadImmed32 (
   return Data;\r
 }\r
 \r
+\r
+/**\r
+  Reads 64-bit immediate value at the offset.\r
+\r
+  This routine is 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
+  chunks size available, but will revert to smaller reads if necessary.\r
+\r
+  @param  VmPtr             A pointer to a VM context.\r
+  @param  Offset            offset from IP of the code bytes to read.\r
+\r
+  @return Signed data of the requested size from the specified address.\r
+\r
+**/\r
 STATIC\r
 INT64\r
 VmReadImmed64 (\r
@@ -4036,11 +5130,13 @@ VmReadImmed64 (
 \r
 \r
 /**\r
-  The following VmReadCode() routines provide the ability to read raw\r
-  unsigned data from the code stream.\r
+  Reads 16-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
 \r
-  @param  VmPtr             pointer to VM context\r
-  @param  Offset            offset from current IP to the raw data to read.\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
@@ -4073,6 +5169,19 @@ VmReadCode16 (
   return (UINT16) (*(UINT8 *) (VmPtr->Ip + Offset) + (*(UINT8 *) (VmPtr->Ip + Offset + 1) << 8));\r
 }\r
 \r
+\r
+/**\r
+  Reads 32-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
+\r
+  @param  VmPtr             A pointer to VM context\r
+  @param  Offset            Offset from current IP to the raw data to read.\r
+\r
+  @return The raw unsigned 32-bit value from the code stream.\r
+\r
+**/\r
 STATIC\r
 UINT32\r
 VmReadCode32 (\r
@@ -4095,6 +5204,19 @@ VmReadCode32 (
   return Data;\r
 }\r
 \r
+\r
+/**\r
+  Reads 64-bit unsinged data from the code stream.\r
+\r
+  This routine provides the ability to read raw unsigned data from the code\r
+  stream.\r
+\r
+  @param  VmPtr             A pointer to VM context\r
+  @param  Offset            Offset from current IP to the raw data to read.\r
+\r
+  @return The raw unsigned 64-bit value from the code stream.\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 VmReadCode64 (\r
@@ -4124,6 +5246,16 @@ VmReadCode64 (
   return Data64;\r
 }\r
 \r
+\r
+/**\r
+  Reads 8-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 8-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT8\r
 VmReadMem8 (\r
@@ -4141,6 +5273,15 @@ VmReadMem8 (
   return * (UINT8 *) Addr;\r
 }\r
 \r
+/**\r
+  Reads 16-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 16-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT16\r
 VmReadMem16 (\r
@@ -4164,6 +5305,15 @@ VmReadMem16 (
   return (UINT16) (*(UINT8 *) Addr + (*(UINT8 *) (Addr + 1) << 8));\r
 }\r
 \r
+/**\r
+  Reads 32-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 32-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT32\r
 VmReadMem32 (\r
@@ -4191,6 +5341,15 @@ VmReadMem32 (
   return Data;\r
 }\r
 \r
+/**\r
+  Reads 64-bit data form the memory address.\r
+\r
+  @param  VmPtr             A pointer to VM context.\r
+  @param  Addr              The memory address.\r
+\r
+  @return The 64-bit value from the memory adress.\r
+\r
+**/\r
 STATIC\r
 UINT64\r
 VmReadMem64 (\r
@@ -4234,11 +5393,11 @@ VmReadMem64 (
   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
-  @param  VmPtr             pointer to VM context\r
-  @param  Addr              address of interest\r
+  @param  VmPtr             A Pointer to VM context.\r
+  @param  Addr              Address of interest\r
 \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
+          adjust for the stack gap and return the modified address.\r
 \r
 **/\r
 STATIC\r
@@ -4299,6 +5458,12 @@ VmReadMemN (
   return Data;\r
 }\r
 \r
+/**\r
+  Returns the version of the EBC virtual machine.\r
+    \r
+  @return The 64-bit version of EBC virtual machine.\r
+\r
+**/\r
 UINT64\r
 GetVmVersion (\r
   VOID\r