- Timestamp:
- Oct 1, 2009 1:12:06 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53100
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r23477 r23478 620 620 /** @} */ 621 621 622 622 623 /** 623 624 * A Physical Guest Page tracking structure. … … 635 636 /** The page state. 636 637 * Only 2 bits are really needed for this. */ 637 #ifdef PGM_PAGE_WITH_BIT_FIELD638 uint32_t uStateY : 8;639 #else640 638 uint8_t uStateY; 641 #endif642 639 /** The page type (PGMPAGETYPE). 643 640 * Only 3 bits are really needed for this. */ 644 #ifdef PGM_PAGE_WITH_BIT_FIELD645 uint32_t uTypeY : 8;646 #else647 641 uint8_t uTypeY; 648 #endif649 642 650 643 /** The physical handler state (PGM_PAGE_HNDL_PHYS_STATE*). 651 644 * Only 2 bits are really needed for this. */ 652 #ifdef PGM_PAGE_WITH_BIT_FIELD653 uint32_t uHandlerPhysStateY : 8;654 #else655 645 uint8_t uHandlerPhysStateY; 656 #endif 657 658 #ifdef PGM_PAGE_WITH_BIT_FIELD 659 /** The virtual handler state (PGM_PAGE_HNDL_VIRT_STATE*) */ 660 uint32_t u2HandlerVirtStateY : 2; 661 /** For later. */ 662 uint32_t afSomethingElse0 : 5; 663 /** Flag indicating that a write monitored page was written to when set. */ 664 uint32_t fWrittenToY : 1; 665 #else 666 /** Combination of u2HandlerVirtStateY, fWrittenToY and 5 unused bits. */ 646 /** Combination of: 647 * - u2HandlerVirtStateY - the virtual handler state 648 * (PGM_PAGE_HNDL_VIRT_STATE_*). 649 * - fWrittenToY - flag indicating that a write monitored page was written to 650 * when set. 651 * - 5 unused bits. */ 667 652 uint8_t f8MiscY; 668 #endif669 653 670 654 /** Usage tracking (page pool). */ … … 688 672 * @param pPage Pointer to the physical guest page tracking structure. 689 673 */ 690 #ifdef PGM_PAGE_WITH_BIT_FIELD 691 # define PGM_PAGE_CLEAR(pPage) \ 692 do { \ 693 (pPage)->HCPhysAndPageID = 0; \ 694 (pPage)->uStateY = 0; \ 695 (pPage)->fWrittenToY = 0; \ 696 (pPage)->afSomethingElse0 = 0; \ 697 (pPage)->uTypeY = 0; \ 698 (pPage)->uHandlerPhysStateY = 0; \ 699 (pPage)->u2HandlerVirtStateY = 0; \ 700 (pPage)->u16TrackingY = 0; \ 701 (pPage)->cReadLocksY = 0; \ 702 (pPage)->cWriteLocksY = 0; \ 703 } while (0) 704 #else 705 # define PGM_PAGE_CLEAR(pPage) \ 674 #define PGM_PAGE_CLEAR(pPage) \ 706 675 do { \ 707 676 (pPage)->HCPhysAndPageID = 0; \ … … 714 683 (pPage)->cWriteLocksY = 0; \ 715 684 } while (0) 716 #endif717 685 718 686 /** … … 720 688 * @param pPage Pointer to the physical guest page tracking structure. 721 689 */ 722 #ifdef PGM_PAGE_WITH_BIT_FIELD 723 # define PGM_PAGE_INIT(pPage, _HCPhys, _idPage, _uType, _uState) \ 690 #define PGM_PAGE_INIT(pPage, _HCPhys, _idPage, _uType, _uState) \ 724 691 do { \ 725 692 RTHCPHYS SetHCPhysTmp = (_HCPhys); \ … … 736 703 (pPage)->cWriteLocksY = 0; \ 737 704 } while (0) 738 #else739 # define PGM_PAGE_INIT(pPage, _HCPhys, _idPage, _uType, _uState) \740 do { \741 RTHCPHYS SetHCPhysTmp = (_HCPhys); \742 AssertFatal(!(SetHCPhysTmp & ~UINT64_C(0x0000fffffffff000))); \743 (pPage)->HCPhysAndPageID = (SetHCPhysTmp << (28-12)) | ((_idPage) & UINT32_C(0x0fffffff)); \744 (pPage)->uStateY = (_uState); \745 (pPage)->uTypeY = (_uType); \746 (pPage)->uHandlerPhysStateY = 0; \747 (pPage)->f8MiscY = 0; \748 (pPage)->u16TrackingY = 0; \749 (pPage)->cReadLocksY = 0; \750 (pPage)->cWriteLocksY = 0; \751 } while (0)752 #endif753 705 754 706 /** … … 889 841 * @param pPage Pointer to the physical guest page tracking structure. 890 842 */ 891 #ifdef PGM_PAGE_WITH_BIT_FIELD892 #define PGM_PAGE_SET_WRITTEN_TO(pPage) do { (pPage)->fWrittenToY = 1; } while (0)893 #else894 843 #define PGM_PAGE_SET_WRITTEN_TO(pPage) do { (pPage)->f8MiscY |= UINT8_C(0x80); } while (0) 895 #endif896 844 897 845 /** … … 899 847 * @param pPage Pointer to the physical guest page tracking structure. 900 848 */ 901 #ifdef PGM_PAGE_WITH_BIT_FIELD902 #define PGM_PAGE_CLEAR_WRITTEN_TO(pPage) do { (pPage)->fWrittenToY = 0; } while (0)903 #else904 849 #define PGM_PAGE_CLEAR_WRITTEN_TO(pPage) do { (pPage)->f8MiscY &= UINT8_C(0x7f); } while (0) 905 #endif906 850 907 851 /** … … 910 854 * @param pPage Pointer to the physical guest page tracking structure. 911 855 */ 912 #ifdef PGM_PAGE_WITH_BIT_FIELD913 #define PGM_PAGE_IS_WRITTEN_TO(pPage) ( (pPage)->fWrittenToY )914 #else915 856 #define PGM_PAGE_IS_WRITTEN_TO(pPage) ( !!((pPage)->f8MiscY & UINT8_C(0x80)) ) 916 #endif917 857 918 858 … … 984 924 * @param pPage Pointer to the physical guest page tracking structure. 985 925 */ 986 #ifdef PGM_PAGE_WITH_BIT_FIELD987 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->u2HandlerVirtStateY )988 #else989 926 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->f8MiscY & UINT8_C(0x03) ) 990 #endif991 927 992 928 /** … … 995 931 * @param _uState The new state value. 996 932 */ 997 #ifdef PGM_PAGE_WITH_BIT_FIELD998 #define PGM_PAGE_SET_HNDL_VIRT_STATE(pPage, _uState) \999 do { (pPage)->u2HandlerVirtStateY = (_uState); } while (0)1000 #else1001 933 #define PGM_PAGE_SET_HNDL_VIRT_STATE(pPage, _uState) \ 1002 934 do { \ … … 1004 936 | ((_uState) & UINT8_C(0x03)); \ 1005 937 } while (0) 1006 #endif1007 938 1008 939 /** -
trunk/src/VBox/VMM/PGMPhys.cpp
r23471 r23478 3328 3328 } 3329 3329 3330 3331
Note:
See TracChangeset
for help on using the changeset viewer.