From 5dce0991864ec5a10add570dca2f8dd850ea29bf Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Thu, 22 Dec 2016 18:20:23 +0800 Subject: EmbeddedPkg: Remove unused Package Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- EmbeddedPkg/Include/Guid/ExtractSection.h | 36 - EmbeddedPkg/Include/Guid/Fdt.h | 28 - EmbeddedPkg/Include/Guid/FdtHob.h | 26 - EmbeddedPkg/Include/Library/AcpiLib.h | 113 -- EmbeddedPkg/Include/Library/DebugAgentTimerLib.h | 62 - EmbeddedPkg/Include/Library/DmaLib.h | 159 -- .../Include/Library/EblAddExternalCommandLib.h | 122 -- EmbeddedPkg/Include/Library/EblCmdLib.h | 48 - EmbeddedPkg/Include/Library/EblNetworkLib.h | 68 - EmbeddedPkg/Include/Library/EfiFileLib.h | 350 ----- EmbeddedPkg/Include/Library/EfiResetSystemLib.h | 58 - EmbeddedPkg/Include/Library/FdtLoadLib.h | 48 - EmbeddedPkg/Include/Library/GdbSerialLib.h | 107 -- .../Include/Library/HalRuntimeServicesLib.h | 165 --- .../Include/Library/PrePiHobListPointerLib.h | 44 - EmbeddedPkg/Include/Library/PrePiLib.h | 789 ---------- EmbeddedPkg/Include/Library/RealTimeClockLib.h | 138 -- .../Include/Protocol/AndroidFastbootPlatform.h | 145 -- .../Include/Protocol/AndroidFastbootTransport.h | 131 -- .../Protocol/DebugSupportPeriodicCallback.h | 42 - EmbeddedPkg/Include/Protocol/EblAddCommand.h | 142 -- EmbeddedPkg/Include/Protocol/EmbeddedDevice.h | 58 - .../Include/Protocol/EmbeddedExternalDevice.h | 94 -- EmbeddedPkg/Include/Protocol/EmbeddedGpio.h | 167 --- EmbeddedPkg/Include/Protocol/HardwareInterrupt.h | 170 --- EmbeddedPkg/Include/Protocol/MmcHost.h | 157 -- EmbeddedPkg/Include/Protocol/PeCoffLoader.h | 241 ---- EmbeddedPkg/Include/Protocol/UsbDevice.h | 118 -- EmbeddedPkg/Include/fdt.h | 111 -- EmbeddedPkg/Include/libfdt.h | 1514 -------------------- EmbeddedPkg/Include/libfdt_env.h | 81 -- 31 files changed, 5532 deletions(-) delete mode 100644 EmbeddedPkg/Include/Guid/ExtractSection.h delete mode 100644 EmbeddedPkg/Include/Guid/Fdt.h delete mode 100644 EmbeddedPkg/Include/Guid/FdtHob.h delete mode 100644 EmbeddedPkg/Include/Library/AcpiLib.h delete mode 100755 EmbeddedPkg/Include/Library/DebugAgentTimerLib.h delete mode 100755 EmbeddedPkg/Include/Library/DmaLib.h delete mode 100644 EmbeddedPkg/Include/Library/EblAddExternalCommandLib.h delete mode 100644 EmbeddedPkg/Include/Library/EblCmdLib.h delete mode 100644 EmbeddedPkg/Include/Library/EblNetworkLib.h delete mode 100644 EmbeddedPkg/Include/Library/EfiFileLib.h delete mode 100644 EmbeddedPkg/Include/Library/EfiResetSystemLib.h delete mode 100644 EmbeddedPkg/Include/Library/FdtLoadLib.h delete mode 100644 EmbeddedPkg/Include/Library/GdbSerialLib.h delete mode 100644 EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h delete mode 100644 EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h delete mode 100644 EmbeddedPkg/Include/Library/PrePiLib.h delete mode 100644 EmbeddedPkg/Include/Library/RealTimeClockLib.h delete mode 100644 EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h delete mode 100644 EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h delete mode 100644 EmbeddedPkg/Include/Protocol/DebugSupportPeriodicCallback.h delete mode 100644 EmbeddedPkg/Include/Protocol/EblAddCommand.h delete mode 100644 EmbeddedPkg/Include/Protocol/EmbeddedDevice.h delete mode 100644 EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h delete mode 100644 EmbeddedPkg/Include/Protocol/EmbeddedGpio.h delete mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt.h delete mode 100644 EmbeddedPkg/Include/Protocol/MmcHost.h delete mode 100644 EmbeddedPkg/Include/Protocol/PeCoffLoader.h delete mode 100644 EmbeddedPkg/Include/Protocol/UsbDevice.h delete mode 100644 EmbeddedPkg/Include/fdt.h delete mode 100644 EmbeddedPkg/Include/libfdt.h delete mode 100644 EmbeddedPkg/Include/libfdt_env.h (limited to 'EmbeddedPkg/Include') diff --git a/EmbeddedPkg/Include/Guid/ExtractSection.h b/EmbeddedPkg/Include/Guid/ExtractSection.h deleted file mode 100644 index f471e876a1..0000000000 --- a/EmbeddedPkg/Include/Guid/ExtractSection.h +++ /dev/null @@ -1,36 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EXTRACT_SECTION_GUID_H__ -#define __EXTRACT_SECTION_GUID_H__ - -#include - - -// -// The GUID for this protocol mathes the Decompression scheme being used -// So for example LZMA would be gLzmaCustomDecompressGuid -// -typedef struct { - EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo; - EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction; -} EXTRACT_SECTION_DATA; - -typedef struct { - EFI_HOB_GUID_TYPE Hob; - EXTRACT_SECTION_DATA Data; -} EXTRACT_SECTION_HOB; - -#endif - diff --git a/EmbeddedPkg/Include/Guid/Fdt.h b/EmbeddedPkg/Include/Guid/Fdt.h deleted file mode 100644 index 74c85dc30b..0000000000 --- a/EmbeddedPkg/Include/Guid/Fdt.h +++ /dev/null @@ -1,28 +0,0 @@ -/** @file -* -* Copyright (c) 2013-2014, ARM Limited. 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. -* -**/ - -#ifndef __FDT_H__ -#define __FDT_H__ - -#define FDT_TABLE_GUID \ - { 0xb1b621d5, 0xf19c, 0x41a5, { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } } - -extern EFI_GUID gFdtTableGuid; - -#define FDT_VARIABLE_GUID \ - { 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0xc8, 0x4e, 0xfb, 0x3e, 0x57 } } - -extern EFI_GUID gFdtVariableGuid; - -#endif /* __FDT_H__ */ diff --git a/EmbeddedPkg/Include/Guid/FdtHob.h b/EmbeddedPkg/Include/Guid/FdtHob.h deleted file mode 100644 index 287729e0c3..0000000000 --- a/EmbeddedPkg/Include/Guid/FdtHob.h +++ /dev/null @@ -1,26 +0,0 @@ -/** @file - GUID for the HOB that contains the copy of the flattened device tree blob - - Copyright (C) 2014, Linaro Ltd. - - This program and the accompanying materials are licensed and made available - under the terms and conditions of the BSD License that 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. - -**/ - -#ifndef __FDT_HOB_H__ -#define __FDT_HOB_H__ - -#define FDT_HOB_GUID { \ - 0x16958446, 0x19B7, 0x480B, \ - { 0xB0, 0x47, 0x74, 0x85, 0xAD, 0x3F, 0x71, 0x6D } \ - } - -extern EFI_GUID gFdtHobGuid; - -#endif diff --git a/EmbeddedPkg/Include/Library/AcpiLib.h b/EmbeddedPkg/Include/Library/AcpiLib.h deleted file mode 100644 index 42710fd1fd..0000000000 --- a/EmbeddedPkg/Include/Library/AcpiLib.h +++ /dev/null @@ -1,113 +0,0 @@ -/** @file - Helper Library for ACPI - - Copyright (c) 2014-2015, ARM Ltd. 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. - -**/ - -#ifndef __ACPI_LIB_H__ -#define __ACPI_LIB_H__ - -#include - -#include - -// -// Macros for the Generic Address Space -// -#define NULL_GAS { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_UNDEFINED, 0L } -#define ARM_GAS8(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 8, 0, EFI_ACPI_5_0_BYTE, Address } -#define ARM_GAS16(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 16, 0, EFI_ACPI_5_0_WORD, Address } -#define ARM_GAS32(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 32, 0, EFI_ACPI_5_0_DWORD, Address } -#define ARM_GASN(Address) { EFI_ACPI_5_0_SYSTEM_MEMORY, 0, 0, EFI_ACPI_5_0_DWORD, Address } - -// -// Macros for the Multiple APIC Description Table (MADT) -// -#define EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, GicDistVector) \ - { \ - EFI_ACPI_5_0_GICD, sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), EFI_ACPI_RESERVED_WORD, \ - GicDistHwId, GicDistBase, GicDistVector, EFI_ACPI_RESERVED_DWORD \ - } - -// Note the parking protocol is configured by UEFI if required -#define EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase) \ - { \ - EFI_ACPI_5_0_GIC, sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \ - GicId, AcpiCpuId, Flags, 0, PmuIrq, 0, GicBase \ - } - -// Note the parking protocol is configured by UEFI if required -#define EFI_ACPI_5_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \ - GicBase, GicVBase, GicHBase, GsivId, GicRBase) \ - { \ - EFI_ACPI_5_1_GIC, sizeof (EFI_ACPI_5_1_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \ - GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \ - GsivId, GicRBase, Mpidr \ - } - -#define EFI_ACPI_6_0_GIC_MSI_FRAME_INIT(GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase) \ - { \ - EFI_ACPI_6_0_GIC_MSI_FRAME, sizeof (EFI_ACPI_6_0_GIC_MSI_FRAME_STRUCTURE), EFI_ACPI_RESERVED_WORD, \ - GicMsiFrameId, PhysicalBaseAddress, Flags, SPICount, SPIBase \ - } - -// -// SBSA Generic Watchdog -// -#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, \ - ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \ - { \ - EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \ - EFI_ACPI_RESERVED_WORD, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \ - WatchdogTimerGSIV, WatchdogTimerFlags \ - } - -typedef -BOOLEAN -(EFIAPI *EFI_LOCATE_ACPI_CHECK) ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ); - -/** - Locate and Install the ACPI tables from the Firmware Volume if it verifies - the function condition. - - @param AcpiFile Guid of the ACPI file into the Firmware Volume - @param CheckAcpiTableFunction Function that checks if the ACPI table should be installed - - @return EFI_SUCCESS The function completed successfully. - @return EFI_NOT_FOUND The protocol could not be located. - @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. - -**/ -EFI_STATUS -LocateAndInstallAcpiFromFvConditional ( - IN CONST EFI_GUID* AcpiFile, - IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction - ); - -/** - Locate and Install the ACPI tables from the Firmware Volume - - @param AcpiFile Guid of the ACPI file into the Firmware Volume - - @return EFI_SUCCESS The function completed successfully. - @return EFI_NOT_FOUND The protocol could not be located. - @return EFI_OUT_OF_RESOURCES There are not enough resources to find the protocol. - -**/ -EFI_STATUS -LocateAndInstallAcpiFromFv ( - IN CONST EFI_GUID* AcpiFile - ); - -#endif // __ACPI_LIB_H__ diff --git a/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h b/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h deleted file mode 100755 index 0a5e5d491e..0000000000 --- a/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h +++ /dev/null @@ -1,62 +0,0 @@ -/** @file - Platform specific Debug Agent abstraction for timer used by the agent. - - The timer is used by the debugger to break into a running program. - - Copyright (c) 2008 - 2010, 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. - -**/ - -#ifndef __GDB_TIMER_LIB__ -#define __GDB_TIMER_LIB__ - - - -/** - Setup all the hardware needed for the debug agents timer. - - This function is used to set up debug enviroment. It may enable interrupts. - -**/ -VOID -EFIAPI -DebugAgentTimerIntialize ( - VOID - ); - - -/** - Set the period for the debug agent timer. Zero means disable the timer. - - @param[in] TimerPeriodMilliseconds Frequency of the debug agent timer. - -**/ -VOID -EFIAPI -DebugAgentTimerSetPeriod ( - IN UINT32 TimerPeriodMilliseconds - ); - - -/** - Perform End Of Interrupt for the debug agent timer. This is called in the - interrupt handler after the interrupt has been processed. - -**/ -VOID -EFIAPI -DebugAgentTimerEndOfInterrupt ( - VOID - ); - -#endif - - diff --git a/EmbeddedPkg/Include/Library/DmaLib.h b/EmbeddedPkg/Include/Library/DmaLib.h deleted file mode 100755 index 3814291c28..0000000000 --- a/EmbeddedPkg/Include/Library/DmaLib.h +++ /dev/null @@ -1,159 +0,0 @@ -/** @file - DMA abstraction library APIs. Based on UEFI PCI IO protocol DMA abstractions. - At some point these functions will probably end up in a non PCI protocol - for embedded systems. - - DMA Bus Master Read Operation: - Call DmaMap() for MapOperationBusMasterRead. - Program the DMA Bus Master with the DeviceAddress returned by DmaMap(). - Start the DMA Bus Master. - Wait for DMA Bus Master to complete the read operation. - Call DmaUnmap(). - - DMA Bus Master Write Operation: - Call DmaMap() for MapOperationBusMasterWrite. - Program the DMA Bus Master with the DeviceAddress returned by DmaMap(). - Start the DMA Bus Master. - Wait for DMA Bus Master to complete the write operation. - Call DmaUnmap(). - - DMA Bus Master Common Buffer Operation: - Call DmaAllocateBuffer() to allocate a common buffer. - Call DmaMap() for MapOperationBusMasterCommonBuffer. - Program the DMA Bus Master with the DeviceAddress returned by DmaMap(). - The common buffer can now be accessed equally by the processor and the DMA bus master. - Call DmaUnmap(). - Call DmaFreeBuffer(). - - Copyright (c) 2008 - 2010, 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. - -**/ - -#ifndef __DMA_LIB_H__ -#define __DMA_LIB_H__ - -typedef enum { - /// - /// A read operation from system memory by a bus master. - /// - MapOperationBusMasterRead, - /// - /// A write operation from system memory by a bus master. - /// - MapOperationBusMasterWrite, - /// - /// Provides both read and write access to system memory by both the processor and a - /// bus master. The buffer is coherent from both the processor's and the bus master's point of view. - /// - MapOperationBusMasterCommonBuffer, - MapOperationMaximum -} DMA_MAP_OPERATION; - - - - -/** - Provides the DMA controller-specific addresses needed to access system memory. - - Operation is relative to the DMA bus master. - - @param Operation Indicates if the bus master is going to read or write to system memory. - @param HostAddress The system memory address to map to the DMA controller. - @param NumberOfBytes On input the number of bytes to map. On output the number of bytes - that were mapped. - @param DeviceAddress The resulting map address for the bus master controller to use to - access the hosts HostAddress. - @param Mapping A resulting value to pass to DmaUnmap(). - - @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. - @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. - -**/ -EFI_STATUS -EFIAPI -DmaMap ( - IN DMA_MAP_OPERATION Operation, - IN VOID *HostAddress, - IN OUT UINTN *NumberOfBytes, - OUT PHYSICAL_ADDRESS *DeviceAddress, - OUT VOID **Mapping - ); - - - - -/** - Completes the DmaMapBusMasterRead, DmaMapBusMasterWrite, or DmaMapBusMasterCommonBuffer - operation and releases any corresponding resources. - - @param Mapping The mapping value returned from DmaMap(). - - @retval EFI_SUCCESS The range was unmapped. - @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. - -**/ -EFI_STATUS -EFIAPI -DmaUnmap ( - IN VOID *Mapping - ); - - -/** - Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer. - mapping. - - @param MemoryType The type of memory to allocate, EfiBootServicesData or - EfiRuntimeServicesData. - @param Pages The number of pages to allocate. - @param HostAddress A pointer to store the base system memory address of the - allocated range. - - @retval EFI_SUCCESS The requested memory pages were allocated. - @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are - MEMORY_WRITE_COMBINE and MEMORY_CACHED. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. - -**/ -EFI_STATUS -EFIAPI -DmaAllocateBuffer ( - IN EFI_MEMORY_TYPE MemoryType, - IN UINTN Pages, - OUT VOID **HostAddress - ); - - -/** - Frees memory that was allocated with DmaAllocateBuffer(). - - @param Pages The number of pages to free. - @param HostAddress The base system memory address of the allocated range. - - @retval EFI_SUCCESS The requested memory pages were freed. - @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages - was not allocated with DmaAllocateBuffer(). - -**/ -EFI_STATUS -EFIAPI -DmaFreeBuffer ( - IN UINTN Pages, - IN VOID *HostAddress - ); - - -#endif - diff --git a/EmbeddedPkg/Include/Library/EblAddExternalCommandLib.h b/EmbeddedPkg/Include/Library/EblAddExternalCommandLib.h deleted file mode 100644 index 65aedddddd..0000000000 --- a/EmbeddedPkg/Include/Library/EblAddExternalCommandLib.h +++ /dev/null @@ -1,122 +0,0 @@ -/** @file - Include file for basic command line parser for EBL (Embedded Boot Loader) - - Copyright (c) 2007, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EBL_ADD_EXTERNAL_COMMAND_LIB_H__ -#define __EBL_ADD_EXTERNAL_COMMAND_LIB_H__ - -#include -#include - - -EFI_STATUS -EFIAPI -EblAddExternalCommands ( - IN const EBL_COMMAND_TABLE *EntryArray, - IN UINTN ArrayCount - ); - -/** - - Return a keypress or optionally timeout if a timeout value was passed in. - - An optional callback function is called every second when waiting for a - - timeout. - - - - @param Key EFI Key information returned - - @param TimeoutInSec Number of seconds to wait to timeout - - @param CallBack Callback called every second during the timeout wait - - - - @return EFI_SUCCESS Key was returned - - @return EFI_TIMEOUT If the TimoutInSec expired - - - -**/ - -EFI_STATUS - -EFIAPI - -EblGetCharKey ( - - IN OUT EFI_INPUT_KEY *Key, - - IN UINTN TimeoutInSec, - - IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL - - ); - - - - - -/** - - This routine is used prevent command output data from scrolling off the end - - of the screen. The global gPageBreak is used to turn on or off this feature. - - If the CurrentRow is near the end of the screen pause and print out a prompt - - If the use hits Q to quit return TRUE else for any other key return FALSE. - - PrefixNewline is used to figure out if a newline is needed before the prompt - - string. This depends on the last print done before calling this function. - - CurrentRow is updated by one on a call or set back to zero if a prompt is - - needed. - - - - @param CurrentRow Used to figure out if its the end of the page and updated - - @param PrefixNewline Did previous print issue a newline - - - - @return TRUE if Q was hit to quit, FALSE in all other cases. - - - -**/ - -BOOLEAN - -EFIAPI - -EblAnyKeyToContinueQtoQuit ( - - IN UINTN *CurrentRow, - - IN BOOLEAN PrefixNewline - - ); - - - -#endif - diff --git a/EmbeddedPkg/Include/Library/EblCmdLib.h b/EmbeddedPkg/Include/Library/EblCmdLib.h deleted file mode 100644 index 5df71e634a..0000000000 --- a/EmbeddedPkg/Include/Library/EblCmdLib.h +++ /dev/null @@ -1,48 +0,0 @@ -/** @file - Include file for basic command line parser for EBL (Embedded Boot Loader) - - Copyright (c) 2007, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EBL_LIB_H__ -#define __EBL_LIB_H__ - -#include -#include - - -VOID -EblAddCommand ( - IN const EBL_COMMAND_TABLE *Entry - ); - -VOID -EblAddCommands ( - IN const EBL_COMMAND_TABLE *EntryArray, - IN UINTN ArrayCount - ); - - -// -// LIbrary constructor called directly from Ebl Code. -// This module calls EblAddCommand () or EblAddCommands () to register new commands -// -VOID -EblInitializeExternalCmd ( - VOID - ); - - - -#endif - diff --git a/EmbeddedPkg/Include/Library/EblNetworkLib.h b/EmbeddedPkg/Include/Library/EblNetworkLib.h deleted file mode 100644 index 66dc6ac305..0000000000 --- a/EmbeddedPkg/Include/Library/EblNetworkLib.h +++ /dev/null @@ -1,68 +0,0 @@ -/** @file - Abstractions for Ebl network accesses. - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EBL_NETWORK_LIB_H__ -#define __EBL_NETWORK_LIB_H__ - -#include - - -EFI_STATUS -EFIAPI -EblGetCurrentIpAddress ( - IN OUT EFI_IP_ADDRESS *Ip - ); - -EFI_STATUS -EFIAPI -EblGetCurrentMacAddress ( - IN OUT EFI_MAC_ADDRESS *Mac - ); - -CHAR8 * -EFIAPI -EblLoadFileBootTypeString ( - IN EFI_HANDLE Handle - ); - -EFI_STATUS -EFIAPI -EblPerformDHCP ( - IN BOOLEAN SortOffers - ); - -EFI_STATUS -EFIAPI -EblSetStationIp ( - IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL - IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL - ); - -EFI_STATUS -EFIAPI -EblMtftp ( - IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation, - IN OUT VOID *BufferPtr OPTIONAL, - IN BOOLEAN Overwrite, - IN OUT UINT64 *BufferSize, - IN UINTN *BlockSize OPTIONAL, - IN EFI_IP_ADDRESS *ServerIp, - IN UINT8 *Filename OPTIONAL, - IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL, - IN BOOLEAN DontUseBuffer - ); - -#endif - diff --git a/EmbeddedPkg/Include/Library/EfiFileLib.h b/EmbeddedPkg/Include/Library/EfiFileLib.h deleted file mode 100644 index e86be4c95b..0000000000 --- a/EmbeddedPkg/Include/Library/EfiFileLib.h +++ /dev/null @@ -1,350 +0,0 @@ -/** @file - Library functions that perform file IO. Memory buffer, file system, and - fimrware volume operations are supproted. - - Copyright (c) 2007, Intel Corporation. All rights reserved.
- Portions copyright (c) 2008 - 2009, 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. - - Basic support for opening files on different device types. The device string - is in the form of DevType:Path. Current DevType is required as there is no - current mounted device concept of current working directory concept implement - by this library. - - Device names are case insensative and only check the leading characters for - unique matches. Thus the following are all the same: - LoadFile0: - l0: - L0: - Lo0: - - Supported Device Names: - A0x1234:0x12 - A memory buffer starting at address 0x1234 for 0x12 bytes - l1: - EFI LoadFile device one. - B0: - EFI BlockIo zero. - fs3: - EFI Simple File System device 3 - Fv2: - EFI Firmware VOlume device 2 - 1.2.3.4:name - TFTP IP and file name - -**/ - -#ifndef __EFI_FILE_LIB_H__ -#define __EFI_FILE_LIB_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_PATHNAME 0x200 - -/// Type of the file that has been opened -typedef enum { - EfiOpenLoadFile, - EfiOpenMemoryBuffer, - EfiOpenFirmwareVolume, - EfiOpenFileSystem, - EfiOpenBlockIo, - EfiOpenTftp, - EfiOpenMaxValue -} EFI_OPEN_FILE_TYPE; - - -/// Public information about the open file -typedef struct { - UINTN Version; // Common information - EFI_OPEN_FILE_TYPE Type; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - EFI_STATUS LastError; - EFI_HANDLE EfiHandle; - CHAR8 *DeviceName; - CHAR8 *FileName; - - UINT64 CurrentPosition; // Information for Seek - UINT64 MaxPosition; - - UINTN BaseOffset; // Base offset for hexdump command - - UINTN Size; // Valid for all types other than l#: - UINT8 *Buffer; // Information valid for A#: - - EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#: - EFI_GUID FvNameGuid; - EFI_SECTION_TYPE FvSectionType; - EFI_FV_FILETYPE FvType; - EFI_FV_FILE_ATTRIBUTES FvAttributes; - - EFI_PHYSICAL_ADDRESS FvStart; - UINTN FvSize; - UINTN FvHeaderSize; - - EFI_FILE *FsFileHandle; // Information valid for Fs#: - EFI_FILE_SYSTEM_INFO *FsInfo; - EFI_FILE_INFO *FsFileInfo; - EFI_BLOCK_IO_MEDIA *FsBlockIoMedia; // Information valid for Fs#: or B#: - EFI_BLOCK_IO_PROTOCOL *FsBlockIo; // Information valid for Fs#: or B#: - - UINTN DiskOffset; // Information valid for B#: - - EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#: - - EFI_IP_ADDRESS ServerIp; // Information valid for t: - BOOLEAN IsDirty; - BOOLEAN IsBufferValid; - -} EFI_OPEN_FILE; - - -/// Type of Seek to perform -typedef enum { - EfiSeekStart, - EfiSeekCurrent, - EfiSeekEnd, - EfiSeekMax -} EFI_SEEK_TYPE; - - -/** - Open a device named by PathName. The PathName includes a device name and - path separated by a :. See file header for more details on the PathName - syntax. There is no checking to prevent a file from being opened more than - one type. - - SectionType is only used to open an FV. Each file in an FV contains multiple - sections and only the SectionType section is opened. - - For any file that is opened with EfiOpen() must be closed with EfiClose(). - - @param PathName Path to parse to open - @param OpenMode Same as EFI_FILE.Open() - @param SectionType Section in FV to open. - - @return NULL Open failed - @return Valid EFI_OPEN_FILE handle - -**/ -EFI_OPEN_FILE * -EfiOpen ( - IN CHAR8 *PathName, - IN CONST UINT64 OpenMode, - IN CONST EFI_SECTION_TYPE SectionType - ); - -EFI_STATUS -EfiCopyFile ( - IN CHAR8 *DestinationFile, - IN CHAR8 *SourceFile - ); - -/** - Use DeviceType and Index to form a valid PathName and try and open it. - - @param DeviceType Device type to open - @param Index Device Index to use. Zero relative. - - @return NULL Open failed - @return Valid EFI_OPEN_FILE handle - -**/ -EFI_OPEN_FILE * -EfiDeviceOpenByType ( - IN EFI_OPEN_FILE_TYPE DeviceType, - IN UINTN Index - ); - - -/** - Close a file handle opened by EfiOpen() and free all resources allocated by - EfiOpen(). - - @param Stream Open File Handle - - @return EFI_INVALID_PARAMETER Stream is not an Open File - @return EFI_SUCCESS Steam closed - -**/ -EFI_STATUS -EfiClose ( - IN EFI_OPEN_FILE *Stream - ); - - -/** - Return the size of the file represented by Stream. Also return the current - Seek position. Opening a file will enable a valid file size to be returned. - LoadFile is an exception as a load file size is set to zero. - - @param Stream Open File Handle - - @return 0 Stream is not an Open File or a valid LoadFile handle - -**/ -UINTN -EfiTell ( - IN EFI_OPEN_FILE *Stream, - OUT UINT64 *CurrentPosition OPTIONAL - ); - - -/** - Seek to the Offset location in the file. LoadFile and FV device types do - not support EfiSeek(). It is not possible to grow the file size using - EfiSeek(). - - SeekType defines how use Offset to calculate the new file position: - EfiSeekStart : Position = Offset - EfiSeekCurrent: Position is Offset bytes from the current position - EfiSeekEnd : Only supported if Offset is zero to seek to end of file. - - @param Stream Open File Handle - @param Offset Offset to seek too. - @param SeekType Type of seek to perform - - - @return EFI_INVALID_PARAMETER Stream is not an Open File - @return EFI_UNSUPPORTED LoadFile and FV does not support Seek - @return EFI_NOT_FOUND Seek past the end of the file. - @return EFI_SUCCESS Steam closed - -**/ -EFI_STATUS -EfiSeek ( - IN EFI_OPEN_FILE *Stream, - IN EFI_LBA Offset, - IN EFI_SEEK_TYPE SeekType - ); - - -/** - Read BufferSize bytes from the current location in the file. For load file - and FV case you must read the entire file. - - @param Stream Open File Handle - @param Buffer Caller allocated buffer. - @param BufferSize Size of buffer in bytes. - - - @return EFI_SUCCESS Stream is not an Open File - @return EFI_END_OF_FILE Tried to read past the end of the file - @return EFI_INVALID_PARAMETER Stream is not an open file handle - @return EFI_BUFFER_TOO_SMALL Buffer is not big enough to do the read - @return "other" Error returned from device read - -**/ -EFI_STATUS -EfiRead ( - IN EFI_OPEN_FILE *Stream, - OUT VOID *Buffer, - OUT UINTN *BufferSize - ); - - -/** - Read the entire file into a buffer. This routine allocates the buffer and - returns it to the user full of the read data. - - This is very useful for load file where it's hard to know how big the buffer - must be. - - @param Stream Open File Handle - @param Buffer Pointer to buffer to return. - @param BufferSize Pointer to Size of buffer return.. - - - @return EFI_SUCCESS Stream is not an Open File - @return EFI_END_OF_FILE Tried to read past the end of the file - @return EFI_INVALID_PARAMETER Stream is not an open file handle - @return EFI_BUFFER_TOO_SMALL Buffer is not big enough to do the read - @return "other" Error returned from device read - -**/ -EFI_STATUS -EfiReadAllocatePool ( - IN EFI_OPEN_FILE *Stream, - OUT VOID **Buffer, - OUT UINTN *BufferSize - ); - - -/** - Write data back to the file. - - @param Stream Open File Handle - @param Buffer Pointer to buffer to return. - @param BufferSize Pointer to Size of buffer return.. - - - @return EFI_SUCCESS Stream is not an Open File - @return EFI_END_OF_FILE Tried to read past the end of the file - @return EFI_INVALID_PARAMETER Stream is not an open file handle - @return EFI_BUFFER_TOO_SMALL Buffer is not big enough to do the read - @return "other" Error returned from device write - -**/ -EFI_STATUS -EfiWrite ( - IN EFI_OPEN_FILE *Stream, - OUT VOID *Buffer, - OUT UINTN *BufferSize - ); - - -/** - Return the number of devices of the current type active in the system - - @param Type Device type to check - - @return 0 Invalid type - -**/ -UINTN -EfiGetDeviceCounts ( - IN EFI_OPEN_FILE_TYPE Type - ); - - -/** - Set the Current Working Directory (CWD). If a call is made to EfiOpen () and - the path does not contain a device name, The CWD is prepended to the path. - - @param Cwd Current Working Directory to set - - - @return EFI_SUCCESS CWD is set - @return EFI_INVALID_PARAMETER Cwd is not a valid device:path - -**/ -EFI_STATUS -EfiSetCwd ( - IN CHAR8 *Cwd - ); - -/** - Set the Current Working Directory (CWD). If a call is made to EfiOpen () and - the path does not contain a device name, The CWD is prepended to the path. - - @param Cwd Current Working Directory - - - @return NULL No CWD set - @return 'other' malloc'ed buffer contains CWD. - -**/ -CHAR8 * -EfiGetCwd ( - VOID - ); - -#endif diff --git a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h b/EmbeddedPkg/Include/Library/EfiResetSystemLib.h deleted file mode 100644 index 83b95c9ddb..0000000000 --- a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h +++ /dev/null @@ -1,58 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - - -#ifndef __EFI_RESET_SYSTEM_LIB_H___ -#define __EFI_RESET_SYSTEM_LIB_H___ - - -/** - Resets the entire platform. - - @param ResetType The type of reset to perform. - @param ResetStatus The status code for the reset. - @param DataSize The size, in bytes, of WatchdogData. - @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or - EfiResetShutdown the data buffer starts with a Null-terminated - Unicode string, optionally followed by additional binary data. - -**/ -EFI_STATUS -EFIAPI -LibResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN CHAR16 *ResetData OPTIONAL - ); - - - -/** - Initialize any infrastructure required for LibResetSystem () to function. - - @param ImageHandle The firmware allocated handle for the EFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. - -**/ -EFI_STATUS -EFIAPI -LibInitializeResetSystem ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - -#endif diff --git a/EmbeddedPkg/Include/Library/FdtLoadLib.h b/EmbeddedPkg/Include/Library/FdtLoadLib.h deleted file mode 100644 index e08f499745..0000000000 --- a/EmbeddedPkg/Include/Library/FdtLoadLib.h +++ /dev/null @@ -1,48 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2014, ARM Limited. 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. -* -**/ - -#ifndef _FDT_LOAD_LIB_H_ -#define _FDT_LOAD_LIB_H_ - -/** - Load and Install FDT from Semihosting - - @param Filename Name of the file to load from semihosting - - @return EFI_SUCCESS Fdt Blob was successfully installed into the configuration table - from semihosting - @return EFI_NOT_FOUND Fail to locate the file in semihosting - @return EFI_OUT_OF_RESOURCES Fail to allocate memory to contain the blob -**/ -EFI_STATUS -InstallFdtFromSemihosting ( - IN CONST CHAR16* FileName - ); - -/** - Load and Install FDT from Firmware Volume - - @param Filename Guid of the FDT blob to load from firmware volume - - @return EFI_SUCCESS Fdt Blob was successfully installed into the configuration table - from firmware volume - @return EFI_NOT_FOUND Failed to locate the file in firmware volume - @return EFI_OUT_OF_RESOURCES Failed to allocate memory to contain the blob -**/ -EFI_STATUS -InstallFdtFromFv ( - IN CONST EFI_GUID *FileName - ); - -#endif diff --git a/EmbeddedPkg/Include/Library/GdbSerialLib.h b/EmbeddedPkg/Include/Library/GdbSerialLib.h deleted file mode 100644 index aa4c3ff640..0000000000 --- a/EmbeddedPkg/Include/Library/GdbSerialLib.h +++ /dev/null @@ -1,107 +0,0 @@ -/** @file - Basic serial IO abstaction for GDB - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __GDB_SERIAL_LIB_H__ -#define __GDB_SERIAL_LIB_H__ - - - -/** - Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, - data buts, and stop bits on a serial device. This call is optional as the serial - port will be set up with defaults base on PCD values. - - @param BaudRate The requested baud rate. A BaudRate value of 0 will use the the - device's default interface speed. - @param Parity The type of parity to use on this serial device. A Parity value of - DefaultParity will use the device's default parity value. - @param DataBits The number of data bits to use on the serial device. A DataBits - vaule of 0 will use the device's default data bit setting. - @param StopBits The number of stop bits to use on this serial device. A StopBits - value of DefaultStopBits will use the device's default number of - stop bits. - - @retval EFI_SUCCESS The device was configured. - @retval EFI_DEVICE_ERROR The serial device could not be coonfigured. - -**/ -RETURN_STATUS -EFIAPI -GdbSerialInit ( - IN UINT64 BaudRate, - IN UINT8 Parity, - IN UINT8 DataBits, - IN UINT8 StopBits - ); - - -/** - Check to see if a character is available from GDB. Do not read the character as that is - done via GdbGetChar(). - - @return TRUE - Character availible - @return FALSE - Character not availible - -**/ -BOOLEAN -EFIAPI -GdbIsCharAvailable ( - VOID - ); - -/** - Get a character from GDB. This function must be able to run in interrupt context. - - @return A character from GDB - -**/ -CHAR8 -EFIAPI -GdbGetChar ( - VOID - ); - - -/** - Send a character to GDB. This function must be able to run in interrupt context. - - - @param Char Send a character to GDB - -**/ - -VOID -EFIAPI -GdbPutChar ( - IN CHAR8 Char - ); - - -/** - Send an ASCII string to GDB. This function must be able to run in interrupt context. - - - @param String Send a string to GDB - -**/ - -VOID -GdbPutString ( - IN CHAR8 *String - ); - - -#endif - diff --git a/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h b/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h deleted file mode 100644 index af813956f1..0000000000 --- a/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h +++ /dev/null @@ -1,165 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - - -#ifndef __RUNTIME_SERVICES_LIB_H__ -#define __RUNTIME_SERVICES_LIB_H__ - -VOID -LibMtcInitialize (VOID); - -VOID -LibMtcVirtualAddressChangeEvent (VOID); - -EFI_STATUS -EFIAPI -LibMtcGetNextHighMonotonicCount ( - OUT UINT32 *HighCount - ); - -EFI_STATUS -LibMtcGetNextMonotonicCount ( - OUT UINT64 *Count - ); - - - -VOID -LibVariableInitialize (VOID); - -VOID -LibVariableVirtualAddressChangeEvent (VOID); - -EFI_STATUS -LibGetVariable ( - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, - OUT UINT32 *Attributes OPTIONAL, - IN OUT UINTN *DataSize, - OUT VOID *Data - ); - -EFI_STATUS -LibGetNextVariableName ( - IN OUT UINTN *VariableNameSize, - IN OUT CHAR16 *VariableName, - IN OUT EFI_GUID *VendorGuid - ); - -EFI_STATUS -LibSetVariable ( - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, - IN UINT32 Attributes, - IN UINTN DataSize, - IN VOID *Data - ); - -EFI_STATUS -LibQueryVariableInfo ( - IN UINT32 Attributes, - OUT UINT64 *MaximumVariableStorageSize, - OUT UINT64 *RemainingVariableStorageSize, - OUT UINT64 *MaximumVariableSize - ); - - - -VOID -LibResetInitializeReset (VOID); - -VOID -LibResetVirtualAddressChangeEvent (VOID); - -VOID -LibResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN CHAR16 *ResetData OPTIONAL - ); - - -VOID -LibCapsuleInitialize (VOID); - -VOID -LibCapsuleVirtualAddressChangeEvent (VOID); - -EFI_STATUS -LibUpdateCapsule ( - IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, - IN UINTN CapsuleCount, - IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL - ); - -EFI_STATUS -QueryCapsuleCapabilities ( - IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, - IN UINTN CapsuleCount, - OUT UINT64 *MaxiumCapsuleSize, - OUT EFI_RESET_TYPE *ResetType - ); - - - -VOID -LibRtcInitialize (VOID); - -VOID -LibRtcVirtualAddressChangeEvent (VOID); - -EFI_STATUS -LibGetTime ( - OUT EFI_TIME *Time, - OUT EFI_TIME_CAPABILITIES *Capabilities - ); - -EFI_STATUS -LibSetTime ( - IN EFI_TIME *Time - ); - -EFI_STATUS -LibGetWakeupTime ( - OUT BOOLEAN *Enabled, - OUT BOOLEAN *Pending, - OUT EFI_TIME *Time - ); - -EFI_STATUS -LibSetWakeupTime ( - IN BOOLEAN Enabled, - OUT EFI_TIME *Time - ); - - -VOID -LibReportStatusCodeInitialize (VOID); - -VOID -LibReportStatusCodeVirtualAddressChangeEvent (VOID); - -EFI_STATUS -LibReportStatusCode ( - IN EFI_STATUS_CODE_TYPE CodeType, - IN EFI_STATUS_CODE_VALUE Value, - IN UINT32 Instance, - IN EFI_GUID *CallerId, - IN EFI_STATUS_CODE_DATA *Data OPTIONAL - ); - - -#endif - diff --git a/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h b/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h deleted file mode 100644 index 16b9ed2e24..0000000000 --- a/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h +++ /dev/null @@ -1,44 +0,0 @@ -/** @file -* -* Copyright (c) 2011, ARM Limited. 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. -* -**/ - -#ifndef __PREPI_HOBLIST_POINTER_LIB_H__ -#define __PREPI_HOBLIST_POINTER_LIB_H__ - -/** - Returns the pointer to the HOB list. - - This function returns the pointer to first HOB in the list. - - @return The pointer to the HOB list. - -**/ -VOID * -EFIAPI -PrePeiGetHobList ( - VOID - ); - -/** - Updates the pointer to the HOB list. - - @param HobList Hob list pointer to store - -**/ -EFI_STATUS -EFIAPI -PrePeiSetHobList ( - IN VOID *HobList - ); - -#endif diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h deleted file mode 100644 index cf70fca3b6..0000000000 --- a/EmbeddedPkg/Include/Library/PrePiLib.h +++ /dev/null @@ -1,789 +0,0 @@ -/** @file - Library that helps implement monolithic PEI. (SEC goes to DXE) - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __PRE_PI_LIB_H__ -#define __PRE_PI_LIB_H__ - -#include - -/** - This service enables discovery of additional firmware volumes. - - @param Instance This instance of the firmware volume to find. The value 0 is the - Boot Firmware Volume (BFV). - @param FwVolHeader Pointer to the firmware volume header of the volume to return. - - @retval EFI_SUCCESS The volume was found. - @retval EFI_NOT_FOUND The volume was not found. - @retval EFI_INVALID_PARAMETER FwVolHeader is NULL. - -**/ -EFI_STATUS -EFIAPI -FfsFindNextVolume ( - IN UINTN Instance, - IN OUT EFI_PEI_FV_HANDLE *VolumeHandle - ); - - -/** - This service enables discovery of additional firmware files. - - @param SearchType A filter to find files only of this type. - @param FwVolHeader Pointer to the firmware volume header of the volume to search. - This parameter must point to a valid FFS volume. - @param FileHeader Pointer to the current file from which to begin searching. - - @retval EFI_SUCCESS The file was found. - @retval EFI_NOT_FOUND The file was not found. - @retval EFI_NOT_FOUND The header checksum was not zero. - -**/ -EFI_STATUS -EFIAPI -FfsFindNextFile ( - IN EFI_FV_FILETYPE SearchType, - IN EFI_PEI_FV_HANDLE VolumeHandle, - IN OUT EFI_PEI_FILE_HANDLE *FileHandle - ); - - -/** - This service enables discovery sections of a given type within a valid FFS file. - - @param SearchType The value of the section type to find. - @param FfsFileHeader A pointer to the file header that contains the set of sections to - be searched. - @param SectionData A pointer to the discovered section, if successful. - - @retval EFI_SUCCESS The section was found. - @retval EFI_NOT_FOUND The section was not found. - -**/ -EFI_STATUS -EFIAPI -FfsFindSectionData ( - IN EFI_SECTION_TYPE SectionType, - IN EFI_PEI_FILE_HANDLE FileHandle, - OUT VOID **SectionData - ); - - -/** - Find a file in the volume by name - - @param FileName A pointer to the name of the file to - find within the firmware volume. - - @param VolumeHandle The firmware volume to search FileHandle - Upon exit, points to the found file's - handle or NULL if it could not be found. - - @retval EFI_SUCCESS File was found. - - @retval EFI_NOT_FOUND File was not found. - - @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or - FileName was NULL. - -**/ -EFI_STATUS -EFIAPI -FfsFindByName ( - IN CONST EFI_GUID *FileName, - IN CONST EFI_PEI_FV_HANDLE VolumeHandle, - OUT EFI_PEI_FILE_HANDLE *FileHandle - ); - - -/** - Get information about the file by name. - - @param FileHandle Handle of the file. - - @param FileInfo Upon exit, points to the file's - information. - - @retval EFI_SUCCESS File information returned. - - @retval EFI_INVALID_PARAMETER If FileHandle does not - represent a valid file. - - @retval EFI_INVALID_PARAMETER If FileInfo is NULL. - -**/ -EFI_STATUS -EFIAPI -FfsGetFileInfo ( - IN CONST EFI_PEI_FILE_HANDLE FileHandle, - OUT EFI_FV_FILE_INFO *FileInfo - ); - - -/** - Get Information about the volume by name - - @param VolumeHandle Handle of the volume. - - @param VolumeInfo Upon exit, points to the volume's - information. - - @retval EFI_SUCCESS File information returned. - - @retval EFI_INVALID_PARAMETER If FileHandle does not - represent a valid file. - - @retval EFI_INVALID_PARAMETER If FileInfo is NULL. - -**/ -EFI_STATUS -EFIAPI -FfsGetVolumeInfo ( - IN EFI_PEI_FV_HANDLE VolumeHandle, - OUT EFI_FV_INFO *VolumeInfo - ); - - - -/** - Get Fv image from the FV type file, then add FV & FV2 Hob. - - @param FileHandle File handle of a Fv type file. - - @retval EFI_NOT_FOUND FV image can't be found. - @retval EFI_SUCCESS Successfully to process it. - -**/ -EFI_STATUS -EFIAPI -FfsProcessFvFile ( - IN EFI_PEI_FILE_HANDLE FvFileHandle - ); - - -/** - Search through every FV until you find a file of type FileType - - @param FileType File handle of a Fv type file. - @param Volumehandle On succes Volume Handle of the match - @param FileHandle On success File Handle of the match - - @retval EFI_NOT_FOUND FV image can't be found. - @retval EFI_SUCCESS Successfully found FileType - -**/ -EFI_STATUS -EFIAPI -FfsAnyFvFindFirstFile ( - IN EFI_FV_FILETYPE FileType, - OUT EFI_PEI_FV_HANDLE *VolumeHandle, - OUT EFI_PEI_FILE_HANDLE *FileHandle - ); - - -/** - Get Fv image from the FV type file, then add FV & FV2 Hob. - - @param FileHandle File handle of a Fv type file. - - - @retval EFI_NOT_FOUND FV image can't be found. - @retval EFI_SUCCESS Successfully to process it. - -**/ -EFI_STATUS -EFIAPI -FfsProcessFvFile ( - IN EFI_PEI_FILE_HANDLE FvFileHandle - ); - - -/** - This service enables PEIMs to ascertain the present value of the boot mode. - - - @retval BootMode - -**/ -EFI_BOOT_MODE -EFIAPI -GetBootMode ( - VOID - ); - - -/** - This service enables PEIMs to update the boot mode variable. - - @param BootMode The value of the boot mode to set. - - @retval EFI_SUCCESS The value was successfully updated - -**/ -EFI_STATUS -EFIAPI -SetBootMode ( - IN EFI_BOOT_MODE BootMode - ); - -/** - This service enables a PEIM to ascertain the address of the list of HOBs in memory. - - @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize. - - @retval EFI_SUCCESS The list was successfully returned. - @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published. - -**/ -VOID * -EFIAPI -GetHobList ( - VOID - ); - - -/** - Updates the pointer to the HOB list. - - @param HobList Hob list pointer to store - -**/ -EFI_STATUS -EFIAPI -SetHobList ( - IN VOID *HobList - ); - -EFI_HOB_HANDOFF_INFO_TABLE* -HobConstructor ( - IN VOID *EfiMemoryBegin, - IN UINTN EfiMemoryLength, - IN VOID *EfiFreeMemoryBottom, - IN VOID *EfiFreeMemoryTop - ); - -/** - Retrieves the magic value from the PE/COFF header. - - @param Hdr The buffer in which to return the PE32, PE32+, or TE header. - - @return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32 - @return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+ - -**/ -VOID -CreateHobList ( - IN VOID *MemoryBegin, - IN UINTN MemoryLength, - IN VOID *HobBase, - IN VOID *StackBase - ); - - -/** - This service enables PEIMs to create various types of HOBs. - - @param Type The type of HOB to be installed. - @param Length The length of the HOB to be added. - - @retval !NULL The HOB was successfully created. - @retval NULL There is no additional space for HOB creation. - -**/ -VOID * -CreateHob ( - IN UINT16 HobType, - IN UINT16 HobLenght - ); - - -/** - Returns the next instance of a HOB type from the starting HOB. - - This function searches the first instance of a HOB type from the starting HOB pointer. - If there does not exist such HOB type from the starting HOB pointer, it will return NULL. - In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer - unconditionally: it returns HobStart back if HobStart itself meets the requirement; - caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. - If HobStart is NULL, then ASSERT(). - - @param Type The HOB type to return. - @param HobStart The starting HOB pointer to search from. - - @return The next instance of a HOB type from the starting HOB. - -**/ -VOID * -EFIAPI -GetNextHob ( - IN UINT16 Type, - IN CONST VOID *HobStart - ); - -/** - Returns the first instance of a HOB type among the whole HOB list. - - This function searches the first instance of a HOB type among the whole HOB list. - If there does not exist such HOB type in the HOB list, it will return NULL. - - @param Type The HOB type to return. - - @return The next instance of a HOB type from the starting HOB. - -**/ -VOID * -EFIAPI -GetFirstHob ( - IN UINT16 Type - ); - -/** - This function searches the first instance of a HOB from the starting HOB pointer. - Such HOB should satisfy two conditions: - its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. - If there does not exist such HOB from the starting HOB pointer, it will return NULL. - Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () - to extract the data section and its size info respectively. - In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer - unconditionally: it returns HobStart back if HobStart itself meets the requirement; - caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. - If Guid is NULL, then ASSERT(). - If HobStart is NULL, then ASSERT(). - - @param Guid The GUID to match with in the HOB list. - @param HobStart A pointer to a Guid. - - @return The next instance of the matched GUID HOB from the starting HOB. - -**/ -VOID * -EFIAPI -GetNextGuidHob ( - IN CONST EFI_GUID *Guid, - IN CONST VOID *HobStart - ); - -/** - This function searches the first instance of a HOB among the whole HOB list. - Such HOB should satisfy two conditions: - its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. - If there does not exist such HOB from the starting HOB pointer, it will return NULL. - Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () - to extract the data section and its size info respectively. - If Guid is NULL, then ASSERT(). - - @param Guid The GUID to match with in the HOB list. - - @return The first instance of the matched GUID HOB among the whole HOB list. - -**/ -VOID * -EFIAPI -GetFirstGuidHob ( - IN CONST EFI_GUID *Guid - ); - - -/** - Builds a HOB for a loaded PE32 module. - - This function builds a HOB for a loaded PE32 module. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If ModuleName is NULL, then ASSERT(). - If there is no additional space for HOB creation, then ASSERT(). - - @param ModuleName The GUID File Name of the module. - @param MemoryAllocationModule The 64 bit physical address of the module. - @param ModuleLength The length of the module in bytes. - @param EntryPoint The 64 bit physical address of the module entry point. - -**/ -VOID -EFIAPI -BuildModuleHob ( - IN CONST EFI_GUID *ModuleName, - IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule, - IN UINT64 ModuleLength, - IN EFI_PHYSICAL_ADDRESS EntryPoint - ); - -/** - Builds a HOB that describes a chunk of system memory. - - This function builds a HOB that describes a chunk of system memory. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param ResourceType The type of resource described by this HOB. - @param ResourceAttribute The resource attributes of the memory described by this HOB. - @param PhysicalStart The 64 bit physical address of memory described by this HOB. - @param NumberOfBytes The length of the memory described by this HOB in bytes. - -**/ -VOID -EFIAPI -BuildResourceDescriptorHob ( - IN EFI_RESOURCE_TYPE ResourceType, - IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, - IN EFI_PHYSICAL_ADDRESS PhysicalStart, - IN UINT64 NumberOfBytes - ); - -/** - Builds a GUID HOB with a certain data length. - - This function builds a customized HOB tagged with a GUID for identification - and returns the start address of GUID HOB data so that caller can fill the customized data. - The HOB Header and Name field is already stripped. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If Guid is NULL, then ASSERT(). - If there is no additional space for HOB creation, then ASSERT(). - If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). - - @param Guid The GUID to tag the customized HOB. - @param DataLength The size of the data payload for the GUID HOB. - - @return The start address of GUID HOB data. - -**/ -VOID * -EFIAPI -BuildGuidHob ( - IN CONST EFI_GUID *Guid, - IN UINTN DataLength - ); - -/** - Copies a data buffer to a newly-built HOB. - - This function builds a customized HOB tagged with a GUID for identification, - copies the input data to the HOB data field and returns the start address of the GUID HOB data. - The HOB Header and Name field is already stripped. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If Guid is NULL, then ASSERT(). - If Data is NULL and DataLength > 0, then ASSERT(). - If there is no additional space for HOB creation, then ASSERT(). - If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). - - @param Guid The GUID to tag the customized HOB. - @param Data The data to be copied into the data field of the GUID HOB. - @param DataLength The size of the data payload for the GUID HOB. - - @return The start address of GUID HOB data. - -**/ -VOID * -EFIAPI -BuildGuidDataHob ( - IN CONST EFI_GUID *Guid, - IN VOID *Data, - IN UINTN DataLength - ); - -/** - Builds a Firmware Volume HOB. - - This function builds a Firmware Volume HOB. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The base address of the Firmware Volume. - @param Length The size of the Firmware Volume in bytes. - -**/ -VOID -EFIAPI -BuildFvHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Builds a Firmware Volume HOB and a resrouce descriptor hob - - This function builds a Firmware Volume HOB. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The base address of the Firmware Volume. - @param Length The size of the Firmware Volume in bytes. - -**/ -VOID -EFIAPI -BuildFvHobs ( - IN EFI_PHYSICAL_ADDRESS PhysicalStart, - IN UINT64 NumberOfBytes, - IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute OPTIONAL - ); - - -/** - Builds a EFI_HOB_TYPE_FV2 HOB. - - This function builds a EFI_HOB_TYPE_FV2 HOB. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The base address of the Firmware Volume. - @param Length The size of the Firmware Volume in bytes. - @param FvName The name of the Firmware Volume. - @param FileName The name of the file. - -**/ -VOID -EFIAPI -BuildFv2Hob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN CONST EFI_GUID *FvName, - IN CONST EFI_GUID *FileName - ); - -/** - Builds a Capsule Volume HOB. - - This function builds a Capsule Volume HOB. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The base address of the Capsule Volume. - @param Length The size of the Capsule Volume in bytes. - -**/ -VOID -EFIAPI -BuildCvHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Builds a HOB for the CPU. - - This function builds a HOB for the CPU. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param SizeOfMemorySpace The maximum physical memory addressability of the processor. - @param SizeOfIoSpace The maximum physical I/O addressability of the processor. - -**/ -VOID -EFIAPI -BuildCpuHob ( - IN UINT8 SizeOfMemorySpace, - IN UINT8 SizeOfIoSpace - ); - -/** - Builds a HOB for the Stack. - - This function builds a HOB for the stack. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The 64 bit physical address of the Stack. - @param Length The length of the stack in bytes. - -**/ -VOID -EFIAPI -BuildStackHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Update the Stack Hob if the stack has been moved - - @param BaseAddress The 64 bit physical address of the Stack. - @param Length The length of the stack in bytes. - -**/ -VOID -UpdateStackHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - - -/** - Builds a HOB for the BSP store. - - This function builds a HOB for BSP store. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The 64 bit physical address of the BSP. - @param Length The length of the BSP store in bytes. - @param MemoryType Type of memory allocated by this HOB. - -**/ -VOID -EFIAPI -BuildBspStoreHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN EFI_MEMORY_TYPE MemoryType - ); - -/** - Builds a HOB for the memory allocation. - - This function builds a HOB for the memory allocation. - It can only be invoked during PEI phase; - for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. - If there is no additional space for HOB creation, then ASSERT(). - - @param BaseAddress The 64 bit physical address of the memory. - @param Length The length of the memory allocation in bytes. - @param MemoryType Type of memory allocated by this HOB. - -**/ -VOID -EFIAPI -BuildMemoryAllocationHob ( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN EFI_MEMORY_TYPE MemoryType - ); - - -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 ( - VOID - ); - - -/** - Allocates one or more 4KB pages of type EfiBootServicesData. - - Allocates the number of 4KB pages of MemoryType and returns a pointer to the - allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL - is returned. If there is not enough memory remaining to satisfy the request, then NULL is - returned. - - @param Pages The number of 4 KB pages to allocate. - - @return A pointer to the allocated buffer or NULL if allocation fails. - -**/ -VOID * -EFIAPI -AllocatePages ( - IN UINTN Pages - ); - -/** - Allocates a buffer of type EfiBootServicesData. - - Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a - pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is - returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. - - @param AllocationSize The number of bytes to allocate. - - @return A pointer to the allocated buffer or NULL if allocation fails. - -**/ -VOID * -EFIAPI -AllocatePool ( - IN UINTN AllocationSize - ); - - -/** - Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. - - Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an - alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is - returned. If there is not enough memory at the specified alignment remaining to satisfy the - request, then NULL is returned. - If Alignment is not a power of two and Alignment is not zero, then ASSERT(). - - @param Pages The number of 4 KB pages to allocate. - @param Alignment The requested alignment of the allocation. Must be a power of two. - If Alignment is zero, then byte alignment is used. - - @return A pointer to the allocated buffer or NULL if allocation fails. - -**/ -VOID * -EFIAPI -AllocateAlignedPages ( - IN UINTN Pages, - IN UINTN Alignment - ); - - -EFI_STATUS -EFIAPI -LoadPeCoffImage ( - IN VOID *PeCoffImage, - OUT EFI_PHYSICAL_ADDRESS *ImageAddress, - OUT UINT64 *ImageSize, - OUT EFI_PHYSICAL_ADDRESS *EntryPoint - ); - -EFI_STATUS -EFIAPI -LoadDxeCoreFromFfsFile ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN UINTN StackSize - ); - -EFI_STATUS -EFIAPI -LoadDxeCoreFromFv ( - IN UINTN *FvInstance, OPTIONAL - IN UINTN StackSize - ); - -EFI_STATUS -EFIAPI -DecompressFirstFv ( - VOID - ); - -VOID -EFIAPI -AddDxeCoreReportStatusCodeCallback ( - VOID - ); - - -#endif diff --git a/EmbeddedPkg/Include/Library/RealTimeClockLib.h b/EmbeddedPkg/Include/Library/RealTimeClockLib.h deleted file mode 100644 index 59a34aad13..0000000000 --- a/EmbeddedPkg/Include/Library/RealTimeClockLib.h +++ /dev/null @@ -1,138 +0,0 @@ -/** @file - Implement EFI RealTimeClock runtime services via Lib. - - Currently this driver does not support runtime virtual calling. - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __REAL_TIME_CLOCK_LIB__ -#define __REAL_TIME_CLOCK_LIB__ - - -/** - Returns the current time and date information, and the time-keeping capabilities - of the hardware platform. - - @param Time A pointer to storage to receive a snapshot of the current time. - @param Capabilities An optional pointer to a buffer to receive the real time clock - device's capabilities. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER Time is NULL. - @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error. - -**/ -EFI_STATUS -EFIAPI -LibGetTime ( - OUT EFI_TIME *Time, - OUT EFI_TIME_CAPABILITIES *Capabilities - ); - - -/** - Sets the current local time and date information. - - @param Time A pointer to the current time. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER A time field is out of range. - @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error. - -**/ -EFI_STATUS -EFIAPI -LibSetTime ( - IN EFI_TIME *Time - ); - - -/** - Returns the current wakeup alarm clock setting. - - @param Enabled Indicates if the alarm is currently enabled or disabled. - @param Pending Indicates if the alarm signal is pending and requires acknowledgement. - @param Time The current alarm setting. - - @retval EFI_SUCCESS The alarm settings were returned. - @retval EFI_INVALID_PARAMETER Any parameter is NULL. - @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error. - -**/ -EFI_STATUS -EFIAPI -LibGetWakeupTime ( - OUT BOOLEAN *Enabled, - OUT BOOLEAN *Pending, - OUT EFI_TIME *Time - ); - - -/** - Sets the system wakeup alarm clock time. - - @param Enabled Enable or disable the wakeup alarm. - @param Time If Enable is TRUE, the time to set the wakeup alarm for. - - @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If - Enable is FALSE, then the wakeup alarm was disabled. - @retval EFI_INVALID_PARAMETER A time field is out of range. - @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error. - @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform. - -**/ -EFI_STATUS -EFIAPI -LibSetWakeupTime ( - IN BOOLEAN Enabled, - OUT EFI_TIME *Time - ); - - - -/** - This is the declaration of an EFI image entry point. This can be the entry point to an application - written to this specification, an EFI boot service driver, or an EFI runtime driver. - - @param ImageHandle Handle that identifies the loaded image. - @param SystemTable System Table for this image. - - @retval EFI_SUCCESS The operation completed successfully. - -**/ -EFI_STATUS -EFIAPI -LibRtcInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - - -/** - Fixup internal data so that EFI can be call in virtual mode. - Call the passed in Child Notify event and convert any pointers in - lib to virtual mode. - - @param[in] Event The Event that is being processed - @param[in] Context Event Context -**/ -VOID -EFIAPI -LibRtcVirtualNotifyEvent ( - IN EFI_EVENT Event, - IN VOID *Context - ); - - -#endif - diff --git a/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h b/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h deleted file mode 100644 index a9b4aac482..0000000000 --- a/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h +++ /dev/null @@ -1,145 +0,0 @@ -/** @file - - Copyright (c) 2014, ARM Ltd. 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. - -**/ - -#ifndef __ANDROID_FASTBOOT_PLATFORM_H__ -#define __ANDROID_FASTBOOT_PLATFORM_H__ - -extern EFI_GUID gAndroidFastbootPlatformProtocolGuid; - -/* - Protocol for platform-specific operations initiated by Android Fastboot. - - Based on Fastboot Protocol version 0.4. See - system/core/fastboot/fastboot_protocol.txt in the AOSP source tree for more - info. - - Doesn't support image verification. -*/ - -/* - Do any initialisation that needs to be done in order to be able to respond to - commands. - - @retval EFI_SUCCESS Initialised successfully. - @retval !EFI_SUCCESS Error in initialisation. -*/ -typedef -EFI_STATUS -(*FASTBOOT_PLATFORM_INIT) ( - VOID - ); - -/* - To be called when Fastboot is finished and we aren't rebooting or booting an - image. Undo initialisation, free resrouces. -*/ -typedef -VOID -(*FASTBOOT_PLATFORM_UN_INIT) ( - VOID - ); - -/* - Flash the partition named (according to a platform-specific scheme) - PartitionName, with the image pointed to by Buffer, whose size is BufferSize. - - @param[in] PartitionName Null-terminated name of partition to write. - @param[in] BufferSize Size of Buffer in byets. - @param[in] Buffer Data to write to partition. - - @retval EFI_NOT_FOUND No such partition. - @retval EFI_DEVICE_ERROR Flashing failed. -*/ -typedef -EFI_STATUS -(*FASTBOOT_PLATFORM_FLASH) ( - IN CHAR8 *PartitionName, - IN UINTN BufferSize, - IN VOID *Buffer - ); - -/* - Erase the partition named PartitionName. - - @param[in] PartitionName Null-terminated name of partition to erase. - - @retval EFI_NOT_FOUND No such partition. - @retval EFI_DEVICE_ERROR Erasing failed. -*/ -typedef -EFI_STATUS -(*FASTBOOT_PLATFORM_ERASE) ( - IN CHAR8 *PartitionName - ); - -/* - If the variable referred to by Name exists, copy it (as a null-terminated - string) into Value. If it doesn't exist, put the Empty string in Value. - - Variable names and values may not be larger than 60 bytes, excluding the - terminal null character. This is a limitation of the Fastboot protocol. - - The Fastboot application will handle platform-nonspecific variables - (Currently "version" is the only one of these.) - - @param[in] Name Null-terminated name of Fastboot variable to retrieve. - @param[out] Value Caller-allocated buffer for null-terminated value of - variable. - - @retval EFI_SUCCESS The variable was retrieved, or it doesn't exist. - @retval EFI_DEVICE_ERROR There was an error looking up the variable. This - does _not_ include the variable not existing. -*/ -typedef -EFI_STATUS -(*FASTBOOT_PLATFORM_GETVAR) ( - IN CHAR8 *Name, - OUT CHAR8 *Value - ); - -/* - React to an OEM-specific command. - - Future versions of this function might want to allow the platform to do some - extra communication with the host. A way to do this would be to add a function - to the FASTBOOT_TRANSPORT_PROTOCOL that allows the implementation of - DoOemCommand to replace the ReceiveEvent with its own, and to restore the old - one when it's finished. - - However at the moment although the specification allows it, the AOSP fastboot - host application doesn't handle receiving any data from the client, and it - doesn't support a data phase for OEM commands. - - @param[in] Command Null-terminated command string. - - @retval EFI_SUCCESS The command executed successfully. - @retval EFI_NOT_FOUND The command wasn't recognised. - @retval EFI_DEVICE_ERROR There was an error executing the command. -*/ -typedef -EFI_STATUS -(*FASTBOOT_PLATFORM_OEM_COMMAND) ( - IN CHAR8 *Command - ); - -typedef struct _FASTBOOT_PLATFORM_PROTOCOL { - FASTBOOT_PLATFORM_INIT Init; - FASTBOOT_PLATFORM_UN_INIT UnInit; - FASTBOOT_PLATFORM_FLASH FlashPartition; - FASTBOOT_PLATFORM_ERASE ErasePartition; - FASTBOOT_PLATFORM_GETVAR GetVar; - FASTBOOT_PLATFORM_OEM_COMMAND DoOemCommand; -} FASTBOOT_PLATFORM_PROTOCOL; - -#endif diff --git a/EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h b/EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h deleted file mode 100644 index 807068717e..0000000000 --- a/EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h +++ /dev/null @@ -1,131 +0,0 @@ -/** @file - - Copyright (c) 2014, ARM Ltd. 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. - -**/ - -/* - Transport protocol over which Android Fastboot transactions can be made. - Fastboot is designed for USB, but this protocol is intended as an abstraction - so that it can be implemented over any transport mechanism. -*/ - -#ifndef __ANDROID_FASTBOOT_TRANSPORT_H__ -#define __ANDROID_FASTBOOT_TRANSPORT_H__ - -extern EFI_GUID gAndroidFastbootTransportProtocolGuid; - -/* - Set up the transport system for use by Fastboot. - e.g. For USB this probably means making the device enumerable. For TCP, - preparing to accept incoming connections. - - It is _not_ the responsibility of this protocol's implementer to unite the - data phase into a single buffer - that is handled by the Fastboot UEFI - application. As the Fastboot protocol spec says: "Short packets are always - acceptable and zero-length packets are ignored." - However the commands and responses must be in a single packet, and the order - of the packets must of course be maintained. - - If there is a fatal error in the receive channel, ReceiveEvent will be - signalled, and a subsequent call to Receive() will return an error. This - allows data transported prior to the error to be received. - - @param[in] ReceiveEvent Event to be Signalled when a packet has been received - and is ready to be retrieved via Receive(). - - @retval EFI_SUCCESS Initialised successfully. - @retval EFI_DEVICE_ERROR Error in initialising hardware - @retval (other) Error return from LocateProtocol functions. -*/ -typedef -EFI_STATUS -(*FASTBOOT_TRANSPORT_START) ( - IN EFI_EVENT ReceiveEvent - ); - -/* - Function to be called when all Fastboot transactions are finished, to - de-initialise the transport system. - e.g. A USB OTG system might want to get out of peripheral mode so it can be - a USB host. - - Note that this function will be called after an error is reported by Send or - Receive - - @retval EFI_SUCCESS De-initialised successfully. - @retval EFI_DEVICE_ERROR Error de-initialising hardware. -*/ -typedef -EFI_STATUS -(* FASTBOOT_TRANSPORT_STOP) ( - VOID - ); - -/* - Send data. This function can be used both for command responses like "OKAY" - and for the data phase (the protocol doesn't describe any situation when the - latter might be necessary, but does allow it) - - Transmission need not finish before the function returns. - If there is an error in transmission from which the transport system cannot - recover, FatalErrorEvent will be signalled. Otherwise, it is assumed that all - data was delivered successfully. - - @param[in] BufferSize Size in bytes of data to send. - @param[in] Buffer Data to send. - @param[in] FatalErrorEvent Event to signal if there was an error in - transmission from which the transport system - cannot recover. - - @retval EFI_SUCCESS The data was sent or queued for send. - @retval EFI_DEVICE_ERROR There was an error preparing to send the data. - */ -typedef -EFI_STATUS -(*FASTBOOT_TRANSPORT_SEND) ( - IN UINTN BufferSize, - IN CONST VOID *Buffer, - IN EFI_EVENT *FatalErrorEvent - ); - -/* - When the event has been Signalled to say data is available from the host, - this function is used to get data. In order to handle the case where several - packets are received before ReceiveEvent's notify function is called, packets - received are queued, and each call to this function returns the next packet in - the queue. It should therefore be called in a loop, the exit condition being a - return of EFI_NOT_READY. - - @param[out] Buffer Pointer to received data. Callee allocated - the - caller must free it with FreePool. - @param[out] BufferSize The size of received data in bytes - - @retval EFI_NOT_READY There is no data available - @retval EFI_DEVICE_ERROR There was a fatal error in the receive channel. - e.g. for USB the cable was unplugged or for TCP the - connection was closed by the remote host.. -*/ -typedef -EFI_STATUS -(*FASTBOOT_TRANSPORT_RECEIVE) ( - OUT UINTN *BufferSize, - OUT VOID **Buffer - ); - -typedef struct _FASTBOOT_TRANSPORT_PROTOCOL { - FASTBOOT_TRANSPORT_START Start; - FASTBOOT_TRANSPORT_STOP Stop; - FASTBOOT_TRANSPORT_SEND Send; - FASTBOOT_TRANSPORT_RECEIVE Receive; -} FASTBOOT_TRANSPORT_PROTOCOL; - -#endif diff --git a/EmbeddedPkg/Include/Protocol/DebugSupportPeriodicCallback.h b/EmbeddedPkg/Include/Protocol/DebugSupportPeriodicCallback.h deleted file mode 100644 index 3d95f930b9..0000000000 --- a/EmbeddedPkg/Include/Protocol/DebugSupportPeriodicCallback.h +++ /dev/null @@ -1,42 +0,0 @@ -/** @file - Protocol is used to help implement DebugSupport.RegisterPeriodicCallback() functionality. - This enables the DXE timer driver to support the periodic callback function so the - DebugSupport driver does not need to contain platform specific information about how a timer - works. - - Copyright (c) 2008 - 2009, 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. - -**/ - - -#ifndef __DEBUG_SUPPORT_PERIODIC_CALLBACK_H__ -#define __DEBUG_SUPPORT_PERIODIC_CALLBACK_H__ - -#include - -typedef struct _EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL; - - -// {9546E07C-2CBB-4c88-986C-CD341086F044} -#define EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL_GUID \ - { 0x9546e07c, 0x2cbb, 0x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } - - -// -// DebugSupport protocol definition -// -struct _EFI_DEBUG_SUPPORT_PERIODIC_CALLBACK_PROTOCOL { - EFI_PERIODIC_CALLBACK PeriodicCallback; -}; - -extern EFI_GUID gEfiDebugSupportPeriodicCallbackProtocolGuid; - -#endif diff --git a/EmbeddedPkg/Include/Protocol/EblAddCommand.h b/EmbeddedPkg/Include/Protocol/EblAddCommand.h deleted file mode 100644 index 4a9f494c5d..0000000000 --- a/EmbeddedPkg/Include/Protocol/EblAddCommand.h +++ /dev/null @@ -1,142 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - - -#ifndef __EBL_ADD_COMMAND_H__ -#define __EBL_ADD_COMMAND_H__ - - - -// -// Protocol GUID -// -// AEDA2428-9A22-4637-9B21-545E28FBB829 - -#define EBL_ADD_COMMAND_PROTOCOL_GUID \ - { 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } } - - -typedef struct _EBL_ADD_COMMAND_PROTOCOL EBL_ADD_COMMAND_PROTOCOL; - -typedef -EFI_STATUS -(EFIAPI *EBL_COMMMAND) ( - IN UINTN Argc, - IN CHAR8 **Argv - ); - -typedef struct { - CHAR8 *Name; - CHAR8 *HelpSummary; - CHAR8 *Help; - EBL_COMMMAND Command; -} EBL_COMMAND_TABLE; - - -/** - Add a single command table entry. - - @param EntryArray Pointer EBL_COMMAND_TABLE of the command that is being added - -**/ -typedef -VOID -(EFIAPI *EBL_ADD_COMMAND) ( - IN const EBL_COMMAND_TABLE *Entry - ); - - -/** - Add a multiple command table entry. - - @param EntryArray Pointer EBL_COMMAND_TABLE of the commands that are being added - - @param ArrayCount Number of commands in the EntryArray. - -**/ -typedef -VOID -(EFIAPI *EBL_ADD_COMMANDS) ( - IN const EBL_COMMAND_TABLE *EntryArray, - IN UINTN ArrayCount - ); - - -typedef -VOID -(EFIAPI *EBL_GET_CHAR_CALL_BACK) ( - IN UINTN ElapsedTime - ); - -/** - Return a keypress or optionally timeout if a timeout value was passed in. - An optional callback function is called every second when waiting for a - timeout. - - @param Key EFI Key information returned - @param TimeoutInSec Number of seconds to wait to timeout - @param CallBack Callback called every second during the timeout wait - - @return EFI_SUCCESS Key was returned - @return EFI_TIMEOUT If the TimoutInSec expired - -**/ -typedef -EFI_STATUS -(EFIAPI *EBL_GET_CHAR_KEY) ( - IN OUT EFI_INPUT_KEY *Key, - IN UINTN TimeoutInSec, - IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL - ); - - -/** - This routine is used prevent command output data from scrolling off the end - of the screen. The global gPageBreak is used to turn on or off this feature. - If the CurrentRow is near the end of the screen pause and print out a prompt - If the use hits Q to quit return TRUE else for any other key return FALSE. - PrefixNewline is used to figure out if a newline is needed before the prompt - string. This depends on the last print done before calling this function. - CurrentRow is updated by one on a call or set back to zero if a prompt is - needed. - - @param CurrentRow Used to figure out if its the end of the page and updated - @param PrefixNewline Did previous print issue a newline - - @return TRUE if Q was hit to quit, FALSE in all other cases. - -**/ -typedef -BOOLEAN -(EFIAPI *EBL_ANY_KEY_CONTINUE_Q_QUIT) ( - IN UINTN *CurrentRow, - IN BOOLEAN PrefixNewline - ); - - - -struct _EBL_ADD_COMMAND_PROTOCOL { - EBL_ADD_COMMAND AddCommand; - EBL_ADD_COMMANDS AddCommands; - - // Commands to reuse EBL infrastructure - EBL_GET_CHAR_KEY EblGetCharKey; - EBL_ANY_KEY_CONTINUE_Q_QUIT EblAnyKeyToContinueQtoQuit; -}; - -extern EFI_GUID gEfiEblAddCommandProtocolGuid; - -#endif - - diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h b/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h deleted file mode 100644 index a999a97557..0000000000 --- a/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h +++ /dev/null @@ -1,58 +0,0 @@ -/** @file - Deal with devices that just exist in memory space. - - To follow the EFI driver model you need a root handle to start with. An - EFI driver will have a driver binding protocol (Supported, Start, Stop) - that is used to layer on top of a handle via a gBS->ConnectController. - The first handle has to just be in the system to make that work. For - PCI it is a PCI Root Bridge IO protocol that provides the root. - - On an embedded system with MMIO device we need a handle to just - show up. That handle will have this protocol and a device path - protocol on it. - - For an ethernet device the device path must contain a MAC address device path - node. - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EMBEDDED_DEVICE_PROTOCOL_H__ -#define __EMBEDDED_DEVICE_PROTOCOL_H__ - - -// -// Protocol GUID -// -// BF4B9D10-13EC-43dd-8880-E90B718F27DE - -#define EMBEDDED_DEVICE_PROTOCOL_GUID \ - { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 0xb, 0x71, 0x8f, 0x27, 0xde } } - - - -typedef struct { - UINT16 VendorId; - UINT16 DeviceId; - UINT16 RevisionId; - UINT16 SubsystemId; - UINT16 SubsystemVendorId; - UINT8 ClassCode[3]; - UINT8 HeaderSize; - UINTN BaseAddress; -} EMBEDDED_DEVICE_PROTOCOL; - -extern EFI_GUID gEmbeddedDeviceGuid; - -#endif - - diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h b/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h deleted file mode 100644 index 06d2f034d0..0000000000 --- a/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h +++ /dev/null @@ -1,94 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EMBEDDED_EXTERNAL_DEVICE_H__ -#define __EMBEDDED_EXTERNAL_DEVICE_H__ - -// -// Protocol GUID -// -#define EMBEDDED_EXTERNAL_DEVICE_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }} - -// -// Protocol interface structure -// -typedef struct _EMBEDDED_EXTERNAL_DEVICE EMBEDDED_EXTERNAL_DEVICE; - -// -// Function Prototypes -// -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_READ) ( - IN EMBEDDED_EXTERNAL_DEVICE *This, - IN UINTN Register, - IN UINTN Length, - OUT VOID *Buffer - ) -/*++ - -Routine Description: - - Read a set of contiguous external device registers. - -Arguments: - - This - pointer to protocol - Offset - starting register number - Length - number of bytes to read - Buffer - destination buffer - -Returns: - - EFI_SUCCESS - registers read successfully - ---*/ -; - -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_WRITE) ( - IN EMBEDDED_EXTERNAL_DEVICE *This, - IN UINTN Register, - IN UINTN Length, - IN VOID *Buffer - ) -/*++ - -Routine Description: - - Write to a set of contiguous external device registers. - -Arguments: - - This - pointer to protocol - Offset - starting register number - Length - number of bytes to write - Buffer - source buffer - -Returns: - - EFI_SUCCESS - registers written successfully - ---*/ -; - -struct _EMBEDDED_EXTERNAL_DEVICE { - EMBEDDED_EXTERNAL_DEVICE_READ Read; - EMBEDDED_EXTERNAL_DEVICE_WRITE Write; -}; - -extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid; - -#endif // __EMBEDDED_EXTERNAL_DEVICE_H__ diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h deleted file mode 100644 index 4e7c8dbcd6..0000000000 --- a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h +++ /dev/null @@ -1,167 +0,0 @@ -/** @file - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __EMBEDDED_GPIO_H__ -#define __EMBEDDED_GPIO_H__ - -// -// Protocol interface structure -// -typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO; - -// -// Data Types -// -typedef UINTN EMBEDDED_GPIO_PIN; - -#define GPIO(Port, Pin) ((EMBEDDED_GPIO_PIN)(((Port) << (16)) | (Pin))) -#define GPIO_PIN(x) ((EMBEDDED_GPIO_PIN)(x) & (0xFFFF)) -#define GPIO_PORT(x) ((EMBEDDED_GPIO_PIN)(x) >> (16)) - -typedef enum { - GPIO_MODE_INPUT = 0x00, - GPIO_MODE_OUTPUT_0 = 0x0E, - GPIO_MODE_OUTPUT_1 = 0x0F, - GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02, - GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03, - GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04, - GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05, - GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06, - GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07 -} EMBEDDED_GPIO_MODE; - -typedef enum { - GPIO_PULL_NONE, - GPIO_PULL_UP, - GPIO_PULL_DOWN -} EMBEDDED_GPIO_PULL; - -// -// Function Prototypes -// -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_GPIO_GET) ( - IN EMBEDDED_GPIO *This, - IN EMBEDDED_GPIO_PIN Gpio, - OUT UINTN *Value - ); -/*++ - -Routine Description: - - Gets the state of a GPIO pin - -Arguments: - - This - pointer to protocol - Gpio - which pin to read - Value - state of the pin - -Returns: - - EFI_SUCCESS - GPIO state returned in Value - ---*/ - - -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_GPIO_SET) ( - IN EMBEDDED_GPIO *This, - IN EMBEDDED_GPIO_PIN Gpio, - IN EMBEDDED_GPIO_MODE Mode - ); -/*++ - -Routine Description: - - Sets the state of a GPIO pin - -Arguments: - - This - pointer to protocol - Gpio - which pin to modify - Mode - mode to set - -Returns: - - EFI_SUCCESS - GPIO set as requested - ---*/ - - -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_GPIO_GET_MODE) ( - IN EMBEDDED_GPIO *This, - IN EMBEDDED_GPIO_PIN Gpio, - OUT EMBEDDED_GPIO_MODE *Mode - ); -/*++ - -Routine Description: - - Gets the mode (function) of a GPIO pin - -Arguments: - - This - pointer to protocol - Gpio - which pin - Mode - pointer to output mode value - -Returns: - - EFI_SUCCESS - mode value retrieved - ---*/ - - -typedef -EFI_STATUS -(EFIAPI *EMBEDDED_GPIO_SET_PULL) ( - IN EMBEDDED_GPIO *This, - IN EMBEDDED_GPIO_PIN Gpio, - IN EMBEDDED_GPIO_PULL Direction - ); -/*++ - -Routine Description: - - Sets the pull-up / pull-down resistor of a GPIO pin - -Arguments: - - This - pointer to protocol - Gpio - which pin - Direction - pull-up, pull-down, or none - -Returns: - - EFI_SUCCESS - pin was set - ---*/ - - - -struct _EMBEDDED_GPIO { - EMBEDDED_GPIO_GET Get; - EMBEDDED_GPIO_SET Set; - EMBEDDED_GPIO_GET_MODE GetMode; - EMBEDDED_GPIO_SET_PULL SetPull; -}; - -extern EFI_GUID gEmbeddedGpioProtocolGuid; - -#endif diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h b/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h deleted file mode 100644 index c4b5b9fa62..0000000000 --- a/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h +++ /dev/null @@ -1,170 +0,0 @@ -/** @file - Abstraction for hardware based interrupt routine - - On non IA-32 systems it is common to have a single hardware interrupt vector - and a 2nd layer of software that routes the interrupt handlers based on the - interrupt source. This protocol enables this routing. The driver implementing - this protocol is responsible for clearing the pending interrupt in the - interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible - for clearing interrupt sources from individual devices. - - - Copyright (c) 2008 - 2009, 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. - -**/ - -#ifndef __HARDWARE_INTERRUPT_H__ -#define __HARDWARE_INTERRUPT_H__ - -#include - - -// -// Protocol GUID -// -// EAB39028-3D05-4316-AD0C-D64808DA3FF1 - -#define EFI_HARDWARE_INTERRUPT_PROTOCOL_GGUID \ - { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } - - -typedef struct _EFI_HARDWARE_INTERRUPT_PROTOCOL EFI_HARDWARE_INTERRUPT_PROTOCOL; - - -typedef UINTN HARDWARE_INTERRUPT_SOURCE; - - -/** - C Interrupt Handler calledin the interrupt context when Source interrupt is active. - - @param Source Source of the interrupt. Hardware routing off a specific platform defines - what source means. - @param SystemContext Pointer to system register context. Mostly used by debuggers and will - update the system context after the return from the interrupt if - modified. Don't change these values unless you know what you are doing - -**/ -typedef -VOID -(EFIAPI *HARDWARE_INTERRUPT_HANDLER) ( - IN HARDWARE_INTERRUPT_SOURCE Source, - IN EFI_SYSTEM_CONTEXT SystemContext - ); - - -/** - Register Handler for the specified interrupt source. - - @param This Instance pointer for this protocol - @param Source Hardware source of the interrupt - @param Handler Callback for interrupt. NULL to unregister - - @retval EFI_SUCCESS Source was updated to support Handler. - @retval EFI_DEVICE_ERROR Hardware could not be programmed. - -**/ -typedef -EFI_STATUS -(EFIAPI *HARDWARE_INTERRUPT_REGISTER) ( - IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, - IN HARDWARE_INTERRUPT_SOURCE Source, - IN HARDWARE_INTERRUPT_HANDLER Handler - ); - - -/** - Enable interrupt source Source. - - @param This Instance pointer for this protocol - @param Source Hardware source of the interrupt - - @retval EFI_SUCCESS Source interrupt enabled. - @retval EFI_DEVICE_ERROR Hardware could not be programmed. - -**/ -typedef -EFI_STATUS -(EFIAPI *HARDWARE_INTERRUPT_ENABLE) ( - IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, - IN HARDWARE_INTERRUPT_SOURCE Source - ); - - - -/** - Disable interrupt source Source. - - @param This Instance pointer for this protocol - @param Source Hardware source of the interrupt - - @retval EFI_SUCCESS Source interrupt disabled. - @retval EFI_DEVICE_ERROR Hardware could not be programmed. - -**/ -typedef -EFI_STATUS -(EFIAPI *HARDWARE_INTERRUPT_DISABLE) ( - IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, - IN HARDWARE_INTERRUPT_SOURCE Source - ); - - -/** - Return current state of interrupt source Source. - - @param This Instance pointer for this protocol - @param Source Hardware source of the interrupt - @param InterruptState TRUE: source enabled, FALSE: source disabled. - - @retval EFI_SUCCESS InterruptState is valid - @retval EFI_DEVICE_ERROR InterruptState is not valid - -**/ -typedef -EFI_STATUS -(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE) ( - IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, - IN HARDWARE_INTERRUPT_SOURCE Source, - IN BOOLEAN *InterruptState - ); - -/** - Signal to the hardware that the End Of Intrrupt state - has been reached. - - @param This Instance pointer for this protocol - @param Source Hardware source of the interrupt - - @retval EFI_SUCCESS Source interrupt EOI'ed. - @retval EFI_DEVICE_ERROR Hardware could not be programmed. - -**/ -typedef -EFI_STATUS -(EFIAPI *HARDWARE_INTERRUPT_END_OF_INTERRUPT) ( - IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This, - IN HARDWARE_INTERRUPT_SOURCE Source - ); - - -struct _EFI_HARDWARE_INTERRUPT_PROTOCOL { - HARDWARE_INTERRUPT_REGISTER RegisterInterruptSource; - HARDWARE_INTERRUPT_ENABLE EnableInterruptSource; - HARDWARE_INTERRUPT_DISABLE DisableInterruptSource; - HARDWARE_INTERRUPT_INTERRUPT_STATE GetInterruptSourceState; - HARDWARE_INTERRUPT_END_OF_INTERRUPT EndOfInterrupt; -}; - -extern EFI_GUID gHardwareInterruptProtocolGuid; - -#endif - - diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h b/EmbeddedPkg/Include/Protocol/MmcHost.h deleted file mode 100644 index 89f2e80b5c..0000000000 --- a/EmbeddedPkg/Include/Protocol/MmcHost.h +++ /dev/null @@ -1,157 +0,0 @@ -/** @file - Definition of the MMC Host Protocol - - Copyright (c) 2011-2014, ARM Limited. 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. - -**/ - -#ifndef __MMC_HOST_H__ -#define __MMC_HOST_H__ - -/// -/// Global ID for the MMC Host Protocol -/// -#define EFI_MMC_HOST_PROTOCOL_GUID \ - { 0x3e591c00, 0x9e4a, 0x11df, {0x92, 0x44, 0x00, 0x02, 0xA5, 0xD5, 0xC5, 0x1B } } - -#define MMC_RESPONSE_TYPE_R1 0 -#define MMC_RESPONSE_TYPE_R1b 0 -#define MMC_RESPONSE_TYPE_R2 1 -#define MMC_RESPONSE_TYPE_R3 0 -#define MMC_RESPONSE_TYPE_R6 0 -#define MMC_RESPONSE_TYPE_R7 0 -#define MMC_RESPONSE_TYPE_OCR 0 -#define MMC_RESPONSE_TYPE_CID 1 -#define MMC_RESPONSE_TYPE_CSD 1 -#define MMC_RESPONSE_TYPE_RCA 0 - -typedef UINT32 MMC_RESPONSE_TYPE; - -typedef UINT32 MMC_CMD; - -#define MMC_CMD_WAIT_RESPONSE (1 << 16) -#define MMC_CMD_LONG_RESPONSE (1 << 17) -#define MMC_CMD_NO_CRC_RESPONSE (1 << 18) - -#define MMC_INDX(Index) ((Index) & 0xFFFF) -#define MMC_GET_INDX(MmcCmd) ((MmcCmd) & 0xFFFF) - -#define MMC_CMD0 (MMC_INDX(0) | MMC_CMD_NO_CRC_RESPONSE) -#define MMC_CMD1 (MMC_INDX(1) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE) -#define MMC_CMD2 (MMC_INDX(2) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE) -#define MMC_CMD3 (MMC_INDX(3) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD5 (MMC_INDX(5) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE) -#define MMC_CMD7 (MMC_INDX(7) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD8 (MMC_INDX(8) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD9 (MMC_INDX(9) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE) -#define MMC_CMD11 (MMC_INDX(11) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD12 (MMC_INDX(12) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD13 (MMC_INDX(13) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD16 (MMC_INDX(16) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD17 (MMC_INDX(17) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD18 (MMC_INDX(18) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD20 (MMC_INDX(20) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD23 (MMC_INDX(23) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD24 (MMC_INDX(24) | MMC_CMD_WAIT_RESPONSE) -#define MMC_CMD55 (MMC_INDX(55) | MMC_CMD_WAIT_RESPONSE) -#define MMC_ACMD41 (MMC_INDX(41) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE) - -// Valid responses for CMD1 in eMMC -#define EMMC_CMD1_CAPACITY_LESS_THAN_2GB 0x00FF8080 // Capacity <= 2GB, byte addressing used -#define EMMC_CMD1_CAPACITY_GREATER_THAN_2GB 0x40FF8080 // Capacity > 2GB, 512-byte sector addressing used - -typedef enum _MMC_STATE { - MmcInvalidState = 0, - MmcHwInitializationState, - MmcIdleState, - MmcReadyState, - MmcIdentificationState, - MmcStandByState, - MmcTransferState, - MmcSendingDataState, - MmcReceiveDataState, - MmcProgrammingState, - MmcDisconnectState, -} MMC_STATE; - -/// -/// Forward declaration for EFI_MMC_HOST_PROTOCOL -/// -typedef struct _EFI_MMC_HOST_PROTOCOL EFI_MMC_HOST_PROTOCOL; - -typedef BOOLEAN (EFIAPI *MMC_ISCARDPRESENT) ( - IN EFI_MMC_HOST_PROTOCOL *This - ); - -typedef BOOLEAN (EFIAPI *MMC_ISREADONLY) ( - IN EFI_MMC_HOST_PROTOCOL *This - ); - -typedef EFI_STATUS (EFIAPI *MMC_BUILDDEVICEPATH) ( - IN EFI_MMC_HOST_PROTOCOL *This, - OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath - ); - -typedef EFI_STATUS (EFIAPI *MMC_NOTIFYSTATE) ( - IN EFI_MMC_HOST_PROTOCOL *This, - IN MMC_STATE State - ); - -typedef EFI_STATUS (EFIAPI *MMC_SENDCOMMAND) ( - IN EFI_MMC_HOST_PROTOCOL *This, - IN MMC_CMD Cmd, - IN UINT32 Argument - ); - -typedef EFI_STATUS (EFIAPI *MMC_RECEIVERESPONSE) ( - IN EFI_MMC_HOST_PROTOCOL *This, - IN MMC_RESPONSE_TYPE Type, - IN UINT32 *Buffer - ); - -typedef EFI_STATUS (EFIAPI *MMC_READBLOCKDATA) ( - IN EFI_MMC_HOST_PROTOCOL *This, - IN EFI_LBA Lba, - IN UINTN Length, - OUT UINT32 *Buffer - ); - -typedef EFI_STATUS (EFIAPI *MMC_WRITEBLOCKDATA) ( - IN EFI_MMC_HOST_PROTOCOL *This, - IN EFI_LBA Lba, - IN UINTN Length, - IN UINT32 *Buffer - ); - - -struct _EFI_MMC_HOST_PROTOCOL { - - UINT32 Revision; - MMC_ISCARDPRESENT IsCardPresent; - MMC_ISREADONLY IsReadOnly; - MMC_BUILDDEVICEPATH BuildDevicePath; - - MMC_NOTIFYSTATE NotifyState; - - MMC_SENDCOMMAND SendCommand; - MMC_RECEIVERESPONSE ReceiveResponse; - - MMC_READBLOCKDATA ReadBlockData; - MMC_WRITEBLOCKDATA WriteBlockData; - -}; - -#define MMC_HOST_PROTOCOL_REVISION 0x00010001 // 1.1 - -extern EFI_GUID gEfiMmcHostProtocolGuid; - -#endif - diff --git a/EmbeddedPkg/Include/Protocol/PeCoffLoader.h b/EmbeddedPkg/Include/Protocol/PeCoffLoader.h deleted file mode 100644 index 1f93cefd17..0000000000 --- a/EmbeddedPkg/Include/Protocol/PeCoffLoader.h +++ /dev/null @@ -1,241 +0,0 @@ -/** @file - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
- Portions copyright (c) 2010, 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. - -**/ - -#ifndef __PE_COFF_LOADER_H__ -#define __PE_COFF_LOADER_H__ - -// Needed for PE_COFF_LOADER_IMAGE_CONTEXT -#include - -// B323179B-97FB-477E-B0FE-D88591FA11AB -#define PE_COFF_LOADER_PROTOCOL_GUID \ - { 0xB323179B, 0x97FB, 0x477E, { 0xB0, 0xFE, 0xD8, 0x85, 0x91, 0xFA, 0x11, 0xAB } } - - -typedef struct _PE_COFF_LOADER_PROTOCOL PE_COFF_LOADER_PROTOCOL; - - - -/** - Retrieves information about a PE/COFF image. - - Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize, - DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and - DebugDirectoryEntryRva fields of the ImageContext structure. - If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. - If the PE/COFF image accessed through the ImageRead service in the ImageContext - structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED. - If any errors occur while computing the fields of ImageContext, - then the error status is returned in the ImageError field of ImageContext. - If the image is a TE image, then SectionAlignment is set to 0. - The ImageRead and Handle fields of ImageContext structure must be valid prior - to invoking this service. - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image that needs to be examined by this function. - - @retval RETURN_SUCCESS The information on the PE/COFF image was collected. - @retval RETURN_INVALID_PARAMETER ImageContext is NULL. - @retval RETURN_UNSUPPORTED The PE/COFF image is not supported. - -**/ -typedef -RETURN_STATUS -(EFIAPI *PE_COFF_LOADER_GET_IMAGE_INFO) ( - IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext - ); - - -/** - Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage(). - - If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of - ImageContext as the relocation base address. Otherwise, use the DestinationAddress field - of ImageContext as the relocation base address. The caller must allocate the relocation - fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function. - - The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, - ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, - DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of - the ImageContext structure must be valid prior to invoking this service. - - If ImageContext is NULL, then ASSERT(). - - Note that if the platform does not maintain coherency between the instruction cache(s) and the data - cache(s) in hardware, then the caller is responsible for performing cache maintenance operations - prior to transferring control to a PE/COFF image that is loaded using this library. - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image that is being relocated. - - @retval RETURN_SUCCESS The PE/COFF image was relocated. - Extended status information is in the ImageError field of ImageContext. - @retval RETURN_LOAD_ERROR The image in not a valid PE/COFF image. - Extended status information is in the ImageError field of ImageContext. - @retval RETURN_UNSUPPORTED A relocation record type is not supported. - Extended status information is in the ImageError field of ImageContext. - -**/ -typedef -RETURN_STATUS -(EFIAPI *PE_COFF_LOADER_RELOCATE_IMAGE) ( - IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext - ); - - -/** - Loads a PE/COFF image into memory. - - Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer - specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate - the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function. - The EntryPoint, FixupDataSize, CodeView, PdbPointer and HiiResourceData fields of ImageContext are computed. - The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize, - DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva - fields of the ImageContext structure must be valid prior to invoking this service. - - If ImageContext is NULL, then ASSERT(). - - Note that if the platform does not maintain coherency between the instruction cache(s) and the data - cache(s) in hardware, then the caller is responsible for performing cache maintenance operations - prior to transferring control to a PE/COFF image that is loaded using this library. - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image that is being loaded. - - @retval RETURN_SUCCESS The PE/COFF image was loaded into the buffer specified by - the ImageAddress and ImageSize fields of ImageContext. - Extended status information is in the ImageError field of ImageContext. - @retval RETURN_BUFFER_TOO_SMALL The caller did not provide a large enough buffer. - Extended status information is in the ImageError field of ImageContext. - @retval RETURN_LOAD_ERROR The PE/COFF image is an EFI Runtime image with no relocations. - Extended status information is in the ImageError field of ImageContext. - @retval RETURN_INVALID_PARAMETER The image address is invalid. - Extended status information is in the ImageError field of ImageContext. - -**/ -typedef -RETURN_STATUS -(EFIAPI *PE_COFF_LOADER_LOAD_IMAGE) ( - IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext - ); - - - -/** - Reads contents of a PE/COFF image from a buffer in system memory. - - This is the default implementation of a PE_COFF_LOADER_READ_FILE function - that assumes FileHandle pointer to the beginning of a PE/COFF image. - This function reads contents of the PE/COFF image that starts at the system memory - address specified by FileHandle. The read operation copies ReadSize bytes from the - PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer. - The size of the buffer actually read is returned in ReadSize. - - If FileHandle is NULL, then ASSERT(). - If ReadSize is NULL, then ASSERT(). - If Buffer is NULL, then ASSERT(). - - @param FileHandle Pointer to base of the input stream - @param FileOffset Offset into the PE/COFF image to begin the read operation. - @param ReadSize On input, the size in bytes of the requested read operation. - On output, the number of bytes actually read. - @param Buffer Output buffer that contains the data read from the PE/COFF image. - - @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into - the buffer. -**/ -typedef -RETURN_STATUS -(EFIAPI *PE_COFF_LOADER_READ_FROM_MEMORY) ( - IN VOID *FileHandle, - IN UINTN FileOffset, - IN OUT UINTN *ReadSize, - OUT VOID *Buffer - ); - - - -/** - Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI - runtime. - - This function reapplies relocation fixups to the PE/COFF image specified by ImageBase - and ImageSize so the image will execute correctly when the PE/COFF image is mapped - to the address specified by VirtualImageBase. RelocationData must be identical - to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure - after this PE/COFF image was relocated with PeCoffLoaderRelocateImage(). - - Note that if the platform does not maintain coherency between the instruction cache(s) and the data - cache(s) in hardware, then the caller is responsible for performing cache maintenance operations - prior to transferring control to a PE/COFF image that is loaded using this library. - - @param ImageBase Base address of a PE/COFF image that has been loaded - and relocated into system memory. - @param VirtImageBase The request virtual address that the PE/COFF image is to - be fixed up for. - @param ImageSize The size, in bytes, of the PE/COFF image. - @param RelocationData A pointer to the relocation data that was collected when the PE/COFF - image was relocated using PeCoffLoaderRelocateImage(). - -**/ -typedef -VOID -(EFIAPI *PE_COFF_LOADER_RELOCATE_IMAGE_FOR_RUNTIME) ( - IN PHYSICAL_ADDRESS ImageBase, - IN PHYSICAL_ADDRESS VirtImageBase, - IN UINTN ImageSize, - IN VOID *RelocationData - ); - - - -/** - Unloads a loaded PE/COFF image from memory and releases its taken resource. - Releases any environment specific resources that were allocated when the image - specified by ImageContext was loaded using PeCoffLoaderLoadImage(). - - For NT32 emulator, the PE/COFF image loaded by system needs to release. - For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, - this function can simply return RETURN_SUCCESS. - - If ImageContext is NULL, then ASSERT(). - - @param ImageContext Pointer to the image context structure that describes the PE/COFF - image to be unloaded. - - @retval RETURN_SUCCESS The PE/COFF image was unloaded successfully. -**/ -typedef -RETURN_STATUS -(EFIAPI *PE_COFF_LOADER_UNLOAD_IMAGE) ( - IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext - ); - - -struct _PE_COFF_LOADER_PROTOCOL { - PE_COFF_LOADER_GET_IMAGE_INFO GetImageInfo; - PE_COFF_LOADER_LOAD_IMAGE LoadImage; - PE_COFF_LOADER_RELOCATE_IMAGE RelocateImage; - PE_COFF_LOADER_READ_FROM_MEMORY ReadFromMemory; - PE_COFF_LOADER_RELOCATE_IMAGE_FOR_RUNTIME RelocateImageForRuntime; - PE_COFF_LOADER_UNLOAD_IMAGE UnloadImage; -}; - - -extern EFI_GUID gPeCoffLoaderProtocolGuid; - - -#endif - diff --git a/EmbeddedPkg/Include/Protocol/UsbDevice.h b/EmbeddedPkg/Include/Protocol/UsbDevice.h deleted file mode 100644 index 13a48dda07..0000000000 --- a/EmbeddedPkg/Include/Protocol/UsbDevice.h +++ /dev/null @@ -1,118 +0,0 @@ -/** @file - - Copyright (c) 2013-2014, ARM Ltd. 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. - -**/ - -#ifndef __USB_DEVICE_PROTOCOL_H__ -#define __USB_DEVICE_PROTOCOL_H__ - -#include - -extern EFI_GUID gUsbDeviceProtocolGuid; - -/* - * Note: This Protocol is just the bare minimum for Android Fastboot. It - * only makes sense for devices that only do Bulk Transfers and only have one - * endpoint. - */ - -/* - Callback to be called when data is received. - Buffer is callee-allocated and it's the caller's responsibility to free it with - FreePool. - - @param[in] Size Size in bytes of data. - @param[in] Buffer Pointer to data. -*/ -typedef -VOID -(*USB_DEVICE_RX_CALLBACK) ( - IN UINTN Size, - IN VOID *Buffer - ); - -/* - Callback to be called when the host asks for data by sending an IN token - (excluding during the data stage of a control transfer). - When this function is called, data previously buffered by calling Send() has - been sent. - - @param[in]Endpoint Endpoint index, as specified in endpoint descriptors, of - the endpoint the IN token was sent to. -*/ -typedef -VOID -(*USB_DEVICE_TX_CALLBACK) ( - IN UINT8 EndpointIndex - ); - -/* - Put data in the Tx buffer to be sent on the next IN token. - Don't call this function again until the TxCallback has been called. - - @param[in]Endpoint Endpoint index, as specified in endpoint descriptors, of - the endpoint to send the data from. - @param[in]Size Size in bytes of data. - @param[in]Buffer Pointer to data. - - @retval EFI_SUCCESS The data was queued successfully. - @retval EFI_INVALID_PARAMETER There was an error sending the data. -*/ -typedef -EFI_STATUS -(*USB_DEVICE_SEND) ( - IN UINT8 EndpointIndex, - IN UINTN Size, - IN CONST VOID *Buffer - ); - -/* - Restart the USB peripheral controller and respond to enumeration. - - @param[in] DeviceDescriptor pointer to device descriptor - @param[in] Descriptors Array of pointers to buffers, where - Descriptors[n] contains the response to a - GET_DESCRIPTOR request for configuration n. From - USB Spec section 9.4.3: - "The first interface descriptor follows the - configuration descriptor. The endpoint - descriptors for the first interface follow the - first interface descriptor. If there are - additional interfaces, their interface - descriptor and endpoint descriptors follow the - first interface’s endpoint descriptors". - - The size of each buffer is the TotalLength - member of the Configuration Descriptor. - - The size of the array is - DeviceDescriptor->NumConfigurations. - @param[in]RxCallback See USB_DEVICE_RX_CALLBACK - @param[in]TxCallback See USB_DEVICE_TX_CALLBACK -*/ -typedef -EFI_STATUS -(*USB_DEVICE_START) ( - IN USB_DEVICE_DESCRIPTOR *DeviceDescriptor, - IN VOID **Descriptors, - IN USB_DEVICE_RX_CALLBACK RxCallback, - IN USB_DEVICE_TX_CALLBACK TxCallback - ); - -struct _USB_DEVICE_PROTOCOL { - USB_DEVICE_START Start; - USB_DEVICE_SEND Send; -}; - -typedef struct _USB_DEVICE_PROTOCOL USB_DEVICE_PROTOCOL; - -#endif //ifndef __USB_DEVICE_PROTOCOL_H__ diff --git a/EmbeddedPkg/Include/fdt.h b/EmbeddedPkg/Include/fdt.h deleted file mode 100644 index 0187749f19..0000000000 --- a/EmbeddedPkg/Include/fdt.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef _FDT_H -#define _FDT_H -/* - * libfdt - Flat Device Tree manipulation - * Copyright (C) 2006 David Gibson, IBM Corporation. - * Copyright 2012 Kim Phillips, Freescale Semiconductor. - * - * libfdt is dual licensed: you can use it either under the terms of - * the GPL, or the BSD license, at your option. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - * - * Alternatively, - * - * b) Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ASSEMBLY__ - -struct fdt_header { - fdt32_t magic; /* magic word FDT_MAGIC */ - fdt32_t totalsize; /* total size of DT block */ - fdt32_t off_dt_struct; /* offset to structure */ - fdt32_t off_dt_strings; /* offset to strings */ - fdt32_t off_mem_rsvmap; /* offset to memory reserve map */ - fdt32_t version; /* format version */ - fdt32_t last_comp_version; /* last compatible version */ - - /* version 2 fields below */ - fdt32_t boot_cpuid_phys; /* Which physical CPU id we're - booting on */ - /* version 3 fields below */ - fdt32_t size_dt_strings; /* size of the strings block */ - - /* version 17 fields below */ - fdt32_t size_dt_struct; /* size of the structure block */ -}; - -struct fdt_reserve_entry { - fdt64_t address; - fdt64_t size; -}; - -struct fdt_node_header { - fdt32_t tag; - char name[0]; -}; - -struct fdt_property { - fdt32_t tag; - fdt32_t len; - fdt32_t nameoff; - char data[0]; -}; - -#endif /* !__ASSEMBLY */ - -#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */ -#define FDT_TAGSIZE sizeof(fdt32_t) - -#define FDT_BEGIN_NODE 0x1 /* Start node: full name */ -#define FDT_END_NODE 0x2 /* End node */ -#define FDT_PROP 0x3 /* Property: name off, - size, content */ -#define FDT_NOP 0x4 /* nop */ -#define FDT_END 0x9 - -#define FDT_V1_SIZE (7*sizeof(fdt32_t)) -#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(fdt32_t)) -#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(fdt32_t)) -#define FDT_V16_SIZE FDT_V3_SIZE -#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(fdt32_t)) - -#endif /* _FDT_H */ diff --git a/EmbeddedPkg/Include/libfdt.h b/EmbeddedPkg/Include/libfdt.h deleted file mode 100644 index 212cb995df..0000000000 --- a/EmbeddedPkg/Include/libfdt.h +++ /dev/null @@ -1,1514 +0,0 @@ -#ifndef _LIBFDT_H -#define _LIBFDT_H -/* - * libfdt - Flat Device Tree manipulation - * Copyright (C) 2006 David Gibson, IBM Corporation. - * - * libfdt is dual licensed: you can use it either under the terms of - * the GPL, or the BSD license, at your option. - * - * a) This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - * - * Alternatively, - * - * b) Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#define FDT_FIRST_SUPPORTED_VERSION 0x10 -#define FDT_LAST_SUPPORTED_VERSION 0x11 - -/* Error codes: informative error codes */ -#define FDT_ERR_NOTFOUND 1 - /* FDT_ERR_NOTFOUND: The requested node or property does not exist */ -#define FDT_ERR_EXISTS 2 - /* FDT_ERR_EXISTS: Attemped to create a node or property which - * already exists */ -#define FDT_ERR_NOSPACE 3 - /* FDT_ERR_NOSPACE: Operation needed to expand the device - * tree, but its buffer did not have sufficient space to - * contain the expanded tree. Use fdt_open_into() to move the - * device tree to a buffer with more space. */ - -/* Error codes: codes for bad parameters */ -#define FDT_ERR_BADOFFSET 4 - /* FDT_ERR_BADOFFSET: Function was passed a structure block - * offset which is out-of-bounds, or which points to an - * unsuitable part of the structure for the operation. */ -#define FDT_ERR_BADPATH 5 - /* FDT_ERR_BADPATH: Function was passed a badly formatted path - * (e.g. missing a leading / for a function which requires an - * absolute path) */ -#define FDT_ERR_BADPHANDLE 6 - /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle - * value. phandle values of 0 and -1 are not permitted. */ -#define FDT_ERR_BADSTATE 7 - /* FDT_ERR_BADSTATE: Function was passed an incomplete device - * tree created by the sequential-write functions, which is - * not sufficiently complete for the requested operation. */ - -/* Error codes: codes for bad device tree blobs */ -#define FDT_ERR_TRUNCATED 8 - /* FDT_ERR_TRUNCATED: Structure block of the given device tree - * ends without an FDT_END tag. */ -#define FDT_ERR_BADMAGIC 9 - /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a - * device tree at all - it is missing the flattened device - * tree magic number. */ -#define FDT_ERR_BADVERSION 10 - /* FDT_ERR_BADVERSION: Given device tree has a version which - * can't be handled by the requested operation. For - * read-write functions, this may mean that fdt_open_into() is - * required to convert the tree to the expected version. */ -#define FDT_ERR_BADSTRUCTURE 11 - /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt - * structure block or other serious error (e.g. misnested - * nodes, or subnodes preceding properties). */ -#define FDT_ERR_BADLAYOUT 12 - /* FDT_ERR_BADLAYOUT: For read-write functions, the given - * device tree has it's sub-blocks in an order that the - * function can't handle (memory reserve map, then structure, - * then strings). Use fdt_open_into() to reorganize the tree - * into a form suitable for the read-write operations. */ - -/* "Can't happen" error indicating a bug in libfdt */ -#define FDT_ERR_INTERNAL 13 - /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion. - * Should never be returned, if it is, it indicates a bug in - * libfdt itself. */ - -#define FDT_ERR_MAX 13 - -/**********************************************************************/ -/* Low-level functions (you probably don't need these) */ -/**********************************************************************/ - -const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen); -static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) -{ - return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); -} - -uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset); - -/**********************************************************************/ -/* Traversal functions */ -/**********************************************************************/ - -int fdt_next_node(const void *fdt, int offset, int *depth); - -/** - * fdt_first_subnode() - get offset of first direct subnode - * - * @fdt: FDT blob - * @offset: Offset of node to check - * @return offset of first subnode, or -FDT_ERR_NOTFOUND if there is none - */ -int fdt_first_subnode(const void *fdt, int offset); - -/** - * fdt_next_subnode() - get offset of next direct subnode - * - * After first calling fdt_first_subnode(), call this function repeatedly to - * get direct subnodes of a parent node. - * - * @fdt: FDT blob - * @offset: Offset of previous subnode - * @return offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more - * subnodes - */ -int fdt_next_subnode(const void *fdt, int offset); - -/**********************************************************************/ -/* General functions */ -/**********************************************************************/ - -#define fdt_get_header(fdt, field) \ - (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field)) -#define fdt_magic(fdt) (fdt_get_header(fdt, magic)) -#define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize)) -#define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct)) -#define fdt_off_dt_strings(fdt) (fdt_get_header(fdt, off_dt_strings)) -#define fdt_off_mem_rsvmap(fdt) (fdt_get_header(fdt, off_mem_rsvmap)) -#define fdt_version(fdt) (fdt_get_header(fdt, version)) -#define fdt_last_comp_version(fdt) (fdt_get_header(fdt, last_comp_version)) -#define fdt_boot_cpuid_phys(fdt) (fdt_get_header(fdt, boot_cpuid_phys)) -#define fdt_size_dt_strings(fdt) (fdt_get_header(fdt, size_dt_strings)) -#define fdt_size_dt_struct(fdt) (fdt_get_header(fdt, size_dt_struct)) - -#define __fdt_set_hdr(name) \ - static inline void fdt_set_##name(void *fdt, uint32_t val) \ - { \ - struct fdt_header *fdth = (struct fdt_header*)fdt; \ - fdth->name = cpu_to_fdt32(val); \ - } -__fdt_set_hdr(magic); -__fdt_set_hdr(totalsize); -__fdt_set_hdr(off_dt_struct); -__fdt_set_hdr(off_dt_strings); -__fdt_set_hdr(off_mem_rsvmap); -__fdt_set_hdr(version); -__fdt_set_hdr(last_comp_version); -__fdt_set_hdr(boot_cpuid_phys); -__fdt_set_hdr(size_dt_strings); -__fdt_set_hdr(size_dt_struct); -#undef __fdt_set_hdr - -/** - * fdt_check_header - sanity check a device tree or possible device tree - * @fdt: pointer to data which might be a flattened device tree - * - * fdt_check_header() checks that the given buffer contains what - * appears to be a flattened device tree with sane information in its - * header. - * - * returns: - * 0, if the buffer appears to contain a valid device tree - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, standard meanings, as above - */ -int fdt_check_header(const void *fdt); - -/** - * fdt_move - move a device tree around in memory - * @fdt: pointer to the device tree to move - * @buf: pointer to memory where the device is to be moved - * @bufsize: size of the memory space at buf - * - * fdt_move() relocates, if possible, the device tree blob located at - * fdt to the buffer at buf of size bufsize. The buffer may overlap - * with the existing device tree blob at fdt. Therefore, - * fdt_move(fdt, fdt, fdt_totalsize(fdt)) - * should always succeed. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, standard meanings - */ -int fdt_move(const void *fdt, void *buf, int bufsize); - -/**********************************************************************/ -/* Read-only functions */ -/**********************************************************************/ - -/** - * fdt_string - retrieve a string from the strings block of a device tree - * @fdt: pointer to the device tree blob - * @stroffset: offset of the string within the strings block (native endian) - * - * fdt_string() retrieves a pointer to a single string from the - * strings block of the device tree blob at fdt. - * - * returns: - * a pointer to the string, on success - * NULL, if stroffset is out of bounds - */ -const char *fdt_string(const void *fdt, int stroffset); - -/** - * fdt_num_mem_rsv - retrieve the number of memory reserve map entries - * @fdt: pointer to the device tree blob - * - * Returns the number of entries in the device tree blob's memory - * reservation map. This does not include the terminating 0,0 entry - * or any other (0,0) entries reserved for expansion. - * - * returns: - * the number of entries - */ -int fdt_num_mem_rsv(const void *fdt); - -/** - * fdt_get_mem_rsv - retrieve one memory reserve map entry - * @fdt: pointer to the device tree blob - * @address, @size: pointers to 64-bit variables - * - * On success, *address and *size will contain the address and size of - * the n-th reserve map entry from the device tree blob, in - * native-endian format. - * - * returns: - * 0, on success - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, standard meanings - */ -int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size); - -/** - * fdt_subnode_offset_namelen - find a subnode based on substring - * @fdt: pointer to the device tree blob - * @parentoffset: structure block offset of a node - * @name: name of the subnode to locate - * @namelen: number of characters of name to consider - * - * Identical to fdt_subnode_offset(), but only examine the first - * namelen characters of name for matching the subnode name. This is - * useful for finding subnodes based on a portion of a larger string, - * such as a full path. - */ -int fdt_subnode_offset_namelen(const void *fdt, int parentoffset, - const char *name, int namelen); -/** - * fdt_subnode_offset - find a subnode of a given node - * @fdt: pointer to the device tree blob - * @parentoffset: structure block offset of a node - * @name: name of the subnode to locate - * - * fdt_subnode_offset() finds a subnode of the node at structure block - * offset parentoffset with the given name. name may include a unit - * address, in which case fdt_subnode_offset() will find the subnode - * with that unit address, or the unit address may be omitted, in - * which case fdt_subnode_offset() will find an arbitrary subnode - * whose name excluding unit address matches the given name. - * - * returns: - * structure block offset of the requested subnode (>=0), on success - * -FDT_ERR_NOTFOUND, if the requested subnode does not exist - * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings. - */ -int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name); - -/** - * fdt_path_offset - find a tree node by its full path - * @fdt: pointer to the device tree blob - * @path: full path of the node to locate - * - * fdt_path_offset() finds a node of a given path in the device tree. - * Each path component may omit the unit address portion, but the - * results of this are undefined if any such path component is - * ambiguous (that is if there are multiple nodes at the relevant - * level matching the given component, differentiated only by unit - * address). - * - * returns: - * structure block offset of the node with the requested path (>=0), on success - * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid - * -FDT_ERR_NOTFOUND, if the requested node does not exist - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings. - */ -int fdt_path_offset(const void *fdt, const char *path); - -/** - * fdt_get_name - retrieve the name of a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: structure block offset of the starting node - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_get_name() retrieves the name (including unit address) of the - * device tree node at structure block offset nodeoffset. If lenp is - * non-NULL, the length of this name is also returned, in the integer - * pointed to by lenp. - * - * returns: - * pointer to the node's name, on success - * If lenp is non-NULL, *lenp contains the length of that name (>=0) - * NULL, on error - * if lenp is non-NULL *lenp contains an error code (<0): - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, standard meanings - */ -const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp); - -/** - * fdt_first_property_offset - find the offset of a node's first property - * @fdt: pointer to the device tree blob - * @nodeoffset: structure block offset of a node - * - * fdt_first_property_offset() finds the first property of the node at - * the given structure block offset. - * - * returns: - * structure block offset of the property (>=0), on success - * -FDT_ERR_NOTFOUND, if the requested node has no properties - * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings. - */ -int fdt_first_property_offset(const void *fdt, int nodeoffset); - -/** - * fdt_next_property_offset - step through a node's properties - * @fdt: pointer to the device tree blob - * @offset: structure block offset of a property - * - * fdt_next_property_offset() finds the property immediately after the - * one at the given structure block offset. This will be a property - * of the same node as the given property. - * - * returns: - * structure block offset of the next property (>=0), on success - * -FDT_ERR_NOTFOUND, if the given property is the last in its node - * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings. - */ -int fdt_next_property_offset(const void *fdt, int offset); - -/** - * fdt_get_property_by_offset - retrieve the property at a given offset - * @fdt: pointer to the device tree blob - * @offset: offset of the property to retrieve - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_get_property_by_offset() retrieves a pointer to the - * fdt_property structure within the device tree blob at the given - * offset. If lenp is non-NULL, the length of the property value is - * also returned, in the integer pointed to by lenp. - * - * returns: - * pointer to the structure representing the property - * if lenp is non-NULL, *lenp contains the length of the property - * value (>=0) - * NULL, on error - * if lenp is non-NULL, *lenp contains an error code (<0): - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -const struct fdt_property *fdt_get_property_by_offset(const void *fdt, - int offset, - int *lenp); - -/** - * fdt_get_property_namelen - find a property based on substring - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to find - * @name: name of the property to find - * @namelen: number of characters of name to consider - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * Identical to fdt_get_property_namelen(), but only examine the first - * namelen characters of name for matching the property name. - */ -const struct fdt_property *fdt_get_property_namelen(const void *fdt, - int nodeoffset, - const char *name, - int namelen, int *lenp); - -/** - * fdt_get_property - find a given property in a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to find - * @name: name of the property to find - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_get_property() retrieves a pointer to the fdt_property - * structure within the device tree blob corresponding to the property - * named 'name' of the node at offset nodeoffset. If lenp is - * non-NULL, the length of the property value is also returned, in the - * integer pointed to by lenp. - * - * returns: - * pointer to the structure representing the property - * if lenp is non-NULL, *lenp contains the length of the property - * value (>=0) - * NULL, on error - * if lenp is non-NULL, *lenp contains an error code (<0): - * -FDT_ERR_NOTFOUND, node does not have named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset, - const char *name, int *lenp); -static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset, - const char *name, - int *lenp) -{ - return (struct fdt_property *)(uintptr_t) - fdt_get_property(fdt, nodeoffset, name, lenp); -} - -/** - * fdt_getprop_by_offset - retrieve the value of a property at a given offset - * @fdt: pointer to the device tree blob - * @ffset: offset of the property to read - * @namep: pointer to a string variable (will be overwritten) or NULL - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_getprop_by_offset() retrieves a pointer to the value of the - * property at structure block offset 'offset' (this will be a pointer - * to within the device blob itself, not a copy of the value). If - * lenp is non-NULL, the length of the property value is also - * returned, in the integer pointed to by lenp. If namep is non-NULL, - * the property's namne will also be returned in the char * pointed to - * by namep (this will be a pointer to within the device tree's string - * block, not a new copy of the name). - * - * returns: - * pointer to the property's value - * if lenp is non-NULL, *lenp contains the length of the property - * value (>=0) - * if namep is non-NULL *namep contiains a pointer to the property - * name. - * NULL, on error - * if lenp is non-NULL, *lenp contains an error code (<0): - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -const void *fdt_getprop_by_offset(const void *fdt, int offset, - const char **namep, int *lenp); - -/** - * fdt_getprop_namelen - get property value based on substring - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to find - * @name: name of the property to find - * @namelen: number of characters of name to consider - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * Identical to fdt_getprop(), but only examine the first namelen - * characters of name for matching the property name. - */ -const void *fdt_getprop_namelen(const void *fdt, int nodeoffset, - const char *name, int namelen, int *lenp); - -/** - * fdt_getprop - retrieve the value of a given property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to find - * @name: name of the property to find - * @lenp: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_getprop() retrieves a pointer to the value of the property - * named 'name' of the node at offset nodeoffset (this will be a - * pointer to within the device blob itself, not a copy of the value). - * If lenp is non-NULL, the length of the property value is also - * returned, in the integer pointed to by lenp. - * - * returns: - * pointer to the property's value - * if lenp is non-NULL, *lenp contains the length of the property - * value (>=0) - * NULL, on error - * if lenp is non-NULL, *lenp contains an error code (<0): - * -FDT_ERR_NOTFOUND, node does not have named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -const void *fdt_getprop(const void *fdt, int nodeoffset, - const char *name, int *lenp); -static inline void *fdt_getprop_w(void *fdt, int nodeoffset, - const char *name, int *lenp) -{ - return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp); -} - -/** - * fdt_get_phandle - retrieve the phandle of a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: structure block offset of the node - * - * fdt_get_phandle() retrieves the phandle of the device tree node at - * structure block offset nodeoffset. - * - * returns: - * the phandle of the node at nodeoffset, on success (!= 0, != -1) - * 0, if the node has no phandle, or another error occurs - */ -uint32_t fdt_get_phandle(const void *fdt, int nodeoffset); - -/** - * fdt_get_alias_namelen - get alias based on substring - * @fdt: pointer to the device tree blob - * @name: name of the alias th look up - * @namelen: number of characters of name to consider - * - * Identical to fdt_get_alias(), but only examine the first namelen - * characters of name for matching the alias name. - */ -const char *fdt_get_alias_namelen(const void *fdt, - const char *name, int namelen); - -/** - * fdt_get_alias - retreive the path referenced by a given alias - * @fdt: pointer to the device tree blob - * @name: name of the alias th look up - * - * fdt_get_alias() retrieves the value of a given alias. That is, the - * value of the property named 'name' in the node /aliases. - * - * returns: - * a pointer to the expansion of the alias named 'name', if it exists - * NULL, if the given alias or the /aliases node does not exist - */ -const char *fdt_get_alias(const void *fdt, const char *name); - -/** - * fdt_get_path - determine the full path of a node - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose path to find - * @buf: character buffer to contain the returned path (will be overwritten) - * @buflen: size of the character buffer at buf - * - * fdt_get_path() computes the full path of the node at offset - * nodeoffset, and records that path in the buffer at buf. - * - * NOTE: This function is expensive, as it must scan the device tree - * structure from the start to nodeoffset. - * - * returns: - * 0, on success - * buf contains the absolute path of the node at - * nodeoffset, as a NUL-terminated string. - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1) - * characters and will not fit in the given buffer. - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen); - -/** - * fdt_supernode_atdepth_offset - find a specific ancestor of a node - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose parent to find - * @supernodedepth: depth of the ancestor to find - * @nodedepth: pointer to an integer variable (will be overwritten) or NULL - * - * fdt_supernode_atdepth_offset() finds an ancestor of the given node - * at a specific depth from the root (where the root itself has depth - * 0, its immediate subnodes depth 1 and so forth). So - * fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL); - * will always return 0, the offset of the root node. If the node at - * nodeoffset has depth D, then: - * fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL); - * will return nodeoffset itself. - * - * NOTE: This function is expensive, as it must scan the device tree - * structure from the start to nodeoffset. - * - * returns: - - * structure block offset of the node at node offset's ancestor - * of depth supernodedepth (>=0), on success - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag -* -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset, - int supernodedepth, int *nodedepth); - -/** - * fdt_node_depth - find the depth of a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose parent to find - * - * fdt_node_depth() finds the depth of a given node. The root node - * has depth 0, its immediate subnodes depth 1 and so forth. - * - * NOTE: This function is expensive, as it must scan the device tree - * structure from the start to nodeoffset. - * - * returns: - * depth of the node at nodeoffset (>=0), on success - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_node_depth(const void *fdt, int nodeoffset); - -/** - * fdt_parent_offset - find the parent of a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose parent to find - * - * fdt_parent_offset() locates the parent node of a given node (that - * is, it finds the offset of the node which contains the node at - * nodeoffset as a subnode). - * - * NOTE: This function is expensive, as it must scan the device tree - * structure from the start to nodeoffset, *twice*. - * - * returns: - * structure block offset of the parent of the node at nodeoffset - * (>=0), on success - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_parent_offset(const void *fdt, int nodeoffset); - -/** - * fdt_node_offset_by_prop_value - find nodes with a given property value - * @fdt: pointer to the device tree blob - * @startoffset: only find nodes after this offset - * @propname: property name to check - * @propval: property value to search for - * @proplen: length of the value in propval - * - * fdt_node_offset_by_prop_value() returns the offset of the first - * node after startoffset, which has a property named propname whose - * value is of length proplen and has value equal to propval; or if - * startoffset is -1, the very first such node in the tree. - * - * To iterate through all nodes matching the criterion, the following - * idiom can be used: - * offset = fdt_node_offset_by_prop_value(fdt, -1, propname, - * propval, proplen); - * while (offset != -FDT_ERR_NOTFOUND) { - * // other code here - * offset = fdt_node_offset_by_prop_value(fdt, offset, propname, - * propval, proplen); - * } - * - * Note the -1 in the first call to the function, if 0 is used here - * instead, the function will never locate the root node, even if it - * matches the criterion. - * - * returns: - * structure block offset of the located node (>= 0, >startoffset), - * on success - * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the - * tree after startoffset - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_node_offset_by_prop_value(const void *fdt, int startoffset, - const char *propname, - const void *propval, int proplen); - -/** - * fdt_node_offset_by_phandle - find the node with a given phandle - * @fdt: pointer to the device tree blob - * @phandle: phandle value - * - * fdt_node_offset_by_phandle() returns the offset of the node - * which has the given phandle value. If there is more than one node - * in the tree with the given phandle (an invalid tree), results are - * undefined. - * - * returns: - * structure block offset of the located node (>= 0), on success - * -FDT_ERR_NOTFOUND, no node with that phandle exists - * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1) - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle); - -/** - * fdt_node_check_compatible: check a node's compatible property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of a tree node - * @compatible: string to match against - * - * - * fdt_node_check_compatible() returns 0 if the given node contains a - * 'compatible' property with the given string as one of its elements, - * it returns non-zero otherwise, or on error. - * - * returns: - * 0, if the node has a 'compatible' property listing the given string - * 1, if the node has a 'compatible' property, but it does not list - * the given string - * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property - * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_node_check_compatible(const void *fdt, int nodeoffset, - const char *compatible); - -/** - * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value - * @fdt: pointer to the device tree blob - * @startoffset: only find nodes after this offset - * @compatible: 'compatible' string to match against - * - * fdt_node_offset_by_compatible() returns the offset of the first - * node after startoffset, which has a 'compatible' property which - * lists the given compatible string; or if startoffset is -1, the - * very first such node in the tree. - * - * To iterate through all nodes matching the criterion, the following - * idiom can be used: - * offset = fdt_node_offset_by_compatible(fdt, -1, compatible); - * while (offset != -FDT_ERR_NOTFOUND) { - * // other code here - * offset = fdt_node_offset_by_compatible(fdt, offset, compatible); - * } - * - * Note the -1 in the first call to the function, if 0 is used here - * instead, the function will never locate the root node, even if it - * matches the criterion. - * - * returns: - * structure block offset of the located node (>= 0, >startoffset), - * on success - * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the - * tree after startoffset - * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, standard meanings - */ -int fdt_node_offset_by_compatible(const void *fdt, int startoffset, - const char *compatible); - -/** - * fdt_stringlist_contains - check a string list property for a string - * @strlist: Property containing a list of strings to check - * @listlen: Length of property - * @str: String to search for - * - * This is a utility function provided for convenience. The list contains - * one or more strings, each terminated by \0, as is found in a device tree - * "compatible" property. - * - * @return: 1 if the string is found in the list, 0 not found, or invalid list - */ -int fdt_stringlist_contains(const char *strlist, int listlen, const char *str); - -/**********************************************************************/ -/* Write-in-place functions */ -/**********************************************************************/ - -/** - * fdt_setprop_inplace - change a property's value, but not its size - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: pointer to data to replace the property value with - * @len: length of the property value - * - * fdt_setprop_inplace() replaces the value of a given property with - * the data in val, of length len. This function cannot change the - * size of a property, and so will only work if len is equal to the - * current length of the property. - * - * This function will alter only the bytes in the blob which contain - * the given property value, and will not alter or move any other part - * of the tree. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, if len is not equal to the property's current length - * -FDT_ERR_NOTFOUND, node does not have the named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, - const void *val, int len); - -/** - * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 32-bit integer value to replace the property with - * - * fdt_setprop_inplace_u32() replaces the value of a given property - * with the 32-bit integer value in val, converting val to big-endian - * if necessary. This function cannot change the size of a property, - * and so will only work if the property already exists and has length - * 4. - * - * This function will alter only the bytes in the blob which contain - * the given property value, and will not alter or move any other part - * of the tree. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, if the property's length is not equal to 4 - * -FDT_ERR_NOTFOUND, node does not have the named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset, - const char *name, uint32_t val) -{ - fdt32_t tmp = cpu_to_fdt32(val); - return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 64-bit integer value to replace the property with - * - * fdt_setprop_inplace_u64() replaces the value of a given property - * with the 64-bit integer value in val, converting val to big-endian - * if necessary. This function cannot change the size of a property, - * and so will only work if the property already exists and has length - * 8. - * - * This function will alter only the bytes in the blob which contain - * the given property value, and will not alter or move any other part - * of the tree. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, if the property's length is not equal to 8 - * -FDT_ERR_NOTFOUND, node does not have the named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset, - const char *name, uint64_t val) -{ - fdt64_t tmp = cpu_to_fdt64(val); - return fdt_setprop_inplace(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_setprop_inplace_cell - change the value of a single-cell property - * - * This is an alternative name for fdt_setprop_inplace_u32() - */ -static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset, - const char *name, uint32_t val) -{ - return fdt_setprop_inplace_u32(fdt, nodeoffset, name, val); -} - -/** - * fdt_nop_property - replace a property with nop tags - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to nop - * @name: name of the property to nop - * - * fdt_nop_property() will replace a given property's representation - * in the blob with FDT_NOP tags, effectively removing it from the - * tree. - * - * This function will alter only the bytes in the blob which contain - * the property, and will not alter or move any other part of the - * tree. - * - * returns: - * 0, on success - * -FDT_ERR_NOTFOUND, node does not have the named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_nop_property(void *fdt, int nodeoffset, const char *name); - -/** - * fdt_nop_node - replace a node (subtree) with nop tags - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node to nop - * - * fdt_nop_node() will replace a given node's representation in the - * blob, including all its subnodes, if any, with FDT_NOP tags, - * effectively removing it from the tree. - * - * This function will alter only the bytes in the blob which contain - * the node and its properties and subnodes, and will not alter or - * move any other part of the tree. - * - * returns: - * 0, on success - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_nop_node(void *fdt, int nodeoffset); - -/**********************************************************************/ -/* Sequential write functions */ -/**********************************************************************/ - -int fdt_create(void *buf, int bufsize); -int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size); -int fdt_finish_reservemap(void *fdt); -int fdt_begin_node(void *fdt, const char *name); -int fdt_property(void *fdt, const char *name, const void *val, int len); -static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val) -{ - fdt32_t tmp = cpu_to_fdt32(val); - return fdt_property(fdt, name, &tmp, sizeof(tmp)); -} -static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val) -{ - fdt64_t tmp = cpu_to_fdt64(val); - return fdt_property(fdt, name, &tmp, sizeof(tmp)); -} -static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val) -{ - return fdt_property_u32(fdt, name, val); -} -#define fdt_property_string(fdt, name, str) \ - fdt_property(fdt, name, str, strlen(str)+1) -int fdt_end_node(void *fdt); -int fdt_finish(void *fdt); - -/**********************************************************************/ -/* Read-write functions */ -/**********************************************************************/ - -int fdt_create_empty_tree(void *buf, int bufsize); -int fdt_open_into(const void *fdt, void *buf, int bufsize); -int fdt_pack(void *fdt); - -/** - * fdt_add_mem_rsv - add one memory reserve map entry - * @fdt: pointer to the device tree blob - * @address, @size: 64-bit values (native endian) - * - * Adds a reserve map entry to the given blob reserving a region at - * address address of length size. - * - * This function will insert data into the reserve map and will - * therefore change the indexes of some entries in the table. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new reservation entry - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size); - -/** - * fdt_del_mem_rsv - remove a memory reserve map entry - * @fdt: pointer to the device tree blob - * @n: entry to remove - * - * fdt_del_mem_rsv() removes the n-th memory reserve map entry from - * the blob. - * - * This function will delete data from the reservation table and will - * therefore change the indexes of some entries in the table. - * - * returns: - * 0, on success - * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there - * are less than n+1 reserve map entries) - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_del_mem_rsv(void *fdt, int n); - -/** - * fdt_set_name - change the name of a given node - * @fdt: pointer to the device tree blob - * @nodeoffset: structure block offset of a node - * @name: name to give the node - * - * fdt_set_name() replaces the name (including unit address, if any) - * of the given node with the given string. NOTE: this function can't - * efficiently check if the new name is unique amongst the given - * node's siblings; results are undefined if this function is invoked - * with a name equal to one of the given node's siblings. - * - * This function may insert or delete data from the blob, and will - * therefore change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob - * to contain the new name - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, standard meanings - */ -int fdt_set_name(void *fdt, int nodeoffset, const char *name); - -/** - * fdt_setprop - create or change a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: pointer to data to set the property value to - * @len: length of the property value - * - * fdt_setprop() sets the value of the named property in the given - * node to the given value and length, creating the property if it - * does not already exist. - * - * This function may insert or delete data from the blob, and will - * therefore change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_setprop(void *fdt, int nodeoffset, const char *name, - const void *val, int len); - -/** - * fdt_setprop_u32 - set a property to a 32-bit integer - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 32-bit integer value for the property (native endian) - * - * fdt_setprop_u32() sets the value of the named property in the given - * node to the given 32-bit integer value (converting to big-endian if - * necessary), or creates a new property with that value if it does - * not already exist. - * - * This function may insert or delete data from the blob, and will - * therefore change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name, - uint32_t val) -{ - fdt32_t tmp = cpu_to_fdt32(val); - return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_setprop_u64 - set a property to a 64-bit integer - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 64-bit integer value for the property (native endian) - * - * fdt_setprop_u64() sets the value of the named property in the given - * node to the given 64-bit integer value (converting to big-endian if - * necessary), or creates a new property with that value if it does - * not already exist. - * - * This function may insert or delete data from the blob, and will - * therefore change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name, - uint64_t val) -{ - fdt64_t tmp = cpu_to_fdt64(val); - return fdt_setprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_setprop_cell - set a property to a single cell value - * - * This is an alternative name for fdt_setprop_u32() - */ -static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name, - uint32_t val) -{ - return fdt_setprop_u32(fdt, nodeoffset, name, val); -} - -/** - * fdt_setprop_string - set a property to a string value - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @str: string value for the property - * - * fdt_setprop_string() sets the value of the named property in the - * given node to the given string value (using the length of the - * string to determine the new length of the property), or creates a - * new property with that value if it does not already exist. - * - * This function may insert or delete data from the blob, and will - * therefore change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -#define fdt_setprop_string(fdt, nodeoffset, name, str) \ - fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) - -/** - * fdt_appendprop - append to or create a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to append to - * @val: pointer to data to append to the property value - * @len: length of the data to append to the property value - * - * fdt_appendprop() appends the value to the named property in the - * given node, creating the property if it does not already exist. - * - * This function may insert data into the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_appendprop(void *fdt, int nodeoffset, const char *name, - const void *val, int len); - -/** - * fdt_appendprop_u32 - append a 32-bit integer value to a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 32-bit integer value to append to the property (native endian) - * - * fdt_appendprop_u32() appends the given 32-bit integer value - * (converting to big-endian if necessary) to the value of the named - * property in the given node, or creates a new property with that - * value if it does not already exist. - * - * This function may insert data into the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_appendprop_u32(void *fdt, int nodeoffset, - const char *name, uint32_t val) -{ - fdt32_t tmp = cpu_to_fdt32(val); - return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_appendprop_u64 - append a 64-bit integer value to a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @val: 64-bit integer value to append to the property (native endian) - * - * fdt_appendprop_u64() appends the given 64-bit integer value - * (converting to big-endian if necessary) to the value of the named - * property in the given node, or creates a new property with that - * value if it does not already exist. - * - * This function may insert data into the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -static inline int fdt_appendprop_u64(void *fdt, int nodeoffset, - const char *name, uint64_t val) -{ - fdt64_t tmp = cpu_to_fdt64(val); - return fdt_appendprop(fdt, nodeoffset, name, &tmp, sizeof(tmp)); -} - -/** - * fdt_appendprop_cell - append a single cell value to a property - * - * This is an alternative name for fdt_appendprop_u32() - */ -static inline int fdt_appendprop_cell(void *fdt, int nodeoffset, - const char *name, uint32_t val) -{ - return fdt_appendprop_u32(fdt, nodeoffset, name, val); -} - -/** - * fdt_appendprop_string - append a string to a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to change - * @name: name of the property to change - * @str: string value to append to the property - * - * fdt_appendprop_string() appends the given string to the value of - * the named property in the given node, or creates a new property - * with that value if it does not already exist. - * - * This function may insert data into the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to - * contain the new property value - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_TRUNCATED, standard meanings - */ -#define fdt_appendprop_string(fdt, nodeoffset, name, str) \ - fdt_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) - -/** - * fdt_delprop - delete a property - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node whose property to nop - * @name: name of the property to nop - * - * fdt_del_property() will delete the given property. - * - * This function will delete data from the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_NOTFOUND, node does not have the named property - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_delprop(void *fdt, int nodeoffset, const char *name); - -/** - * fdt_add_subnode_namelen - creates a new node based on substring - * @fdt: pointer to the device tree blob - * @parentoffset: structure block offset of a node - * @name: name of the subnode to locate - * @namelen: number of characters of name to consider - * - * Identical to fdt_add_subnode(), but use only the first namelen - * characters of name as the name of the new node. This is useful for - * creating subnodes based on a portion of a larger string, such as a - * full path. - */ -int fdt_add_subnode_namelen(void *fdt, int parentoffset, - const char *name, int namelen); - -/** - * fdt_add_subnode - creates a new node - * @fdt: pointer to the device tree blob - * @parentoffset: structure block offset of a node - * @name: name of the subnode to locate - * - * fdt_add_subnode() creates a new node as a subnode of the node at - * structure block offset parentoffset, with the given name (which - * should include the unit address, if any). - * - * This function will insert data into the blob, and will therefore - * change the offsets of some existing nodes. - - * returns: - * structure block offset of the created nodeequested subnode (>=0), on success - * -FDT_ERR_NOTFOUND, if the requested subnode does not exist - * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag - * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of - * the given name - * -FDT_ERR_NOSPACE, if there is insufficient free space in the - * blob to contain the new node - * -FDT_ERR_NOSPACE - * -FDT_ERR_BADLAYOUT - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings. - */ -int fdt_add_subnode(void *fdt, int parentoffset, const char *name); - -/** - * fdt_del_node - delete a node (subtree) - * @fdt: pointer to the device tree blob - * @nodeoffset: offset of the node to nop - * - * fdt_del_node() will remove the given node, including all its - * subnodes if any, from the blob. - * - * This function will delete data from the blob, and will therefore - * change the offsets of some existing nodes. - * - * returns: - * 0, on success - * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag - * -FDT_ERR_BADLAYOUT, - * -FDT_ERR_BADMAGIC, - * -FDT_ERR_BADVERSION, - * -FDT_ERR_BADSTATE, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -int fdt_del_node(void *fdt, int nodeoffset); - -/**********************************************************************/ -/* Debugging / informational functions */ -/**********************************************************************/ - -const char *fdt_strerror(int errval); - -#endif /* _LIBFDT_H */ diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_env.h deleted file mode 100644 index 3e24db9409..0000000000 --- a/EmbeddedPkg/Include/libfdt_env.h +++ /dev/null @@ -1,81 +0,0 @@ -/** @file -* -* Copyright (c) 2011-2014, ARM Limited. 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. -* -**/ - -#ifndef _LIBFDT_ENV_H -#define _LIBFDT_ENV_H - -#include -#include - -typedef UINT16 fdt16_t; -typedef UINT32 fdt32_t; -typedef UINT64 fdt64_t; - -typedef UINT8 uint8_t; -typedef UINT16 uint16_t; -typedef UINT32 uint32_t; -typedef UINT64 uint64_t; -typedef UINTN uintptr_t; -typedef UINTN size_t; - -static inline uint16_t fdt16_to_cpu(fdt16_t x) -{ - return SwapBytes16 (x); -} -#define cpu_to_fdt16(x) fdt16_to_cpu(x) - -static inline uint32_t fdt32_to_cpu(fdt32_t x) -{ - return SwapBytes32 (x); -} -#define cpu_to_fdt32(x) fdt32_to_cpu(x) - -static inline uint64_t fdt64_to_cpu(fdt64_t x) -{ - return SwapBytes64 (x); -} -#define cpu_to_fdt64(x) fdt64_to_cpu(x) - -static inline void* memcpy(void* dest, const void* src, size_t len) { - return CopyMem (dest, src, len); -} - -static inline void *memmove(void *dest, const void *src, size_t n) { - return CopyMem (dest, src, n); -} - -static inline void *memset(void *s, int c, size_t n) { - return SetMem (s, n, c); -} - -static inline int memcmp(const void* dest, const void* src, int len) { - return CompareMem (dest, src, len); -} - -static inline void *memchr(const void *s, int c, size_t n) { - return ScanMem8 (s, n, c); -} - -static inline size_t strlen (const char* str) { - return AsciiStrLen (str); -} - -static inline char *strchr(const char *s, int c) { - char pattern[2]; - pattern[0] = c; - pattern[1] = 0; - return AsciiStrStr (s, pattern); -} - -#endif /* _LIBFDT_ENV_H */ -- cgit v1.2.3