Changeset 8882 in vbox for trunk/include/iprt
- Timestamp:
- May 16, 2008 11:55:20 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 30917
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r8277 r8882 942 942 #endif 943 943 944 945 /** 946 * Extracts the CPU family from ASMCpuId(1) or ASMCpuId(0x80000001) 947 * 948 * @returns Family. 949 * @param uEAX EAX return from ASMCpuId(1) or ASMCpuId(0x80000001). 950 */ 951 DECLINLINE(uint32_t) ASMGetCpuFamily(uint32_t uEAX) 952 { 953 return ((uEAX >> 8) & 0xf) == 0xf 954 ? ((uEAX >> 20) & 0x7f) + 0xf 955 : ((uEAX >> 8) & 0xf); 956 } 957 958 959 /** 960 * Extracts the CPU model from ASMCpuId(1) or ASMCpuId(0x80000001) 961 * 962 * @returns Model. 963 * @param uEAX EAX from ASMCpuId(1) or ASMCpuId(0x80000001). 964 */ 965 DECLINLINE(uint32_t) ASMGetCpuModel(uint32_t uEAX) 966 { 967 return ((uEAX >> 8) & 0xf) == 0xf /* family! */ 968 ? ((uEAX >> 4) & 0xf) | ((uEAX >> 12) & 0xf0) 969 : ((uEAX >> 4) & 0xf); 970 } 971 972 973 /** 974 * Extracts the CPU stepping from ASMCpuId(1) or ASMCpuId(0x80000001) 975 * 976 * @returns Model. 977 * @param uEAX EAX from ASMCpuId(1) or ASMCpuId(0x80000001). 978 */ 979 DECLINLINE(uint32_t) ASMGetCpuStepping(uint32_t uEAX) 980 { 981 return uEAX & 0xf; 982 } 983 984 944 985 /** 945 986 * Get cr0.
Note:
See TracChangeset
for help on using the changeset viewer.