Changeset 47432 in vbox for trunk/include/iprt
- Timestamp:
- Jul 27, 2013 12:35:49 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/x86.h
r47406 r47432 738 738 /** Bit 3 - B3 - Breakpoint 3 condition detected. */ 739 739 #define X86_DR6_B3 RT_BIT(3) 740 /** Mask of all the Bx bits. */ 741 #define X86_DR6_B_MASK UINT64_C(0x0000000f) 740 742 /** Bit 13 - BD - Debug register access detected. Corresponds to the X86_DR7_GD bit. */ 741 743 #define X86_DR6_BD RT_BIT(13) … … 753 755 #define X86_DR6_MBZ_MASK UINT64_C(0xffffffff00000000) 754 756 /** @} */ 757 758 /** Get the DR6.Bx bit for a the given breakpoint. */ 759 #define X86_DR6_B(iBp) RT_BIT_64(iBp) 755 760 756 761 … … 815 820 #define X86_DR7_G(iBp) ( UINT32_C(1) << (iBp * 2 + 1) ) 816 821 822 /** Calcs the L and G bits of Nth breakpoint. 823 * @param iBp The breakpoint number [0..3]. 824 */ 825 #define X86_DR7_L_G(iBp) ( UINT32_C(3) << (iBp * 2) ) 826 817 827 /** @name Read/Write values. 818 828 * @{ */ … … 833 843 #define X86_DR7_RW(iBp, fRw) ( (fRw) << ((iBp) * 4 + 16) ) 834 844 845 /** Fetch the the R/Wx bits for a given breakpoint (so it can be compared with 846 * one of the X86_DR7_RW_XXX constants). 847 * 848 * @returns X86_DR7_RW_XXX 849 * @param uDR7 DR7 value 850 * @param iBp The breakpoint number [0..3]. 851 */ 852 #define X86_DR7_GET_RW(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 16) ) & UINT32_C(3) ) 853 854 /** R/W0, R/W1, R/W2, and R/W3. */ 855 #define X86_DR7_RW_ALL_MASKS UINT32_C(0x33330000) 856 857 /** Checks if there are any I/O breakpoint types configured in the RW 858 * registers. Does NOT check if these are enabled, sorry. */ 859 #define X86_DR7_ANY_RW_IO(uDR7) \ 860 ( ( UINT32_C(0x22220000) & (uDR7) ) /* any candidates? */ \ 861 && ( ( (UINT32_C(0x22220000) & (uDR7) ) >> 1 ) & ~(uDR7) ) ) 862 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x33330000)) == 0); 863 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x22220000)) == 1); 864 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x32320000)) == 1); 865 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x23230000)) == 1); 866 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00000000)) == 0); 867 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00010000)) == 0); 868 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00020000)) == 1); 869 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00030000)) == 0); 870 AssertCompile(X86_DR7_ANY_RW_IO(UINT32_C(0x00040000)) == 0); 871 835 872 /** @name Length values. 836 873 * @{ */ … … 851 888 * @param iBp The breakpoint number [0..3]. 852 889 */ 853 #define X86_DR7_GET_LEN(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 18) ) & 0x3U)890 #define X86_DR7_GET_LEN(uDR7, iBp) ( ( (uDR7) >> ((iBp) * 4 + 18) ) & UINT32_C(0x3) ) 854 891 855 892 /** Mask used to check if any breakpoints are enabled. */ 856 #define X86_DR7_ENABLED_MASK (RT_BIT(0) | RT_BIT(1) | RT_BIT(2) | RT_BIT(3) | RT_BIT(4) | RT_BIT(5) | RT_BIT(6) | RT_BIT(7)) 857 858 /** Mask used to check if any io breakpoints are set. */ 859 #define X86_DR7_IO_ENABLED_MASK (X86_DR7_RW(0, X86_DR7_RW_IO) | X86_DR7_RW(1, X86_DR7_RW_IO) | X86_DR7_RW(2, X86_DR7_RW_IO) | X86_DR7_RW(3, X86_DR7_RW_IO)) 893 #define X86_DR7_ENABLED_MASK UINT32_C(0x000000ff) 860 894 861 895 /** Value of DR7 after powerup/reset. */
Note:
See TracChangeset
for help on using the changeset viewer.