Changeset 55493 in vbox for trunk/src/VBox/VMM/include/PGMInternal.h
- Timestamp:
- Apr 28, 2015 4:51:35 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99843
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/PGMInternal.h
r52764 r55493 5 5 6 6 /* 7 * Copyright (C) 2006-201 4Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 40 40 #include <iprt/avl.h> 41 41 #include <iprt/critsect.h> 42 #include <iprt/list-off32.h> 42 43 #include <iprt/sha.h> 43 44 … … 575 576 576 577 /** 578 * Physical page access handler type registration. 579 */ 580 typedef struct PGMPHYSHANDLERTYPEINT 581 { 582 /** Number of references. */ 583 uint32_t volatile cRefs; 584 /** Magic number (PGMPHYSHANDLERTYPEINT_MAGIC). */ 585 uint32_t u32Magic; 586 /** Link of handler types anchored in PGMTREES::HeadPhysHandlerTypes. */ 587 RTLISTOFF32NODE ListNode; 588 /** The kind of accesses we're handling. */ 589 PGMPHYSHANDLERKIND enmKind; 590 /** The PGM_PAGE_HNDL_PHYS_STATE_XXX value corresponding to enmKind. */ 591 uint32_t uState; 592 /** Pointer to RC callback function. */ 593 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnHandlerRC; 594 /** Explicit alignment padding. */ 595 RTRCPTR RCPtrPadding; 596 /** Pointer to R3 callback function. */ 597 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3; 598 /** Pointer to R0 callback function. */ 599 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0; 600 /** Description / Name. For easing debugging. */ 601 R3PTRTYPE(const char *) pszDesc; 602 } PGMPHYSHANDLERTYPEINT; 603 /** Pointer to a physical access handler type registration. */ 604 typedef PGMPHYSHANDLERTYPEINT *PPGMPHYSHANDLERTYPEINT; 605 /** Magic value for the physical handler callbacks (Robert A. Heinlein). */ 606 #define PGMPHYSHANDLERTYPEINT_MAGIC UINT32_C(0x19070707) 607 /** Magic value for the physical handler callbacks. */ 608 #define PGMPHYSHANDLERTYPEINT_MAGIC_DEAD UINT32_C(0x19880508) 609 610 /** 611 * Converts a handle to a pointer. 612 * @returns PPGMPHYSHANDLERTYPEINT 613 * @param a_pVM Pointer to the cross context VM structure. 614 * @param a_hType Physical access handler handle. 615 */ 616 #define PGMPHYSHANDLERTYPEINT_FROM_HANDLE(a_pVM, a_hType) ((PPGMPHYSHANDLERTYPEINT)MMHyperHeapOffsetToPtr(a_pVM, a_hType)) 617 618 619 /** 577 620 * Physical page access handler structure. 578 621 * … … 583 626 { 584 627 AVLROGCPHYSNODECORE Core; 585 /** Access type. */586 PGMPHYSHANDLERTYPE enmType;587 628 /** Number of pages to update. */ 588 629 uint32_t cPages; … … 591 632 /** Set if we have pages that have temporarily been disabled. */ 592 633 uint32_t cTmpOffPages; 593 /** Pointer to R3 callback function. */ 594 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnHandlerR3; 634 /** Registered handler type handle (heap offset). */ 635 PGMPHYSHANDLERTYPE hType; 636 /** User argument for RC handlers. */ 637 RCPTRTYPE(void *) pvUserRC; 638 #if HC_ARCH_BITS == 64 639 RTRCPTR Padding0; /**< Explicit alignment padding. */ 640 #endif 595 641 /** User argument for R3 handlers. */ 596 642 R3PTRTYPE(void *) pvUserR3; 597 /** Pointer to R0 callback function. */598 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnHandlerR0;599 643 /** User argument for R0 handlers. */ 600 644 R0PTRTYPE(void *) pvUserR0; 601 /** Pointer to RC callback function. */602 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnHandlerRC;603 /** User argument for RC handlers. */604 RCPTRTYPE(void *) pvUserRC;605 645 /** Description / Name. For easing debugging. */ 606 646 R3PTRTYPE(const char *) pszDesc; … … 612 652 /** Pointer to a physical page access handler structure. */ 613 653 typedef PGMPHYSHANDLER *PPGMPHYSHANDLER; 654 655 /** 656 * Gets the type record for a physical handler (no reference added). 657 * @returns PPGMPHYSHANDLERTYPEINT 658 * @param a_pVM Pointer to the cross context VM structure. 659 * @param a_pPhysHandler Pointer to the physical handler structure 660 * (PGMPHYSHANDLER). 661 */ 662 #define PGMPHYSHANDLER_GET_TYPE(a_pVM, a_pPhysHandler) PGMPHYSHANDLERTYPEINT_FROM_HANDLE(a_pVM, (a_pPhysHandler)->hType) 614 663 615 664 … … 2314 2363 /** The current number of modified pages. */ 2315 2364 uint16_t cModifiedPages; 2316 /** Access handler, RC. */ 2317 RCPTRTYPE(PFNPGMRCPHYSHANDLER) pfnAccessHandlerRC; 2318 /** Access handler, R0. */ 2319 R0PTRTYPE(PFNPGMR0PHYSHANDLER) pfnAccessHandlerR0; 2320 /** Access handler, R3. */ 2321 R3PTRTYPE(PFNPGMR3PHYSHANDLER) pfnAccessHandlerR3; 2322 /** The access handler description (R3 ptr). */ 2323 R3PTRTYPE(const char *) pszAccessHandler; 2324 # if HC_ARCH_BITS == 32 2325 /** Alignment padding. */ 2326 uint32_t u32Padding2; 2327 # endif 2365 /** Physical access handler type registration handle. */ 2366 PGMPHYSHANDLERTYPE hAccessHandlerType; 2328 2367 /** Next available slot (in aDirtyPages). */ 2329 2368 uint32_t idxFreeDirtyPage; … … 2611 2650 2612 2651 /** 2613 * Trees are using self relative offsets as pointers. 2614 * So, all its data, including the root pointer, must be in the heap for HC and GC 2615 * to have the same layout. 2652 * Roots and anchors for trees and list employing self relative offsets as 2653 * pointers. 2654 * 2655 * When using self-relative offsets instead of pointers, the offsets needs to be 2656 * the same in all offsets. Thus the roots and anchors needs to live on the 2657 * hyper heap just like the nodes. 2616 2658 */ 2617 2659 typedef struct PGMTREES … … 2625 2667 /** Virtual access handlers for the hypervisor (AVL range + GC ptr tree). */ 2626 2668 AVLROGCPTRTREE HyperVirtHandlers; 2669 /** List of physical access handler types (offset pointers) of type 2670 * PGMPHYSHANDLERTYPEINT. This is needed for relocations. */ 2671 RTLISTOFF32ANCHOR HeadPhysHandlerTypes; 2627 2672 } PGMTREES; 2628 2673 /** Pointer to PGM trees. */ … … 3156 3201 /** The address of the previous RAM range mapping. */ 3157 3202 RTGCPTR GCPtrPrevRamRangeMapping; 3203 3204 /** Physical access handler type for ROM protection. */ 3205 PGMPHYSHANDLERTYPE hRomPhysHandlerType; 3206 /** Alignment padding. */ 3207 uint32_t u32Padding; 3158 3208 3159 3209 /** 4 MB page mask; 32 or 36 bits depending on PSE-36 (identical for all VCPUs) */ … … 4059 4109 4060 4110 #ifdef IN_RING3 4111 DECLCALLBACK(int) pgmR3PhysRomWriteHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, 4112 PGMACCESSTYPE enmAccessType, void *pvUser); 4061 4113 void pgmR3PhysRelinkRamRanges(PVM pVM); 4062 4114 int pgmR3PhysRamPreAllocate(PVM pVM);
Note:
See TracChangeset
for help on using the changeset viewer.