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

@ -41,7 +41,7 @@ DisplayTheBlocks(
ShellStatus = SHELL_SUCCESS; ShellStatus = SHELL_SUCCESS;
Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, &((EFI_DEVICE_PATH_PROTOCOL *)DevPath), &BlockIoHandle); Status = gBS->LocateDevicePath(&gEfiBlockIoProtocolGuid, (EFI_DEVICE_PATH_PROTOCOL **)&DevPath, &BlockIoHandle);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
return (SHELL_NOT_FOUND); return (SHELL_NOT_FOUND);
} }

View File

@ -68,12 +68,12 @@ DisplayMmioMemory(
Buffer = AllocateZeroPool(Size); Buffer = AllocateZeroPool(Size);
ASSERT(Buffer != NULL); ASSERT(Buffer != NULL);
Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)Address, Size, Buffer); Status = PciRbIo->Mem.Read(PciRbIo, EfiPciWidthUint8, (UINT64)(UINTN)Address, Size, Buffer);
if (EFI_ERROR(Status)) { if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, Status); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PCIRBIO_ER), gShellDebug1HiiHandle, Status);
ShellStatus = SHELL_NOT_FOUND; ShellStatus = SHELL_NOT_FOUND;
} else { } else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)Address, Size); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_MMIO_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
DumpHex(2,0,Size,Buffer); DumpHex(2,0,Size,Buffer);
} }
@ -167,7 +167,7 @@ ShellCommandRunDmem (
if (ShellStatus == SHELL_SUCCESS) { if (ShellStatus == SHELL_SUCCESS) {
if (!ShellCommandLineGetFlag(Package, L"-mmio")) { if (!ShellCommandLineGetFlag(Package, L"-mmio")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)Address, Size); ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_HEADER_ROW), gShellDebug1HiiHandle, (UINT64)(UINTN)Address, Size);
DumpHex(2,0,(UINTN)Size,Address); DumpHex(2,0,(UINTN)Size,Address);
if (Address == (VOID*)gST) { if (Address == (VOID*)gST) {
Acpi20TableAddress = 0; Acpi20TableAddress = 0;
@ -177,36 +177,36 @@ ShellCommandRunDmem (
MpsTableAddress = 0; MpsTableAddress = 0;
for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) { for (TableWalker = 0 ; TableWalker < gST->NumberOfTableEntries ; TableWalker++) {
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) { if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi20TableGuid)) {
Acpi20TableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable; Acpi20TableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue; continue;
} }
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) { if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiAcpi10TableGuid)) {
AcpiTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable; AcpiTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue; continue;
} }
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) { if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSalSystemTableGuid)) {
SalTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable; SalTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue; continue;
} }
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) { if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiSmbiosTableGuid)) {
SmbiosTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable; SmbiosTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue; continue;
} }
if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) { if (CompareGuid(&gST->ConfigurationTable[TableWalker].VendorGuid, &gEfiMpsTableGuid)) {
MpsTableAddress = (UINT64)gST->ConfigurationTable[TableWalker].VendorTable; MpsTableAddress = (UINT64)(UINTN)gST->ConfigurationTable[TableWalker].VendorTable;
continue; continue;
} }
} }
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle, ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMEM_SYSTEM_TABLE), gShellDebug1HiiHandle,
(UINT64)Address, (UINT64)(UINTN)Address,
gST->Hdr.HeaderSize, gST->Hdr.HeaderSize,
gST->Hdr.Revision, gST->Hdr.Revision,
(UINT64)gST->ConIn, (UINT64)(UINTN)gST->ConIn,
(UINT64)gST->ConOut, (UINT64)(UINTN)gST->ConOut,
(UINT64)gST->StdErr, (UINT64)(UINTN)gST->StdErr,
(UINT64)gST->RuntimeServices, (UINT64)(UINTN)gST->RuntimeServices,
(UINT64)gST->BootServices, (UINT64)(UINTN)gST->BootServices,
SalTableAddress, SalTableAddress,
AcpiTableAddress, AcpiTableAddress,
Acpi20TableAddress, Acpi20TableAddress,

View File

@ -188,6 +188,8 @@ MainTitleBarRefresh (
ASSERT(FALSE); ASSERT(FALSE);
case FileTypeFileBuffer: case FileTypeFileBuffer:
break; break;
default:
break;
} }
// //
// print modified field // print modified field

