VirtualBox

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


Ignore:
Timestamp:
Jun 16, 2010 11:14:20 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62731
Message:

Make sure GMMR0MapUnmapChunk can deal with calls from non-EMT threads.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/GMMR0.cpp

    r30203 r30237  
    33093309 * @returns VBox status code.
    33103310 * @param   pVM             The VM.
    3311  * @param   idCpu           VCPU id
    33123311 * @param   idChunkMap      The chunk to map. NIL_GMM_CHUNKID if nothing to map.
    33133312 * @param   idChunkUnmap    The chunk to unmap. NIL_GMM_CHUNKID if nothing to unmap.
     
    33153314 * @thread  EMT
    33163315 */
    3317 GMMR0DECL(int) GMMR0MapUnmapChunk(PVM pVM, VMCPUID idCpu, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3)
     3316GMMR0DECL(int) GMMR0MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3)
    33183317{
    33193318    LogFlow(("GMMR0MapUnmapChunk: pVM=%p idChunkMap=%#x idChunkUnmap=%#x ppvR3=%p\n",
     
    33263325    GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR);
    33273326    PGVM pGVM;
    3328     int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM);
     3327    int rc = GVMMR0ByVM(pVM, &pGVM);
    33293328    if (RT_FAILURE(rc))
    33303329        return rc;
     
    34013400 * @returns see GMMR0MapUnmapChunk.
    34023401 * @param   pVM             Pointer to the shared VM structure.
    3403  * @param   idCpu           VCPU id
    34043402 * @param   pReq            The request packet.
    34053403 */
    3406 GMMR0DECL(int)  GMMR0MapUnmapChunkReq(PVM pVM, VMCPUID idCpu, PGMMMAPUNMAPCHUNKREQ pReq)
     3404GMMR0DECL(int)  GMMR0MapUnmapChunkReq(PVM pVM, PGMMMAPUNMAPCHUNKREQ pReq)
    34073405{
    34083406    /*
     
    34133411    AssertMsgReturn(pReq->Hdr.cbReq == sizeof(*pReq), ("%#x != %#x\n", pReq->Hdr.cbReq, sizeof(*pReq)), VERR_INVALID_PARAMETER);
    34143412
    3415     return GMMR0MapUnmapChunk(pVM, idCpu, pReq->idChunkMap, pReq->idChunkUnmap, &pReq->pvR3);
     3413    return GMMR0MapUnmapChunk(pVM, pReq->idChunkMap, pReq->idChunkUnmap, &pReq->pvR3);
    34163414}
    34173415
  • trunk/src/VBox/VMM/VMMR0/GVMMR0.cpp

    r30112 r30237  
    12241224 * Lookup a GVM structure by the shared VM structure.
    12251225 *
    1226  * @returns The GVM pointer on success, NULL on failure.
     1226 * @returns VBox status code.
    12271227 * @param   pVM     The shared VM structure (the ring-0 mapping).
     1228 * @param   ppGVM       Where to store the GVM pointer.
    12281229 *
    12291230 * @remark  This will not take the 'used'-lock because it doesn't do
    12301231 *          nesting and this function will be used from under the lock.
    12311232 */
    1232 GVMMR0DECL(PGVM) GVMMR0ByVM(PVM pVM)
    1233 {
    1234     PGVM pGVM;
     1233GVMMR0DECL(int) GVMMR0ByVM(PVM pVM, PGVM *ppGVM)
     1234{
    12351235    PGVMM pGVMM;
    1236     int rc = gvmmR0ByVM(pVM, &pGVM, &pGVMM, false /* fTakeUsedLock */);
    1237     if (RT_SUCCESS(rc))
    1238         return pGVM;
    1239     AssertRC(rc);
    1240     return NULL;
     1236    return gvmmR0ByVM(pVM, ppGVM, &pGVMM, false /* fTakeUsedLock */);
    12411237}
    12421238
  • trunk/src/VBox/VMM/VMMR0/VMMR0.cpp

    r29908 r30237  
    925925            if (u64Arg)
    926926                return VERR_INVALID_PARAMETER;
    927             return GMMR0MapUnmapChunkReq(pVM, idCpu, (PGMMMAPUNMAPCHUNKREQ)pReqHdr);
     927            return GMMR0MapUnmapChunkReq(pVM, (PGMMMAPUNMAPCHUNKREQ)pReqHdr);
    928928
    929929        case VMMR0_DO_GMM_SEED_CHUNK:
Note: See TracChangeset for help on using the changeset viewer.

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