]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/EbcDxe/EbcExecute.c
1) Add type cast for better coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcExecute.c
index 48f7dcebdb728923b94b7c8a69287a422bed8d67..433eea250f7f5e0d650584bcee3dc59e1c0a39ac 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Contains code that implements the virtual machine.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -1344,12 +1344,6 @@ CONST VM_TABLE_ENTRY           mVmOpcodeTable[] = {
 //\r
 CONST UINT8                    mJMPLen[] = { 2, 2, 6, 10 };\r
 \r
-//\r
-// Simple Debugger Protocol GUID\r
-//\r
-EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;\r
-\r
-\r
 /**\r
   Given a pointer to a new VM context, execute one or more instructions. This\r
   function is only used for test purposes via the EBC VM test protocol.\r
@@ -1365,6 +1359,7 @@ EFI_GUID mEbcSimpleDebuggerProtocolGuid = EFI_EBC_SIMPLE_DEBUGGER_PROTOCOL_GUID;
 \r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 EbcExecuteInstructions (\r
   IN EFI_EBC_VM_TEST_PROTOCOL *This,\r
   IN VM_CONTEXT               *VmPtr,\r
@@ -1452,7 +1447,7 @@ EbcExecute (
   //\r
   DEBUG_CODE_BEGIN ();\r
     Status = gBS->LocateProtocol (\r
-                    &mEbcSimpleDebuggerProtocolGuid,\r
+                    &gEfiEbcSimpleDebuggerProtocolGuid,\r
                     NULL,\r
                     (VOID **) &EbcSimpleDebugger\r
                     );\r
@@ -1832,6 +1827,7 @@ ExecuteBREAK (
   UINT64      U64EbcEntryPoint;\r
   INT32       Offset;\r
 \r
+  Thunk = NULL;\r
   Operands = GETOPERANDS (VmPtr);\r
   switch (Operands) {\r
   //\r
@@ -2367,7 +2363,7 @@ ExecuteMOVIn (
     // Get the address\r
     //\r
     Op1 = (UINT64) VmPtr->Gpr[OPERAND1_REGNUM (Operands)] + Index16;\r
-    VmWriteMemN (VmPtr, (UINTN) Op1, (INTN) ImmedIndex64);\r
+    VmWriteMemN (VmPtr, (UINTN) Op1, (UINTN)(INTN) ImmedIndex64);\r
   }\r
   //\r
   // Advance the instruction pointer\r
@@ -2551,9 +2547,9 @@ ExecuteMOVsnw (
   //\r
   // Get the data from the source.\r
   //\r
-  Op2 = (UINT64) (VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
+  Op2 = (UINT64)(INT64)(INTN)(VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
   if (OPERAND2_INDIRECT (Operands)) {\r
-    Op2 = (UINT64) VmReadMemN (VmPtr, (UINTN) Op2);\r
+    Op2 = (UINT64)(INT64)(INTN)VmReadMemN (VmPtr, (UINTN) Op2);\r
   }\r
   //\r
   // Now write back the result.\r
@@ -2644,9 +2640,9 @@ ExecuteMOVsnd (
   //\r
   // Get the data from the source.\r
   //\r
-  Op2 = (UINT64) (VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
+  Op2 = (UINT64)(INT64)(INTN)(INT64)(VmPtr->Gpr[OPERAND2_REGNUM (Operands)] + Op2Index);\r
   if (OPERAND2_INDIRECT (Operands)) {\r
-    Op2 = (UINT64) VmReadMemN (VmPtr, (UINTN) Op2);\r
+    Op2 = (UINT64)(INT64)(INTN)(INT64)VmReadMemN (VmPtr, (UINTN) Op2);\r
   }\r
   //\r
   // Now write back the result.\r
@@ -3273,7 +3269,7 @@ ExecuteCMP (
   if (Flag != 0) {\r
     VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
   } else {\r
-    VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+    VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
   }\r
   //\r
   // Advance the IP\r
@@ -3452,7 +3448,7 @@ ExecuteCMPI (
   if (Flag != 0) {\r
     VMFLAG_SET (VmPtr, VMFLAGS_CC);\r
   } else {\r
-    VMFLAG_CLEAR (VmPtr, VMFLAGS_CC);\r
+    VMFLAG_CLEAR (VmPtr, (UINT64)VMFLAGS_CC);\r
   }\r
   //\r
   // Advance the IP\r