儲存庫 vbox 的更動 12221
- 時間撮記:
- 2008-9-8 下午12:28:02 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/iprt/asm.h
r12176 r12221 91 91 # pragma intrinsic(__readcr8) 92 92 # pragma intrinsic(__writecr8) 93 # pragma intrinsic(__readdr) 94 # pragma intrinsic(__writedr) 93 95 # pragma intrinsic(_byteswap_uint64) 94 96 # pragma intrinsic(_InterlockedExchange64) … … 1617 1619 1618 1620 /** 1619 * Gets dr7. 1620 * 1621 * @returns dr7. 1622 */ 1623 #if RT_INLINE_ASM_EXTERNAL 1624 DECLASM(RTCCUINTREG) ASMGetDR7(void); 1625 #else 1626 DECLINLINE(RTCCUINTREG) ASMGetDR7(void) 1627 { 1628 RTCCUINTREG uDR7; 1629 # if RT_INLINE_ASM_GNU_STYLE 1630 # ifdef RT_ARCH_AMD64 1631 __asm__ __volatile__("movq %%dr7, %0\n\t" : "=r" (uDR7)); 1632 # else 1633 __asm__ __volatile__("movl %%dr7, %0\n\t" : "=r" (uDR7)); 1634 # endif 1635 # else 1636 __asm 1637 { 1638 # ifdef RT_ARCH_AMD64 1639 mov rax, dr7 1640 mov [uDR7], rax 1641 # else 1642 mov eax, dr7 1643 mov [uDR7], eax 1644 # endif 1645 } 1646 # endif 1647 return uDR7; 1621 * Gets dr0. 1622 * 1623 * @returns dr0. 1624 */ 1625 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1626 DECLASM(RTCCUINTREG) ASMGetDR0(void); 1627 #else 1628 DECLINLINE(RTCCUINTREG) ASMGetDR0(void) 1629 { 1630 RTCCUINTREG uDR0; 1631 # if RT_INLINE_ASM_USES_INTRIN 1632 uDR0 = __readdr(0); 1633 # elif RT_INLINE_ASM_GNU_STYLE 1634 # ifdef RT_ARCH_AMD64 1635 __asm__ __volatile__("movq %%dr0, %0\n\t" : "=r" (uDR0)); 1636 # else 1637 __asm__ __volatile__("movl %%dr0, %0\n\t" : "=r" (uDR0)); 1638 # endif 1639 # else 1640 __asm 1641 { 1642 # ifdef RT_ARCH_AMD64 1643 mov rax, dr0 1644 mov [uDR0], rax 1645 # else 1646 mov eax, dr0 1647 mov [uDR0], eax 1648 # endif 1649 } 1650 # endif 1651 return uDR0; 1652 } 1653 #endif 1654 1655 1656 /** 1657 * Gets dr1. 1658 * 1659 * @returns dr1. 1660 */ 1661 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1662 DECLASM(RTCCUINTREG) ASMGetDR1(void); 1663 #else 1664 DECLINLINE(RTCCUINTREG) ASMGetDR1(void) 1665 { 1666 RTCCUINTREG uDR1; 1667 # if RT_INLINE_ASM_USES_INTRIN 1668 uDR1 = __readdr(1); 1669 # elif RT_INLINE_ASM_GNU_STYLE 1670 # ifdef RT_ARCH_AMD64 1671 __asm__ __volatile__("movq %%dr1, %0\n\t" : "=r" (uDR1)); 1672 # else 1673 __asm__ __volatile__("movl %%dr1, %0\n\t" : "=r" (uDR1)); 1674 # endif 1675 # else 1676 __asm 1677 { 1678 # ifdef RT_ARCH_AMD64 1679 mov rax, dr1 1680 mov [uDR1], rax 1681 # else 1682 mov eax, dr1 1683 mov [uDR1], eax 1684 # endif 1685 } 1686 # endif 1687 return uDR1; 1688 } 1689 #endif 1690 1691 1692 /** 1693 * Gets dr2. 1694 * 1695 * @returns dr2. 1696 */ 1697 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1698 DECLASM(RTCCUINTREG) ASMGetDR2(void); 1699 #else 1700 DECLINLINE(RTCCUINTREG) ASMGetDR2(void) 1701 { 1702 RTCCUINTREG uDR2; 1703 # if RT_INLINE_ASM_USES_INTRIN 1704 uDR2 = __readdr(2); 1705 # elif RT_INLINE_ASM_GNU_STYLE 1706 # ifdef RT_ARCH_AMD64 1707 __asm__ __volatile__("movq %%dr2, %0\n\t" : "=r" (uDR2)); 1708 # else 1709 __asm__ __volatile__("movl %%dr2, %0\n\t" : "=r" (uDR2)); 1710 # endif 1711 # else 1712 __asm 1713 { 1714 # ifdef RT_ARCH_AMD64 1715 mov rax, dr2 1716 mov [uDR2], rax 1717 # else 1718 mov eax, dr2 1719 mov [uDR2], eax 1720 # endif 1721 } 1722 # endif 1723 return uDR2; 1724 } 1725 #endif 1726 1727 1728 /** 1729 * Gets dr3. 1730 * 1731 * @returns dr3. 1732 */ 1733 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1734 DECLASM(RTCCUINTREG) ASMGetDR3(void); 1735 #else 1736 DECLINLINE(RTCCUINTREG) ASMGetDR3(void) 1737 { 1738 RTCCUINTREG uDR3; 1739 # if RT_INLINE_ASM_USES_INTRIN 1740 uDR3 = __readdr(3); 1741 # elif RT_INLINE_ASM_GNU_STYLE 1742 # ifdef RT_ARCH_AMD64 1743 __asm__ __volatile__("movq %%dr3, %0\n\t" : "=r" (uDR3)); 1744 # else 1745 __asm__ __volatile__("movl %%dr3, %0\n\t" : "=r" (uDR3)); 1746 # endif 1747 # else 1748 __asm 1749 { 1750 # ifdef RT_ARCH_AMD64 1751 mov rax, dr3 1752 mov [uDR3], rax 1753 # else 1754 mov eax, dr3 1755 mov [uDR3], eax 1756 # endif 1757 } 1758 # endif 1759 return uDR3; 1648 1760 } 1649 1761 #endif … … 1655 1767 * @returns dr6. 1656 1768 */ 1657 #if RT_INLINE_ASM_EXTERNAL 1769 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1658 1770 DECLASM(RTCCUINTREG) ASMGetDR6(void); 1659 1771 #else … … 1661 1773 { 1662 1774 RTCCUINTREG uDR6; 1663 # if RT_INLINE_ASM_GNU_STYLE 1775 # if RT_INLINE_ASM_USES_INTRIN 1776 uDR6 = __readdr(6); 1777 # elif RT_INLINE_ASM_GNU_STYLE 1664 1778 # ifdef RT_ARCH_AMD64 1665 1779 __asm__ __volatile__("movq %%dr6, %0\n\t" : "=r" (uDR6)); … … 1689 1803 * @returns DR6. 1690 1804 */ 1691 #if RT_INLINE_ASM_EXTERNAL 1805 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1692 1806 DECLASM(RTCCUINTREG) ASMGetAndClearDR6(void); 1693 1807 #else … … 1695 1809 { 1696 1810 RTCCUINTREG uDR6; 1697 # if RT_INLINE_ASM_GNU_STYLE 1698 RTCCUINTREG uNewValue = 0xffff0ff0; /* 31-16 and 4-11 are 1's, 12 and 63-31 are zero. */ 1811 # if RT_INLINE_ASM_USES_INTRIN 1812 uDR6 = __readdr(6); 1813 __writedr(6, 0xffff0ff0U); /* 31-16 and 4-11 are 1's, 12 and 63-31 are zero. */ 1814 # elif RT_INLINE_ASM_GNU_STYLE 1815 RTCCUINTREG uNewValue = 0xffff0ff0U;/* 31-16 and 4-11 are 1's, 12 and 63-31 are zero. */ 1699 1816 # ifdef RT_ARCH_AMD64 1700 1817 __asm__ __volatile__("movq %%dr6, %0\n\t" … … 1729 1846 #endif 1730 1847 1731 /** 1732 * Gets dr0. 1733 * 1734 * @returns dr0. 1735 */ 1736 #if RT_INLINE_ASM_EXTERNAL 1737 DECLASM(RTCCUINTREG) ASMGetDR0(void); 1738 #else 1739 DECLINLINE(RTCCUINTREG) ASMGetDR0(void) 1740 { 1741 RTCCUINTREG uDR0; 1742 # if RT_INLINE_ASM_GNU_STYLE 1743 # ifdef RT_ARCH_AMD64 1744 __asm__ __volatile__("movq %%dr0, %0\n\t" : "=r" (uDR0)); 1745 # else 1746 __asm__ __volatile__("movl %%dr0, %0\n\t" : "=r" (uDR0)); 1747 # endif 1748 # else 1749 __asm 1750 { 1751 # ifdef RT_ARCH_AMD64 1752 mov rax, dr0 1753 mov [uDR0], rax 1754 # else 1755 mov eax, dr0 1756 mov [uDR0], eax 1757 # endif 1758 } 1759 # endif 1760 return uDR0; 1761 } 1762 #endif 1763 1764 1765 /** 1766 * Gets dr1. 1767 * 1768 * @returns dr1. 1769 */ 1770 #if RT_INLINE_ASM_EXTERNAL 1771 DECLASM(RTCCUINTREG) ASMGetDR1(void); 1772 #else 1773 DECLINLINE(RTCCUINTREG) ASMGetDR1(void) 1774 { 1775 RTCCUINTREG uDR1; 1776 # if RT_INLINE_ASM_GNU_STYLE 1777 # ifdef RT_ARCH_AMD64 1778 __asm__ __volatile__("movq %%dr1, %0\n\t" : "=r" (uDR1)); 1779 # else 1780 __asm__ __volatile__("movl %%dr1, %0\n\t" : "=r" (uDR1)); 1781 # endif 1782 # else 1783 __asm 1784 { 1785 # ifdef RT_ARCH_AMD64 1786 mov rax, dr1 1787 mov [uDR1], rax 1788 # else 1789 mov eax, dr1 1790 mov [uDR1], eax 1791 # endif 1792 } 1793 # endif 1794 return uDR1; 1795 } 1796 #endif 1797 1798 /** 1799 * Gets dr2. 1800 * 1801 * @returns dr2. 1802 */ 1803 #if RT_INLINE_ASM_EXTERNAL 1804 DECLASM(RTCCUINTREG) ASMGetDR2(void); 1805 #else 1806 DECLINLINE(RTCCUINTREG) ASMGetDR2(void) 1807 { 1808 RTCCUINTREG uDR2; 1809 # if RT_INLINE_ASM_GNU_STYLE 1810 # ifdef RT_ARCH_AMD64 1811 __asm__ __volatile__("movq %%dr2, %0\n\t" : "=r" (uDR2)); 1812 # else 1813 __asm__ __volatile__("movl %%dr2, %0\n\t" : "=r" (uDR2)); 1814 # endif 1815 # else 1816 __asm 1817 { 1818 # ifdef RT_ARCH_AMD64 1819 mov rax, dr2 1820 mov [uDR2], rax 1821 # else 1822 mov eax, dr2 1823 mov [uDR2], eax 1824 # endif 1825 } 1826 # endif 1827 return uDR2; 1828 } 1829 #endif 1830 1831 /** 1832 * Gets dr3. 1833 * 1834 * @returns dr3. 1835 */ 1836 #if RT_INLINE_ASM_EXTERNAL 1837 DECLASM(RTCCUINTREG) ASMGetDR3(void); 1838 #else 1839 DECLINLINE(RTCCUINTREG) ASMGetDR3(void) 1840 { 1841 RTCCUINTREG uDR3; 1842 # if RT_INLINE_ASM_GNU_STYLE 1843 # ifdef RT_ARCH_AMD64 1844 __asm__ __volatile__("movq %%dr3, %0\n\t" : "=r" (uDR3)); 1845 # else 1846 __asm__ __volatile__("movl %%dr3, %0\n\t" : "=r" (uDR3)); 1847 # endif 1848 # else 1849 __asm 1850 { 1851 # ifdef RT_ARCH_AMD64 1852 mov rax, dr3 1853 mov [uDR3], rax 1854 # else 1855 mov eax, dr3 1856 mov [uDR3], eax 1857 # endif 1858 } 1859 # endif 1860 return uDR3; 1861 } 1862 #endif 1848 1849 /** 1850 * Gets dr7. 1851 * 1852 * @returns dr7. 1853 */ 1854 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1855 DECLASM(RTCCUINTREG) ASMGetDR7(void); 1856 #else 1857 DECLINLINE(RTCCUINTREG) ASMGetDR7(void) 1858 { 1859 RTCCUINTREG uDR7; 1860 # if RT_INLINE_ASM_USES_INTRIN 1861 uDR7 = __readdr(7); 1862 # elif RT_INLINE_ASM_GNU_STYLE 1863 # ifdef RT_ARCH_AMD64 1864 __asm__ __volatile__("movq %%dr7, %0\n\t" : "=r" (uDR7)); 1865 # else 1866 __asm__ __volatile__("movl %%dr7, %0\n\t" : "=r" (uDR7)); 1867 # endif 1868 # else 1869 __asm 1870 { 1871 # ifdef RT_ARCH_AMD64 1872 mov rax, dr7 1873 mov [uDR7], rax 1874 # else 1875 mov eax, dr7 1876 mov [uDR7], eax 1877 # endif 1878 } 1879 # endif 1880 return uDR7; 1881 } 1882 #endif 1883 1863 1884 1864 1885 /** … … 1867 1888 * @param uDRVal Debug register value to write 1868 1889 */ 1869 #if RT_INLINE_ASM_EXTERNAL 1890 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1870 1891 DECLASM(void) ASMSetDR0(RTCCUINTREG uDRVal); 1871 1892 #else 1872 1893 DECLINLINE(void) ASMSetDR0(RTCCUINTREG uDRVal) 1873 1894 { 1874 # if RT_INLINE_ASM_GNU_STYLE 1895 # if RT_INLINE_ASM_USES_INTRIN 1896 __writedr(0, uDRVal); 1897 # elif RT_INLINE_ASM_GNU_STYLE 1875 1898 # ifdef RT_ARCH_AMD64 1876 1899 __asm__ __volatile__("movq %0, %%dr0\n\t" : "=r" (uDRVal)); … … 1882 1905 { 1883 1906 # ifdef RT_ARCH_AMD64 1884 mov dr0, [uDRVal] 1907 mov rax, [uDRVal] 1908 mov dr0, rax 1885 1909 # else 1886 1910 mov eax, [uDRVal] … … 1892 1916 #endif 1893 1917 1918 1894 1919 /** 1895 1920 * Sets dr1. … … 1897 1922 * @param uDRVal Debug register value to write 1898 1923 */ 1899 #if RT_INLINE_ASM_EXTERNAL 1924 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1900 1925 DECLASM(void) ASMSetDR1(RTCCUINTREG uDRVal); 1901 1926 #else 1902 1927 DECLINLINE(void) ASMSetDR1(RTCCUINTREG uDRVal) 1903 1928 { 1904 # if RT_INLINE_ASM_GNU_STYLE 1929 # if RT_INLINE_ASM_USES_INTRIN 1930 __writedr(1, uDRVal); 1931 # elif RT_INLINE_ASM_GNU_STYLE 1905 1932 # ifdef RT_ARCH_AMD64 1906 1933 __asm__ __volatile__("movq %0, %%dr1\n\t" : "=r" (uDRVal)); … … 1912 1939 { 1913 1940 # ifdef RT_ARCH_AMD64 1914 mov dr1, [uDRVal] 1941 mov rax, [uDRVal] 1942 mov dr1, rax 1915 1943 # else 1916 1944 mov eax, [uDRVal] … … 1922 1950 #endif 1923 1951 1952 1924 1953 /** 1925 1954 * Sets dr2. … … 1927 1956 * @param uDRVal Debug register value to write 1928 1957 */ 1929 #if RT_INLINE_ASM_EXTERNAL 1958 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1930 1959 DECLASM(void) ASMSetDR2(RTCCUINTREG uDRVal); 1931 1960 #else 1932 1961 DECLINLINE(void) ASMSetDR2(RTCCUINTREG uDRVal) 1933 1962 { 1934 # if RT_INLINE_ASM_GNU_STYLE 1963 # if RT_INLINE_ASM_USES_INTRIN 1964 __writedr(2, uDRVal); 1965 # elif RT_INLINE_ASM_GNU_STYLE 1935 1966 # ifdef RT_ARCH_AMD64 1936 1967 __asm__ __volatile__("movq %0, %%dr2\n\t" : "=r" (uDRVal)); … … 1942 1973 { 1943 1974 # ifdef RT_ARCH_AMD64 1944 mov dr2, [uDRVal] 1975 mov rax, [uDRVal] 1976 mov dr2, rax 1945 1977 # else 1946 1978 mov eax, [uDRVal] … … 1952 1984 #endif 1953 1985 1986 1954 1987 /** 1955 1988 * Sets dr3. … … 1957 1990 * @param uDRVal Debug register value to write 1958 1991 */ 1959 #if RT_INLINE_ASM_EXTERNAL 1992 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1960 1993 DECLASM(void) ASMSetDR3(RTCCUINTREG uDRVal); 1961 1994 #else 1962 1995 DECLINLINE(void) ASMSetDR3(RTCCUINTREG uDRVal) 1963 1996 { 1964 # if RT_INLINE_ASM_GNU_STYLE 1997 # if RT_INLINE_ASM_USES_INTRIN 1998 __writedr(3, uDRVal); 1999 # elif RT_INLINE_ASM_GNU_STYLE 1965 2000 # ifdef RT_ARCH_AMD64 1966 2001 __asm__ __volatile__("movq %0, %%dr3\n\t" : "=r" (uDRVal)); … … 1972 2007 { 1973 2008 # ifdef RT_ARCH_AMD64 1974 mov dr3, [uDRVal] 2009 mov rax, [uDRVal] 2010 mov dr3, rax 1975 2011 # else 1976 2012 mov eax, [uDRVal] … … 1982 2018 #endif 1983 2019 2020 1984 2021 /** 1985 2022 * Sets dr6. … … 1987 2024 * @param uDRVal Debug register value to write 1988 2025 */ 1989 #if RT_INLINE_ASM_EXTERNAL 2026 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 1990 2027 DECLASM(void) ASMSetDR6(RTCCUINTREG uDRVal); 1991 2028 #else 1992 2029 DECLINLINE(void) ASMSetDR6(RTCCUINTREG uDRVal) 1993 2030 { 1994 # if RT_INLINE_ASM_GNU_STYLE 2031 # if RT_INLINE_ASM_USES_INTRIN 2032 __writedr(6, uDRVal); 2033 # elif RT_INLINE_ASM_GNU_STYLE 1995 2034 # ifdef RT_ARCH_AMD64 1996 2035 __asm__ __volatile__("movq %0, %%dr6\n\t" : "=r" (uDRVal)); … … 2002 2041 { 2003 2042 # ifdef RT_ARCH_AMD64 2004 mov dr6, [uDRVal] 2043 mov rax, [uDRVal] 2044 mov dr6, rax 2005 2045 # else 2006 2046 mov eax, [uDRVal] … … 2012 2052 #endif 2013 2053 2054 2014 2055 /** 2015 2056 * Sets dr7. … … 2017 2058 * @param uDRVal Debug register value to write 2018 2059 */ 2019 #if RT_INLINE_ASM_EXTERNAL 2060 #if RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN 2020 2061 DECLASM(void) ASMSetDR7(RTCCUINTREG uDRVal); 2021 2062 #else 2022 2063 DECLINLINE(void) ASMSetDR7(RTCCUINTREG uDRVal) 2023 2064 { 2024 # if RT_INLINE_ASM_GNU_STYLE 2065 # if RT_INLINE_ASM_USES_INTRIN 2066 __writedr(7, uDRVal); 2067 # elif RT_INLINE_ASM_GNU_STYLE 2025 2068 # ifdef RT_ARCH_AMD64 2026 2069 __asm__ __volatile__("movq %0, %%dr7\n\t" : "=r" (uDRVal)); … … 2032 2075 { 2033 2076 # ifdef RT_ARCH_AMD64 2034 mov dr7, [uDRVal] 2077 mov rax, [uDRVal] 2078 mov dr7, rax 2035 2079 # else 2036 2080 mov eax, [uDRVal] … … 2041 2085 } 2042 2086 #endif 2087 2043 2088 2044 2089 /** … … 2803 2848 # else 2804 2849 , "m" (*pu64) 2805 # endif 2850 # endif 2806 2851 ); 2807 2852 # else /* !PIC */ … … 3692 3737 # else 3693 3738 , "m" (*pu64) 3694 # endif 3739 # endif 3695 3740 ); 3696 3741 # else /* !PIC */ … … 3771 3816 # else 3772 3817 , "m" (*pu64) 3773 # endif 3818 # endif 3774 3819 ); 3775 3820 # else /* !PIC */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器