Changeset 28974 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- May 3, 2010 1:09:44 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60991
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r28806 r28974 2991 2991 2992 2992 /** 2993 * Return the total amount of free pages2993 * Return memory statistics for the hypervisor 2994 2994 * 2995 2995 * @returns VBox status code: … … 2997 2997 * @param pReq The request packet. 2998 2998 */ 2999 GMMR0DECL(int) GMMR0Query VMMMemoryStatsReq(PVM pVM, PGMMMEMSTATSREQ pReq)2999 GMMR0DECL(int) GMMR0QueryHypervisorMemoryStatsReq(PVM pVM, PGMMMEMSTATSREQ pReq) 3000 3000 { 3001 3001 /* … … 3016 3016 pReq->cFreePages = (pGMM->cChunks << (GMM_CHUNK_SHIFT- PAGE_SHIFT)) - pGMM->cAllocatedPages; 3017 3017 pReq->cBalloonedPages = pGMM->cBalloonedPages; 3018 pReq->cMaxPages = pGMM->cMaxPages; 3018 3019 GMM_CHECK_SANITY_UPON_LEAVING(pGMM); 3019 3020 3020 3021 return VINF_SUCCESS; 3022 } 3023 3024 /** 3025 * Return memory statistics for the VM 3026 * 3027 * @returns VBox status code: 3028 * @param pVM Pointer to the shared VM structure. 3029 * @parma idCpu Cpu id. 3030 * @param pReq The request packet. 3031 */ 3032 GMMR0DECL(int) GMMR0QueryMemoryStatsReq(PVM pVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq) 3033 { 3034 /* 3035 * Validate input and pass it on. 3036 */ 3037 AssertPtrReturn(pVM, VERR_INVALID_POINTER); 3038 AssertPtrReturn(pReq, VERR_INVALID_POINTER); 3039 AssertMsgReturn(pReq->Hdr.cbReq == sizeof(GMMMEMSTATSREQ), 3040 ("%#x < %#x\n", pReq->Hdr.cbReq, sizeof(GMMMEMSTATSREQ)), 3041 VERR_INVALID_PARAMETER); 3042 3043 /* 3044 * Validate input and get the basics. 3045 */ 3046 PGMM pGMM; 3047 GMM_GET_VALID_INSTANCE(pGMM, VERR_INTERNAL_ERROR); 3048 PGVM pGVM; 3049 int rc = GVMMR0ByVMAndEMT(pVM, idCpu, &pGVM); 3050 if (RT_FAILURE(rc)) 3051 return rc; 3052 3053 /* 3054 * Take the sempahore and do some more validations. 3055 */ 3056 rc = RTSemFastMutexRequest(pGMM->Mtx); 3057 AssertRC(rc); 3058 if (GMM_CHECK_SANITY_UPON_ENTERING(pGMM)) 3059 { 3060 pReq->cAllocPages = pGVM->gmm.s.Allocated.cBasePages; 3061 pReq->cBalloonedPages = pGVM->gmm.s.cBalloonedPages; 3062 pReq->cMaxPages = pGVM->gmm.s.Reserved.cBasePages; 3063 pReq->cFreePages = pReq->cMaxPages - pReq->cAllocPages; 3064 } 3065 else 3066 rc = VERR_INTERNAL_ERROR_5; 3067 3068 RTSemFastMutexRelease(pGMM->Mtx); 3069 LogFlow(("GMMR3QueryVMMemoryStats: returns %Rrc\n", rc)); 3070 return rc; 3021 3071 } 3022 3072 … … 3416 3466 GMMR0DECL(int) GMMR0UnregisterSharedModule(PVM pVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion, RTGCPTR GCBaseAddr, uint32_t cbModule) 3417 3467 { 3468 #ifdef VBOX_WITH_PAGE_SHARING 3418 3469 return VERR_NOT_IMPLEMENTED; 3470 #else 3471 return VERR_NOT_IMPLEMENTED; 3472 #endif 3419 3473 } 3420 3474 … … 3441 3495 3442 3496 /** 3443 * Checks reg sitered modules for shared pages3497 * Checks registered modules for shared pages 3444 3498 * 3445 3499 * @returns VBox status code. … … 3449 3503 GMMR0DECL(int) GMMR0CheckSharedModules(PVM pVM, VMCPUID idCpu) 3450 3504 { 3505 #ifdef VBOX_WITH_PAGE_SHARING 3451 3506 return VERR_NOT_IMPLEMENTED; 3452 } 3507 #else 3508 return VERR_NOT_IMPLEMENTED; 3509 #endif 3510 } -
trunk/src/VBox/VMM/VMMR0/VMMR0.cpp
r28800 r28974 905 905 return GMMR0FreeLargePageReq(pVM, idCpu, (PGMMFREELARGEPAGEREQ)pReqHdr); 906 906 907 case VMMR0_DO_GMM_QUERY_ VMM_MEM_STATS:907 case VMMR0_DO_GMM_QUERY_HYPERVISOR_MEM_STATS: 908 908 if (u64Arg) 909 909 return VERR_INVALID_PARAMETER; 910 return GMMR0QueryVMMMemoryStatsReq(pVM, (PGMMMEMSTATSREQ)pReqHdr); 910 return GMMR0QueryHypervisorMemoryStatsReq(pVM, (PGMMMEMSTATSREQ)pReqHdr); 911 912 case VMMR0_DO_GMM_QUERY_MEM_STATS: 913 if (idCpu == NIL_VMCPUID) 914 return VERR_INVALID_CPU_ID; 915 if (u64Arg) 916 return VERR_INVALID_PARAMETER; 917 return GMMR0QueryMemoryStatsReq(pVM, idCpu, (PGMMMEMSTATSREQ)pReqHdr); 911 918 912 919 case VMMR0_DO_GMM_BALLOONED_PAGES:
Note:
See TracChangeset
for help on using the changeset viewer.