Fix Xcode, clang, and ARM build and link issues.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11513 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
andrewfish
2011-04-07 21:50:16 +00:00
parent 392fa5a63b
commit e0c2cc6f89
14 changed files with 147 additions and 192 deletions

View File

@@ -1,28 +0,0 @@
/** @file
The implement to read TSC in IA32 platform.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Library/BaseLib.h>
/**
Reads and returns the current value of the Time Stamp Counter (TSC).
@return The current value of TSC.
**/
UINT64
ReadTime ()
{
return AsmReadTsc ();
}

View File

@@ -1,28 +0,0 @@
/** @file
The implement to read ITC in IA64 platform.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Library/BaseLib.h>
/**
Reads and returns the current value of the Interval Timer Counter Register (ITC).
@return The current value of ITC.
**/
UINT64
ReadTime ()
{
return AsmReadItc ();
}

View File

@@ -185,11 +185,6 @@ NetChecksum (
@return The current value of the register.
**/
UINT64
EFIAPI
ReadTime (
VOID
);
STATIC CONST SHELL_PARAM_ITEM PingParamList[] = {
{
@@ -220,6 +215,32 @@ STATIC CONST SHELL_PARAM_ITEM PingParamList[] = {
STATIC CONST CHAR16 *mDstString;
STATIC CONST CHAR16 *mSrcString;
STATIC UINT64 mFrequency = 0;
EFI_CPU_ARCH_PROTOCOL *gCpu = NULL;
UINT64
EFIAPI
ReadTime (
VOID
)
{
static UINT64 CurrentTick = 0;
UINT64 TimerPeriod;
EFI_STATUS Status;
ASSERT (gCpu != NULL);
Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
if (EFI_ERROR (Status)) {
//
// The WinntGetTimerValue will return EFI_UNSUPPORTED. Set the
// TimerPeriod by ourselves.
//
CurrentTick += 1000000;
}
return CurrentTick;
}
/**
Get and caculate the frequency in tick/ms.
@@ -236,17 +257,15 @@ GetFrequency (
)
{
EFI_STATUS Status;
EFI_CPU_ARCH_PROTOCOL *Cpu;
UINT64 CurrentTick;
UINT64 TimerPeriod;
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &Cpu);
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &gCpu);
if (EFI_ERROR (Status)) {
return Status;
}
Status = Cpu->GetTimerValue (Cpu, 0, &CurrentTick, &TimerPeriod);
Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
if (EFI_ERROR (Status)) {
TimerPeriod = DEFAULT_TIMER_PERIOD;

View File

@@ -30,15 +30,6 @@
Ping.c
Ifconfig.c
[Sources.IA32]
Ia32/Tsc.c
[Sources.X64]
X64/Tsc.c
[Sources.IPF]
Ipf/Itc.c
[Packages]
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec

View File

@@ -1,28 +0,0 @@
/** @file
The implement to read TSC in X64 platform.
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Library/BaseLib.h>
/**
Reads and returns the current value of Time Stamp Counter (TSC).
@return The current value of TSC
**/
UINT64
ReadTime ()
{
return AsmReadTsc ();
}