From: andrewfish Date: Sat, 30 Jan 2010 20:37:50 +0000 (+0000) Subject: Change name to remove Template X-Git-Tag: edk2-stable201903~16459 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e4dbec73c5f31286bb1645465d87a65793cfadce;hp=76a689b57344bb915be03e2b27dc432eec7c03b5 Change name to remove Template git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9877 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index a7882ef4f3..4532149120 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -55,6 +55,7 @@ gEmbeddedDeviceGuid = { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 0xb, 0x71, 0x8f, 0x27, 0xde } } gEmbeddedExternalDeviceProtocolGuid = { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }} gEmbeddedGpioProtocolGuid = { 0x17a0a3d7, 0xc0a5, 0x4635, { 0xbb, 0xd5, 0x07, 0x21, 0x87, 0xdf, 0xe2, 0xee }} + gPeCoffLoaderProtocolGuid = { 0xB323179B, 0x97FB, 0x477E, { 0xB0, 0xFE, 0xD8, 0x85, 0x91, 0xFA, 0x11, 0xAB } } [PcdsFeatureFlag.common] gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|FALSE|BOOLEAN|0x00000001 diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc index a9ba337307..c34b10b32b 100644 --- a/EmbeddedPkg/EmbeddedPkg.dsc +++ b/EmbeddedPkg/EmbeddedPkg.dsc @@ -117,6 +117,10 @@ [LibraryClasses.ARM] SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf +[LibraryClasses.ARM] + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + + ################################################################################ # # Pcd Section - list of all PCD Entries defined by this Platform @@ -242,9 +246,7 @@ EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.inf EmbeddedPkg/Library/TemplateResetSystemLib/TemplateResetSystemLib.inf EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf - -####ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf ??? - + EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf EmbeddedPkg/Ebl/Ebl.inf #### EmbeddedPkg/EblExternCmd/EblExternCmd.inf @@ -255,7 +257,6 @@ EmbeddedPkg/SerialDxe/SerialDxe.inf EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf EmbeddedPkg/TemplateBds/TemplateBds.inf - EmbeddedPkg/TemplateCpuDxe/TemplateCpuDxe.inf EmbeddedPkg/TemplateMetronomeDxe/TemplateMetronomeDxe.inf EmbeddedPkg/TemplateSec/TemplateSec.inf EmbeddedPkg/TemplateTimerDxe/TemplateTimerDxe.inf diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h index 61c7e4d7ac..3e4e6c023d 100644 --- a/EmbeddedPkg/Include/Library/PrePiLib.h +++ b/EmbeddedPkg/Include/Library/PrePiLib.h @@ -16,6 +16,8 @@ #ifndef __PRE_PI_LIB_H__ #define __PRE_PI_LIB_H__ +#include + /** This service enables discovery of additional firmware volumes. @@ -665,6 +667,20 @@ BuildMemoryAllocationHob ( ); +VOID +EFIAPI +BuildExtractSectionHob ( + IN EFI_GUID *Guid, + IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo, + IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction + ); + +VOID +EFIAPI +BuildPeCoffLoaderHob ( + ); + + /** Allocates one or more 4KB pages of type EfiBootServicesData. diff --git a/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.c b/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.c index fcb533c8b7..a95de69190 100644 --- a/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.c +++ b/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.c @@ -15,12 +15,11 @@ **/ -#include -#include -#include -#include +#include #include - +#include +#include +#include STATIC BOOLEAN gInstalledCommand = FALSE; STATIC EFI_EVENT mEblCommandRegistration = NULL; diff --git a/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf b/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf index fbb021283e..7cc4556825 100644 --- a/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf +++ b/EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf @@ -39,8 +39,10 @@ [LibraryClasses] UefiBootServicesTableLib UefiLib + EblAddExternalCommandLib [Protocols] + gEfiEblAddCommandProtocolGuid [Guids] \ No newline at end of file diff --git a/EmbeddedPkg/Library/PrePiLib/Hob.c b/EmbeddedPkg/Library/PrePiLib/Hob.c index 3c6574282c..04b49bb044 100644 --- a/EmbeddedPkg/Library/PrePiLib/Hob.c +++ b/EmbeddedPkg/Library/PrePiLib/Hob.c @@ -13,7 +13,10 @@ **/ #include +#include +#include #include +#include // // Have to use build system to set the original value in case we are running @@ -806,3 +809,48 @@ BuildMemoryAllocationHob ( } + +VOID +EFIAPI +BuildExtractSectionHob ( + IN EFI_GUID *Guid, + IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo, + IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction + ) +{ + EXTRACT_SECTION_HOB Hob; + + Hob.SectionGetInfo = SectionGetInfo; + Hob.SectionExtraction = SectionExtraction; + BuildGuidDataHob (Guid, &Hob, sizeof (EXTRACT_SECTION_HOB)); +} + +PE_COFF_LOADER_PROTOCOL gPeCoffProtocol = { + PeCoffLoaderGetImageInfo, + PeCoffLoaderLoadImage, + PeCoffLoaderRelocateImage, + PeCoffLoaderImageReadFromMemory, + PeCoffLoaderRelocateImageForRuntime, + PeCoffLoaderUnloadImage +}; + +typedef struct { + EFI_HOB_GUID_TYPE Hob; + VOID *Interface; +} PROTOCOL_HOB; + + + +VOID +EFIAPI +BuildPeCoffLoaderHob ( + ) +{ + PROTOCOL_HOB Hob; + + Hob.Interface = &gPeCoffProtocol; + BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Hob, sizeof (PROTOCOL_HOB)); +} + + + diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf index 8e4f796bb2..72e41c999f 100644 --- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf +++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.inf @@ -65,6 +65,7 @@ [Protocols] gEfiStatusCodeRuntimeProtocolGuid + gPeCoffLoaderProtocolGuid [FixedPcd.common] diff --git a/EmbeddedPkg/MetronomeDxe/Metronome.c b/EmbeddedPkg/MetronomeDxe/Metronome.c new file mode 100644 index 0000000000..861bf249cd --- /dev/null +++ b/EmbeddedPkg/MetronomeDxe/Metronome.c @@ -0,0 +1,132 @@ +/** @file + + Copyright (c) 2008-2009, Apple Inc. All rights reserved. + + All rights reserved. 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 + +#include +#include +#include +#include +#include +#include +#include + +#include + + + +/** + The WaitForTick() function waits for the number of ticks specified by + TickNumber from a known time source in the platform. If TickNumber of + ticks are detected, then EFI_SUCCESS is returned. The actual time passed + between entry of this function and the first tick is between 0 and + TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod + time has elapsed, wait for two ticks. This function waits for a hardware + event to determine when a tick occurs. It is possible for interrupt + processing, or exception processing to interrupt the execution of the + WaitForTick() function. Depending on the hardware source for the ticks, it + is possible for a tick to be missed. This function cannot guarantee that + ticks will not be missed. If a timeout occurs waiting for the specified + number of ticks, then EFI_TIMEOUT is returned. + + @param This The EFI_METRONOME_ARCH_PROTOCOL instance. + @param TickNumber Number of ticks to wait. + + @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber + succeeded. + @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks. + +**/ +EFI_STATUS +EFIAPI +WaitForTick ( + IN EFI_METRONOME_ARCH_PROTOCOL *This, + IN UINT32 TickNumber + ) +{ + // + // Fill me in + // + MicroSecondDelay (10 * TickNumber); + return EFI_UNSUPPORTED; +} + + + +/** + Interface stucture for the Metronome Architectural Protocol. + + @par Protocol Description: + This protocol provides access to a known time source in the platform to the + core. The core uses this known time source to produce core services that + require calibrated delays. + + @param WaitForTick + Waits for a specified number of ticks from a known time source + in the platform. The actual time passed between entry of this + function and the first tick is between 0 and TickPeriod 100 nS + units. If you want to guarantee that at least TickPeriod time + has elapsed, wait for two ticks. + + @param TickPeriod + The period of platform's known time source in 100 nS units. + This value on any platform must be at least 10 uS, and must not + exceed 200 uS. The value in this field is a constant that must + not be modified after the Metronome architectural protocol is + installed. All consumers must treat this as a read-only field. + +**/ +EFI_METRONOME_ARCH_PROTOCOL gMetronome = { + WaitForTick, + 100 +}; + + +EFI_HANDLE gMetronomeHandle = NULL; + + + +/** + Initialize the state information for the CPU Architectural Protocol + + @param ImageHandle of the loaded driver + @param SystemTable Pointer to the System Table + + @retval EFI_SUCCESS Protocol registered + @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure + @retval EFI_DEVICE_ERROR Hardware problems + +**/ +EFI_STATUS +MetronomeInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + // + // Do any hardware init required to make WaitForTick () to work here. + // + + Status = gBS->InstallMultipleProtocolInterfaces ( + &gMetronomeHandle, + &gEfiMetronomeArchProtocolGuid, &gMetronome, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} + diff --git a/EmbeddedPkg/MetronomeDxe/TemplateMetronomeDxe.inf b/EmbeddedPkg/MetronomeDxe/TemplateMetronomeDxe.inf new file mode 100644 index 0000000000..698b17c750 --- /dev/null +++ b/EmbeddedPkg/MetronomeDxe/TemplateMetronomeDxe.inf @@ -0,0 +1,49 @@ +#/** @file +# +# Component discription file for Bds module +# +# Copyright (c) 2008, Apple, Inc
+# All rights reserved. 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. +# +#**/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = TemplateMetronomeDxe + FILE_GUID = 4C6E0267-C77D-410D-8100-1495911A989D + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + + ENTRY_POINT = MetronomeInitialize + + +[Sources.common] + Metronome.c + + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + UefiLib + UefiBootServicesTableLib + DebugLib + PrintLib + UefiDriverEntryPoint + TimerLib + +[Guids] + + +[Protocols] + gEfiMetronomeArchProtocolGuid + +[depex] + TRUE diff --git a/EmbeddedPkg/TemplateMetronomeDxe/Metronome.c b/EmbeddedPkg/TemplateMetronomeDxe/Metronome.c deleted file mode 100644 index 861bf249cd..0000000000 --- a/EmbeddedPkg/TemplateMetronomeDxe/Metronome.c +++ /dev/null @@ -1,132 +0,0 @@ -/** @file - - Copyright (c) 2008-2009, Apple Inc. All rights reserved. - - All rights reserved. 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 - -#include -#include -#include -#include -#include -#include -#include - -#include - - - -/** - The WaitForTick() function waits for the number of ticks specified by - TickNumber from a known time source in the platform. If TickNumber of - ticks are detected, then EFI_SUCCESS is returned. The actual time passed - between entry of this function and the first tick is between 0 and - TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod - time has elapsed, wait for two ticks. This function waits for a hardware - event to determine when a tick occurs. It is possible for interrupt - processing, or exception processing to interrupt the execution of the - WaitForTick() function. Depending on the hardware source for the ticks, it - is possible for a tick to be missed. This function cannot guarantee that - ticks will not be missed. If a timeout occurs waiting for the specified - number of ticks, then EFI_TIMEOUT is returned. - - @param This The EFI_METRONOME_ARCH_PROTOCOL instance. - @param TickNumber Number of ticks to wait. - - @retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber - succeeded. - @retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks. - -**/ -EFI_STATUS -EFIAPI -WaitForTick ( - IN EFI_METRONOME_ARCH_PROTOCOL *This, - IN UINT32 TickNumber - ) -{ - // - // Fill me in - // - MicroSecondDelay (10 * TickNumber); - return EFI_UNSUPPORTED; -} - - - -/** - Interface stucture for the Metronome Architectural Protocol. - - @par Protocol Description: - This protocol provides access to a known time source in the platform to the - core. The core uses this known time source to produce core services that - require calibrated delays. - - @param WaitForTick - Waits for a specified number of ticks from a known time source - in the platform. The actual time passed between entry of this - function and the first tick is between 0 and TickPeriod 100 nS - units. If you want to guarantee that at least TickPeriod time - has elapsed, wait for two ticks. - - @param TickPeriod - The period of platform's known time source in 100 nS units. - This value on any platform must be at least 10 uS, and must not - exceed 200 uS. The value in this field is a constant that must - not be modified after the Metronome architectural protocol is - installed. All consumers must treat this as a read-only field. - -**/ -EFI_METRONOME_ARCH_PROTOCOL gMetronome = { - WaitForTick, - 100 -}; - - -EFI_HANDLE gMetronomeHandle = NULL; - - - -/** - Initialize the state information for the CPU Architectural Protocol - - @param ImageHandle of the loaded driver - @param SystemTable Pointer to the System Table - - @retval EFI_SUCCESS Protocol registered - @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure - @retval EFI_DEVICE_ERROR Hardware problems - -**/ -EFI_STATUS -MetronomeInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Do any hardware init required to make WaitForTick () to work here. - // - - Status = gBS->InstallMultipleProtocolInterfaces ( - &gMetronomeHandle, - &gEfiMetronomeArchProtocolGuid, &gMetronome, - NULL - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} - diff --git a/EmbeddedPkg/TemplateMetronomeDxe/TemplateMetronomeDxe.inf b/EmbeddedPkg/TemplateMetronomeDxe/TemplateMetronomeDxe.inf deleted file mode 100644 index 698b17c750..0000000000 --- a/EmbeddedPkg/TemplateMetronomeDxe/TemplateMetronomeDxe.inf +++ /dev/null @@ -1,49 +0,0 @@ -#/** @file -# -# Component discription file for Bds module -# -# Copyright (c) 2008, Apple, Inc
-# All rights reserved. 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. -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = TemplateMetronomeDxe - FILE_GUID = 4C6E0267-C77D-410D-8100-1495911A989D - MODULE_TYPE = DXE_DRIVER - VERSION_STRING = 1.0 - - ENTRY_POINT = MetronomeInitialize - - -[Sources.common] - Metronome.c - - -[Packages] - MdePkg/MdePkg.dec - -[LibraryClasses] - BaseLib - UefiLib - UefiBootServicesTableLib - DebugLib - PrintLib - UefiDriverEntryPoint - TimerLib - -[Guids] - - -[Protocols] - gEfiMetronomeArchProtocolGuid - -[depex] - TRUE