VirtualBox

Ignore:
Timestamp:
Oct 17, 2021 1:35:07 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147571
Message:

SUPDrv: Added SUPR0HCPhysToVirt implementation for FreeBSD (untested). bugref:9627

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c

    r90780 r91785  
    4545#include <sys/conf.h>
    4646#include <sys/uio.h>
     47#include <vm/pmap.h> /* for pmap_map() */
    4748
    4849#include "../SUPDrvInternal.h"
     
    638639
    639640
     641#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64)
     642SUPR0DECL(int) SUPR0HCPhysToVirt(RTHCPHYS HCPhys, void **ppv)
     643{
     644    AssertReturn(!(HCPhys & PAGE_OFFSET_MASK), VERR_INVALID_POINTER);
     645    AssertReturn(HCPhys != NIL_RTHCPHYS, VERR_INVALID_POINTER);
     646    *ppv = (void *)(uintptr_t)pmap_map(NULL, HCPhys, (HCPhys | PAGE_OFFSET_MASK) + 1, VM_PROT_WRITE | VM_PROT_READ);
     647    return VINF_SUCCESS;
     648}
     649#endif
     650
     651
    640652SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
    641653{
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