VirtualBox

Changeset 14826 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 30, 2008 7:55:50 AM (16 years ago)
Author:
vboxsync
Message:

VMM: New DevHlp pfnMMIO2MapKernel for darwin/VT-x/VGA.

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

Legend:

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

    r13840 r14826  
    25782578
    25792579    LogFlow(("pdmR3DevHlp_MMHyperMapMMIO2: caller='%s'/%d: returns %Rrc *pRCPtr=%RRv\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *pRCPtr));
     2580    return rc;
     2581}
     2582
     2583
     2584/**
     2585 * @copydoc PDMDEVHLPR3::pfnMMIO2MapKernel
     2586 */
     2587static DECLCALLBACK(int) pdmR3DevHlp_MMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
     2588                                                    const char *pszDesc, PRTR0PTR pR0Ptr)
     2589{
     2590    PDMDEV_ASSERT_DEVINS(pDevIns);
     2591    VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3);
     2592    LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: iRegion=#x off=%RGp cb=%RGp pszDesc=%p:{%s} pR0Ptr=%p\n",
     2593             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, iRegion, off, cb, pszDesc, pszDesc, pR0Ptr));
     2594
     2595    int rc = PGMR3PhysMMIO2MapKernel(pDevIns->Internal.s.pVMR3, pDevIns, iRegion, off, cb, pszDesc, pR0Ptr);
     2596
     2597    LogFlow(("pdmR3DevHlp_MMIO2MapKernel: caller='%s'/%d: returns %Rrc *pR0Ptr=%RHv\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc, *pR0Ptr));
    25802598    return rc;
    25812599}
     
    26982716    pdmR3DevHlp_MMIO2Unmap,
    26992717    pdmR3DevHlp_MMHyperMapMMIO2,
     2718    pdmR3DevHlp_MMIO2MapKernel,
    27002719    pdmR3DevHlp_RegisterVMMDevHeap,
    27012720    pdmR3DevHlp_UnregisterVMMDevHeap,
     
    30533072/** @copydoc PDMDEVHLPR3::pfnMMHyperMapMMIO2 */
    30543073static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTRCPTR pRCPtr)
     3074{
     3075    PDMDEV_ASSERT_DEVINS(pDevIns);
     3076    AssertReleaseMsgFailed(("Untrusted device called trusted helper! '%s'/%d\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance));
     3077    return VERR_ACCESS_DENIED;
     3078}
     3079
     3080
     3081/** @copydoc PDMDEVHLPR3::pfnMMIO2MapKernel */
     3082static DECLCALLBACK(int) pdmR3DevHlp_Untrusted_MMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, const char *pszDesc, PRTR0PTR pR0Ptr)
    30553083{
    30563084    PDMDEV_ASSERT_DEVINS(pDevIns);
     
    31683196    pdmR3DevHlp_Untrusted_MMIO2Unmap,
    31693197    pdmR3DevHlp_Untrusted_MMHyperMapMMIO2,
     3198    pdmR3DevHlp_Untrusted_MMIO2MapKernel,
    31703199    pdmR3DevHlp_Untrusted_RegisterVMMDevHeap,
    31713200    pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap,
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r14592 r14826  
    10751075
    10761076/**
     1077 * Maps a portion of an MMIO2 region into kernel space (host).
     1078 *
     1079 * The kernel mapping will become invalid when the MMIO2 memory is deregistered
     1080 * or the VM is terminated.
     1081 *
     1082 * @return VBox status code.
     1083 *
     1084 * @param   pVM         Pointer to the shared VM structure.
     1085 * @param   pDevIns     The device owning the MMIO2 memory.
     1086 * @param   iRegion     The region.
     1087 * @param   off         The offset into the region. Must be page aligned.
     1088 * @param   cb          The number of bytes to map. Must be page aligned.
     1089 * @param   pszDesc     Mapping description.
     1090 * @param   pR0Ptr      Where to store the R0 address.
     1091 */
     1092VMMR3DECL(int) PGMR3PhysMMIO2MapKernel(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
     1093                                       const char *pszDesc, PRTR0PTR pR0Ptr)
     1094{
     1095    /*
     1096     * Validate input.
     1097     */
     1098    VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
     1099    AssertPtrReturn(pDevIns, VERR_INVALID_PARAMETER);
     1100    AssertReturn(iRegion <= UINT8_MAX, VERR_INVALID_PARAMETER);
     1101
     1102    PPGMMMIO2RANGE pCur = pgmR3PhysMMIO2Find(pVM, pDevIns, iRegion);
     1103    AssertReturn(pCur, VERR_NOT_FOUND);
     1104    AssertReturn(off < pCur->RamRange.cb, VERR_INVALID_PARAMETER);
     1105    AssertReturn(cb <= pCur->RamRange.cb, VERR_INVALID_PARAMETER);
     1106    AssertReturn(off + cb <= pCur->RamRange.cb, VERR_INVALID_PARAMETER);
     1107
     1108    /*
     1109     * Pass the request on to the support library/driver.
     1110     */
     1111    int rc = SUPR3PageMapKernel(pCur->pvR3, off, cb, 0, pR0Ptr);
     1112
     1113    return rc;
     1114}
     1115
     1116
     1117/**
    10771118 * Registers a ROM image.
    10781119 *
  • trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp

    r14823 r14826  
    13601360    RTSPINLOCKTMP   Tmp = RTSPINLOCKTMP_INITIALIZER;
    13611361    RTSpinlockAcquire(pThis->hSpinlock, &Tmp);
     1362
    13621363#define CHECK_RET(expr, a) \
    13631364    do { \
    1364         if (!(expr)) \
     1365        if (RT_UNLIKELY(!(expr))) \
    13651366        { \
    13661367            RTSpinlockRelease(pThis->hSpinlock, &Tmp); \
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