Changeset 12561 in vbox for trunk/include
- Timestamp:
- Sep 18, 2008 11:54:34 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 36770
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/iom.h
r12545 r12561 49 49 50 50 51 52 typedef enum 51 /** 52 * MMIO CPU context. 53 */ 54 typedef enum IOMMMIOCTX 53 55 { 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, 74 65 /** MMIO mapping for all CPUs. */ 75 MMIO_REGCTX_GLOBAL = 0x100000, 76 66 IOMMMIOCTX_GLOBAL = 0x00100000, 77 67 /** 32bit hackishness. */ 78 MMIO_REGCTX_32BIT_HACK = 0x7fffffff 79 } MMIO_REGISTRATION_CTX; 68 IOMMMIOCTX_32BIT_HACK = 0x7fffffff 69 } IOMMMIOCTX; 70 80 71 81 72 /** … … 280 271 IOMR3DECL(int) IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts); 281 272 282 IOMR3DECL(int) IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,273 IOMR3DECL(int) IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 283 274 R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, 284 275 R3PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback, 285 276 R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc); 286 IOMR3DECL(int) IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,277 IOMR3DECL(int) IOMR3MMIORegisterR0(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser, 287 278 R0PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, 288 279 R0PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback, 289 280 R0PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback); 290 IOMR3DECL(int) IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,281 IOMR3DECL(int) IOMR3MMIORegisterGC(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser, 291 282 RCPTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, 292 283 RCPTRTYPE(PFNIOMMMIOREAD) pfnReadCallback, 293 284 RCPTRTYPE(PFNIOMMMIOFILL) pfnFillCallback); 294 IOMR3DECL(int) IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, MMIO_REGISTRATION_CTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange);285 IOMR3DECL(int) IOMR3MMIODeregister(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOCTX enmCtx, RTGCPHYS GCPhysStart, RTUINT cbRange); 295 286 /** @} */ 296 287 #endif /* IN_RING3 */ -
trunk/include/VBox/pdmdev.h
r12545 r12561 1726 1726 * @param pDevIns The device instance to register the MMIO with. 1727 1727 * @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). 1729 1730 * @param cbRange The size of the range (in bytes). 1730 1731 * @param pvUser User argument. … … 1734 1735 * @param pszDesc Pointer to description string. This must not be freed. 1735 1736 */ 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, 1737 1738 PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill, 1738 1739 const char *pszDesc)); … … 1747 1748 * @returns VBox status. 1748 1749 * @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). 1750 1752 * @param GCPhysStart First physical address in the range. 1751 1753 * @param cbRange The size of the range (in bytes). … … 1757 1759 * @todo Remove pszDesc in the next major revision of PDMDEVHLP. 1758 1760 */ 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, 1760 1762 const char *pszWrite, const char *pszRead, const char *pszFill, 1761 1763 const char *pszDesc)); … … 1769 1771 * @returns VBox status. 1770 1772 * @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). 1772 1775 * @param GCPhysStart First physical address in the range. 1773 1776 * @param cbRange The size of the range (in bytes). … … 1779 1782 * @todo Remove pszDesc in the next major revision of PDMDEVHLP. 1780 1783 */ 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, 1782 1785 const char *pszWrite, const char *pszRead, const char *pszFill, 1783 1786 const char *pszDesc)); … … 1790 1793 * @returns VBox status. 1791 1794 * @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) 1793 1796 * @param GCPhysStart First physical address in the range. 1794 1797 * @param cbRange The size of the range (in bytes). 1795 1798 */ 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)); 1797 1800 1798 1801 /** … … 3114 3117 const char *pszDesc) 3115 3118 { 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); 3117 3120 } 3118 3121 … … 3123 3126 const char *pszWrite, const char *pszRead, const char *pszFill) 3124 3127 { 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); 3126 3129 } 3127 3130 … … 3132 3135 const char *pszWrite, const char *pszRead, const char *pszFill) 3133 3136 { 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); 3135 3138 } 3136 3139 … … 3142 3145 const char *pszDesc) 3143 3146 { 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); 3145 3148 } 3146 3149 … … 3151 3154 const char *pszWrite, const char *pszRead, const char *pszFill) 3152 3155 { 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); 3154 3157 } 3155 3158 … … 3160 3163 const char *pszWrite, const char *pszRead, const char *pszFill) 3161 3164 { 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); 3163 3166 } 3164 3167
Note:
See TracChangeset
for help on using the changeset viewer.