/**@file\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
#include "CpuDriver.h"\r
\r
+UINT64 mTimerPeriod;\r
\r
CPU_ARCH_PROTOCOL_PRIVATE mCpuTemplate = {\r
CPU_ARCH_PROT_PRIVATE_SIGNATURE,\r
WinNtRegisterInterruptHandler,\r
WinNtGetTimerValue,\r
WinNtSetMemoryAttributes,\r
- 0,\r
+ 1,\r
4\r
},\r
{\r
if (TimerValue == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
-\r
- //\r
- // No timer supported\r
- //\r
- return EFI_UNSUPPORTED;\r
+ \r
+ if (TimerIndex != 0) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ \r
+ gWinNt->QueryPerformanceCounter ((LARGE_INTEGER *)TimerValue);\r
+ \r
+ if (TimerPeriod != NULL) {\r
+ *TimerPeriod = mTimerPeriod;\r
+ }\r
+ \r
+ return EFI_SUCCESS;\r
}\r
\r
\r
EFI_STATUS Status;\r
EFI_SMBIOS_HANDLE SmbiosHandle;\r
\r
- SmbiosHandle = 0;\r
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
Status = Smbios->Add (\r
Smbios,\r
NULL,\r
\r
--*/\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
+ UINT64 Frequency;\r
\r
+ //\r
+ // Retrieve the frequency of the performance counter in Hz.\r
+ // \r
+ gWinNt->QueryPerformanceFrequency ((LARGE_INTEGER *)&Frequency);\r
+ \r
+ //\r
+ // Convert frequency in Hz to a clock period in femtoseconds.\r
+ //\r
+ mTimerPeriod = DivU64x64Remainder (1000000000000000, Frequency, NULL);\r
+ \r
CpuUpdateSmbios ();\r
\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&mCpuTemplate.Handle,\r
&gEfiCpuArchProtocolGuid, &mCpuTemplate.Cpu,\r
- &gEfiCpuIoProtocolGuid, &mCpuTemplate.CpuIo,\r
+ &gEfiCpuIo2ProtocolGuid, &mCpuTemplate.CpuIo,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r