VirtualBox

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


Ignore:
Timestamp:
Feb 11, 2008 11:35:37 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28066
Message:

Pass mapping sizes in uint32_t instead of size_t to avoid warnings. (PGMR3MapPT, PGMR3MappingsSize and PGMR3MappingsFix.)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGM.cpp

    r6914 r6915  
    38853885    pVM->pgm.s.fDisableMappings = !fEnable;
    38863886
    3887     size_t cb;
     3887    uint32_t cb;
    38883888    int rc = PGMR3MappingsSize(pVM, &cb);
    38893889    AssertRCReturn(rc, rc);
  • trunk/src/VBox/VMM/PGMMap.cpp

    r6914 r6915  
    5454 * @param   pszDesc         Pointer to description string. This must not be freed.
    5555 */
    56 PGMR3DECL(int) PGMR3MapPT(PVM pVM, RTGCPTR GCPtr, size_t cb, PFNPGMRELOCATE pfnRelocate, void *pvUser, const char *pszDesc)
     56PGMR3DECL(int) PGMR3MapPT(PVM pVM, RTGCPTR GCPtr, uint32_t cb, PFNPGMRELOCATE pfnRelocate, void *pvUser, const char *pszDesc)
    5757{
    5858    LogFlow(("PGMR3MapPT: GCPtr=%#x cb=%d pfnRelocate=%p pvUser=%p pszDesc=%s\n", GCPtr, cb, pfnRelocate, pvUser, pszDesc));
     
    6767        return VERR_INVALID_PARAMETER;
    6868    }
    69     cb = RT_ALIGN_Z(cb, _4M);
     69    cb = RT_ALIGN_32(cb, _4M);
    7070    RTGCPTR GCPtrLast = GCPtr + cb - 1;
    7171    if (GCPtrLast < GCPtr)
     
    275275 * @param   pcb     Where to store the size.
    276276 */
    277 PGMR3DECL(int) PGMR3MappingsSize(PVM pVM, size_t *pcb)
    278 {
    279     size_t cb = 0;
     277PGMR3DECL(int) PGMR3MappingsSize(PVM pVM, uint32_t *pcb)
     278{
     279    RTGCUINTPTR cb = 0;
    280280    for (PPGMMAPPING pCur = pVM->pgm.s.pMappingsR3; pCur; pCur = pCur->pNextR3)
    281281        cb += pCur->cb;
    282282
    283283    *pcb = cb;
     284    AssertReturn(*pcb != cb, VERR_NUMBER_TOO_BIG);
    284285    Log(("PGMR3MappingsSize: return %d (%#x) bytes\n", cb, cb));
    285286    return VINF_SUCCESS;
     
    295296 * @param   cb          The size of the range starting at GCPtrBase.
    296297 */
    297 PGMR3DECL(int) PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, size_t cb)
     298PGMR3DECL(int) PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb)
    298299{
    299300    Log(("PGMR3MappingsFix: GCPtrBase=%#x cb=%#x\n", GCPtrBase, cb));
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