VirtualBox

Changeset 39111 in vbox for trunk/include


Ignore:
Timestamp:
Oct 25, 2011 2:47:02 PM (13 years ago)
Author:
vboxsync
Message:

IOM,PDM: Working on moving unaligned and non-dword MMIO access splitting and buffering up into IOM (from the device emulation).

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/iom.h

    r38677 r39111  
    7979                                ) \
    8080                            )
     81
     82/** @name IOMMMIO_FLAGS_XXX
     83 * @{ */
     84/** Pass all reads thru unmodified. */
     85#define IOMMMIO_FLAGS_READ_PASSTHRU                     UINT32_C(0x00000000)
     86/** All read accesses are DWORD sized (32-bit). */
     87#define IOMMMIO_FLAGS_READ_DWORD                        UINT32_C(0x00000001)
     88/** All read accesses are DWORD (32-bit) or QWORD (64-bit) sized.
     89 * Only accesses that are both QWORD sized and aligned are performed as QWORD.
     90 * All other access will be done DWORD fashion (because it is way simpler). */
     91#define IOMMMIO_FLAGS_READ_DWORD_QWORD                  UINT32_C(0x00000002)
     92/** The read access mode mask. */
     93#define IOMMMIO_FLAGS_READ_MODE                         UINT32_C(0x00000003)
     94
     95/** Pass all writes thru unmodified. */
     96#define IOMMMIO_FLAGS_WRITE_PASSTHRU                    UINT32_C(0x00000000)
     97/** All write accesses are DWORD (32-bit) sized and unspecified bytes are
     98 * written as zero. */
     99#define IOMMMIO_FLAGS_WRITE_DWORD_ZEROED                UINT32_C(0x00000010)
     100/** All write accesses are either DWORD (32-bit) or QWORD (64-bit) sized,
     101 * missing bytes will be written as zero.  Only accesses that are both QWORD
     102 * sized and aligned are performed as QWORD, all other accesses will be done
     103 * DWORD fashion (because it's way simpler). */
     104#define IOMMMIO_FLAGS_WRITE_DWORD_QWORD_ZEROED          UINT32_C(0x00000020)
     105/** All write accesses are DWORD (32-bit) sized and unspecified bytes are
     106 * read from the device first as DWORDs.
     107 * @remarks This isn't how it happens on real hardware, but it allows
     108 *          simplifications of devices where reads doesn't change the device
     109 *          state in any way. */
     110#define IOMMMIO_FLAGS_WRITE_DWORD_READ_MISSING          UINT32_C(0x00000030)
     111/** All write accesses are DWORD (32-bit) or QWORD (64-bit) sized and
     112 * unspecified bytes are read from the device first as DWORDs.  Only accesses
     113 * that are both QWORD sized and aligned are performed as QWORD, all other
     114 * accesses will be done DWORD fashion (because it's way simpler).
     115 * @remarks This isn't how it happens on real hardware, but it allows
     116 *          simplifications of devices where reads doesn't change the device
     117 *          state in any way. */
     118#define IOMMMIO_FLAGS_WRITE_DWORD_QWORD_READ_MISSING    UINT32_C(0x00000040)
     119/** The read access mode mask. */
     120#define IOMMMIO_FLAGS_WRITE_MODE                        UINT32_C(0x00000070)
     121
     122/** Mask of valid flags. */
     123#define IOMMMIO_FLAGS_VALID_MASK                        UINT32_C(0x00000073)
     124/** @} */
    81125
    82126
     
    228272 * @{
    229273 */
    230 VMMR3DECL(int)  IOMR3Init(PVM pVM);
    231 VMMR3DECL(void) IOMR3Reset(PVM pVM);
    232 VMMR3DECL(void) IOMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
    233 VMMR3DECL(int)  IOMR3Term(PVM pVM);
    234 VMMR3DECL(int)  IOMR3IOPortRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
    235                                       R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
    236                                       R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStringCallback, R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStringCallback,
    237                                       const char *pszDesc);
    238 VMMR3DECL(int)  IOMR3IOPortRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTRCPTR pvUser,
    239                                       RCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, RCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
    240                                       RCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, RCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
    241                                       const char *pszDesc);
    242 VMMR3DECL(int)  IOMR3IOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
    243                                       R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
    244                                       R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
    245                                       const char *pszDesc);
    246 VMMR3DECL(int)  IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
    247 
    248 VMMR3_INT_DECL(int)  IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     274VMMR3_INT_DECL(int)  IOMR3Init(PVM pVM);
     275VMMR3_INT_DECL(void) IOMR3Reset(PVM pVM);
     276VMMR3_INT_DECL(void) IOMR3Relocate(PVM pVM, RTGCINTPTR offDelta);
     277VMMR3_INT_DECL(int)  IOMR3Term(PVM pVM);
     278VMMR3_INT_DECL(int)  IOMR3IOPortRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
     279                                           R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
     280                                           R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStringCallback, R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStringCallback,
     281                                           const char *pszDesc);
     282VMMR3_INT_DECL(int)  IOMR3IOPortRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTRCPTR pvUser,
     283                                           RCPTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, RCPTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
     284                                           RCPTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, RCPTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
     285                                           const char *pszDesc);
     286VMMR3_INT_DECL(int)  IOMR3IOPortRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts, RTR0PTR pvUser,
     287                                           R0PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback, R0PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
     288                                           R0PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStrCallback, R0PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStrCallback,
     289                                           const char *pszDesc);
     290VMMR3_INT_DECL(int)  IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
     291
     292VMMR3_INT_DECL(int)  IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTHCPTR pvUser,
    249293                                         R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    250294                                         R3PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    251                                          R3PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback, const char *pszDesc);
    252 VMMR3_INT_DECL(int)  IOMR3MmioRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     295                                         R3PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback,
     296                                         uint32_t fFlags, const char *pszDesc);
     297VMMR3_INT_DECL(int)  IOMR3MmioRegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTR0PTR pvUser,
    253298                                         R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    254299                                         R0PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    255300                                         R0PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    256 VMMR3_INT_DECL(int)  IOMR3MmioRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     301VMMR3_INT_DECL(int)  IOMR3MmioRegisterRC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange, RTGCPTR pvUser,
    257302                                         RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    258303                                         RCPTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    259304                                         RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    260 VMMR3_INT_DECL(int)  IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange);
     305VMMR3_INT_DECL(int)  IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, uint32_t cbRange);
    261306
    262307/** @} */
  • trunk/include/VBox/vmm/pdmdev.h

    r39078 r39111  
    22392239     * @param   pfnRead             Pointer to function which is gonna handle Read operations.
    22402240     * @param   pfnFill             Pointer to function which is gonna handle Fill/memset operations. (optional)
     2241     * @param   fFlags              Flags, IOMMMIO_FLAGS_XXX.
    22412242     * @param   pszDesc             Pointer to description string. This must not be freed.
    22422243     */
    22432244    DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    22442245                                               PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    2245                                                const char *pszDesc));
     2246                                               uint32_t fFlags, const char *pszDesc));
    22462247
    22472248    /**
     
    41084109                                      const char *pszDesc)
    41094110{
    4110     return pDevIns->pHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     4111    return pDevIns->pHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill,
     4112                                            IOMMMIO_FLAGS_WRITE_PASSTHRU | IOMMMIO_FLAGS_READ_PASSTHRU, pszDesc);
    41114113}
    41124114
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