Changeset 12087 in vbox
- Timestamp:
- Sep 4, 2008 12:26:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r12086 r12087 1863 1863 1864 1864 /** 1865 * Sets dr0. 1866 * 1867 * @param uDRVal Debug register value to write 1868 */ 1869 #if RT_INLINE_ASM_EXTERNAL 1870 DECLASM(void) ASMSetDR0(RTCCUINTREG uDRVal); 1871 #else 1872 DECLINLINE(void) ASMSetDR0(RTCCUINTREG uDRVal) 1873 { 1874 # if RT_INLINE_ASM_GNU_STYLE 1875 # ifdef RT_ARCH_AMD64 1876 __asm__ __volatile__("movq %0, %%dr0\n\t" : "r" (uDRVal)); 1877 # else 1878 __asm__ __volatile__("movl %0, %%dr0\n\t" : "r" (uDRVal)); 1879 # endif 1880 # else 1881 __asm 1882 { 1883 # ifdef RT_ARCH_AMD64 1884 mov dr0, [uDRVal] 1885 # else 1886 mov dr0, [uDRVal] 1887 # endif 1888 } 1889 # endif 1890 } 1891 #endif 1892 1893 /** 1894 * Sets dr1. 1895 * 1896 * @param uDRVal Debug register value to write 1897 */ 1898 #if RT_INLINE_ASM_EXTERNAL 1899 DECLASM(void) ASMSetDR1(RTCCUINTREG uDRVal); 1900 #else 1901 DECLINLINE(void) ASMSetDR1(RTCCUINTREG uDRVal) 1902 { 1903 # if RT_INLINE_ASM_GNU_STYLE 1904 # ifdef RT_ARCH_AMD64 1905 __asm__ __volatile__("movq %0, %%dr1\n\t" : "r" (uDRVal)); 1906 # else 1907 __asm__ __volatile__("movl %0, %%dr1\n\t" : "r" (uDRVal)); 1908 # endif 1909 # else 1910 __asm 1911 { 1912 # ifdef RT_ARCH_AMD64 1913 mov dr1, [uDRVal] 1914 # else 1915 mov dr1, [uDRVal] 1916 # endif 1917 } 1918 # endif 1919 } 1920 #endif 1921 1922 /** 1923 * Sets dr2. 1924 * 1925 * @param uDRVal Debug register value to write 1926 */ 1927 #if RT_INLINE_ASM_EXTERNAL 1928 DECLASM(void) ASMSetDR2(RTCCUINTREG uDRVal); 1929 #else 1930 DECLINLINE(void) ASMSetDR2(RTCCUINTREG uDRVal) 1931 { 1932 # if RT_INLINE_ASM_GNU_STYLE 1933 # ifdef RT_ARCH_AMD64 1934 __asm__ __volatile__("movq %0, %%dr2\n\t" : "r" (uDRVal)); 1935 # else 1936 __asm__ __volatile__("movl %0, %%dr2\n\t" : "r" (uDRVal)); 1937 # endif 1938 # else 1939 __asm 1940 { 1941 # ifdef RT_ARCH_AMD64 1942 mov dr2, [uDRVal] 1943 # else 1944 mov dr2, [uDRVal] 1945 # endif 1946 } 1947 # endif 1948 } 1949 #endif 1950 1951 /** 1952 * Sets dr3. 1953 * 1954 * @param uDRVal Debug register value to write 1955 */ 1956 #if RT_INLINE_ASM_EXTERNAL 1957 DECLASM(void) ASMSetDR3(RTCCUINTREG uDRVal); 1958 #else 1959 DECLINLINE(void) ASMSetDR3(RTCCUINTREG uDRVal) 1960 { 1961 # if RT_INLINE_ASM_GNU_STYLE 1962 # ifdef RT_ARCH_AMD64 1963 __asm__ __volatile__("movq %0, %%dr3\n\t" : "r" (uDRVal)); 1964 # else 1965 __asm__ __volatile__("movl %0, %%dr3\n\t" : "r" (uDRVal)); 1966 # endif 1967 # else 1968 __asm 1969 { 1970 # ifdef RT_ARCH_AMD64 1971 mov dr3, [uDRVal] 1972 # else 1973 mov dr3, [uDRVal] 1974 # endif 1975 } 1976 # endif 1977 } 1978 #endif 1979 1980 /** 1981 * Sets dr6. 1982 * 1983 * @param uDRVal Debug register value to write 1984 */ 1985 #if RT_INLINE_ASM_EXTERNAL 1986 DECLASM(void) ASMSetDR6(RTCCUINTREG uDRVal); 1987 #else 1988 DECLINLINE(void) ASMSetDR6(RTCCUINTREG uDRVal) 1989 { 1990 # if RT_INLINE_ASM_GNU_STYLE 1991 # ifdef RT_ARCH_AMD64 1992 __asm__ __volatile__("movq %0, %%dr6\n\t" : "r" (uDRVal)); 1993 # else 1994 __asm__ __volatile__("movl %0, %%dr6\n\t" : "r" (uDRVal)); 1995 # endif 1996 # else 1997 __asm 1998 { 1999 # ifdef RT_ARCH_AMD64 2000 mov dr6, [uDRVal] 2001 # else 2002 mov dr6, [uDRVal] 2003 # endif 2004 } 2005 # endif 2006 } 2007 #endif 2008 2009 /** 2010 * Sets dr7. 2011 * 2012 * @param uDRVal Debug register value to write 2013 */ 2014 #if RT_INLINE_ASM_EXTERNAL 2015 DECLASM(void) ASMSetDR7(RTCCUINTREG uDRVal); 2016 #else 2017 DECLINLINE(void) ASMSetDR7(RTCCUINTREG uDRVal) 2018 { 2019 # if RT_INLINE_ASM_GNU_STYLE 2020 # ifdef RT_ARCH_AMD64 2021 __asm__ __volatile__("movq %0, %%dr7\n\t" : "r" (uDRVal)); 2022 # else 2023 __asm__ __volatile__("movl %0, %%dr7\n\t" : "r" (uDRVal)); 2024 # endif 2025 # else 2026 __asm 2027 { 2028 # ifdef RT_ARCH_AMD64 2029 mov dr7, [uDRVal] 2030 # else 2031 mov dr7, [uDRVal] 2032 # endif 2033 } 2034 # endif 2035 } 2036 #endif 2037 2038 /** 1865 2039 * Compiler memory barrier. 1866 2040 *
Note:
See TracChangeset
for help on using the changeset viewer.