Changeset 44169 in vbox for trunk/include/iprt
- Timestamp:
- Dec 19, 2012 5:56:44 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 82879
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm-amd64-x86.h
r39993 r44169 980 980 981 981 /** 982 * Tests if it a authentic AMD CPU based on the ASMCpuId(0) output.982 * Tests if it an authentic AMD CPU based on the ASMCpuId(0) output. 983 983 * 984 984 * @returns true/false. … … 1006 1006 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 1007 1007 return ASMIsAmdCpuEx(uEBX, uECX, uEDX); 1008 } 1009 1010 1011 /** 1012 * Tests if it a centaur hauling VIA CPU based on the ASMCpuId(0) output. 1013 * 1014 * @returns true/false. 1015 * @param uEBX EBX return from ASMCpuId(0). 1016 * @param uECX ECX return from ASMCpuId(0). 1017 * @param uEDX EDX return from ASMCpuId(0). 1018 */ 1019 DECLINLINE(bool) ASMIsViaCentaurCpuEx(uint32_t uEBX, uint32_t uECX, uint32_t uEDX) 1020 { 1021 return uEBX == UINT32_C(0x746e6543) 1022 && uECX == UINT32_C(0x736c7561) 1023 && uEDX == UINT32_C(0x48727561); 1024 } 1025 1026 1027 /** 1028 * Tests if this is a centaur hauling VIA CPU. 1029 * 1030 * @returns true/false. 1031 * @remarks ASSUMES that cpuid is supported by the CPU. 1032 */ 1033 DECLINLINE(bool) ASMIsViaCentaurCpu(void) 1034 { 1035 uint32_t uEAX, uEBX, uECX, uEDX; 1036 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 1037 return ASMIsAmdCpuEx(uEBX, uECX, uEDX); 1038 } 1039 1040 1041 /** 1042 * Checks whether ASMCpuId_EAX(0x00000000) indicates a valid range. 1043 * 1044 * 1045 * @returns true/false. 1046 * @param uEAX The EAX value of CPUID leaf 0x00000000. 1047 * 1048 * @note This only succeeds if there are at least two leaves in the range. 1049 * @remarks The upper range limit is just some half reasonable value we've 1050 * picked out of thin air. 1051 */ 1052 DECLINLINE(bool) ASMIsValidStdRange(uint32_t uEAX) 1053 { 1054 return uEAX >= UINT32_C(0x00000001) && uEAX <= UINT32_C(0x000fffff); 1055 } 1056 1057 1058 /** 1059 * Checks whether ASMCpuId_EAX(0x80000000) indicates a valid range. 1060 * 1061 * This only succeeds if there are at least two leaves in the range. 1062 * 1063 * @returns true/false. 1064 * @param uEAX The EAX value of CPUID leaf 0x80000000. 1065 * 1066 * @note This only succeeds if there are at least two leaves in the range. 1067 * @remarks The upper range limit is just some half reasonable value we've 1068 * picked out of thin air. 1069 */ 1070 DECLINLINE(bool) ASMIsValidExtRange(uint32_t uEAX) 1071 { 1072 return uEAX >= UINT32_C(0x80000001) && uEAX <= UINT32_C(0x800fffff); 1008 1073 } 1009 1074
Note:
See TracChangeset
for help on using the changeset viewer.