VirtualBox

Changeset 21645 in vbox


Ignore:
Timestamp:
Jul 16, 2009 12:05:21 PM (16 years ago)
Author:
vboxsync
Message:

Naming changes

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VMMDev.h

    r21644 r21645  
    131131    VMMDevReq_GetHypervisorInfo          = 20,
    132132    VMMDevReq_SetHypervisorInfo          = 21,
    133     VMMDevReq_SetPatchMemory             = 22,
    134     VMMDevReq_ClearPatchMemory           = 23,
     133    VMMDevReq_RegisterPatchMemory             = 22,
     134    VMMDevReq_DeregisterPatchMemory           = 23,
    135135    VMMDevReq_SetPowerStatus             = 30,
    136136    VMMDevReq_AcknowledgeEvents          = 41,
     
    462462
    463463/** @name Default patch memory size .
    464  * Used by VMMDevReq_SetPatchMemory and VMMDevReq_ClearPatchMemory.
     464 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory.
    465465 * @{ */
    466466#define VMMDEV_GUEST_DEFAULT_PATCHMEM_SIZE          8192
     
    470470 * Patching memory structure. (locked executable & read-only page from the guest's perspective)
    471471 *
    472  * Used by VMMDevReq_SetPatchMemory and VMMDevReq_ClearPatchMemory
     472 * Used by VMMDevReq_RegisterPatchMemory and VMMDevReq_DeregisterPatchMemory
    473473 */
    474474typedef struct
     
    14041404        case VMMDevReq_SetHypervisorInfo:
    14051405            return sizeof(VMMDevReqHypervisorInfo);
    1406         case VMMDevReq_SetPatchMemory:
    1407         case VMMDevReq_ClearPatchMemory:
     1406        case VMMDevReq_RegisterPatchMemory:
     1407        case VMMDevReq_DeregisterPatchMemory:
    14081408            return sizeof(VMMDevReqPatchMemory);
    14091409        case VMMDevReq_SetPowerStatus:
  • trunk/include/VBox/hwaccm.h

    r21217 r21645  
    141141VMMR3DECL(int)  HWACCMR3EmulateIoBlock(PVM pVM, PCPUMCTX pCtx);
    142142VMMR3DECL(int)  HWACCMR3RestartPendingIOInstr(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
     143VMMR3DECL(int)  HWACMMR3EnablePatching(PVM pVM);
     144VMMR3DECL(int)  HWACMMR3DisablePatching(PVM pVM);
    143145
    144146/** @} */
  • trunk/include/VBox/vmm.h

    r21644 r21645  
    192192VMMR3DECL(void)     VMMR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector);
    193193VMMR3DECL(void)     VMMR3SendInitIpi(PVM pVM, VMCPUID idCpu);
    194 VMMR3DECL(int)      VMMR3SetPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
    195 VMMR3DECL(int)      VMMR3ClearPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
     194VMMR3DECL(int)      VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
     195VMMR3DECL(int)      VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem);
    196196VMMR3DECL(int)      VMMR3AtomicExecuteHandler(PVM pVM, PFNATOMICHANDLER pfnHandler, void *pvUser);
    197197VMMR3DECL(int)      VMMR3EmtRendezvous(PVM pVM, uint32_t fFlags, PFNVMMEMTRENDEZVOUS pfnRendezvous, void *pvUser);
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r21644 r21645  
    17431743    {
    17441744        VMMDevReqPatchMemory *req = NULL;
    1745         int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_SetPatchMemory);
     1745        int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_RegisterPatchMemory);
    17461746        if (RT_SUCCESS(rc))
    17471747        {
     
    17561756                if (RT_FAILURE(rc) || RT_FAILURE(req->header.rc))
    17571757                {
    1758                     dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_SetPatchMemory error!"
     1758                    dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_RegisterPatchMemory error!"
    17591759                                "rc = %d, VMMDev rc = %Rrc\n", rc, req->header.rc));
    17601760                    RTR0MemObjFree(pDevExt->PatchMemObj, true);
     
    17831783    {
    17841784        VMMDevReqPatchMemory *req = NULL;
    1785         int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_ClearPatchMemory);
     1785        int rc = VbglGRAlloc ((VMMDevRequestHeader **)&req, sizeof (VMMDevReqPatchMemory), VMMDevReq_DeregisterPatchMemory);
    17861786        if (RT_SUCCESS(rc))
    17871787        {
     
    17921792            if (RT_FAILURE(rc) || RT_FAILURE(req->header.rc))
    17931793            {
    1794                 dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_ClearPatchMemory error!"
     1794                dprintf(("VBoxGuest::reserveHypervisorMemory: VMMDevReq_DeregisterPatchMemory error!"
    17951795                            "rc = %d, VMMDev rc = %Rrc\n", rc, req->header.rc));
    17961796                /* We intentially leak the memory object here as there still could
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r21644 r21645  
    811811        }
    812812
    813         case VMMDevReq_SetPatchMemory:
     813        case VMMDevReq_RegisterPatchMemory:
    814814        {
    815815            if (pRequestHeader->size != sizeof(VMMDevReqPatchMemory))
    816816            {
    817                 AssertMsgFailed(("VMMDevReq_SetPatchMemory structure has invalid size!\n"));
     817                AssertMsgFailed(("VMMDevReq_RegisterPatchMemory structure has invalid size!\n"));
    818818                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    819819            }
     
    822822                VMMDevReqPatchMemory *pPatchRequest = (VMMDevReqPatchMemory*)pRequestHeader;
    823823
    824                 pRequestHeader->rc = VMMR3SetPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);
    825             }
    826             break;
    827         }
    828 
    829         case VMMDevReq_ClearPatchMemory:
     824                pRequestHeader->rc = VMMR3RegisterPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);
     825            }
     826            break;
     827        }
     828
     829        case VMMDevReq_DeregisterPatchMemory:
    830830        {
    831831            if (pRequestHeader->size != sizeof(VMMDevReqPatchMemory))
    832832            {
    833                 AssertMsgFailed(("VMMDevReq_ClearPatchMemory structure has invalid size!\n"));
     833                AssertMsgFailed(("VMMDevReq_DeregisterPatchMemory structure has invalid size!\n"));
    834834                pRequestHeader->rc = VERR_INVALID_PARAMETER;
    835835            }
     
    838838                VMMDevReqPatchMemory *pPatchRequest = (VMMDevReqPatchMemory*)pRequestHeader;
    839839
    840                 pRequestHeader->rc = VMMR3ClearPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);
     840                pRequestHeader->rc = VMMR3DeregisterPatchMemory(PDMDevHlpGetVM(pDevIns), pPatchRequest->pPatchMem, pPatchRequest->cbPatchMem);
    841841            }
    842842            break;
  • trunk/src/VBox/VMM/HWACCM.cpp

    r21213 r21645  
    13831383
    13841384/**
     1385 * Enable patching in a VT-x/AMD-V guest
     1386 *
     1387 * @returns VBox status code.
     1388 * @param   pVM         The VM to operate on.
     1389 */
     1390VMMR3DECL(int)  HWACMMR3EnablePatching(PVM pVM)
     1391{
     1392    return VINF_SUCCESS;
     1393}
     1394
     1395/**
     1396 * Disable patching in a VT-x/AMD-V guest
     1397 *
     1398 * @returns VBox status code.
     1399 * @param   pVM         The VM to operate on.
     1400 */
     1401VMMR3DECL(int)  HWACMMR3DisablePatching(PVM pVM)
     1402{
     1403    return VINF_SUCCESS;
     1404}
     1405
     1406/**
    13851407 * Force execution of the current IO code in the recompiler
    13861408 *
  • trunk/src/VBox/VMM/VMM.cpp

    r21644 r21645  
    13051305
    13061306/**
    1307  * Sets the guest memory range that can be used for patching
    1308  *
     1307 * Registers the guest memory range that can be used for patching
     1308 *
     1309 * @returns VBox status code.
    13091310 * @param   pVM         The VM to operate on.
    13101311 * @param   pPatchMem   Patch memory range
    13111312 * @param   cbPatchMem  Size of the memory range
    13121313 */
    1313 VMMR3DECL(int) VMMR3SetPatchMemory(PVM pVM, RTGCPTR pPatchPage, unsigned cbPatch)
    1314 {
     1314VMMR3DECL(int) VMMR3RegisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
     1315{
     1316    if (HWACCMIsEnabled(pVM))
     1317        HWACMMR3EnablePatching(pVM);
     1318
    13151319    return VERR_ACCESS_DENIED;
    13161320}
    13171321
    13181322/**
    1319  * Clears the guest memory range that can be used for patching
    1320  *
     1323 * Deregisters the guest memory range that can be used for patching
     1324 *
     1325 * @returns VBox status code.
    13211326 * @param   pVM         The VM to operate on.
    13221327 * @param   pPatchMem   Patch memory range
    13231328 * @param   cbPatchMem  Size of the memory range
    13241329 */
    1325 VMMR3DECL(int) VMMR3ClearPatchMemory(PVM pVM, RTGCPTR pPatchPage, unsigned cbPatch)
    1326 {
     1330VMMR3DECL(int) VMMR3DeregisterPatchMemory(PVM pVM, RTGCPTR pPatchMem, unsigned cbPatchMem)
     1331{
     1332    if (HWACCMIsEnabled(pVM))
     1333    {
     1334        int rc = HWACMMR3DisablePatching(pVM);
     1335        if (VBOX_FAILURE(rc))
     1336            return rc;
     1337    }
     1338
    13271339    return VINF_SUCCESS;
    13281340}
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