VirtualBox

Ignore:
Timestamp:
Sep 20, 2012 12:31:54 PM (12 years ago)
Author:
vboxsync
Message:

Haiku Additions: cleanup, missed file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c

    r43363 r43366  
    7878        case RTR0MEMOBJTYPE_LOCK:
    7979            return pMem->u.Lock.R0Process == NIL_RTR0PROCESS
    80                 ? kernel_map
    81                 : &((struct proc *)pMem->u.Lock.R0Process)->p_vmspace->vm_map;
     80            ? kernel_map
     81            : &((struct proc *)pMem->u.Lock.R0Process)->p_vmspace->vm_map;
    8282
    8383        case RTR0MEMOBJTYPE_RES_VIRT:
    8484            return pMem->u.ResVirt.R0Process == NIL_RTR0PROCESS
    85                 ? kernel_map
    86                 : &((struct proc *)pMem->u.ResVirt.R0Process)->p_vmspace->vm_map;
     85            ? kernel_map
     86            : &((struct proc *)pMem->u.ResVirt.R0Process)->p_vmspace->vm_map;
    8787
    8888        case RTR0MEMOBJTYPE_MAPPING:
    8989            return pMem->u.Mapping.R0Process == NIL_RTR0PROCESS
    90                 ? kernel_map
    91                 : &((struct proc *)pMem->u.Mapping.R0Process)->p_vmspace->vm_map;
     90            ? kernel_map
     91            : &((struct proc *)pMem->u.Mapping.R0Process)->p_vmspace->vm_map;
    9292
    9393        default:
     
    150150
    151151static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb,
    152     bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment)
     152                                     bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment)
    153153{
    154154    NOREF(fExecutable);
     
    159159    uint32 addressSpec  = B_ANY_KERNEL_ADDRESS;
    160160    uint32 fLock        = ~0U;
    161     LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem, (unsigned)cb,
    162                fExecutable ? "true" : "false", type, PhysHighest, (unsigned)uAlignment));
     161    LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb,
     162                 fExecutable ? "true" : "false", type, PhysHighest,(unsigned)uAlignment));
    163163
    164164    switch (type)
     
    194194        case RTR0MEMOBJTYPE_LOCK:
    195195            break;
    196 #endif       
     196#endif
    197197        default:
    198198            return VERR_INTERNAL_ERROR;
     
    237237        }
    238238
    239            delete_area(pMemHaiku->AreaId);
     239        delete_area(pMemHaiku->AreaId);
    240240    }
    241241
     
    277277{
    278278    AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED);
    279     LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys, (unsigned)cb, uCachePolicy));
     279    LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys,(unsigned)cb, uCachePolicy));
    280280
    281281    /* Create the object. */
     
    315315
    316316    LogFlowFunc(("ppMem=%p pvStart=%p cb=%u fAccess=%x R0Process=%d fFlags=%x\n", ppMem, pvStart, cb, fAccess, R0Process,
    317                 fFlags));
     317                 fFlags));
    318318
    319319    /* Create the object. */
     
    365365
    366366    if (R0Process != NIL_RTR0PROCESS)
    367         team = (team_id)R0Process;
     367    team = (team_id)R0Process;
    368368
    369369    /* Check that the specified alignment is supported. */
    370370    if (uAlignment > PAGE_SIZE)
    371         return VERR_NOT_SUPPORTED;
     371    return VERR_NOT_SUPPORTED;
    372372
    373373    /* Create the object. */
    374374    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(*pMemHaiku), RTR0MEMOBJTYPE_RES_VIRT, NULL, cb);
    375375    if (!pMemHaiku)
    376         return VERR_NO_MEMORY;
     376    return VERR_NO_MEMORY;
    377377
    378378    /* Ask the kernel to reserve the address range. */
     
    410410    /** @todo r=ramshankar: Wrong format specifiers, fix later! */
    411411    dprintf("%s(%p, %p, %p, %d, %x, %u, %u)\n", __FUNCTION__, ppMem, pMemToMap, pvFixed, uAlignment,
    412         fProt, offSub, cbSub);
     412            fProt, offSub, cbSub);
    413413#endif
    414414    /* Check that the specified alignment is supported. */
     
    436436        rc = area = clone_area("IPRT R0MemObj MapKernel", &pvMap, uAddrSpec, fProtect, pMemToMapHaiku->AreaId);
    437437        LogFlow(("rtR0MemObjNativeMapKernel: clone_area uAddrSpec=%d fProtect=%x AreaId=%d rc=%d\n", uAddrSpec, fProtect,
    438                 pMemToMapHaiku->AreaId, rc));
     438                 pMemToMapHaiku->AreaId, rc));
    439439    }
    440440    else if (pMemToMapHaiku->Core.enmType == RTR0MEMOBJTYPE_PHYS)
     
    457457                                                    pMemToMapHaiku->Core.cb);
    458458        if (RT_UNLIKELY(!pMemHaiku))
    459                return VERR_NO_MEMORY;
     459            return VERR_NO_MEMORY;
    460460
    461461        pMemHaiku->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
     
    483483    AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED);
    484484    if (uAlignment > PAGE_SIZE)
    485         return VERR_NOT_SUPPORTED;
     485    return VERR_NOT_SUPPORTED;
    486486
    487487    int                rc;
     
    493493    vm_prot_t       ProtectionFlags = 0;
    494494    if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE)
    495         ProtectionFlags = VM_PROT_NONE;
     495    ProtectionFlags = VM_PROT_NONE;
    496496    if ((fProt & RTMEM_PROT_READ) == RTMEM_PROT_READ)
    497         ProtectionFlags |= VM_PROT_READ;
     497    ProtectionFlags |= VM_PROT_READ;
    498498    if ((fProt & RTMEM_PROT_WRITE) == RTMEM_PROT_WRITE)
    499         ProtectionFlags |= VM_PROT_WRITE;
     499    ProtectionFlags |= VM_PROT_WRITE;
    500500    if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC)
    501         ProtectionFlags |= VM_PROT_EXECUTE;
     501    ProtectionFlags |= VM_PROT_EXECUTE;
    502502
    503503    /* calc mapping address */
     
    562562         */
    563563        PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU),
    564                                                                            RTR0MEMOBJTYPE_MAPPING,
    565                                                                            (void *)AddrR3,
    566                                                                            pMemToMap->cb);
     564                                                                     RTR0MEMOBJTYPE_MAPPING,
     565                                                                     (void *)AddrR3,
     566                                                                     pMemToMap->cb);
    567567        if (pMemHaiku)
    568568        {
     
    591591    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)pMem;
    592592    status_t rc;
    593    
     593
    594594    /** @todo r=ramshankar: Validate objects */
    595  
    596     LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType, (unsigned)iPage));
     595
     596    LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType,(unsigned)iPage));
    597597
    598598    switch (pMemHaiku->Core.enmType)
     
    602602            team_id        TeamId = B_SYSTEM_TEAM;
    603603            physical_entry aPhysMap[2];
    604             int32          cPhysMap = 2;        /** @todo r=ramshankar: why not use RT_ELEMENTS? */
     604            int32          cPhysMap = 2;    /** @todo r=ramshankar: why not use RT_ELEMENTS? */
    605605
    606606            if (pMemHaiku->Core.u.Lock.R0Process != NIL_RTR0PROCESS)
     
    643643            team_id        TeamId = B_SYSTEM_TEAM;
    644644            physical_entry aPhysMap[2];
    645             int32          cPhysMap = 2;        /** @todo r=ramshankar: why not use RT_ELEMENTS? */
     645            int32          cPhysMap = 2;    /** @todo r=ramshankar: why not use RT_ELEMENTS? */
    646646
    647647            void *pb = pMemHaiku->Core.pv + (iPage << PAGE_SHIFT);
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