~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
211
211
                pPage = vm_page_alloc(pMemFreeBSD->pObject, PageIndex,
212
212
                                      VM_ALLOC_NOBUSY | VM_ALLOC_SYSTEM |
213
213
                                      VM_ALLOC_WIRED);
 
214
 
 
215
#if __FreeBSD_version >= 800000 /** @todo Find exact version number */
 
216
                /* Fixes crashes during VM termination on FreeBSD8-CURRENT amd64
 
217
                 * with kernel debugging enabled. */
 
218
                vm_page_set_valid(pPage, 0, PAGE_SIZE);
 
219
#endif
 
220
 
214
221
                if (pPage)
215
222
                {
216
223
                    vm_page_lock_queues();
370
377
}
371
378
 
372
379
 
373
 
int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, RTR0PROCESS R0Process)
 
380
int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process)
374
381
{
375
382
    int rc;
 
383
    NOREF(fAccess);
376
384
 
377
385
    /* create the object. */
378
386
    PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_LOCK, (void *)R3Ptr, cb);
398
406
}
399
407
 
400
408
 
401
 
int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb)
 
409
int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, uint32_t fAccess)
402
410
{
403
411
    int rc;
 
412
    NOREF(fAccess);
404
413
 
405
414
    /* create the object. */
406
415
    PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_LOCK, pv, cb);
441
450
        return VERR_INVALID_PARAMETER;
442
451
 
443
452
    /*
 
453
     * Check that the specified alignment is supported.
 
454
     */
 
455
    if (uAlignment > PAGE_SIZE)
 
456
        return VERR_NOT_SUPPORTED;
 
457
 
 
458
    /*
444
459
     * Create the object.
445
460
     */
446
461
    PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_RES_VIRT, NULL, cb);
456
471
        vm_offset_t MapAddress = pvFixed != (void *)-1
457
472
                               ? (vm_offset_t)pvFixed
458
473
                               : vm_map_min(pMap);
459
 
        if (pvFixed)
 
474
        if (pvFixed != (void *)-1)
460
475
            vm_map_remove(pMap,
461
476
                          MapAddress,
462
477
                          MapAddress + cb);
514
529
    AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED);
515
530
    AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED);
516
531
 
 
532
    /*
 
533
     * Check that the specified alignment is supported.
 
534
     */
 
535
    if (uAlignment > PAGE_SIZE)
 
536
        return VERR_NOT_SUPPORTED;
 
537
 
 
538
 
 
539
 
517
540
/* Phys: see pmap_mapdev in i386/i386/pmap.c (http://fxr.watson.org/fxr/source/i386/i386/pmap.c?v=RELENG62#L2860) */
518
541
 
519
542
#if 0
587
610
/* see http://markmail.org/message/udhq33tefgtyfozs */
588
611
int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)
589
612
{
 
613
    /*
 
614
     * Check for unsupported stuff.
 
615
     */
590
616
    AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED);
591
617
    AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED);
 
618
    if (uAlignment > PAGE_SIZE)
 
619
        return VERR_NOT_SUPPORTED;
592
620
 
593
621
    int             rc;
594
622
    vm_object_t     pObjectToMap = ((PRTR0MEMOBJFREEBSD)pMemToMap)->pObject;