]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Code scrub for EBC module.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 26 Jul 2008 07:35:34 +0000 (07:35 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 26 Jul 2008 07:35:34 +0000 (07:35 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5568 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
MdeModulePkg/Universal/EbcDxe/EbcExecute.c
MdeModulePkg/Universal/EbcDxe/EbcExecute.h
MdeModulePkg/Universal/EbcDxe/EbcInt.c
MdeModulePkg/Universal/EbcDxe/EbcInt.h
MdeModulePkg/Universal/EbcDxe/X64/EbcSupport.c

index d912a2c93c84e7cae44b4cc907530303cac0749f..68fd2300c5666c11d3bdaddafed27f8b2714b0a2 100644 (file)
@@ -1,9 +1,7 @@
 #/** @file\r
 #  \r
-#    Component description file for Ebc module.\r
-#  \r
 #   This module for the EBC virtual machine implementation produces \r
-#    EBC and EBC debug support protocols.\r
+#   EBC and EBC debug support protocols.\r
 #  \r
 #  Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 #  All rights reserved. This program and the accompanying materials\r
@@ -57,7 +55,6 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-  \r
 \r
 \r
 [LibraryClasses]\r
index b819c5f024360fa967a580ccdbd525f39fb85c0a..334073c9540d45fcb7ce8d6926668d434e0fb2c3 100644 (file)
@@ -49,13 +49,13 @@ UINT64
     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
+\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
+  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
@@ -179,7 +179,7 @@ VmReadMemN (
 \r
 /**\r
   Writes 8-bit data to memory address.\r
-   \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
@@ -189,14 +189,14 @@ VmReadMemN (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -209,7 +209,7 @@ VmWriteMem8 (
 \r
 /**\r
   Writes 16-bit data to memory address.\r
-   \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
@@ -219,14 +219,14 @@ VmWriteMem8 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -239,7 +239,7 @@ VmWriteMem16 (
 \r
 /**\r
   Writes 32-bit data to memory address.\r
-   \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
@@ -249,14 +249,14 @@ VmWriteMem16 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -440,7 +440,7 @@ ConvertStackAddr (
   @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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -472,7 +472,7 @@ ExecuteBREAK (
   Instruction syntax:\r
     JMP64{cs|cc} Immed64\r
     JMP32{cs|cc} {@}R1 {Immed32|Index32}\r
-  \r
+\r
   Encoding:\r
     b0.7 -  immediate data present\r
     b0.6 -  1 = 64 bit immediate data\r
@@ -557,7 +557,7 @@ ExecuteRET (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -574,7 +574,7 @@ ExecuteCMP (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -587,15 +587,15 @@ ExecuteCMPI (
   Execute the MOVxx instructions.\r
 \r
   Instruction format:\r
-    \r
+\r
     MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}\r
     MOVqq {@}R1 {Index64}, {@}R2 {Index64}\r
-  \r
+\r
     Copies contents of [R2] -> [R1], zero extending where required.\r
-  \r
+\r
     First character indicates the size of the move.\r
     Second character indicates the size of the index(s).\r
-  \r
+\r
     Invalid to have R1 direct with index.\r
 \r
   @param  VmPtr             A pointer to a VM context.\r
@@ -613,20 +613,20 @@ ExecuteMOVxx (
   Execute the EBC MOVI.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
-  \r
+\r
     First variable character specifies the move size\r
     Second variable character specifies size of the immediate data\r
-  \r
+\r
     Sign-extend the immediate data to the size of the operation, and zero-extend\r
     if storing to a register.\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -640,12 +640,12 @@ ExecuteMOVI (
   index value into a register or memory location.\r
 \r
   Instruction syntax:\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -659,12 +659,12 @@ ExecuteMOVIn (
   Dest <- Ip + ImmData\r
 \r
   Instruction syntax:\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -750,7 +750,7 @@ ExecutePOP (
 \r
   @param  VmPtr             A pointer to VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -772,7 +772,7 @@ ExecuteSignedDataManip (
 \r
   @param  VmPtr             A pointer to VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -789,7 +789,7 @@ ExecuteUnsignedDataManip (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -806,7 +806,7 @@ ExecuteLOADSP (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -822,15 +822,15 @@ ExecuteSTORESP (
   is a register.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -846,15 +846,15 @@ ExecuteMOVsnd (
   is a register.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -1250,7 +1250,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
+CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] = {\r
   ExecuteNOT,\r
   ExecuteNEG,\r
   ExecuteADD,\r
@@ -1272,7 +1272,7 @@ STATIC CONST DATA_MANIP_EXEC_FUNCTION mDataManipDispatchTable[] = {
   ExecuteEXTNDD,\r
 };\r
 \r
-STATIC CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {\r
+CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {\r
   { ExecuteBREAK },             // opcode 0x00\r
   { ExecuteJMP },               // opcode 0x01\r
   { ExecuteJMP8 },              // opcode 0x02\r
@@ -1336,7 +1336,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
+CONST UINT8                    mJMPLen[] = { 2, 2, 6, 10 };\r
 \r
 //\r
 // Simple Debugger Protocol GUID\r
@@ -1536,15 +1536,15 @@ Done:
   Execute the MOVxx instructions.\r
 \r
   Instruction format:\r
-    \r
+\r
     MOV[b|w|d|q|n]{w|d} {@}R1 {Index16|32}, {@}R2 {Index16|32}\r
     MOVqq {@}R1 {Index64}, {@}R2 {Index64}\r
-  \r
+\r
     Copies contents of [R2] -> [R1], zero extending where required.\r
-  \r
+\r
     First character indicates the size of the move.\r
     Second character indicates the size of the index(s).\r
-  \r
+\r
     Invalid to have R1 direct with index.\r
 \r
   @param  VmPtr             A pointer to a VM context.\r
@@ -1928,7 +1928,7 @@ ExecuteBREAK (
   Instruction syntax:\r
     JMP64{cs|cc} Immed64\r
     JMP32{cs|cc} {@}R1 {Immed32|Index32}\r
-  \r
+\r
   Encoding:\r
     b0.7 -  immediate data present\r
     b0.6 -  1 = 64 bit immediate data\r
@@ -2152,20 +2152,20 @@ ExecuteJMP8 (
   Execute the EBC MOVI.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVI[b|w|d|q][w|d|q] {@}R1 {Index16}, ImmData16|32|64\r
-  \r
+\r
     First variable character specifies the move size\r
     Second variable character specifies size of the immediate data\r
-  \r
+\r
     Sign-extend the immediate data to the size of the operation, and zero-extend\r
     if storing to a register.\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -2278,12 +2278,12 @@ ExecuteMOVI (
   index value into a register or memory location.\r
 \r
   Instruction syntax:\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -2380,12 +2380,12 @@ ExecuteMOVIn (
   Dest <- Ip + ImmData\r
 \r
   Instruction syntax:\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -2483,15 +2483,15 @@ ExecuteMOVREL (
   is a register.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVsnw {@}R1 {Index16}, {@}R2 {Index16|Immed16}\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -2576,15 +2576,15 @@ ExecuteMOVsnw (
   is a register.\r
 \r
   Instruction syntax:\r
-  \r
+\r
     MOVsnd {@}R1 {Indx32}, {@}R2 {Index32|Immed32}\r
-  \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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -3128,7 +3128,7 @@ ExecuteRET (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -3289,7 +3289,7 @@ ExecuteCMP (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4057,7 +4057,7 @@ ExecuteEXTNDD (
 \r
   @param  VmPtr             A pointer to VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4087,7 +4087,7 @@ ExecuteSignedDataManip (
 \r
   @param  VmPtr             A pointer to VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4118,7 +4118,7 @@ ExecuteUnsignedDataManip (
   @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_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4267,7 +4267,7 @@ ExecuteDataManip (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4321,7 +4321,7 @@ ExecuteLOADSP (
 \r
   @param  VmPtr             A pointer to a VM context.\r
 \r
-  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.     \r
+  @retval EFI_UNSUPPORTED   The opcodes/operands is not supported.\r
   @retval EFI_SUCCESS       The instruction is executed successfully.\r
 \r
 **/\r
@@ -4381,13 +4381,13 @@ ExecuteSTORESP (
     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
+\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
+  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
@@ -4585,7 +4585,7 @@ VmReadIndex64 (
 \r
 /**\r
   Writes 8-bit data to memory address.\r
-   \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
@@ -4595,14 +4595,14 @@ VmReadIndex64 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -4623,7 +4623,7 @@ VmWriteMem8 (
 \r
 /**\r
   Writes 16-bit data to memory address.\r
-   \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
@@ -4633,14 +4633,14 @@ VmWriteMem8 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -4686,7 +4686,7 @@ VmWriteMem16 (
 \r
 /**\r
   Writes 32-bit data to memory address.\r
-   \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
@@ -4696,14 +4696,14 @@ VmWriteMem16 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -4749,7 +4749,7 @@ VmWriteMem32 (
 \r
 /**\r
   Writes 64-bit data to memory address.\r
-   \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
@@ -4759,14 +4759,14 @@ VmWriteMem32 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -4814,7 +4814,7 @@ VmWriteMem64 (
 \r
 /**\r
   Writes UINTN data to memory address.\r
-   \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
@@ -4824,14 +4824,14 @@ VmWriteMem64 (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -4862,7 +4862,7 @@ VmWriteMemN (
       MemoryFence ();\r
       Status = VmWriteMem32 (VmPtr, Addr + Index * sizeof (UINT32), (UINT32) Data);\r
       MemoryFence ();\r
-      Data = (UINTN)RShiftU64 ((UINT64)Data, 32);\r
+      Data = (UINTN) RShiftU64 ((UINT64)Data, 32);\r
     }\r
   }\r
 \r
@@ -4969,8 +4969,8 @@ VmReadImmed32 (
   //\r
   // Return unaligned data\r
   //\r
-  Data = (UINT32) VmReadCode16 (VmPtr, Offset);\r
-  Data |= (UINT32) (VmReadCode16 (VmPtr, Offset + 2) << 16);\r
+  Data  = (UINT32) VmReadCode16 (VmPtr, Offset);\r
+  Data |= (UINT32)(VmReadCode16 (VmPtr, Offset + 2) << 16);\r
   return Data;\r
 }\r
 \r
@@ -5011,7 +5011,7 @@ VmReadImmed64 (
   Ptr             = (UINT8 *) &Data64;\r
   Data32          = VmReadCode32 (VmPtr, Offset);\r
   *(UINT32 *) Ptr = Data32;\r
-  Ptr += sizeof (Data32);\r
+  Ptr            += sizeof (Data32);\r
   Data32          = VmReadCode32 (VmPtr, Offset + sizeof (UINT32));\r
   *(UINT32 *) Ptr = Data32;\r
   return Data64;\r
@@ -5126,7 +5126,7 @@ VmReadCode64 (
   Ptr             = (UINT8 *) &Data64;\r
   Data32          = VmReadCode32 (VmPtr, Offset);\r
   *(UINT32 *) Ptr = Data32;\r
-  Ptr += sizeof (Data32);\r
+  Ptr            += sizeof (Data32);\r
   Data32          = VmReadCode32 (VmPtr, Offset + sizeof (UINT32));\r
   *(UINT32 *) Ptr = Data32;\r
   return Data64;\r
@@ -5340,7 +5340,7 @@ VmReadMemN (
 \r
 /**\r
   Returns the version of the EBC virtual machine.\r
-    \r
+\r
   @return The 64-bit version of EBC virtual machine.\r
 \r
 **/\r
index e9805445eac6576d51efdf9c53c46794c9ffe869..88bf9d5843a81575375cb31e5db519eacdba9594 100644 (file)
@@ -245,7 +245,7 @@ EbcExecute (
 \r
 /**\r
   Returns the version of the EBC virtual machine.\r
-    \r
+\r
   @return The 64-bit version of EBC virtual machine.\r
 \r
 **/\r
@@ -256,7 +256,7 @@ GetVmVersion (
 \r
 /**\r
   Writes UINTN data to memory address.\r
-   \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
@@ -266,14 +266,14 @@ GetVmVersion (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
@@ -286,7 +286,7 @@ VmWriteMemN (
 \r
 /**\r
   Writes 64-bit data to memory address.\r
-   \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
@@ -296,14 +296,14 @@ VmWriteMemN (
   [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             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 EFI_SUCCESS       The instruction is executed successfully.\r
   @retval Other             Some error occurs when writing data to the address.\r
 \r
 **/\r
index e6c463e672d64abbe2beec62837d56750d128ff0..764732c29f273b3cb7d3d067d71ca52ee9a05b33 100644 (file)
@@ -89,7 +89,7 @@ EbcCreateThunk (
   @param  This                  A pointer to the EFI_EBC_PROTOCOL instance.\r
   @param  Version               Pointer to where to store the returned version\r
                                 of the interpreter.\r
-   \r
+\r
   @retval EFI_SUCCESS           The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER Version pointer is NULL.\r
 \r
@@ -184,7 +184,7 @@ InitEbcVmTestProtocol (
 \r
 /**\r
   Returns the EFI_UNSUPPORTED Status.\r
-   \r
+\r
   @return EFI_UNSUPPORTED  This function always return EFI_UNSUPPORTED status.\r
 \r
 **/\r
@@ -195,11 +195,11 @@ EbcVmTestUnsupported (
 \r
 /**\r
   Registers a callback function that the EBC interpreter calls to flush the\r
-  processor instruction cache following creation of thunks. \r
+  processor instruction cache following creation of thunks.\r
 \r
   @param  This        A pointer to the EFI_EBC_PROTOCOL instance.\r
   @param  Flush       Pointer to a function of type EBC_ICACH_FLUSH.\r
-   \r
+\r
   @retval EFI_SUCCESS The function completed successfully.\r
 \r
 **/\r
@@ -302,7 +302,7 @@ EbcDebugRegisterExceptionCallback (
   @param  Start                 StartSpecifies the physical base of the memory\r
                                 range to be invalidated.\r
   @param  Length                Specifies the minimum number of bytes in the\r
-                                processor's instruction cache to invalidate. \r
+                                processor's instruction cache to invalidate.\r
 \r
   @retval EFI_SUCCESS           The function completed successfully.\r
 \r
@@ -322,29 +322,29 @@ EbcDebugInvalidateInstructionCache (
 // also be global since the execution of an EBC image does not provide\r
 // a This pointer.\r
 //\r
-STATIC EBC_IMAGE_LIST         *mEbcImageList = NULL;\r
+EBC_IMAGE_LIST         *mEbcImageList = NULL;\r
 \r
 //\r
 // Callback function to flush the icache after thunk creation\r
 //\r
-STATIC EBC_ICACHE_FLUSH       mEbcICacheFlush;\r
+EBC_ICACHE_FLUSH       mEbcICacheFlush;\r
 \r
 //\r
 // These get set via calls by the debug agent\r
 //\r
-STATIC EFI_PERIODIC_CALLBACK  mDebugPeriodicCallback                            = NULL;\r
-STATIC EFI_EXCEPTION_CALLBACK mDebugExceptionCallback[MAX_EBC_EXCEPTION + 1] = {NULL};\r
-STATIC EFI_GUID               mEfiEbcVmTestProtocolGuid = EFI_EBC_VM_TEST_PROTOCOL_GUID;\r
+EFI_PERIODIC_CALLBACK  mDebugPeriodicCallback = NULL;\r
+EFI_EXCEPTION_CALLBACK mDebugExceptionCallback[MAX_EBC_EXCEPTION + 1] = {NULL};\r
+EFI_GUID               mEfiEbcVmTestProtocolGuid = EFI_EBC_VM_TEST_PROTOCOL_GUID;\r
 \r
-STATIC VOID*      mStackBuffer[MAX_STACK_NUM];\r
-STATIC EFI_HANDLE mStackBufferIndex[MAX_STACK_NUM];\r
-STATIC UINTN      mStackNum = 0;\r
+VOID                   *mStackBuffer[MAX_STACK_NUM];\r
+EFI_HANDLE             mStackBufferIndex[MAX_STACK_NUM];\r
+UINTN                  mStackNum = 0;\r
 \r
 //\r
 // Event for Periodic callback\r
 //\r
-STATIC EFI_EVENT              mEbcPeriodicEvent;\r
-VM_CONTEXT                    *mVmPtr = NULL;\r
+EFI_EVENT              mEbcPeriodicEvent;\r
+VM_CONTEXT             *mVmPtr = NULL;\r
 \r
 \r
 /**\r
@@ -701,7 +701,7 @@ EbcDebugRegisterExceptionCallback (
   @param  Start                 StartSpecifies the physical base of the memory\r
                                 range to be invalidated.\r
   @param  Length                Specifies the minimum number of bytes in the\r
-                                processor's instruction cache to invalidate. \r
+                                processor's instruction cache to invalidate.\r
 \r
   @retval EFI_SUCCESS           The function completed successfully.\r
 \r
@@ -723,7 +723,7 @@ EbcDebugInvalidateInstructionCache (
   The VM interpreter calls this function when an exception is detected.\r
 \r
   @param  ExceptionType          Specifies the processor exception detected.\r
-  @param  ExceptionFlags         Specifies the exception context. \r
+  @param  ExceptionFlags         Specifies the exception context.\r
   @param  VmPtr                  Pointer to a VM context for passing info to the\r
                                  EFI debugger.\r
 \r
@@ -1120,11 +1120,11 @@ EbcAddImageThunk (
 \r
 /**\r
   Registers a callback function that the EBC interpreter calls to flush the\r
-  processor instruction cache following creation of thunks. \r
+  processor instruction cache following creation of thunks.\r
 \r
   @param  This        A pointer to the EFI_EBC_PROTOCOL instance.\r
   @param  Flush       Pointer to a function of type EBC_ICACH_FLUSH.\r
-   \r
+\r
   @retval EFI_SUCCESS The function completed successfully.\r
 \r
 **/\r
@@ -1145,7 +1145,7 @@ EbcRegisterICacheFlush (
   @param  This                  A pointer to the EFI_EBC_PROTOCOL instance.\r
   @param  Version               Pointer to where to store the returned version\r
                                 of the interpreter.\r
-   \r
+\r
   @retval EFI_SUCCESS           The function completed successfully.\r
   @retval EFI_INVALID_PARAMETER Version pointer is NULL.\r
 \r
@@ -1168,10 +1168,10 @@ EbcGetVersion (
 /**\r
   Returns the stack index and buffer assosicated with the Handle parameter.\r
 \r
-  @param  Handle                The EFI handle as the index to the EBC stack. \r
+  @param  Handle                The EFI handle as the index to the EBC stack.\r
   @param  StackBuffer           A pointer to hold the returned stack buffer.\r
   @param  BufferIndex           A pointer to hold the returned stack index.\r
-   \r
+\r
   @retval EFI_OUT_OF_RESOURCES  The Handle parameter does not correspond to any\r
                                 existing EBC stack.\r
   @retval EFI_SUCCESS           The stack index and buffer were found and\r
@@ -1204,10 +1204,10 @@ GetEBCStack(
 }\r
 \r
 /**\r
-  Returns from the EBC stack by stack Index. \r
-   \r
+  Returns from the EBC stack by stack Index.\r
+\r
   @param  Index        Specifies which EBC stack to return from.\r
-   \r
+\r
   @retval EFI_SUCCESS  The function completed successfully.\r
 \r
 **/\r
@@ -1221,10 +1221,10 @@ ReturnEBCStack(
 }\r
 \r
 /**\r
-  Returns from the EBC stack associated with the Handle parameter. \r
-   \r
+  Returns from the EBC stack associated with the Handle parameter.\r
+\r
   @param  Handle      Specifies the EFI handle to find the EBC stack with.\r
-   \r
+\r
   @retval EFI_SUCCESS The function completed successfully.\r
 \r
 **/\r
@@ -1249,7 +1249,7 @@ ReturnEBCStackByHandle(
 /**\r
   Allocates memory to hold all the EBC stacks.\r
 \r
-  @retval EFI_SUCCESS          The EBC stacks were allocated successfully. \r
+  @retval EFI_SUCCESS          The EBC stacks were allocated successfully.\r
   @retval EFI_OUT_OF_RESOURCES Not enough memory available for EBC stacks.\r
 \r
 **/\r
@@ -1336,7 +1336,7 @@ InitEbcVmTestProtocol (
 \r
 /**\r
   Returns the EFI_UNSUPPORTED Status.\r
-   \r
+\r
   @return EFI_UNSUPPORTED  This function always return EFI_UNSUPPORTED status.\r
 \r
 **/\r
index a8767e8957f5fa0071bf62ecedfb16354f508239..becd7019748c42ca671254b37e81c56deacab552 100644 (file)
@@ -34,11 +34,11 @@ typedef UINT8   *VMIP;      // instruction pointer for the VM
 typedef UINT32  EXCEPTION_FLAGS;\r
 \r
 typedef struct {\r
-  VM_REGISTER       R[8];   // General purpose registers.\r
-  UINT64            Flags;  // Flags register:\r
-                            //   0   Set to 1 if the result of the last compare was true\r
-                            //   1  Set to 1 if stepping\r
-                            //   2..63 Reserved.\r
+  VM_REGISTER       R[8];                   // General purpose registers.\r
+  UINT64            Flags;                  // Flags register:\r
+                                            //   0   Set to 1 if the result of the last compare was true\r
+                                            //   1  Set to 1 if stepping\r
+                                            //   2..63 Reserved.\r
   VMIP              Ip;                     // Instruction pointer.\r
   UINTN             LastException;          //\r
   EXCEPTION_FLAGS   ExceptionFlags;         // to keep track of exceptions\r
@@ -132,7 +132,7 @@ EbcAddImageThunk (
   The VM interpreter calls this function when an exception is detected.\r
 \r
   @param  ExceptionType          Specifies the processor exception detected.\r
-  @param  ExceptionFlags         Specifies the exception context. \r
+  @param  ExceptionFlags         Specifies the exception context.\r
   @param  VmPtr                  Pointer to a VM context for passing info to the\r
                                  EFI debugger.\r
 \r
@@ -157,13 +157,13 @@ EbcDebugSignalException (
 \r
 //\r
 // External low level functions that are native-processor dependent\r
-// \r
+//\r
 /**\r
-  The VM thunk code stuffs an EBC entry point into a processor \r
+  The VM thunk code stuffs an EBC entry point into a processor\r
   register. Since we can't use inline assembly to get it from\r
   the interpreter C code, stuff it into the return value\r
   register and return.\r
\r
+\r
   @return  The contents of the register in which the entry point is passed.\r
 \r
 **/\r
@@ -191,7 +191,7 @@ EbcLLGetStackPointer (
 /**\r
   This function is called to execute an EBC CALLEX instruction.\r
   This instruction requires that we thunk out to external native\r
-  code. For x64, we switch stacks, copy the arguments to the stack \r
+  code. For x64, we switch stacks, copy the arguments to the stack\r
   and jump to the specified function.\r
   On return, we restore the stack pointer to its original location.\r
   Destroys no working registers.\r
@@ -251,10 +251,10 @@ EbcLLGetReturnValue (
 /**\r
   Returns the stack index and buffer assosicated with the Handle parameter.\r
 \r
-  @param  Handle                The EFI handle as the index to the EBC stack. \r
+  @param  Handle                The EFI handle as the index to the EBC stack.\r
   @param  StackBuffer           A pointer to hold the returned stack buffer.\r
   @param  BufferIndex           A pointer to hold the returned stack index.\r
-   \r
+\r
   @retval EFI_OUT_OF_RESOURCES  The Handle parameter does not correspond to any\r
                                 existing EBC stack.\r
   @retval EFI_SUCCESS           The stack index and buffer were found and\r
@@ -269,10 +269,10 @@ GetEBCStack(
   );\r
 \r
 /**\r
-  Returns from the EBC stack by stack Index. \r
-   \r
+  Returns from the EBC stack by stack Index.\r
+\r
   @param  Index        Specifies which EBC stack to return from.\r
-   \r
+\r
   @retval EFI_SUCCESS  The function completed successfully.\r
 \r
 **/\r
@@ -284,7 +284,7 @@ ReturnEBCStack(
 /**\r
   Allocates memory to hold all the EBC stacks.\r
 \r
-  @retval EFI_SUCCESS          The EBC stacks were allocated successfully. \r
+  @retval EFI_SUCCESS          The EBC stacks were allocated successfully.\r
   @retval EFI_OUT_OF_RESOURCES Not enough memory available for EBC stacks.\r
 \r
 **/\r
@@ -305,10 +305,10 @@ FreeEBCStack(
   );\r
 \r
 /**\r
-  Returns from the EBC stack associated with the Handle parameter. \r
-   \r
+  Returns from the EBC stack associated with the Handle parameter.\r
+\r
   @param  Handle      Specifies the EFI handle to find the EBC stack with.\r
-   \r
+\r
   @retval EFI_SUCCESS The function completed successfully.\r
 \r
 **/\r
@@ -316,6 +316,8 @@ EFI_STATUS
 ReturnEBCStackByHandle(\r
   IN EFI_HANDLE Handle\r
   );\r
+\r
+\r
 //\r
 // Defines for a simple EBC debugger interface\r
 //\r
@@ -329,23 +331,23 @@ typedef struct _EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL EFI_EBC_SIMPLE_DEBUGGER_PROTOCO
 typedef\r
 EFI_STATUS\r
 (*EBC_DEBUGGER_SIGNAL_EXCEPTION) (\r
-  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           * This,\r
-  IN VM_CONTEXT                                 * VmPtr,\r
+  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           *This,\r
+  IN VM_CONTEXT                                 *VmPtr,\r
   IN EFI_EXCEPTION_TYPE                         ExceptionType\r
   );\r
 \r
 typedef\r
 VOID\r
 (*EBC_DEBUGGER_DEBUG) (\r
-  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           * This,\r
-  IN VM_CONTEXT                                 * VmPtr\r
+  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           *This,\r
+  IN VM_CONTEXT                                 *VmPtr\r
   );\r
 \r
 typedef\r
 UINT32\r
 (*EBC_DEBUGGER_DASM) (\r
-  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           * This,\r
-  IN VM_CONTEXT                                 * VmPtr,\r
+  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           *This,\r
+  IN VM_CONTEXT                                 *VmPtr,\r
   IN UINT16                                     *DasmString OPTIONAL,\r
   IN UINT32                                     DasmStringSize\r
   );\r
@@ -359,7 +361,7 @@ UINT32
 typedef\r
 EFI_STATUS\r
 (*EBC_DEBUGGER_CONFIGURE) (\r
-  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           * This,\r
+  IN EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL           *This,\r
   IN UINT32                                     ConfigId,\r
   IN UINTN                                      ConfigValue\r
   );\r
index 2a01c892456921ac66a8c37c0a40ef915734210e..3f84bcc49633e9047ba7e3ce79d70538baa059c7 100644 (file)
@@ -273,7 +273,7 @@ ExecuteEbcImageEntryPoint (
   // Initialize the stack pointer for the EBC. Get the current system stack\r
   // pointer and adjust it down by the max needed for the interpreter.\r
   //\r
-  Addr            = EbcLLGetStackPointer ();\r
+  Addr = EbcLLGetStackPointer ();\r
 \r
   Status = GetEBCStack(ImageHandle, &VmContext.StackPool, &StackIndex);\r
   if (EFI_ERROR(Status)) {\r