VirtualBox

Changeset 9984 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 27, 2008 9:58:09 AM (16 years ago)
Author:
vboxsync
Message:

Big instruction emulation update for 64 bits mode. Watch for regressions!

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/EMAll.cpp

    r9817 r9984  
    5252*   Structures and Typedefs                                                    *
    5353*******************************************************************************/
    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);
     54typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2_UINT32(void *pvParam1, uint64_t val2);
     55typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM2(void *pvParam1, size_t val2);
     56typedef DECLCALLBACK(uint32_t) PFN_EMULATE_PARAM3(void *pvParam1, uint64_t val2, size_t val3);
     57typedef DECLCALLBACK(int)      FNEMULATELOCKPARAM2(void *pvParam1, uint64_t val2, RTGCUINTREG32 *pf);
    5858typedef FNEMULATELOCKPARAM2 *PFNEMULATELOCKPARAM2;
    59 typedef DECLCALLBACK(int)      FNEMULATELOCKPARAM3(RTRCPTR GCPtrParam1, RTGCUINTREG32 Val2, size_t cb, RTGCUINTREG32 *pf);
     59typedef DECLCALLBACK(int)      FNEMULATELOCKPARAM3(void *pvParam1, uint64_t val2, size_t cb, RTGCUINTREG32 *pf);
    6060typedef FNEMULATELOCKPARAM3 *PFNEMULATELOCKPARAM3;
    6161
     
    348348}
    349349
    350 #if defined(IN_GC) && (defined(VBOX_STRICT) || defined(LOG_ENABLED))
     350#if defined(VBOX_STRICT) || defined(LOG_ENABLED)
    351351/**
    352352 * Get the mnemonic for the disassembled instruction.
     
    542542                             PFN_EMULATE_PARAM2 pfnEmulate)
    543543{
    544     Assert(pCpu->mode != CPUMODE_64BIT);    /** @todo check */
    545544    OP_PARAMVAL param1;
    546545
     
    556555#endif
    557556            RTGCPTR pParam1 = 0;
    558             uint32_t valpar1;
     557            uint64_t valpar1;
    559558
    560559            if (param1.type == PARMTYPE_ADDRESS)
     
    695694                               PFN_EMULATE_PARAM3 pfnEmulate)
    696695{
    697     Assert(pCpu->mode != CPUMODE_64BIT);    /** @todo check */
    698696    OP_PARAMVAL param1, param2;
    699697    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
     
    725723#endif
    726724            RTGCPTR  pParam1;
    727             uint32_t valpar1, valpar2;
     725            uint64_t valpar1, valpar2;
    728726
    729727            if (pCpu->param1.size != pCpu->param2.size)
     
    766764            {
    767765            case PARMTYPE_IMMEDIATE:    /* both immediate data and register (ugly) */
    768                 valpar2 = param2.val.val32;
     766                valpar2 = param2.val.val64;
    769767                break;
    770768
     
    796794}
    797795
    798 #ifdef IN_GC
    799796/**
    800797 * LOCK XOR/OR/AND Emulation.
     
    803800                                   uint32_t *pcbSize, PFNEMULATELOCKPARAM3 pfnEmulate)
    804801{
    805     Assert(pCpu->mode != CPUMODE_64BIT);    /** @todo check */
     802    void *pvParam1;
     803
    806804    OP_PARAMVAL param1, param2;
    807805    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
     
    826824    /* The destination is always a virtual address */
    827825    AssertReturn(param1.type == PARMTYPE_ADDRESS, VERR_EM_INTERPRETER);
    828     RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val32;
     826
     827    RTGCPTR GCPtrPar1 = param1.val.val64;
    829828    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
    830839
    831840# ifdef IN_GC
     
    838847    /* Register and immediate data == PARMTYPE_IMMEDIATE */
    839848    AssertReturn(param2.type == PARMTYPE_IMMEDIATE, VERR_EM_INTERPRETER);
    840     RTGCUINTREG32 ValPar2 = param2.val.val32;
     849    RTGCUINTREG ValPar2 = param2.val.val64;
    841850
    842851    /* 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));
    844853
    845854    RTGCUINTREG32 eflags = 0;
     855#ifdef IN_GC
    846856    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
    848860    MMGCRamDeregisterTrapHandler(pVM);
    849 
     861#endif
    850862    if (RT_FAILURE(rc))
    851863    {
    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));
    853865        return VERR_EM_INTERPRETER;
    854866    }
     
    861873    return VINF_SUCCESS;
    862874}
    863 #endif
    864875
    865876/**
     
    869880                             PFN_EMULATE_PARAM3 pfnEmulate)
    870881{
    871     Assert(pCpu->mode != CPUMODE_64BIT);    /** @todo check */
    872882    OP_PARAMVAL param1, param2;
    873883    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
     
    899909#endif
    900910            RTGCPTR  pParam1;
    901             uint32_t valpar1, valpar2;
     911            uint64_t valpar1, valpar2;
    902912
    903913            if (pCpu->param1.size != pCpu->param2.size)
     
    942952            {
    943953            case PARMTYPE_IMMEDIATE:    /* both immediate data and register (ugly) */
    944                 valpar2 = param2.val.val32;
     954                valpar2 = param2.val.val64;
    945955                break;
    946956
     
    10181028#endif
    10191029            RTGCPTR  pParam1;
    1020             uint32_t valpar1 = 0, valpar2;
     1030            uint64_t valpar1 = 0, valpar2;
    10211031            uint32_t eflags;
    10221032
     
    10321042            {
    10331043            case PARMTYPE_IMMEDIATE:    /* both immediate data and register (ugly) */
    1034                 valpar2 = param2.val.val32;
     1044                valpar2 = param2.val.val64;
    10351045                break;
    10361046
     
    10781088}
    10791089
    1080 #ifdef IN_GC
    10811090/**
    10821091 * LOCK BTR/C/S Emulation.
     
    10851094                                  uint32_t *pcbSize, PFNEMULATELOCKPARAM2 pfnEmulate)
    10861095{
    1087     Assert(pCpu->mode != CPUMODE_64BIT);    /** @todo check */
     1096    void *pvParam1;
     1097
    10881098    OP_PARAMVAL param1, param2;
    10891099    int rc = DISQueryParamVal(pRegFrame, pCpu, &pCpu->param1, &param1, PARAM_DEST);
     
    10991109        return VERR_EM_INTERPRETER;
    11001110
    1101     RTGCPTR GCPtrPar1 = (RTGCPTR)param1.val.val64;
    1102     GCPtrPar1 = emConvertToFlatAddr(pVM, pRegFrame, pCpu, &pCpu->param1, GCPtrPar1);
    1103 
    11041111    /* Register and immediate data == PARMTYPE_IMMEDIATE */
    11051112    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;
    11091114
    11101115    /* 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);
    11121118    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
    11141136    Assert(TRPMHasTrap(pVM));
    11151137    AssertMsgReturn((RTGCPTR)((RTGCUINTPTR)GCPtrPar1 & ~(RTGCUINTPTR)3) == pvFault,
    11161138                    ("GCPtrPar1=%VGv pvFault=%VGv\n", GCPtrPar1, pvFault),
    11171139                    VERR_EM_INTERPRETER);
    1118 # endif
     1140#endif
    11191141
    11201142    /* Try emulate it with a one-shot #PF handler in place. */
    11211143    RTGCUINTREG32 eflags = 0;
     1144#ifdef IN_GC
    11221145    MMGCRamRegisterTrapHandler(pVM);
    1123     rc = pfnEmulate((RTRCPTR)GCPtrPar1, ValPar2, &eflags);
     1146#endif
     1147    rc = pfnEmulate(pvParam1, ValPar2, &eflags);
     1148#ifdef IN_GC
    11241149    MMGCRamDeregisterTrapHandler(pVM);
    1125 
     1150#endif
    11261151    if (RT_FAILURE(rc))
    11271152    {
    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",
    11291154             emGetMnemonic(pCpu), GCPtrPar1, pCpu->param2.size*8, ValPar2));
    11301155        return VERR_EM_INTERPRETER;
    11311156    }
    11321157
    1133     Log2(("emInterpretLockBitTest %s: GCPtrPar1=%RGv imm=%RGr CF=%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)));
    11341159
    11351160    /* Update guest's eflags and finish. */
     
    11401165    return VINF_SUCCESS;
    11411166}
    1142 #endif /* IN_GC */
    11431167
    11441168/**
     
    15201544#endif
    15211545
     1546#ifdef IN_GC
    15221547/**
    15231548 * Interpret IRET (currently only to V86 code)
     
    15711596    return VINF_SUCCESS;
    15721597}
    1573 
     1598#endif
    15741599
    15751600/**
     
    24332458       )
    24342459#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       )
    24362466#endif
    24372467    {
     
    24472477    switch (pCpu->pCurInstr->opcode)
    24482478    {
    2449 #ifdef IN_GC
    24502479# define INTERPRET_CASE_EX_LOCK_PARAM3(opcode, Instr, InstrFn, pfnEmulate, pfnEmulateLock) \
    24512480        case opcode:\
     
    24592488                STAM_COUNTER_INC(&pVM->em.s.CTXSUFF(pStats)->CTXMID(Stat,Failed##Instr)); \
    24602489            return rc
    2461 #else
    2462 # define INTERPRET_CASE_EX_LOCK_PARAM3(opcode, Instr, InstrFn, pfnEmulate, pfnEmulateLock) \
    2463         INTERPRET_CASE_EX_PARAM3(opcode, Instr, InstrFn, pfnEmulate)
    2464 #endif
    24652490#define INTERPRET_CASE_EX_PARAM3(opcode, Instr, InstrFn, pfnEmulate) \
    24662491        case opcode:\
  • trunk/src/VBox/VMM/VMMAll/EMAllA.asm

    r9250 r9984  
    4848;;
    4949; Emulate CMP instruction, CDECL calling conv.
    50 ; EMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint32_t u32Param2, size_t cb);
     50; EMDECL(uint32_t) EMEmulateCmp(uint32_t u32Param1, uint64_t u64Param2, size_t cb);
    5151;
    5252; @returns EFLAGS after the operation, only arithmetic flags is valid.
    5353; @param    [esp + 04h]  rdi  rcx       Param 1 - First parameter (Dst).
    5454; @param    [esp + 08h]  rsi  edx       Param 2 - Second parameter (Src).
    55 ; @param    [esp + 0ch]  rdx  r8        Param 3 - Size of parameters, only 1/2/4 is valid.
     55; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    5656;
    5757align 16
     
    6666%endif  ; !RT_OS_WINDOWS
    6767%else   ; !RT_ARCH_AMD64
    68     mov     eax, [esp + 0ch]            ; eax = size of parameters
     68    mov     eax, [esp + 10h]            ; eax = size of parameters
    6969    mov     ecx, [esp + 04h]            ; ecx = first parameter
    7070    mov     edx, [esp + 08h]            ; edx = second parameter
     
    112112;;
    113113; 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);
    115115;
    116116; @returns EFLAGS after the operation, only arithmetic flags is valid.
    117117; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    118118; @param    [esp + 08h]    Param 2 - Second parameter.
    119 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     119; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    120120; @uses     eax, ecx, edx
    121121;
     
    131131%endif  ; !RT_OS_WINDOWS
    132132%else   ; !RT_ARCH_AMD64
    133     mov     eax, [esp + 0ch]            ; eax = size of parameters
     133    mov     eax, [esp + 10h]            ; eax = size of parameters
    134134    mov     ecx, [esp + 04h]            ; ecx = first parameter
    135135    mov     edx, [esp + 08h]            ; edx = second parameter
     
    177177;;
    178178; 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);
    180180;
    181181; @returns EFLAGS after the operation, only arithmetic flags is valid.
    182182; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    183183; @param    [esp + 08h]    Param 2 - Second parameter.
    184 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     184; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    185185; @uses     eax, ecx, edx
    186186;
     
    196196%endif  ; !RT_OS_WINDOWS
    197197%else   ; !RT_ARCH_AMD64
    198     mov     eax, [esp + 0ch]            ; eax = size of parameters
     198    mov     eax, [esp + 10h]            ; eax = size of parameters
    199199    mov     ecx, [esp + 04h]            ; ecx = first parameter
    200200    mov     edx, [esp + 08h]            ; edx = second parameter
     
    241241;;
    242242; 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);
    244244;
    245245; @returns VINF_SUCCESS on success, VERR_ACCESS_DENIED on \#PF (GC only).
    246246; @param    [esp + 04h]  gcc:rdi  msc:rcx   Param 1 - First parameter - pointer to data item (the real stuff).
    247247; @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 + 10h]  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.
    250250;                                                     only arithmetic flags are valid.
    251251align 16
     
    260260%endif  ; !RT_OS_WINDOWS
    261261%else   ; !RT_ARCH_AMD64
    262     mov     eax, [esp + 0ch]            ; eax = size of parameters
     262    mov     eax, [esp + 10h]            ; eax = size of parameters
    263263    mov     ecx, [esp + 04h]            ; ecx = first parameter (MY_PTR_REG)
    264264    mov     edx, [esp + 08h]            ; edx = second parameter
     
    307307 %endif ; !RT_OS_WINDOWS
    308308%else   ; !RT_ARCH_AMD64
    309     mov     eax, [esp + 10h + 4]
     309    mov     eax, [esp + 14h + 4]
    310310    pop     dword [eax]
    311311%endif
     
    324324;;
    325325; 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);
    327327;
    328328; @returns EFLAGS after the operation, only arithmetic flags is valid.
    329329; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    330330; @param    [esp + 08h]    Param 2 - Second parameter.
    331 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     331; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    332332; @uses     eax, ecx, edx
    333333;
     
    343343%endif  ; !RT_OS_WINDOWS
    344344%else   ; !RT_ARCH_AMD64
    345     mov     eax, [esp + 0ch]            ; eax = size of parameters
     345    mov     eax, [esp + 10h]            ; eax = size of parameters
    346346    mov     ecx, [esp + 04h]            ; ecx = first parameter
    347347    mov     edx, [esp + 08h]            ; edx = second parameter
     
    388388;;
    389389; 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);
    391391;
    392392; @returns EFLAGS after the operation, only arithmetic flags are valid.
     
    451451;;
    452452; 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);
    454454;
    455455; @returns EFLAGS after the operation, only arithmetic flags are valid.
     
    513513;;
    514514; 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);
    516516;
    517517; @returns EFLAGS after the operation, only arithmetic flags is valid.
    518518; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    519519; @param    [esp + 08h]    Param 2 - Second parameter.
    520 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     520; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    521521; @uses     eax, ecx, edx
    522522;
     
    532532%endif  ; !RT_OS_WINDOWS
    533533%else   ; !RT_ARCH_AMD64
    534     mov     eax, [esp + 0ch]            ; eax = size of parameters
     534    mov     eax, [esp + 10h]            ; eax = size of parameters
    535535    mov     ecx, [esp + 04h]            ; ecx = first parameter
    536536    mov     edx, [esp + 08h]            ; edx = second parameter
     
    577577;;
    578578; 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);
    580580;
    581581; @returns EFLAGS after the operation, only arithmetic flags is valid.
    582582; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    583583; @param    [esp + 08h]    Param 2 - Second parameter.
    584 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     584; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    585585; @uses     eax, ecx, edx
    586586;
     
    596596%endif  ; !RT_OS_WINDOWS
    597597%else   ; !RT_ARCH_AMD64
    598     mov     eax, [esp + 0ch]            ; eax = size of parameters
     598    mov     eax, [esp + 10h]            ; eax = size of parameters
    599599    mov     ecx, [esp + 04h]            ; ecx = first parameter
    600600    mov     edx, [esp + 08h]            ; edx = second parameter
     
    645645;;
    646646; 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);
    648648;
    649649; @returns EFLAGS after the operation, only arithmetic flags is valid.
    650650; @param    [esp + 04h]    Param 1 - First parameter - pointer to data item.
    651651; @param    [esp + 08h]    Param 2 - Second parameter.
    652 ; @param    [esp + 0ch]    Param 3 - Size of parameters, only 1/2/4 is valid.
     652; @param    [esp + 10h]    Param 3 - Size of parameters, only 1/2/4/8 (64 bits host only) is valid.
    653653; @uses     eax, ecx, edx
    654654;
     
    664664%endif  ; !RT_OS_WINDOWS
    665665%else   ; !RT_ARCH_AMD64
    666     mov     eax, [esp + 0ch]            ; eax = size of parameters
     666    mov     eax, [esp + 10h]            ; eax = size of parameters
    667667    mov     ecx, [esp + 04h]            ; ecx = first parameter
    668668    mov     edx, [esp + 08h]            ; edx = second parameter
     
    710710;;
    711711; 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);
    713713;
    714714; @returns EFLAGS after the operation, only arithmetic flags is valid.
     
    740740;;
    741741; 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);
    743743;
    744744; @returns VINF_SUCCESS on success, VERR_ACCESS_DENIED on \#PF (GC only).
    745745; @param    [esp + 04h]  gcc:rdi  msc:rcx   Param 1 - First parameter - pointer to data item (the real stuff).
    746746; @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.
    748748;
    749749align 16
     
    760760    mov     ecx, [esp + 04h]            ; ecx = first parameter
    761761    mov     edx, [esp + 08h]            ; edx = second parameter
    762     mov     eax, [esp + 0ch]            ; eax = third parameter
     762    mov     eax, [esp + 10h]            ; eax = third parameter
    763763%endif
    764764
     
    783783;;
    784784; 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);
    786786;
    787787; @returns EFLAGS after the operation, only arithmetic flags is valid.
     
    813813;;
    814814; 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);
    816816;
    817817; @returns EFLAGS after the operation, only arithmetic flags are valid.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette