VirtualBox

Changeset 108963 in vbox for trunk/include/VBox/vmm/gmm.h


Ignore:
Timestamp:
Apr 14, 2025 10:12:43 AM (7 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
168481
Message:

VMM/GMM: Eliminated IN_GMM_R3/R0.

File:
1 edited

Legend:

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

    r106061 r108963  
    5353 * @{
    5454 */
    55 
    56 /** @def IN_GMM_R0
    57  * Used to indicate whether we're inside the same link module as the ring 0
    58  * part of the Global Memory Manager or not.
    59  */
    60 #ifdef DOXYGEN_RUNNING
    61 # define IN_GMM_R0
    62 #endif
    63 /** @def GMMR0DECL
    64  * Ring 0 GMM export or import declaration.
    65  * @param   type    The return type of the function declaration.
    66  */
    67 #ifdef IN_GMM_R0
    68 # define GMMR0DECL(type)    DECLEXPORT(type) VBOXCALL
    69 #else
    70 # define GMMR0DECL(type)    DECLIMPORT(type) VBOXCALL
    71 #endif
    72 
    73 /** @def IN_GMM_R3
    74  * Used to indicate whether we're inside the same link module as the ring 3
    75  * part of the Global Memory Manager or not.
    76  */
    77 #ifdef DOXYGEN_RUNNING
    78 # define IN_GMM_R3
    79 #endif
    80 /** @def GMMR3DECL
    81  * Ring 3 GMM export or import declaration.
    82  * @param   type    The return type of the function declaration.
    83  */
    84 #ifdef IN_GMM_R3
    85 # define GMMR3DECL(type)    DECLEXPORT(type) VBOXCALL
    86 #else
    87 # define GMMR3DECL(type)    DECLIMPORT(type) VBOXCALL
    88 #endif
    89 
    9055
    9156/** The chunk shift. (2^21 = 2 MB) */
     
    415380typedef const GMMSTATS *PCGMMSTATS;
    416381
    417 
    418 GMMR0DECL(int)  GMMR0Init(void);
    419 GMMR0DECL(void) GMMR0Term(void);
    420 GMMR0DECL(int)  GMMR0InitPerVMData(PGVM pGVM);
    421 GMMR0DECL(void) GMMR0CleanupVM(PGVM pGVM);
    422 GMMR0DECL(int)  GMMR0InitialReservation(PGVM pGVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
    423                                         GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority);
    424 GMMR0DECL(int)  GMMR0UpdateReservation(PGVM pGVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
    425 GMMR0DECL(int)  GMMR0AllocateHandyPages(PGVM pGVM, VMCPUID idCpu, uint32_t cPagesToUpdate,
    426                                         uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
    427 GMMR0DECL(int)  GMMR0AllocatePages(PGVM pGVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
    428 GMMR0DECL(int)  GMMR0AllocateLargePage(PGVM pGVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys);
    429 GMMR0DECL(int)  GMMR0FreePages(PGVM pGVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
    430 GMMR0DECL(int)  GMMR0FreeLargePage(PGVM pGVM, VMCPUID idCpu, uint32_t idPage);
    431 GMMR0DECL(int)  GMMR0BalloonedPages(PGVM pGVM, VMCPUID idCpu, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
    432 GMMR0DECL(int)  GMMR0MapUnmapChunk(PGVM pGVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
    433 GMMR0DECL(int)  GMMR0PageIdToVirt(PGVM pGVM, uint32_t idPage, void **ppv);
    434 GMMR0DECL(int)  GMMR0RegisterSharedModule(PGVM pGVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName,
    435                                           char *pszVersion, RTGCPTR GCBaseAddr,  uint32_t cbModule, uint32_t cRegions,
    436                                           struct VMMDEVSHAREDREGIONDESC const *paRegions);
    437 GMMR0DECL(int)  GMMR0UnregisterSharedModule(PGVM pGVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion,
    438                                             RTGCPTR GCBaseAddr, uint32_t cbModule);
    439 GMMR0DECL(int)  GMMR0UnregisterAllSharedModules(PGVM pGVM, VMCPUID idCpu);
    440 GMMR0DECL(int)  GMMR0CheckSharedModules(PGVM pGVM, VMCPUID idCpu);
    441 GMMR0DECL(int)  GMMR0ResetSharedModules(PGVM pGVM, VMCPUID idCpu);
    442 GMMR0DECL(int)  GMMR0QueryStatistics(PGMMSTATS pStats, PSUPDRVSESSION pSession);
    443 GMMR0DECL(int)  GMMR0ResetStatistics(PCGMMSTATS pStats, PSUPDRVSESSION pSession);
     382VMMR0_INT_DECL(int)  GMMR0Init(void);
     383VMMR0_INT_DECL(void) GMMR0Term(void);
     384VMMR0_INT_DECL(int)  GMMR0InitPerVMData(PGVM pGVM);
     385VMMR0_INT_DECL(void) GMMR0CleanupVM(PGVM pGVM);
     386VMMR0_INT_DECL(int)  GMMR0InitialReservation(PGVM pGVM, VMCPUID idCpu, uint64_t cBasePages, uint32_t cShadowPages,
     387                                             uint32_t cFixedPages, GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority);
     388VMMR0_INT_DECL(int)  GMMR0UpdateReservation(PGVM pGVM, VMCPUID idCpu, uint64_t cBasePages,
     389                                            uint32_t cShadowPages, uint32_t cFixedPages);
     390VMMR0_INT_DECL(int)  GMMR0AllocateHandyPages(PGVM pGVM, VMCPUID idCpu, uint32_t cPagesToUpdate,
     391                                             uint32_t cPagesToAlloc, PGMMPAGEDESC paPages);
     392VMMR0_INT_DECL(int)  GMMR0AllocatePages(PGVM pGVM, VMCPUID idCpu, uint32_t cPages, PGMMPAGEDESC paPages, GMMACCOUNT enmAccount);
     393VMMR0_INT_DECL(int)  GMMR0AllocateLargePage(PGVM pGVM, VMCPUID idCpu, uint32_t cbPage, uint32_t *pIdPage, RTHCPHYS *pHCPhys);
     394VMMR0_INT_DECL(int)  GMMR0FreePages(PGVM pGVM, VMCPUID idCpu, uint32_t cPages, PGMMFREEPAGEDESC paPages, GMMACCOUNT enmAccount);
     395VMMR0_INT_DECL(int)  GMMR0FreeLargePage(PGVM pGVM, VMCPUID idCpu, uint32_t idPage);
     396VMMR0_INT_DECL(int)  GMMR0BalloonedPages(PGVM pGVM, VMCPUID idCpu, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
     397VMMR0_INT_DECL(int)  GMMR0MapUnmapChunk(PGVM pGVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
     398VMMR0_INT_DECL(int)  GMMR0PageIdToVirt(PGVM pGVM, uint32_t idPage, void **ppv);
     399VMMR0_INT_DECL(int)  GMMR0RegisterSharedModule(PGVM pGVM, VMCPUID idCpu, VBOXOSFAMILY enmGuestOS, char *pszModuleName,
     400                                               char *pszVersion, RTGCPTR GCBaseAddr,  uint32_t cbModule, uint32_t cRegions,
     401                                               struct VMMDEVSHAREDREGIONDESC const *paRegions);
     402VMMR0_INT_DECL(int)  GMMR0UnregisterSharedModule(PGVM pGVM, VMCPUID idCpu, char *pszModuleName, char *pszVersion,
     403                                                 RTGCPTR GCBaseAddr, uint32_t cbModule);
     404VMMR0_INT_DECL(int)  GMMR0UnregisterAllSharedModules(PGVM pGVM, VMCPUID idCpu);
     405VMMR0_INT_DECL(int)  GMMR0CheckSharedModules(PGVM pGVM, VMCPUID idCpu);
     406VMMR0_INT_DECL(int)  GMMR0ResetSharedModules(PGVM pGVM, VMCPUID idCpu);
     407VMMR0_INT_DECL(int)  GMMR0QueryStatistics(PGMMSTATS pStats, PSUPDRVSESSION pSession);
     408VMMR0_INT_DECL(int)  GMMR0ResetStatistics(PCGMMSTATS pStats, PSUPDRVSESSION pSession);
    444409
    445410/**
     
    460425typedef GMMINITIALRESERVATIONREQ *PGMMINITIALRESERVATIONREQ;
    461426
    462 GMMR0DECL(int)  GMMR0InitialReservationReq(PGVM pGVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq);
     427VMMR0_INT_DECL(int)  GMMR0InitialReservationReq(PGVM pGVM, VMCPUID idCpu, PGMMINITIALRESERVATIONREQ pReq);
    463428
    464429
     
    478443typedef GMMUPDATERESERVATIONREQ *PGMMUPDATERESERVATIONREQ;
    479444
    480 GMMR0DECL(int)  GMMR0UpdateReservationReq(PGVM pGVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq);
     445VMMR0_INT_DECL(int)  GMMR0UpdateReservationReq(PGVM pGVM, VMCPUID idCpu, PGMMUPDATERESERVATIONREQ pReq);
    481446
    482447
     
    499464typedef GMMALLOCATEPAGESREQ *PGMMALLOCATEPAGESREQ;
    500465
    501 GMMR0DECL(int)  GMMR0AllocatePagesReq(PGVM pGVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq);
     466VMMR0_INT_DECL(int)  GMMR0AllocatePagesReq(PGVM pGVM, VMCPUID idCpu, PGMMALLOCATEPAGESREQ pReq);
    502467
    503468
     
    520485typedef GMMFREEPAGESREQ *PGMMFREEPAGESREQ;
    521486
    522 GMMR0DECL(int)  GMMR0FreePagesReq(PGVM pGVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq);
     487VMMR0_INT_DECL(int)  GMMR0FreePagesReq(PGVM pGVM, VMCPUID idCpu, PGMMFREEPAGESREQ pReq);
    523488
    524489/**
     
    538503typedef GMMBALLOONEDPAGESREQ *PGMMBALLOONEDPAGESREQ;
    539504
    540 GMMR0DECL(int)  GMMR0BalloonedPagesReq(PGVM pGVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq);
     505VMMR0_INT_DECL(int)  GMMR0BalloonedPagesReq(PGVM pGVM, VMCPUID idCpu, PGMMBALLOONEDPAGESREQ pReq);
    541506
    542507
     
    563528typedef GMMMEMSTATSREQ *PGMMMEMSTATSREQ;
    564529
    565 GMMR0DECL(int)  GMMR0QueryHypervisorMemoryStatsReq(PGMMMEMSTATSREQ pReq);
    566 GMMR0DECL(int)  GMMR0QueryMemoryStatsReq(PGVM pGVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq);
     530VMMR0_INT_DECL(int)  GMMR0QueryHypervisorMemoryStatsReq(PGMMMEMSTATSREQ pReq);
     531VMMR0_INT_DECL(int)  GMMR0QueryMemoryStatsReq(PGVM pGVM, VMCPUID idCpu, PGMMMEMSTATSREQ pReq);
    567532
    568533/**
     
    584549typedef GMMMAPUNMAPCHUNKREQ *PGMMMAPUNMAPCHUNKREQ;
    585550
    586 GMMR0DECL(int)  GMMR0MapUnmapChunkReq(PGVM pGVM, PGMMMAPUNMAPCHUNKREQ pReq);
     551VMMR0_INT_DECL(int)  GMMR0MapUnmapChunkReq(PGVM pGVM, PGMMMAPUNMAPCHUNKREQ pReq);
    587552
    588553
     
    601566typedef GMMFREELARGEPAGEREQ *PGMMFREELARGEPAGEREQ;
    602567
    603 GMMR0DECL(int) GMMR0FreeLargePageReq(PGVM pGVM, VMCPUID idCpu, PGMMFREELARGEPAGEREQ pReq);
     568VMMR0_INT_DECL(int) GMMR0FreeLargePageReq(PGVM pGVM, VMCPUID idCpu, PGMMFREELARGEPAGEREQ pReq);
    604569
    605570/** Maximum length of the shared module name string, terminator included. */
     
    636601typedef GMMREGISTERSHAREDMODULEREQ *PGMMREGISTERSHAREDMODULEREQ;
    637602
    638 GMMR0DECL(int) GMMR0RegisterSharedModuleReq(PGVM pGVM, VMCPUID idCpu, PGMMREGISTERSHAREDMODULEREQ pReq);
     603VMMR0_INT_DECL(int) GMMR0RegisterSharedModuleReq(PGVM pGVM, VMCPUID idCpu, PGMMREGISTERSHAREDMODULEREQ pReq);
    639604
    640605/**
     
    698663typedef GMMSHAREDPAGEDESC *PGMMSHAREDPAGEDESC;
    699664
    700 GMMR0DECL(int) GMMR0SharedModuleCheckPage(PGVM pGVM, PGMMSHAREDMODULE pModule, uint32_t idxRegion, uint32_t idxPage,
    701                                           PGMMSHAREDPAGEDESC pPageDesc);
     665VMMR0_INT_DECL(int) GMMR0SharedModuleCheckPage(PGVM pGVM, PGMMSHAREDMODULE pModule, uint32_t idxRegion, uint32_t idxPage,
     666                                               PGMMSHAREDPAGEDESC pPageDesc);
    702667
    703668/**
     
    723688typedef GMMUNREGISTERSHAREDMODULEREQ *PGMMUNREGISTERSHAREDMODULEREQ;
    724689
    725 GMMR0DECL(int) GMMR0UnregisterSharedModuleReq(PGVM pGVM, VMCPUID idCpu, PGMMUNREGISTERSHAREDMODULEREQ pReq);
     690VMMR0_INT_DECL(int) GMMR0UnregisterSharedModuleReq(PGVM pGVM, VMCPUID idCpu, PGMMUNREGISTERSHAREDMODULEREQ pReq);
    726691
    727692#if defined(VBOX_STRICT) && HC_ARCH_BITS == 64
     
    742707typedef GMMFINDDUPLICATEPAGEREQ *PGMMFINDDUPLICATEPAGEREQ;
    743708
    744 GMMR0DECL(int) GMMR0FindDuplicatePageReq(PGVM pGVM, PGMMFINDDUPLICATEPAGEREQ pReq);
     709VMMR0_INT_DECL(int) GMMR0FindDuplicatePageReq(PGVM pGVM, PGMMFINDDUPLICATEPAGEREQ pReq);
    745710#endif /* VBOX_STRICT && HC_ARCH_BITS == 64 */
    746711
     
    763728typedef GMMQUERYSTATISTICSSREQ *PGMMQUERYSTATISTICSSREQ;
    764729
    765 GMMR0DECL(int)      GMMR0QueryStatisticsReq(PGVM pGVM, PGMMQUERYSTATISTICSSREQ pReq);
     730VMMR0_INT_DECL(int)      GMMR0QueryStatisticsReq(PGVM pGVM, PGMMQUERYSTATISTICSSREQ pReq);
    766731
    767732
     
    784749typedef GMMRESETSTATISTICSSREQ *PGMMRESETSTATISTICSSREQ;
    785750
    786 GMMR0DECL(int)      GMMR0ResetStatisticsReq(PGVM pGVM, PGMMRESETSTATISTICSSREQ pReq);
     751VMMR0_INT_DECL(int)      GMMR0ResetStatisticsReq(PGVM pGVM, PGMMRESETSTATISTICSSREQ pReq);
    787752
    788753
     
    792757 * @{
    793758 */
    794 GMMR3DECL(int)  GMMR3InitialReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
    795                                         GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority);
    796 GMMR3DECL(int)  GMMR3UpdateReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
    797 GMMR3DECL(int)  GMMR3AllocatePagesPrepare(PVM pVM, PGMMALLOCATEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
    798 GMMR3DECL(int)  GMMR3AllocatePagesPerform(PVM pVM, PGMMALLOCATEPAGESREQ pReq);
    799 GMMR3DECL(void) GMMR3AllocatePagesCleanup(PGMMALLOCATEPAGESREQ pReq);
    800 GMMR3DECL(int)  GMMR3FreePagesPrepare(PVM pVM, PGMMFREEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
    801 GMMR3DECL(void) GMMR3FreePagesRePrep(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cPages, GMMACCOUNT enmAccount);
    802 GMMR3DECL(int)  GMMR3FreePagesPerform(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cActualPages);
    803 GMMR3DECL(void) GMMR3FreePagesCleanup(PGMMFREEPAGESREQ pReq);
    804 GMMR3DECL(void) GMMR3FreeAllocatedPages(PVM pVM, GMMALLOCATEPAGESREQ const *pAllocReq);
    805 GMMR3DECL(int)  GMMR3AllocateLargePage(PVM pVM,  uint32_t cbPage);
    806 GMMR3DECL(int)  GMMR3FreeLargePage(PVM pVM,  uint32_t idPage);
    807 GMMR3DECL(int)  GMMR3MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
    808 GMMR3DECL(int)  GMMR3QueryHypervisorMemoryStats(PVM pVM, uint64_t *pcTotalAllocPages, uint64_t *pcTotalFreePages, uint64_t *pcTotalBalloonPages, uint64_t *puTotalBalloonSize);
    809 GMMR3DECL(int)  GMMR3QueryMemoryStats(PVM pVM, uint64_t *pcAllocPages, uint64_t *pcMaxPages, uint64_t *pcBalloonPages);
    810 GMMR3DECL(int)  GMMR3BalloonedPages(PVM pVM, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
    811 GMMR3DECL(int)  GMMR3RegisterSharedModule(PVM pVM, PGMMREGISTERSHAREDMODULEREQ pReq);
    812 GMMR3DECL(int)  GMMR3UnregisterSharedModule(PVM pVM, PGMMUNREGISTERSHAREDMODULEREQ pReq);
    813 GMMR3DECL(int)  GMMR3CheckSharedModules(PVM pVM);
    814 GMMR3DECL(int)  GMMR3ResetSharedModules(PVM pVM);
     759VMMR3_INT_DECL(int)  GMMR3InitialReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages,
     760                                             GMMOCPOLICY enmPolicy, GMMPRIORITY enmPriority);
     761VMMR3_INT_DECL(int)  GMMR3UpdateReservation(PVM pVM, uint64_t cBasePages, uint32_t cShadowPages, uint32_t cFixedPages);
     762VMMR3_INT_DECL(int)  GMMR3AllocatePagesPrepare(PVM pVM, PGMMALLOCATEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
     763VMMR3_INT_DECL(int)  GMMR3AllocatePagesPerform(PVM pVM, PGMMALLOCATEPAGESREQ pReq);
     764VMMR3_INT_DECL(void) GMMR3AllocatePagesCleanup(PGMMALLOCATEPAGESREQ pReq);
     765VMMR3_INT_DECL(int)  GMMR3FreePagesPrepare(PVM pVM, PGMMFREEPAGESREQ *ppReq, uint32_t cPages, GMMACCOUNT enmAccount);
     766VMMR3_INT_DECL(void) GMMR3FreePagesRePrep(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cPages, GMMACCOUNT enmAccount);
     767VMMR3_INT_DECL(int)  GMMR3FreePagesPerform(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t cActualPages);
     768VMMR3_INT_DECL(void) GMMR3FreePagesCleanup(PGMMFREEPAGESREQ pReq);
     769VMMR3_INT_DECL(void) GMMR3FreeAllocatedPages(PVM pVM, GMMALLOCATEPAGESREQ const *pAllocReq);
     770VMMR3_INT_DECL(int)  GMMR3AllocateLargePage(PVM pVM,  uint32_t cbPage);
     771VMMR3_INT_DECL(int)  GMMR3FreeLargePage(PVM pVM,  uint32_t idPage);
     772VMMR3_INT_DECL(int)  GMMR3MapUnmapChunk(PVM pVM, uint32_t idChunkMap, uint32_t idChunkUnmap, PRTR3PTR ppvR3);
     773VMMR3_INT_DECL(int)  GMMR3QueryHypervisorMemoryStats(PVM pVM, uint64_t *pcTotalAllocPages, uint64_t *pcTotalFreePages,
     774                                                     uint64_t *pcTotalBalloonPages, uint64_t *puTotalBalloonSize);
     775VMMR3_INT_DECL(int)  GMMR3QueryMemoryStats(PVM pVM, uint64_t *pcAllocPages, uint64_t *pcMaxPages, uint64_t *pcBalloonPages);
     776VMMR3_INT_DECL(int)  GMMR3BalloonedPages(PVM pVM, GMMBALLOONACTION enmAction, uint32_t cBalloonedPages);
     777VMMR3_INT_DECL(int)  GMMR3RegisterSharedModule(PVM pVM, PGMMREGISTERSHAREDMODULEREQ pReq);
     778VMMR3_INT_DECL(int)  GMMR3UnregisterSharedModule(PVM pVM, PGMMUNREGISTERSHAREDMODULEREQ pReq);
     779VMMR3_INT_DECL(int)  GMMR3CheckSharedModules(PVM pVM);
     780VMMR3_INT_DECL(int)  GMMR3ResetSharedModules(PVM pVM);
    815781
    816782# if defined(VBOX_STRICT) && HC_ARCH_BITS == 64
    817 GMMR3DECL(bool) GMMR3IsDuplicatePage(PVM pVM, uint32_t idPage);
     783VMMR3_INT_DECL(bool) GMMR3IsDuplicatePage(PVM pVM, uint32_t idPage);
    818784# endif
    819785
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