Changeset 24452 in vbox
- Timestamp:
- Nov 6, 2009 3:43:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r24060 r24452 980 980 DECLINLINE(bool) ASMIsIntelCpuEx(uint32_t uEBX, uint32_t uECX, uint32_t uEDX) 981 981 { 982 return uEBX == 0x756e6547983 && uECX == 0x6c65746e984 && uEDX == 0x49656e69;982 return uEBX == UINT32_C(0x756e6547) 983 && uECX == UINT32_C(0x6c65746e) 984 && uEDX == UINT32_C(0x49656e69); 985 985 } 986 986 … … 997 997 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 998 998 return ASMIsIntelCpuEx(uEBX, uECX, uEDX); 999 } 1000 1001 1002 /** 1003 * Tests if it a authentic AMD CPU based on the ASMCpuId(0) output. 1004 * 1005 * @returns true/false. 1006 * @param uEBX EBX return from ASMCpuId(0) 1007 * @param uECX ECX return from ASMCpuId(0) 1008 * @param uEDX EDX return from ASMCpuId(0) 1009 */ 1010 DECLINLINE(bool) ASMIsAmdCpuEx(uint32_t uEBX, uint32_t uECX, uint32_t uEDX) 1011 { 1012 return uEBX == UINT32_C(0x68747541) 1013 && uECX == UINT32_C(0x444d4163) 1014 && uEDX == UINT32_C(0x69746e65); 1015 } 1016 1017 1018 /** 1019 * Tests if this is an authentic AMD CPU. 1020 * 1021 * @returns true/false. 1022 * @remarks ASSUMES that cpuid is supported by the CPU. 1023 */ 1024 DECLINLINE(bool) ASMIsAmdCpu(void) 1025 { 1026 uint32_t uEAX, uEBX, uECX, uEDX; 1027 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 1028 return ASMIsAmdCpuEx(uEBX, uECX, uEDX); 999 1029 } 1000 1030
Note:
See TracChangeset
for help on using the changeset viewer.