Changeset 9984 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 27, 2008 9:58:09 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r9817 r9984 52 52 * Structures and Typedefs * 53 53 *******************************************************************************/ 54 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2_UINT32( uint32_t *pu32Param1, uint32_t val2);55 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2( uint32_t *pu32Param1, size_t val2);56 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM3( uint32_t *pu32Param1, uint32_t val2, size_t val3);57 typedef DECLCALLBACK(int) FNEMULATELOCKPARAM2( RTRCPTR GCPtrParam1, RTGCUINTREG32 Val2, RTGCUINTREG32 *pf);54 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2_UINT32(void *pvParam1, uint64_t val2); 55 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2(void *pvParam1, size_t val2); 56 typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM3(void *pvParam1, uint64_t val2, size_t val3); 57 typedef DECLCALLBACK(int) FNEMULATELOCKPARAM2(void *pvParam1, uint64_t val2, RTGCUINTREG32 *pf); 58 58 typedef FNEMULATELOCKPARAM2 *PFNEMULATELOCKPARAM2; 59 typedef DECLCALLBACK(int) FNEMULATELOCKPARAM3( RTRCPTR GCPtrParam1, RTGCUINTREG32 Val2, size_t cb, RTGCUINTREG32 *pf);59 typedef DECLCALLBACK(int) FNEMULATELOCKPARAM3(void *pvParam1, uint64_t val2, size_t cb, RTGCUINTREG32 *pf); 60 60 typedef FNEMULATELOCKPARAM3 *PFNEMULATELOCKPARAM3; 61 61 … … 348 348 } 349 349 350 #if defined( IN_GC) && (defined(VBOX_STRICT) || defined(LOG_ENABLED))350 #if defined(VBOX_STRICT) || defined(LOG_ENABLED) 351 351 /** 352 352 * Get the mnemonic for the disassembled instruction. … … 542 542 PFN_EMULATE_PARAM2 pfnEmulate) 543 543 { 544 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */545 544 OP_PARAMVAL param1; 546 545 … … 556 555 #endif 557 556 RTGCPTR pParam1 = 0; 558 uint 32_t valpar1;557 uint64_t valpar1; 559 558 560 559 if (param1.type == PARMTYPE_ADDRESS) … … 695 694 PFN_EMULATE_PARAM3 pfnEmulate) 696 695 { 697 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */698 696 OP_PARAMVAL param1, param2; 699 697 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 725 723 #endif 726 724 RTGCPTR pParam1; 727 uint 32_t valpar1, valpar2;725 uint64_t valpar1, valpar2; 728 726 729 727 if (pCpu->param1.size != pCpu->param2.size) … … 766 764 { 767 765 case PARMTYPE_IMMEDIATE: /* both immediate data and register (ugly) */ 768 valpar2 = param2.val.val 32;766 valpar2 = param2.val.val64; 769 767 break; 770 768 … … 796 794 } 797 795 798 #ifdef IN_GC799 796 /** 800 797 * LOCK XOR/OR/AND Emulation. … … 803 800 uint32_t *pcbSize, PFNEMULATELOCKPARAM3 pfnEmulate) 804 801 { 805 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 802 void *pvParam1; 803 806 804 OP_PARAMVAL param1, param2; 807 805 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 826 824 /* The destination is always a virtual address */ 827 825 AssertReturn(param1.type == PARMTYPE_ADDRESS, VERR_EM_INTERPRETER); 828 RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val32; 826 827 RTGCPTR GCPtrPar1 = param1.val.val64; 829 828 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 829 #ifdef IN_GC 830 pvParam1 = (void *)GCPtrPar1; 831 #else 832 rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrPar1, &pvParam1); 833 if (VBOX_FAILURE(rc)) 834 { 835 AssertRC(rc); 836 return VERR_EM_INTERPRETER; 837 } 838 #endif 830 839 831 840 # ifdef IN_GC … … 838 847 /* Register and immediate data == PARMTYPE_IMMEDIATE */ 839 848 AssertReturn(param2.type == PARMTYPE_IMMEDIATE, VERR_EM_INTERPRETER); 840 RTGCUINTREG 32 ValPar2 = param2.val.val32;849 RTGCUINTREG ValPar2 = param2.val.val64; 841 850 842 851 /* Try emulate it with a one-shot #PF handler in place. */ 843 Log2(("%s % RGv imm%d=%RGr\n", emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2));852 Log2(("%s %VGv imm%d=%RX64\n", emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2)); 844 853 845 854 RTGCUINTREG32 eflags = 0; 855 #ifdef IN_GC 846 856 MMGCRamRegisterTrapHandler(pVM); 847 rc = pfnEmulate((RTRCPTR)GCPtrPar1, ValPar2, pCpu->param2.size, &eflags); 857 #endif 858 rc = pfnEmulate(pvParam1, ValPar2, pCpu->param2.size, &eflags); 859 #ifdef IN_GC 848 860 MMGCRamDeregisterTrapHandler(pVM); 849 861 #endif 850 862 if (RT_FAILURE(rc)) 851 863 { 852 Log(("%s % RGv imm%d=%RGr-> emulation failed due to page fault!\n", emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2));864 Log(("%s %VGv imm%d=%RX64-> emulation failed due to page fault!\n", emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2)); 853 865 return VERR_EM_INTERPRETER; 854 866 } … … 861 873 return VINF_SUCCESS; 862 874 } 863 #endif864 875 865 876 /** … … 869 880 PFN_EMULATE_PARAM3 pfnEmulate) 870 881 { 871 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */872 882 OP_PARAMVAL param1, param2; 873 883 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 899 909 #endif 900 910 RTGCPTR pParam1; 901 uint 32_t valpar1, valpar2;911 uint64_t valpar1, valpar2; 902 912 903 913 if (pCpu->param1.size != pCpu->param2.size) … … 942 952 { 943 953 case PARMTYPE_IMMEDIATE: /* both immediate data and register (ugly) */ 944 valpar2 = param2.val.val 32;954 valpar2 = param2.val.val64; 945 955 break; 946 956 … … 1018 1028 #endif 1019 1029 RTGCPTR pParam1; 1020 uint 32_t valpar1 = 0, valpar2;1030 uint64_t valpar1 = 0, valpar2; 1021 1031 uint32_t eflags; 1022 1032 … … 1032 1042 { 1033 1043 case PARMTYPE_IMMEDIATE: /* both immediate data and register (ugly) */ 1034 valpar2 = param2.val.val 32;1044 valpar2 = param2.val.val64; 1035 1045 break; 1036 1046 … … 1078 1088 } 1079 1089 1080 #ifdef IN_GC1081 1090 /** 1082 1091 * LOCK BTR/C/S Emulation. … … 1085 1094 uint32_t *pcbSize, PFNEMULATELOCKPARAM2 pfnEmulate) 1086 1095 { 1087 Assert(pCpu->mode != CPUMODE_64BIT); /** @todo check */ 1096 void *pvParam1; 1097 1088 1098 OP_PARAMVAL param1, param2; 1089 1099 int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, ¶m1, PARAM_DEST); … … 1099 1109 return VERR_EM_INTERPRETER; 1100 1110 1101 RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val64;1102 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1);1103 1104 1111 /* Register and immediate data == PARMTYPE_IMMEDIATE */ 1105 1112 AssertReturn(param2.type == PARMTYPE_IMMEDIATE, VERR_EM_INTERPRETER); 1106 RTGCUINTREG32 ValPar2 = param2.val.val32; 1107 1108 Log2(("emInterpretLockBitTest %s: pvFault=%VGv GCPtrPar1=%RGv imm=%RGr\n", emGetMnemonic(pCpu), pvFault, GCPtrPar1, ValPar2)); 1113 uint64_t ValPar2 = param2.val.val64; 1109 1114 1110 1115 /* Adjust the parameters so what we're dealing with is a bit within the byte pointed to. */ 1111 GCPtrPar1 = (RTGCPTR)((RTGCUINTPTR)GCPtrPar1 + ValPar2 / 8); 1116 RTGCPTR GCPtrPar1 = param1.val.val64; 1117 GCPtrPar1 = (GCPtrPar1 + ValPar2 / 8); 1112 1118 ValPar2 &= 7; 1113 # ifdef IN_GC 1119 1120 #ifdef IN_GC 1121 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 1122 pvParam1 = (void *)GCPtrPar1; 1123 #else 1124 GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1); 1125 rc = PGMPhysGCPtr2HCPtr(pVM, GCPtrPar1, &pvParam1); 1126 if (VBOX_FAILURE(rc)) 1127 { 1128 AssertRC(rc); 1129 return VERR_EM_INTERPRETER; 1130 } 1131 #endif 1132 1133 Log2(("emInterpretLockBitTest %s: pvFault=%VGv GCPtrPar1=%VGv imm=%RX64\n", emGetMnemonic(pCpu), pvFault, GCPtrPar1, ValPar2)); 1134 1135 #ifdef IN_GC 1114 1136 Assert(TRPMHasTrap(pVM)); 1115 1137 AssertMsgReturn((RTGCPTR)((RTGCUINTPTR)GCPtrPar1 & ~(RTGCUINTPTR)3) == pvFault, 1116 1138 ("GCPtrPar1=%VGv pvFault=%VGv\n", GCPtrPar1, pvFault), 1117 1139 VERR_EM_INTERPRETER); 1118 # 1140 #endif 1119 1141 1120 1142 /* Try emulate it with a one-shot #PF handler in place. */ 1121 1143 RTGCUINTREG32 eflags = 0; 1144 #ifdef IN_GC 1122 1145 MMGCRamRegisterTrapHandler(pVM); 1123 rc = pfnEmulate((RTRCPTR)GCPtrPar1, ValPar2, &eflags); 1146 #endif 1147 rc = pfnEmulate(pvParam1, ValPar2, &eflags); 1148 #ifdef IN_GC 1124 1149 MMGCRamDeregisterTrapHandler(pVM); 1125 1150 #endif 1126 1151 if (RT_FAILURE(rc)) 1127 1152 { 1128 Log(("emInterpretLockBitTest %s: % RGv imm%d=%RGr-> emulation failed due to page fault!\n",1153 Log(("emInterpretLockBitTest %s: %VGv imm%d=%RX64 -> emulation failed due to page fault!\n", 1129 1154 emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2)); 1130 1155 return VERR_EM_INTERPRETER; 1131 1156 } 1132 1157 1133 Log2(("emInterpretLockBitTest %s: GCPtrPar1=% RGv imm=%RGrCF=%d\n", emGetMnemonic(pCpu), GCPtrPar1, ValPar2, !!(eflags & X86_EFL_CF)));1158 Log2(("emInterpretLockBitTest %s: GCPtrPar1=%VGv imm=%VX64 CF=%d\n", emGetMnemonic(pCpu), GCPtrPar1, ValPar2, !!(eflags & X86_EFL_CF))); 1134 1159 1135 1160 /* Update guest's eflags and finish. */ … … 1140 1165 return VINF_SUCCESS; 1141 1166 } 1142 #endif /* IN_GC */1143 1167 1144 1168 /** … … 1520 1544 #endif 1521 1545 1546 #ifdef IN_GC 1522 1547 /** 1523 1548 * Interpret IRET (currently only to V86 code) … … 1571 1596 return VINF_SUCCESS; 1572 1597 } 1573 1598 #endif 1574 1599 1575 1600 /** … … 2433 2458 ) 2434 2459 #else 2435 if (pCpu->prefix & (PREFIX_REPNE | PREFIX_REP | PREFIX_LOCK)) 2460 if ( (pCpu->prefix & (PREFIX_REPNE | PREFIX_REP)) 2461 || ( (pCpu->prefix & PREFIX_LOCK) 2462 && pCpu->pCurInstr->opcode != OP_OR 2463 && pCpu->pCurInstr->opcode != OP_BTR 2464 ) 2465 ) 2436 2466 #endif 2437 2467 { … … 2447 2477 switch (pCpu->pCurInstr->opcode) 2448 2478 { 2449 #ifdef IN_GC2450 2479 # define INTERPRET_CASE_EX_LOCK_PARAM3(opcode, Instr, InstrFn, pfnEmulate, pfnEmulateLock) \ 2451 2480 case opcode:\ … … 2459 2488 STAM_COUNTER_INC(&pVM->em.s.CTXSUFF(pStats)->CTXMID(Stat,Failed##Instr)); \ 2460 2489 return rc 2461 #else2462 # define INTERPRET_CASE_EX_LOCK_PARAM3(opcode, Instr, InstrFn, pfnEmulate, pfnEmulateLock) \2463 INTERPRET_CASE_EX_PARAM3(opcode, Instr, InstrFn, pfnEmulate)2464 #endif2465 2490 #define INTERPRET_CASE_EX_PARAM3(opcode, Instr, InstrFn, pfnEmulate) \ 2466 2491 case opcode:\ -
trunk/src/VBox/VMM/VMMAll/EMAllA.asm
r9250 r9984 48 48 ;; 49 49 ; Emulate CMP instruction, CDECL calling conv. 50 ; EMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint 32_t u32Param2, size_t cb);50 ; EMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint64_t u64Param2, size_t cb); 51 51 ; 52 52 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 53 53 ; @param [esp + 04h] rdi rcx Param 1 - First parameter (Dst). 54 54 ; @param [esp + 08h] rsi edx Param 2 - Second parameter (Src). 55 ; @param [esp + 0ch] rdx r8 Param 3 - Size of parameters, only 1/2/4is valid.55 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 56 56 ; 57 57 align 16 … … 66 66 %endif ; !RT_OS_WINDOWS 67 67 %else ; !RT_ARCH_AMD64 68 mov eax, [esp + 0ch] ; eax = size of parameters68 mov eax, [esp + 10h] ; eax = size of parameters 69 69 mov ecx, [esp + 04h] ; ecx = first parameter 70 70 mov edx, [esp + 08h] ; edx = second parameter … … 112 112 ;; 113 113 ; Emulate AND instruction, CDECL calling conv. 114 ; EMDECL(uint32_t) EMEmulateAnd( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);114 ; EMDECL(uint32_t) EMEmulateAnd(void *pvParam1, uint64_t u64Param2, size_t cb); 115 115 ; 116 116 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 117 117 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 118 118 ; @param [esp + 08h] Param 2 - Second parameter. 119 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.119 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 120 120 ; @uses eax, ecx, edx 121 121 ; … … 131 131 %endif ; !RT_OS_WINDOWS 132 132 %else ; !RT_ARCH_AMD64 133 mov eax, [esp + 0ch] ; eax = size of parameters133 mov eax, [esp + 10h] ; eax = size of parameters 134 134 mov ecx, [esp + 04h] ; ecx = first parameter 135 135 mov edx, [esp + 08h] ; edx = second parameter … … 177 177 ;; 178 178 ; Emulate OR instruction, CDECL calling conv. 179 ; EMDECL(uint32_t) EMEmulateOr( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);179 ; EMDECL(uint32_t) EMEmulateOr(void *pvParam1, uint64_t u64Param2, size_t cb); 180 180 ; 181 181 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 182 182 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 183 183 ; @param [esp + 08h] Param 2 - Second parameter. 184 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.184 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 185 185 ; @uses eax, ecx, edx 186 186 ; … … 196 196 %endif ; !RT_OS_WINDOWS 197 197 %else ; !RT_ARCH_AMD64 198 mov eax, [esp + 0ch] ; eax = size of parameters198 mov eax, [esp + 10h] ; eax = size of parameters 199 199 mov ecx, [esp + 04h] ; ecx = first parameter 200 200 mov edx, [esp + 08h] ; edx = second parameter … … 241 241 ;; 242 242 ; Emulate LOCK OR instruction. 243 ; EMDECL(int) EMEmulateLockOr(RTGCPTR GCPtrParam1, RTGCUINTREG Param2, size_t cbSize, RTGCUINTREG*pf);243 ; EMDECL(int) EMEmulateLockOr(void *pvParam1, uint64_t u64Param2, size_t cbSize, RTGCUINTREG32 *pf); 244 244 ; 245 245 ; @returns VINF_SUCCESS on success, VERR_ACCESS_DENIED on \#PF (GC only). 246 246 ; @param [esp + 04h] gcc:rdi msc:rcx Param 1 - First parameter - pointer to data item (the real stuff). 247 247 ; @param [esp + 08h] gcc:rsi msc:rdx Param 2 - Second parameter- the immediate / register value. 248 ; @param [esp + 0ch] gcc:rdx msc:r8 Param 3 - Size of the operation - 1, 2, 4 or 8 bytes.249 ; @param [esp + 1 0h] gcc:rcx msc:r9 Param 4 - Where to store the eflags on success.248 ; @param [esp + 10h] gcc:rdx msc:r8 Param 3 - Size of the operation - 1, 2, 4 or 8 bytes. 249 ; @param [esp + 14h] gcc:rcx msc:r9 Param 4 - Where to store the eflags on success. 250 250 ; only arithmetic flags are valid. 251 251 align 16 … … 260 260 %endif ; !RT_OS_WINDOWS 261 261 %else ; !RT_ARCH_AMD64 262 mov eax, [esp + 0ch] ; eax = size of parameters262 mov eax, [esp + 10h] ; eax = size of parameters 263 263 mov ecx, [esp + 04h] ; ecx = first parameter (MY_PTR_REG) 264 264 mov edx, [esp + 08h] ; edx = second parameter … … 307 307 %endif ; !RT_OS_WINDOWS 308 308 %else ; !RT_ARCH_AMD64 309 mov eax, [esp + 1 0h + 4]309 mov eax, [esp + 14h + 4] 310 310 pop dword [eax] 311 311 %endif … … 324 324 ;; 325 325 ; Emulate XOR instruction, CDECL calling conv. 326 ; EMDECL(uint32_t) EMEmulateXor( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);326 ; EMDECL(uint32_t) EMEmulateXor(void *pvParam1, uint64_t u64Param2, size_t cb); 327 327 ; 328 328 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 329 329 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 330 330 ; @param [esp + 08h] Param 2 - Second parameter. 331 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.331 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 332 332 ; @uses eax, ecx, edx 333 333 ; … … 343 343 %endif ; !RT_OS_WINDOWS 344 344 %else ; !RT_ARCH_AMD64 345 mov eax, [esp + 0ch] ; eax = size of parameters345 mov eax, [esp + 10h] ; eax = size of parameters 346 346 mov ecx, [esp + 04h] ; ecx = first parameter 347 347 mov edx, [esp + 08h] ; edx = second parameter … … 388 388 ;; 389 389 ; Emulate INC instruction, CDECL calling conv. 390 ; EMDECL(uint32_t) EMEmulateInc( uint32_t *pu32Param1, size_t cb);390 ; EMDECL(uint32_t) EMEmulateInc(void *pvParam1, size_t cb); 391 391 ; 392 392 ; @returns EFLAGS after the operation, only arithmetic flags are valid. … … 451 451 ;; 452 452 ; Emulate DEC instruction, CDECL calling conv. 453 ; EMDECL(uint32_t) EMEmulateDec( uint32_t *pu32Param1, size_t cb);453 ; EMDECL(uint32_t) EMEmulateDec(void *pvParam1, size_t cb); 454 454 ; 455 455 ; @returns EFLAGS after the operation, only arithmetic flags are valid. … … 513 513 ;; 514 514 ; Emulate ADD instruction, CDECL calling conv. 515 ; EMDECL(uint32_t) EMEmulateAdd( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);515 ; EMDECL(uint32_t) EMEmulateAdd(void *pvParam1, uint64_t u64Param2, size_t cb); 516 516 ; 517 517 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 518 518 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 519 519 ; @param [esp + 08h] Param 2 - Second parameter. 520 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.520 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 521 521 ; @uses eax, ecx, edx 522 522 ; … … 532 532 %endif ; !RT_OS_WINDOWS 533 533 %else ; !RT_ARCH_AMD64 534 mov eax, [esp + 0ch] ; eax = size of parameters534 mov eax, [esp + 10h] ; eax = size of parameters 535 535 mov ecx, [esp + 04h] ; ecx = first parameter 536 536 mov edx, [esp + 08h] ; edx = second parameter … … 577 577 ;; 578 578 ; Emulate ADC instruction, CDECL calling conv. 579 ; EMDECL(uint32_t) EMEmulateAdcWithCarrySet( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);579 ; EMDECL(uint32_t) EMEmulateAdcWithCarrySet(void *pvParam1, uint64_t u64Param2, size_t cb); 580 580 ; 581 581 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 582 582 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 583 583 ; @param [esp + 08h] Param 2 - Second parameter. 584 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.584 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 585 585 ; @uses eax, ecx, edx 586 586 ; … … 596 596 %endif ; !RT_OS_WINDOWS 597 597 %else ; !RT_ARCH_AMD64 598 mov eax, [esp + 0ch] ; eax = size of parameters598 mov eax, [esp + 10h] ; eax = size of parameters 599 599 mov ecx, [esp + 04h] ; ecx = first parameter 600 600 mov edx, [esp + 08h] ; edx = second parameter … … 645 645 ;; 646 646 ; Emulate SUB instruction, CDECL calling conv. 647 ; EMDECL(uint32_t) EMEmulateSub( uint32_t *pu32Param1, uint32_t u32Param2, size_t cb);647 ; EMDECL(uint32_t) EMEmulateSub(void *pvParam1, uint64_t u64Param2, size_t cb); 648 648 ; 649 649 ; @returns EFLAGS after the operation, only arithmetic flags is valid. 650 650 ; @param [esp + 04h] Param 1 - First parameter - pointer to data item. 651 651 ; @param [esp + 08h] Param 2 - Second parameter. 652 ; @param [esp + 0ch] Param 3 - Size of parameters, only 1/2/4is valid.652 ; @param [esp + 10h] Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid. 653 653 ; @uses eax, ecx, edx 654 654 ; … … 664 664 %endif ; !RT_OS_WINDOWS 665 665 %else ; !RT_ARCH_AMD64 666 mov eax, [esp + 0ch] ; eax = size of parameters666 mov eax, [esp + 10h] ; eax = size of parameters 667 667 mov ecx, [esp + 04h] ; ecx = first parameter 668 668 mov edx, [esp + 08h] ; edx = second parameter … … 710 710 ;; 711 711 ; Emulate BTR instruction, CDECL calling conv. 712 ; EMDECL(uint32_t) EMEmulateBtr( uint32_t *pu32Param1, uint32_t u32Param2);712 ; EMDECL(uint32_t) EMEmulateBtr(void *pvParam1, uint64_t u64Param2); 713 713 ; 714 714 ; @returns EFLAGS after the operation, only arithmetic flags is valid. … … 740 740 ;; 741 741 ; Emulate LOCK BTR instruction. 742 ; EMDECL(int) EMEmulateLockBtr(RTGCPTR GCPtrParam1, RTGCUINTREG Param2, uint32_t*pf);742 ; EMDECL(int) EMEmulateLockBtr(void *pvParam1, uint64_t u64Param2, RTGCUINTREG32 *pf); 743 743 ; 744 744 ; @returns VINF_SUCCESS on success, VERR_ACCESS_DENIED on \#PF (GC only). 745 745 ; @param [esp + 04h] gcc:rdi msc:rcx Param 1 - First parameter - pointer to data item (the real stuff). 746 746 ; @param [esp + 08h] gcc:rsi msc:rdx Param 2 - Second parameter- the immediate / register value. (really an 8 byte value) 747 ; @param [esp + 0ch] gcc:rdx msc:r8 Param 3 - Where to store the eflags on success.747 ; @param [esp + 10h] gcc:rdx msc:r8 Param 3 - Where to store the eflags on success. 748 748 ; 749 749 align 16 … … 760 760 mov ecx, [esp + 04h] ; ecx = first parameter 761 761 mov edx, [esp + 08h] ; edx = second parameter 762 mov eax, [esp + 0ch] ; eax = third parameter762 mov eax, [esp + 10h] ; eax = third parameter 763 763 %endif 764 764 … … 783 783 ;; 784 784 ; Emulate BTC instruction, CDECL calling conv. 785 ; EMDECL(uint32_t) EMEmulateBtc( uint32_t *pu32Param1, uint32_t u32Param2);785 ; EMDECL(uint32_t) EMEmulateBtc(void *pvParam1, uint64_t u64Param2); 786 786 ; 787 787 ; @returns EFLAGS after the operation, only arithmetic flags is valid. … … 813 813 ;; 814 814 ; Emulate BTS instruction, CDECL calling conv. 815 ; EMDECL(uint32_t) EMEmulateBts( uint32_t *pu32Param1, uint32_t u32Param2);815 ; EMDECL(uint32_t) EMEmulateBts(void *pvParam1, uint64_t u64Param2); 816 816 ; 817 817 ; @returns EFLAGS after the operation, only arithmetic flags are valid.
Note:
See TracChangeset
for help on using the changeset viewer.