Changeset 7635 in vbox for trunk/include/VBox/pdmdev.h
- Timestamp:
- Mar 28, 2008 5:15:38 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r5999 r7635 644 644 DECLR3CALLBACKMEMBER(void, pfnIoApicSetIrq,(PPDMDEVINS pDevIns, int iIrq, int iLevel)); 645 645 646 /** 647 * Checks if the given address is an MMIO2 base address or not. 648 * 649 * @returns true/false accordingly. 650 * @param pDevIns The PCI device instance. 651 * @param pOwner The owner of the memory, optional. 652 * @param GCPhys The address to check. 653 */ 654 DECLR3CALLBACKMEMBER(bool, pfnIsMMIO2Base,(PPDMDEVINS pDevIns, PPDMDEVINS pOwner, RTGCPHYS GCPhys)); 655 656 /** 657 * Gets the address of the GC PCI Bus helpers. 658 * 659 * This should be called at both construction and relocation time 660 * to obtain the correct address of the GC helpers. 661 * 662 * @returns GC pointer to the PCI Bus helpers. 663 * @param pDevIns Device instance of the PCI Bus. 664 * @thread EMT only. 665 */ 666 DECLR3CALLBACKMEMBER(PCPDMPCIHLPGC, pfnGetGCHelpers,(PPDMDEVINS pDevIns)); 667 668 /** 669 * Gets the address of the R0 PCI Bus helpers. 670 * 671 * This should be called at both construction and relocation time 672 * to obtain the correct address of the GC helpers. 673 * 674 * @returns R0 pointer to the PCI Bus helpers. 675 * @param pDevIns Device instance of the PCI Bus. 676 * @thread EMT only. 677 */ 678 DECLR3CALLBACKMEMBER(PCPDMPCIHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns)); 679 646 680 #ifdef VBOX_WITH_PDM_LOCK 647 681 /** … … 662 696 DECLR3CALLBACKMEMBER(void, pfnUnlock,(PPDMDEVINS pDevIns)); 663 697 #endif 664 665 /**666 * Gets the address of the GC PCI Bus helpers.667 *668 * This should be called at both construction and relocation time669 * to obtain the correct address of the GC helpers.670 *671 * @returns GC pointer to the PCI Bus helpers.672 * @param pDevIns Device instance of the PCI Bus.673 * @thread EMT only.674 */675 DECLR3CALLBACKMEMBER(PCPDMPCIHLPGC, pfnGetGCHelpers,(PPDMDEVINS pDevIns));676 677 /**678 * Gets the address of the R0 PCI Bus helpers.679 *680 * This should be called at both construction and relocation time681 * to obtain the correct address of the GC helpers.682 *683 * @returns R0 pointer to the PCI Bus helpers.684 * @param pDevIns Device instance of the PCI Bus.685 * @thread EMT only.686 */687 DECLR3CALLBACKMEMBER(PCPDMPCIHLPR0, pfnGetR0Helpers,(PPDMDEVINS pDevIns));688 698 689 699 /** Just a safety precaution. */ … … 696 706 697 707 /** Current PDMPCIHLPR3 version number. */ 698 #define PDM_PCIHLPR3_VERSION 0xf10 10000708 #define PDM_PCIHLPR3_VERSION 0xf1020000 699 709 700 710 … … 1709 1719 */ 1710 1720 DECLR3CALLBACKMEMBER(int, pfnIOPortDeregister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts)); 1711 1712 1721 1713 1722 /** … … 2569 2578 DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange)); 2570 2579 2580 /** 2581 * Allocate and register a MMIO2 region. 2582 * 2583 * As mentioned elsewhere, MMIO2 is just RAM spelled differently. It's 2584 * RAM associated with a device. It is also non-shared memory with a 2585 * permanent ring-3 mapping and page backing (presently). 2586 * 2587 * @returns VBox status. 2588 * @param pDevIns The device instance. 2589 * @param iRegion The region number. Use the PCI region number as 2590 * this must be known to the PCI bus device too. If it's not associated 2591 * with the PCI device, then any number up to UINT8_MAX is fine. 2592 * @param cb The size (in bytes) of the region. 2593 * @param ppv Where to store the address of the ring-3 mapping of the memory. 2594 * @param pszDesc Pointer to description string. This must not be freed. 2595 * @thread EMT. 2596 */ 2597 DECLR3CALLBACKMEMBER(int, pfnMMIO2Register,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, void **ppv, const char *pszDesc)); 2598 2599 /** 2600 * Deregisters and frees a MMIO2 region. 2601 * 2602 * Any physical (and virtual) access handlers registered for the region must 2603 * be deregistered before calling this function. 2604 * 2605 * @returns VBox status code. 2606 * @param pDevIns The device instance. 2607 * @param iRegion The region number used during registration. 2608 * @thread EMT. 2609 */ 2610 DECLR3CALLBACKMEMBER(int, pfnMMIO2Deregister,(PPDMDEVINS pDevIns, uint32_t iRegion)); 2611 2612 /** 2613 * Maps a MMIO2 region into the physical memory space. 2614 * 2615 * A MMIO2 range may overlap with base memory if a lot of RAM 2616 * is configured for the VM, in which case we'll drop the base 2617 * memory pages. Presently we will make no attempt to preserve 2618 * anything that happens to be present in the base memory that 2619 * is replaced, this is of course incorrectly but it's too much 2620 * effort. 2621 * 2622 * @returns VBox status code. 2623 * @param pDevIns The device instance. 2624 * @param iRegion The region number used during registration. 2625 * @param GCPhys The physical address to map it at. 2626 * @thread EMT. 2627 */ 2628 DECLR3CALLBACKMEMBER(int, pfnMMIO2Map,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)); 2629 2630 /** 2631 * Unmaps a MMIO2 region previously mapped using pfnMMIO2Map. 2632 * 2633 * @returns VBox status code. 2634 * @param pDevIns The device instance. 2635 * @param iRegion The region number used during registration. 2636 * @param GCPhys The physical address it's currently mapped at. 2637 * @thread EMT. 2638 */ 2639 DECLR3CALLBACKMEMBER(int, pfnMMIO2Unmap,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys)); 2640 2641 /** 2642 * Maps a portion of an MMIO2 region into the hypervisor region. 2643 * 2644 * Callers of this API must never deregister the MMIO2 region before the 2645 * VM is powered off. 2646 * 2647 * @return VBox status code. 2648 * @param pDevIns The device owning the MMIO2 memory. 2649 * @param iRegion The region. 2650 * @param off The offset into the region. Will be rounded down to closest page boundrary. 2651 * @param cb The number of bytes to map. Will be rounded up to the closest page boundrary. 2652 * @param pszDesc Mapping description. 2653 * @param pGCPtr Where to store the GC address. 2654 */ 2655 DECLR3CALLBACKMEMBER(int, pfnMMHyperMapMMIO2,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, 2656 const char *pszDesc, PRTGCPTR pGCPtr)); 2657 2571 2658 /** @} */ 2572 2659 … … 2581 2668 2582 2669 /** Current PDMDEVHLP version number. */ 2583 #define PDM_DEVHLP_VERSION 0xf205000 02670 #define PDM_DEVHLP_VERSION 0xf2050001 2584 2671 2585 2672 … … 3044 3131 return pDevIns->pDevHlp->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 3045 3132 } 3046 3047 3133 /** 3048 3134 * @copydoc PDMDEVHLP::pfnROMProtectShadow … … 3051 3137 { 3052 3138 return pDevIns->pDevHlp->pfnROMProtectShadow(pDevIns, GCPhysStart, cbRange); 3139 } 3140 3141 /** 3142 * @copydoc PDMDEVHLP::pfnMMIO2Register 3143 */ 3144 DECLINLINE(int) PDMDevHlpMMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, void **ppv, const char *pszDesc) 3145 { 3146 return pDevIns->pDevHlp->pfnMMIO2Register(pDevIns, iRegion, cb, ppv, pszDesc); 3147 } 3148 3149 /** 3150 * @copydoc PDMDEVHLP::pfnMMIO2Deregister 3151 */ 3152 DECLINLINE(int) PDMDevHlpMMIO2Deregister(PPDMDEVINS pDevIns, uint32_t iRegion) 3153 { 3154 return pDevIns->pDevHlp->pfnMMIO2Deregister(pDevIns, iRegion); 3155 } 3156 3157 /** 3158 * @copydoc PDMDEVHLP::pfnMMIO2Map 3159 */ 3160 DECLINLINE(int) PDMDevHlpMMIO2Map(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3161 { 3162 return pDevIns->pDevHlp->pfnMMIO2Map(pDevIns, iRegion, GCPhys); 3163 } 3164 3165 /** 3166 * @copydoc PDMDEVHLP::pfnMMIO2Unmap 3167 */ 3168 DECLINLINE(int) PDMDevHlpMMIO2Unmap(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS GCPhys) 3169 { 3170 return pDevIns->pDevHlp->pfnMMIO2Unmap(pDevIns, iRegion, GCPhys); 3171 } 3172 3173 /** 3174 * @copydoc PDMDEVHLP::pfnMMHyperMapMMIO2 3175 */ 3176 DECLINLINE(int) PDMDevHlpMMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, 3177 const char *pszDesc, PRTGCPTR pGCPtr) 3178 { 3179 return pDevIns->pDevHlp->pfnMMHyperMapMMIO2(pDevIns, iRegion, off, cb, pszDesc, pGCPtr); 3053 3180 } 3054 3181
Note:
See TracChangeset
for help on using the changeset viewer.