/** @file\r
The implementation for Ping6 application.\r
\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
EFI_HII_HANDLE mHiiHandle;\r
CONST CHAR16 *mIp6DstString;\r
CONST CHAR16 *mIp6SrcString;\r
-EFI_GUID mEfiPing6Guid = EFI_PING6_GUID;\r
-UINT32 mFrequency = 0;\r
+UINT64 mFrequency = 0;\r
/**\r
Get and caculate the frequency in tick/ms.\r
The result is saved in the globle variable mFrequency\r
EFI_STATUS Status;\r
EFI_CPU_ARCH_PROTOCOL *Cpu;\r
UINT64 CurrentTick;\r
- UINT32 TimerPeriod;\r
+ UINT64 TimerPeriod;\r
\r
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &Cpu);\r
\r
return Status;\r
}\r
\r
- Status = Cpu->GetTimerValue (Cpu, 0, &CurrentTick, (UINT64 *) &TimerPeriod);\r
+ Status = Cpu->GetTimerValue (Cpu, 0, &CurrentTick, &TimerPeriod);\r
\r
if (EFI_ERROR (Status)) {\r
//\r
// For NT32 Simulator only. 358049 is a similar value to keep timer granularity.\r
// Set the timer period by ourselves.\r
//\r
- TimerPeriod = NTTIMERPERIOD;\r
+ TimerPeriod = (UINT64) NTTIMERPERIOD;\r
}\r
//\r
// The timer period is in femtosecond (1 femtosecond is 1e-15 second).\r
// So 1e+12 is divided by timer period to produce the freq in tick/ms.\r
//\r
- mFrequency = (UINT32) DivU64x32 (1000000000000ULL, TimerPeriod);\r
+ mFrequency = DivU64x64Remainder (1000000000000ULL, TimerPeriod, NULL);\r
\r
return EFI_SUCCESS;\r
}\r
@return The duration in ms.\r
\r
**/\r
-UINT32\r
+UINT64\r
Ping6CalculateTick (\r
IN UINT64 Begin,\r
IN UINT64 End\r
)\r
{\r
ASSERT (End > Begin);\r
- return (UINT32) DivU64x32 (End - Begin, mFrequency);\r
+ return DivU64x64Remainder (End - Begin, mFrequency, NULL);\r
}\r
\r
/**\r
EFI_IP6_RECEIVE_DATA *RxData;\r
ICMP6_ECHO_REQUEST_REPLY *Reply;\r
UINT32 PayLoad;\r
- UINT32 Rtt;\r
+ UINT64 Rtt;\r
CHAR8 Near;\r
\r
Private = (PING6_PRIVATE_DATA *) Context;\r
PING6_ICMP6_TX_INFO *TxInfo;\r
LIST_ENTRY *Entry;\r
LIST_ENTRY *NextEntry;\r
- UINT32 Time;\r
+ UINT64 Time;\r
\r
Private = (PING6_PRIVATE_DATA *) Context;\r
\r
}\r
\r
/**\r
- Destory the IP6 instance.\r
+ Destroy the IP6 instance.\r
\r
@param[in] Private The pointer of PING6_PRIVATE_DATA.\r
\r
**/\r
VOID\r
-Ping6DestoryIp6Instance (\r
+Ping6DestroyIp6Instance (\r
IN PING6_PRIVATE_DATA *Private\r
)\r
{\r
Private->ImageHandle = ImageHandle;\r
Private->SendNum = SendNumber;\r
Private->BufferSize = BufferSize;\r
- Private->RttMin = 0xFFFF;\r
+ Private->RttMin = ~((UINT64 )(0x0));\r
Private->Status = EFI_NOT_READY;\r
\r
InitializeListHead (&Private->TxList);\r
mHiiHandle,\r
Private->RttMin,\r
Private->RttMax,\r
- Private->RttSum / Private->RxCount\r
+ DivU64x64Remainder (Private->RttSum, Private->RxCount, NULL)\r
);\r
}\r
\r
}\r
\r
if (Private->Ip6ChildHandle != NULL) {\r
- Ping6DestoryIp6Instance (Private);\r
+ Ping6DestroyIp6Instance (Private);\r
}\r
\r
FreePool (Private);\r