VirtualBox

Changeset 12545 in vbox for trunk/include


Ignore:
Timestamp:
Sep 17, 2008 3:11:37 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
36722
Message:

Updates for per-cpu MMIO range registration. (APIC)

Location:
trunk/include/VBox
Files:
4 edited

Legend:

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

    r9293 r12545  
    4747 */
    4848#define IOM_NO_PDMINS_CHECKS
     49
     50
     51
     52typedef enum
     53{
     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
     74    /** MMIO mapping for all CPUs. */
     75    MMIO_REGCTX_GLOBAL  = 0x100000,
     76
     77    /** 32bit hackishness. */
     78    MMIO_REGCTX_32BIT_HACK = 0x7fffffff
     79} MMIO_REGISTRATION_CTX;
    4980
    5081/**
     
    249280IOMR3DECL(int)  IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts);
    250281
    251 IOMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     282IOMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    252283                                    R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    253284                                    R3PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    254285                                    R3PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback, const char *pszDesc);
    255 IOMR3DECL(int)  IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     286IOMR3DECL(int)  IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    256287                                    R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    257288                                    R0PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    258289                                    R0PTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    259 IOMR3DECL(int)  IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     290IOMR3DECL(int)  IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
    260291                                    RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback,
    261292                                    RCPTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback,
    262293                                    RCPTRTYPE(PFNIOMMMIOFILL)  pfnFillCallback);
    263 IOMR3DECL(int)  IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange);
     294IOMR3DECL(int)  IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange);
    264295/** @} */
    265296#endif /* IN_RING3 */
  • trunk/include/VBox/pdmdev.h

    r12375 r12545  
    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)
    17281729     * @param   cbRange             The size of the range (in bytes).
    17291730     * @param   pvUser              User argument.
     
    17331734     * @param   pszDesc             Pointer to description string. This must not be freed.
    17341735     */
    1735     DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     1736    DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
    17361737                                               PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
    17371738                                               const char *pszDesc));
     
    17461747     * @returns VBox status.
    17471748     * @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)
    17481750     * @param   GCPhysStart         First physical address in the range.
    17491751     * @param   cbRange             The size of the range (in bytes).
     
    17551757     * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
    17561758     */
    1757     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     1759    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
    17581760                                                 const char *pszWrite, const char *pszRead, const char *pszFill,
    17591761                                                 const char *pszDesc));
     
    17671769     * @returns VBox status.
    17681770     * @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)
    17691772     * @param   GCPhysStart         First physical address in the range.
    17701773     * @param   cbRange             The size of the range (in bytes).
     
    17761779     * @todo    Remove pszDesc in the next major revision of PDMDEVHLP.
    17771780     */
    1778     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     1781    DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
    17791782                                                 const char *pszWrite, const char *pszRead, const char *pszFill,
    17801783                                                 const char *pszDesc));
     
    17871790     * @returns VBox status.
    17881791     * @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)
    17891793     * @param   GCPhysStart         First physical address in the range.
    17901794     * @param   cbRange             The size of the range (in bytes).
    17911795     */
    1792     DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange));
     1796    DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange));
    17931797
    17941798    /**
     
    31103114                                      const char *pszDesc)
    31113115{
    3112     return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     3116    return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
    31133117}
    31143118
     
    31193123                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31203124{
    3121     return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3125    return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31223126}
    31233127
     
    31283132                                        const char *pszWrite, const char *pszRead, const char *pszFill)
    31293133{
    3130     return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3134    return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, MMIO_REGCTX_GLOBAL, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3135}
     3136
     3137/**
     3138 * @copydoc PDMDEVHLP::pfnMMIORegisterPerCPU
     3139 */
     3140DECLINLINE(int) PDMDevHlpMMIORegisterPerCPU(PPDMDEVINS pDevIns, int idCPU, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
     3141                                      PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill,
     3142                                      const char *pszDesc)
     3143{
     3144    return pDevIns->pDevHlp->pfnMMIORegister(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
     3145}
     3146
     3147/**
     3148 * @copydoc PDMDEVHLP::pfnMMIORegisterPerCPUGC
     3149 */
     3150DECLINLINE(int) PDMDevHlpMMIORegisterPerCPUGC(PPDMDEVINS pDevIns, int idCPU, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
     3151                                        const char *pszWrite, const char *pszRead, const char *pszFill)
     3152{
     3153    return pDevIns->pDevHlp->pfnMMIORegisterGC(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
     3154}
     3155
     3156/**
     3157 * @copydoc PDMDEVHLP::pfnMMIORegisterPerCPUR0
     3158 */
     3159DECLINLINE(int) PDMDevHlpMMIORegisterPerCPUR0(PPDMDEVINS pDevIns, int idCPU, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
     3160                                        const char *pszWrite, const char *pszRead, const char *pszFill)
     3161{
     3162    return pDevIns->pDevHlp->pfnMMIORegisterR0(pDevIns, (MMIO_REGISTRATION_CTX)idCPU, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
    31313163}
    31323164
  • trunk/include/VBox/vm.h

    r12532 r12545  
    287287    /** The GVM VM handle. Only the GVM should modify this field. */
    288288    uint32_t                    hSelf;
    289     /** Reserved / padding. */
    290     uint32_t                    u32Reserved;
     289    /** Number of virtual CPUs. */
     290    uint32_t                    cCPUs;
     291    /** Current CPU id; @todo move to per CPU structure. */
     292    uint32_t                    idCPU;
     293    /** Reserved; alignment. */
     294    uint32_t                    u32Reserved[7];
    291295
    292296    /** @name Public VMM Switcher APIs
  • trunk/include/VBox/vm.mac

    r9451 r12545  
    5656    .pVMGC              RTGCPTR32_RES 1
    5757    .hSelf              resd 1
    58     .u32Reserved        resd 1
     58    .cCPUs              resd 1
     59    .idCPU              resd 1
     60    .u32Reserved        resd 7
    5961
    6062    .pfnVMMGCGuestToHostAsmGuestCtx RTGCPTR32_RES 1
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