Changeset 35003 in vbox for trunk/include
- Timestamp:
- Dec 13, 2010 1:09:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r33540 r35003 1922 1922 * @param puRes Where to store the result. 1923 1923 */ 1924 #define ASMAtomicReadSize(pu, puRes) \ 1924 #if HC_ARCH_BITS == 32 1925 # define ASMAtomicReadSize(pu, puRes) \ 1925 1926 do { \ 1926 switch (sizeof(*(pu))) { \ 1927 case 1: *(uint8_t *)(puRes) = ASMAtomicReadU8( (volatile uint8_t *)(void *)(pu)); break; \ 1928 case 2: *(uint16_t *)(puRes) = ASMAtomicReadU16((volatile uint16_t *)(void *)(pu)); break; \ 1929 case 4: *(uint32_t *)(puRes) = ASMAtomicReadU32((volatile uint32_t *)(void *)(pu)); break; \ 1930 case 8: *(uint64_t *)(puRes) = ASMAtomicReadU64((volatile uint64_t *)(void *)(pu)); break; \ 1931 default: AssertMsgFailed(("ASMAtomicReadSize: size %d is not supported\n", sizeof(*(pu)))); \ 1932 } \ 1927 *(uint32_t *)(puRes) = ASMAtomicReadU32((volatile uint32_t *)(void *)(pu)); \ 1933 1928 } while (0) 1929 #elif HC_ARCH_BITS == 64 1930 # define ASMAtomicReadSize(pu, puRes) \ 1931 do { \ 1932 *(uint64_t *)(puRes) = ASMAtomicReadU64((volatile uint64_t *)(void *)(pu)); \ 1933 } while (0) 1934 #else 1935 # error HC_ARCH_BITS 1936 #endif 1934 1937 1935 1938 … … 1941 1944 * @param puRes Where to store the result. 1942 1945 */ 1943 #define ASMAtomicUoReadSize(pu, puRes) \ 1946 #if HC_ARCH_BITS == 32 1947 # define ASMAtomicUoReadSize(pu, puRes) \ 1944 1948 do { \ 1945 switch (sizeof(*(pu))) { \ 1946 case 1: *(uint8_t *)(puRes) = ASMAtomicUoReadU8( (volatile uint8_t *)(void *)(pu)); break; \ 1947 case 2: *(uint16_t *)(puRes) = ASMAtomicUoReadU16((volatile uint16_t *)(void *)(pu)); break; \ 1948 case 4: *(uint32_t *)(puRes) = ASMAtomicUoReadU32((volatile uint32_t *)(void *)(pu)); break; \ 1949 case 8: *(uint64_t *)(puRes) = ASMAtomicUoReadU64((volatile uint64_t *)(void *)(pu)); break; \ 1950 default: AssertMsgFailed(("ASMAtomicReadSize: size %d is not supported\n", sizeof(*(pu)))); \ 1951 } \ 1949 *(uint32_t *)(puRes) = ASMAtomicUoReadU32((volatile uint32_t *)(void *)(pu)); \ 1952 1950 } while (0) 1953 1951 #elif HC_ARCH_BITS == 64 1952 # define ASMAtomicUoReadSize(pu, puRes) \ 1953 do { \ 1954 *(uint64_t *)(puRes) = ASMAtomicUoReadU64((volatile uint64_t *)(void *)(pu)); \ 1955 } while (0) 1956 #else 1957 # error HC_ARCH_BITS 1958 #endif 1954 1959 1955 1960 /**
Note:
See TracChangeset
for help on using the changeset viewer.