VirtualBox

Changeset 12561 in vbox for trunk/include


Ignore:
Timestamp:
Sep 18, 2008 11:54:34 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
36770
Message:

IOM: Made some minor adjustments to the MMIO CPU registration context stuff and added some TODOs for what needs to be done.

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r12545 r12561  
    4949
    5050
    51 
    52 typedef enum
     51/**
     52 * MMIO CPU context.
     53 */
     54typedef enum IOMMMIOCTX
    5355{
    54     /** MMIO mapping for a specific CPU. */
    55     MMIO_REGCTX_CPU0    = 0,
    56     MMIO_REGCTX_CPU1    = 1,
    57     MMIO_REGCTX_CPU2    = 2,
    58     MMIO_REGCTX_CPU3    = 3,
    59     MMIO_REGCTX_CPU4    = 4,
    60     MMIO_REGCTX_CPU5    = 5,
    61     MMIO_REGCTX_CPU6    = 6,
    62     MMIO_REGCTX_CPU7    = 7,
    63     MMIO_REGCTX_CPU8    = 8,
    64     MMIO_REGCTX_CPU9    = 9,
    65     MMIO_REGCTX_CPU10   = 10,
    66     MMIO_REGCTX_CPU11   = 11,
    67     MMIO_REGCTX_CPU12   = 12,
    68     MMIO_REGCTX_CPU13   = 13,
    69     MMIO_REGCTX_CPU14   = 14,
    70     MMIO_REGCTX_CPU15   = 15,
    71     MMIO_REGCTX_CPU16   = 16,
    72     /* ... */
    73 
     56    /** Base of the CPU specific registrations.
     57     * Preferrably this should be used like this IOMMMIOCTX_CPU_BASE + idCpu,
     58     * but it's prefectly fine to just pass the idCpu. */
     59    IOMMMIOCTX_CPU_BASE     = 0,
     60    /** CPU0 is (currently) special. */
     61    IOMMMIOCTX_CPU0         = IOMMMIOCTX_CPU_BASE,
     62    /* ...  */
     63    /** CPU ID mask.  */
     64    IOMMMIOCTX_CPU_MASK     = 0x000000ff,
    7465    /** MMIO mapping for all CPUs. */
    75     MMIO_REGCTX_GLOBAL  = 0x100000,
    76 
     66    IOMMMIOCTX_GLOBAL       = 0x00100000,
    7767    /** 32bit hackishness. */
    78     MMIO_REGCTX_32BIT_HACK = 0x7fffffff
    79 } MMIO_REGISTRATION_CTX;
     68    IOMMMIOCTX_32BIT_HACK   = 0x7fffffff
     69} IOMMMIOCTX;
     70
    8071
    8172/**
     
    280271IOMR3DECL(int)  IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
    281272
    282 IOMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     273IOMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    283274                                    R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    284275                                    R3PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    285276                                    R3PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback, const char *pszDesc);
    286 IOMR3DECL(int)  IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     277IOMR3DECL(int)  IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    287278                                    R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    288279                                    R0PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    289280                                    R0PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    290 IOMR3DECL(int)  IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     281IOMR3DECL(int)  IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
    291282                                    RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    292283                                    RCPTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    293284                                    RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    294 IOMR3DECL(int)  IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange);
     285IOMR3DECL(int)  IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange);
    295286/** @} */
    296287#endif /* IN_RING3 */
  • trunk/include/VBox/pdmdev.h

    r12545 r12561  
    17261726     * @param   pDevIns             The device instance to register the MMIO with.
    17271727     * @param   GCPhysStart         First physical address in the range.
    1728      * @param   enmCtx              CPU id or MMIO_REGCTX_GLOBAL if it's a global registration (applies to all CPUs)
     1728     * @param   enmCtx              CPU id or IOMMMIOCTX_GLOBAL if it's a global
     1729     *                              registration (applies to all CPUs).
    17291730     * @param   cbRange             The size of the range (in bytes).
    17301731     * @param   pvUser              User argument.
     
    17341735     * @param   pszDesc             Pointer to description string. This must not be freed.
    17351736     */
    1736     DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     1737    DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    17371738                                               PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    17381739                                               const char *pszDesc));
     
    17471748     * @returns VBox status.
    17481749     * @param   pDevIns             The device instance to register the MMIO with.
    1749      * @param   enmCtx              CPU id or MMIO_REGCTX_GLOBAL if it's a global registration (applies to all CPUs)
     1750     * @param   enmCtx              CPU id or IOMMMIOCTX_GLOBAL if it's a global
     1751     *                              registration (applies to all CPUs).
    17501752     * @param   GCPhysStart         First physical address in the range.
    17511753     * @param   cbRange             The size of the range (in bytes).
     
    17571759     * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
    17581760     */
    1759     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     1761    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
    17601762                                                 const char *pszWrite, const char *pszRead, const char *pszFill,
    17611763                                                 const char *pszDesc));
     
    17691771     * @returns VBox status.
    17701772     * @param   pDevIns             The device instance to register the MMIO with.
    1771      * @param   enmCtx              CPU id or MMIO_REGCTX_GLOBAL if it's a global registration (applies to all CPUs)
     1773     * @param   enmCtx              CPU id or IOMMMIOCTX_GLOBAL if it's a global
     1774     *                              registration (applies to all CPUs).
    17721775     * @param   GCPhysStart         First physical address in the range.
    17731776     * @param   cbRange             The size of the range (in bytes).
     
    17791782     * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
    17801783     */
    1781     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     1784    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    17821785                                                 const char *pszWrite, const char *pszRead, const char *pszFill,
    17831786                                                 const char *pszDesc));
     
    17901793     * @returns VBox status.
    17911794     * @param   pDevIns             The device instance owning the MMIO region(s).
    1792      * @param   enmCtx              CPU id or MMIO_REGCTX_GLOBAL if it's a global registration (applies to all CPUs)
     1795     * @param   enmCtx              CPU id or IOMMMIOCTX_GLOBAL if it's a global registration (applies to all CPUs)
    17931796     * @param   GCPhysStart         First physical address in the range.
    17941797     * @param   cbRange             The size of the range (in bytes).
    17951798     */
    1796     DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange));
     1799    DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange));
    17971800
    17981801    /**
     
    31143117                                      const char *pszDesc)
    31153118{
    3116     return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     3119    return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, IOMMMIOCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
    31173120}
    31183121
     
    31233126                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31243127{
    3125     return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3128    return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, IOMMMIOCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31263129}
    31273130
     
    31323135                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31333136{
    3134     return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3137    return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, IOMMMIOCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31353138}
    31363139
     
    31423145                                      const char *pszDesc)
    31433146{
    3144     return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     3147    return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, (IOMMMIOCTX)(IOMMMIOCTX_CPU_BASE + idCPU), GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
    31453148}
    31463149
     
    31513154                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31523155{
    3153     return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3156    return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, (IOMMMIOCTX)(IOMMMIOCTX_CPU_BASE + idCPU), GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31543157}
    31553158
     
    31603163                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31613164{
    3162     return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3165    return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, (IOMMMIOCTX)(IOMMMIOCTX_CPU_BASE + idCPU), GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31633166}
    31643167
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