Changeset 1047 in vbox
- Timestamp:
- Feb 23, 2007 4:46:23 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18923
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r1027 r1047 163 163 static void supdrvLdrFree(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage); 164 164 static int supdrvIOCtl_GetPagingMode(PSUPGETPAGINGMODE_OUT pOut); 165 static SUPGIPMODE supdrvGipDeterminTscMode(void); 165 166 #ifdef USE_NEW_OS_INTERFACE 166 167 static int supdrvGipCreate(PSUPDRVDEVEXT pDevExt); … … 4019 4020 memset(pGip, 0, PAGE_SIZE); 4020 4021 pGip->u32Magic = SUPGLOBALINFOPAGE_MAGIC; 4021 pGip->u32Mode = SUPGIPMODE_SYNC_TSC;4022 pGip->u32Mode = supdrvGipDeterminTscMode(); 4022 4023 pGip->u32UpdateHz = uUpdateHz; 4023 4024 pGip->u32UpdateIntervalNS = 1000000000 / uUpdateHz; … … 4053 4054 pDevExt->cGipUsers = 0; 4054 4055 4055 /* 4056 * Check if we should switch to async TSC mode. 4057 */ 4058 #if 0 4056 return 0; 4057 } 4058 4059 4060 /** 4061 * Determin the GIP TSC mode. 4062 * 4063 * @returns The most suitable TSC mode. 4064 */ 4065 static SUPGIPMODE supdrvGipDeterminTscMode(void) 4066 { 4059 4067 if (supdrvOSGetCPUCount() > 1) 4060 4068 { 4061 ASMCpuId(0, 4062 } 4063 #endif 4064 4065 return 0; 4069 uint32_t uEAX, uEBX, uECX, uEDX; 4070 4071 /* Check for "AuthenticAMD" */ 4072 ASMCpuId(0, &uEAX, &uEBX, &uECX, &uEDX); 4073 if (uEAX >= 1 && uEBX == 0x68747541 && uECX == 0x444d4163 && uEDX == 0x69746e65) 4074 { 4075 /* Check for family 15 and the RDTSCP feature - hope that's is sufficient. */ 4076 ASMCpuId(0x80000001, &uEAX, &uEBX, &uECX, &uEDX); 4077 if ( ((uEAX >> 8) & 0xf) == 0xf && ((uEAX >> 20) & 0x7f) == 0 /* family=15 */ 4078 && (uEDX & BIT(27) /*RDTSCP*/)) 4079 { 4080 /** @todo when we get the model / family numbers of barcelona and other amd cores with proper TSC, 4081 * add the appropriate model checks here. */ 4082 return SUPGIPMODE_ASYNC_TSC; 4083 } 4084 } 4085 } 4086 return SUPGIPMODE_SYNC_TSC; 4066 4087 } 4067 4088
Note:
See TracChangeset
for help on using the changeset viewer.