View File

@ -176,6 +176,9 @@ HBufferImageBackup (
case FileTypeMemBuffer: case FileTypeMemBuffer:
HMemImageBackup (); HMemImageBackup ();
break; break;
default:
break;
} }
return EFI_SUCCESS; return EFI_SUCCESS;
@ -944,6 +947,10 @@ HBufferImageRead (
case FileTypeMemBuffer: case FileTypeMemBuffer:
Status = HMemImageRead (MemOffset, MemSize, Recover); Status = HMemImageRead (MemOffset, MemSize, Recover);
break; break;
default:
Status = EFI_NOT_FOUND;
break;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
@ -1007,6 +1014,10 @@ HBufferImageSave (
case FileTypeMemBuffer: case FileTypeMemBuffer:
Status = HMemImageSave (MemOffset, MemSize); Status = HMemImageSave (MemOffset, MemSize);
break; break;
default:
Status = EFI_NOT_FOUND;
break;
} }
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {

View File

@ -223,6 +223,9 @@ ShellCommandRunHexEdit (
); );
break; break;
default:
Status = EFI_NOT_FOUND;
break;
} }
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
HMainEditorRefresh (); HMainEditorRefresh ();

View File

@ -2164,6 +2164,10 @@ HMainEditorKeyInput (
case FileTypeMemBuffer: case FileTypeMemBuffer:
OldSize = HBufferImage.MemImage->Size; OldSize = HBufferImage.MemImage->Size;
break; break;
default:
OldSize = 0;
break;
} }
if (!LengthChange) { if (!LengthChange) {

View File

@ -36,7 +36,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{NULL, TypeMax} {NULL, TypeMax}
}; };
STATIC CONST UINT64 MaxNum[9] = { 0xff, 0xffff, 0xffffffff, 0xffffffffffffffff }; STATIC CONST UINT64 MaxNum[9] = { 0xff, 0xffff, 0xffffffff, 0xffffffffffffffffULL };
/** /**
Read some data into a buffer from memory. Read some data into a buffer from memory.
@ -424,7 +424,7 @@ ShellCommandRunMm (
// //
if (AccessType == EfiPciEConfig) { if (AccessType == EfiPciEConfig) {
SegmentNumber = (UINT32) RShiftU64 (Address, 36) & 0xff; SegmentNumber = (UINT32) RShiftU64 (Address, 36) & 0xff;
Address &= 0xfffffffff; Address &= 0xfffffffffULL;
} else { } else {
if (AccessType == EfiPciConfig) { if (AccessType == EfiPciConfig) {
SegmentNumber = (UINT32) RShiftU64 (Address, 32) & 0xff; SegmentNumber = (UINT32) RShiftU64 (Address, 32) & 0xff;

View File

@ -1876,8 +1876,8 @@ DisplayProcessorVoltage (
Display processor information. Display processor information.
@param[in] Status The status. @param[in] Status The status.
Bit 7 Reserved, must be 0 Bit 7 Reserved, must be 0
Bit 6 CPU Socket Populated Bit 6 CPU Socket Populated
1 - CPU Socket Populated 1 - CPU Socket Populated
0 - CPU Socket UnpopulatedBits 0 - CPU Socket UnpopulatedBits
5:3 Reserved, must be zero 5:3 Reserved, must be zero
@ -2225,7 +2225,7 @@ DisplaySystemBootStatus (
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FUTURE_ASSIGNMENT), gShellDebug1HiiHandle); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RSVD_FUTURE_ASSIGNMENT), gShellDebug1HiiHandle);
} else if (Parameter >= 128 && Parameter <= 191) { } else if (Parameter >= 128 && Parameter <= 191) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VENDOR_OEM_SPECIFIC), gShellDebug1HiiHandle); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VENDOR_OEM_SPECIFIC), gShellDebug1HiiHandle);
} else if (Parameter >= 192 && Parameter <= 255) { } else if (Parameter >= 192) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRODUCT_SPEC_IMPLMENTATION), gShellDebug1HiiHandle); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRODUCT_SPEC_IMPLMENTATION), gShellDebug1HiiHandle);
} else { } else {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle); ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle);
@ -2271,7 +2271,7 @@ DisplaySBDSManufactureDate (
Display System Reset (Type 23) information. Display System Reset (Type 23) information.
Identifies the system-reset capabilities for the system. Identifies the system-reset capabilities for the system.
Bits 7:6 Reserved for future assignment via this specification, set to 00b. Bits 7:6 Reserved for future assignment via this specification, set to 00b.
Bit 5 System contains a watchdog timer, either True (1) or False (0). Bit 5 System contains a watchdog timer, either True (1) or False (0).
Bits 4:3 Boot Option on Limit. Bits 4:3 Boot Option on Limit.
@ -2375,24 +2375,24 @@ DisplaySystemResetCapabilities (
Display Hardware Security (Type 24) information. Display Hardware Security (Type 24) information.
Identifies the password and reset status for the system: Identifies the password and reset status for the system:
Bits 7:6 Power-on Password Status, one of: Bits 7:6 Power-on Password Status, one of:
00b Disabled 00b Disabled
01b Enabled 01b Enabled
10b Not Implemented 10b Not Implemented
11b Unknown 11b Unknown
Bits 5:4 Keyboard Password Status, one of: Bits 5:4 Keyboard Password Status, one of:
00b Disabled 00b Disabled
01b Enabled 01b Enabled
10b Not Implemented 10b Not Implemented
11b Unknown 11b Unknown
Bits 3:2 Administrator Password Status, one of: Bits 3:2 Administrator Password Status, one of:
00b Disabled 00b Disabled
01b Enabled 01b Enabled
10b Not Implemented 10b Not Implemented
11b Unknown 11b Unknown
Bits 1:0 Front Panel Reset Status, one of: Bits 1:0 Front Panel Reset Status, one of:
00b Disabled 00b Disabled
01b Enabled 01b Enabled
10b Not Implemented 10b Not Implemented

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. @return The current value of the register.
**/ **/
UINT64
EFIAPI
ReadTime (
VOID
);
STATIC CONST SHELL_PARAM_ITEM PingParamList[] = { STATIC CONST SHELL_PARAM_ITEM PingParamList[] = {
{ {
@ -220,6 +215,32 @@ STATIC CONST SHELL_PARAM_ITEM PingParamList[] = {
STATIC CONST CHAR16 *mDstString; STATIC CONST CHAR16 *mDstString;
STATIC CONST CHAR16 *mSrcString; STATIC CONST CHAR16 *mSrcString;
STATIC UINT64 mFrequency = 0; 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. Get and caculate the frequency in tick/ms.
@ -236,17 +257,15 @@ GetFrequency (
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_CPU_ARCH_PROTOCOL *Cpu;
UINT64 CurrentTick; UINT64 CurrentTick;
UINT64 TimerPeriod; UINT64 TimerPeriod;
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &Cpu); Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **) &gCpu);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
return Status; return Status;
} }
Status = Cpu->GetTimerValue (Cpu, 0, &CurrentTick, &TimerPeriod); Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
TimerPeriod = DEFAULT_TIMER_PERIOD; TimerPeriod = DEFAULT_TIMER_PERIOD;

View File

@ -30,15 +30,6 @@
Ping.c Ping.c
Ifconfig.c Ifconfig.c
[Sources.IA32]
Ia32/Tsc.c
[Sources.X64]
X64/Tsc.c
[Sources.IPF]
Ipf/Itc.c
[Packages] [Packages]
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
ShellPkg/ShellPkg.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 ();
}

View File

@ -19,7 +19,7 @@
PLATFORM_VERSION = 0.50 PLATFORM_VERSION = 0.50
DSC_SPECIFICATION = 0x00010006 DSC_SPECIFICATION = 0x00010006
OUTPUT_DIRECTORY = Build/Shell OUTPUT_DIRECTORY = Build/Shell
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM
BUILD_TARGETS = DEBUG|RELEASE BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT SKUID_IDENTIFIER = DEFAULT
@ -49,6 +49,15 @@
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
[LibraryClasses.ARM]
#
# It is not possible to prevent the ARM compiler for generic intrinsic functions.
# This library provides the instrinsic functions generate by a given compiler.
# [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
#
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
[Components.common] [Components.common]