- Timestamp:
- Oct 1, 2009 1:40:25 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53105
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r23480 r23483 641 641 uint8_t uTypeY; 642 642 643 #define PGM_PAGE_WITH_U16MISCY 1 644 #ifdef PGM_PAGE_WITH_U16MISCY 645 /** Combination of: 646 * - [0-7]: u2HandlerPhysStateY - the physical handler state 647 * (PGM_PAGE_HNDL_PHYS_STATE_*). 648 * - [8-9]: u2HandlerVirtStateY - the virtual handler state 649 * (PGM_PAGE_HNDL_VIRT_STATE_*). 650 * - [15]: fWrittenToY - flag indicating that a write monitored page was 651 * written to when set. 652 * - [10-14]: 5 unused bits. 653 * @remarks Warning! All accesses to the bits are hardcoded. 654 */ 655 RTUINT16U u16MiscY; 656 #else 643 657 /** The physical handler state (PGM_PAGE_HNDL_PHYS_STATE*). 644 658 * Only 2 bits are really needed for this. */ … … 651 665 * - 5 unused bits. */ 652 666 uint8_t f8MiscY; 667 #endif 653 668 654 669 /** Usage tracking (page pool). */ … … 672 687 * @param pPage Pointer to the physical guest page tracking structure. 673 688 */ 689 #ifdef PGM_PAGE_WITH_U16MISCY 690 #define PGM_PAGE_CLEAR(pPage) \ 691 do { \ 692 (pPage)->HCPhysAndPageID = 0; \ 693 (pPage)->uStateY = 0; \ 694 (pPage)->uTypeY = 0; \ 695 (pPage)->u16MiscY.u = 0; \ 696 (pPage)->u16TrackingY = 0; \ 697 (pPage)->cReadLocksY = 0; \ 698 (pPage)->cWriteLocksY = 0; \ 699 } while (0) 700 #else 674 701 #define PGM_PAGE_CLEAR(pPage) \ 675 702 do { \ … … 683 710 (pPage)->cWriteLocksY = 0; \ 684 711 } while (0) 712 #endif 685 713 686 714 /** … … 688 716 * @param pPage Pointer to the physical guest page tracking structure. 689 717 */ 718 #ifdef PGM_PAGE_WITH_U16MISCY 719 #define PGM_PAGE_INIT(pPage, _HCPhys, _idPage, _uType, _uState) \ 720 do { \ 721 RTHCPHYS SetHCPhysTmp = (_HCPhys); \ 722 AssertFatal(!(SetHCPhysTmp & ~UINT64_C(0x0000fffffffff000))); \ 723 (pPage)->HCPhysAndPageID = (SetHCPhysTmp << (28-12)) | ((_idPage) & UINT32_C(0x0fffffff)); \ 724 (pPage)->uStateY = (_uState); \ 725 (pPage)->uTypeY = (_uType); \ 726 (pPage)->u16MiscY.u = 0; \ 727 (pPage)->u16TrackingY = 0; \ 728 (pPage)->cReadLocksY = 0; \ 729 (pPage)->cWriteLocksY = 0; \ 730 } while (0) 731 #else 690 732 #define PGM_PAGE_INIT(pPage, _HCPhys, _idPage, _uType, _uState) \ 691 733 do { \ … … 701 743 (pPage)->cWriteLocksY = 0; \ 702 744 } while (0) 745 #endif 703 746 704 747 /** … … 839 882 * @param pPage Pointer to the physical guest page tracking structure. 840 883 */ 884 #ifdef PGM_PAGE_WITH_U16MISCY 885 #define PGM_PAGE_SET_WRITTEN_TO(pPage) do { (pPage)->u16MiscY.au8[1] |= UINT8_C(0x80); } while (0) 886 #else 841 887 #define PGM_PAGE_SET_WRITTEN_TO(pPage) do { (pPage)->f8MiscY |= UINT8_C(0x80); } while (0) 888 #endif 842 889 843 890 /** … … 845 892 * @param pPage Pointer to the physical guest page tracking structure. 846 893 */ 894 #ifdef PGM_PAGE_WITH_U16MISCY 895 #define PGM_PAGE_CLEAR_WRITTEN_TO(pPage) do { (pPage)->u16MiscY.au8[1] &= UINT8_C(0x7f); } while (0) 896 #else 847 897 #define PGM_PAGE_CLEAR_WRITTEN_TO(pPage) do { (pPage)->f8MiscY &= UINT8_C(0x7f); } while (0) 898 #endif 848 899 849 900 /** … … 852 903 * @param pPage Pointer to the physical guest page tracking structure. 853 904 */ 905 #ifdef PGM_PAGE_WITH_U16MISCY 906 #define PGM_PAGE_IS_WRITTEN_TO(pPage) ( !!((pPage)->u16MiscY.au8[1] & UINT8_C(0x80)) ) 907 #else 854 908 #define PGM_PAGE_IS_WRITTEN_TO(pPage) ( !!((pPage)->f8MiscY & UINT8_C(0x80)) ) 909 #endif 855 910 856 911 … … 875 930 * @param pPage Pointer to the physical guest page tracking structure. 876 931 */ 932 #ifdef PGM_PAGE_WITH_U16MISCY 933 #define PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) \ 934 ( (pPage)->u16MiscY.au8[0] ) 935 #else 877 936 #define PGM_PAGE_GET_HNDL_PHYS_STATE(pPage) \ 878 937 ( (pPage)->uHandlerPhysStateY ) 938 #endif 879 939 880 940 /** … … 883 943 * @param _uState The new state value. 884 944 */ 945 #ifdef PGM_PAGE_WITH_U16MISCY 946 #define PGM_PAGE_SET_HNDL_PHYS_STATE(pPage, _uState) \ 947 do { (pPage)->u16MiscY.au8[0] = (_uState); } while (0) 948 #else 885 949 #define PGM_PAGE_SET_HNDL_PHYS_STATE(pPage, _uState) \ 886 950 do { (pPage)->uHandlerPhysStateY = (_uState); } while (0) 951 #endif 887 952 888 953 /** … … 922 987 * @param pPage Pointer to the physical guest page tracking structure. 923 988 */ 989 #ifdef PGM_PAGE_WITH_U16MISCY 990 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->u16MiscY.au8[1] & UINT8_C(0x03) ) 991 #else 924 992 #define PGM_PAGE_GET_HNDL_VIRT_STATE(pPage) ( (pPage)->f8MiscY & UINT8_C(0x03) ) 993 #endif 925 994 926 995 /** … … 929 998 * @param _uState The new state value. 930 999 */ 1000 #ifdef PGM_PAGE_WITH_U16MISCY 1001 #define PGM_PAGE_SET_HNDL_VIRT_STATE(pPage, _uState) \ 1002 do { \ 1003 (pPage)->u16MiscY.au8[1] = ((pPage)->u16MiscY.au8[1] & UINT8_C(0xfc)) \ 1004 | ((_uState) & UINT8_C(0x03)); \ 1005 } while (0) 1006 #else 931 1007 #define PGM_PAGE_SET_HNDL_VIRT_STATE(pPage, _uState) \ 932 1008 do { \ … … 934 1010 | ((_uState) & UINT8_C(0x03)); \ 935 1011 } while (0) 1012 #endif 936 1013 937 1014 /**
Note:
See TracChangeset
for help on using the changeset viewer.