summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Include
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:56 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commite7108d0e9655b1795c94ac372b0449f28dd907df (patch)
treeb153716589979b9e42e9b85281ff8b7511ba272f /EmbeddedPkg/Include
parent731c67e1d77b7741a91762d17659fc9fbcb9e305 (diff)
downloadedk2-e7108d0e9655b1795c94ac372b0449f28dd907df.tar.gz
edk2-e7108d0e9655b1795c94ac372b0449f28dd907df.tar.bz2
edk2-e7108d0e9655b1795c94ac372b0449f28dd907df.zip
EmbeddedPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmbeddedPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
Diffstat (limited to 'EmbeddedPkg/Include')
-rw-r--r--EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h2
-rw-r--r--EmbeddedPkg/Include/Guid/DtPlatformDefaultDtbFile.h2
-rw-r--r--EmbeddedPkg/Include/Guid/DtPlatformFormSet.h2
-rw-r--r--EmbeddedPkg/Include/Guid/ExtractSection.h10
-rw-r--r--EmbeddedPkg/Include/Guid/Fdt.h4
-rw-r--r--EmbeddedPkg/Include/Guid/FdtHob.h4
-rw-r--r--EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h3
-rw-r--r--EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h3
-rw-r--r--EmbeddedPkg/Include/Library/AcpiLib.h24
-rw-r--r--EmbeddedPkg/Include/Library/AndroidBootImgLib.h41
-rw-r--r--EmbeddedPkg/Include/Library/DebugAgentTimerLib.h6
-rw-r--r--EmbeddedPkg/Include/Library/DmaLib.h40
-rw-r--r--EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h4
-rw-r--r--EmbeddedPkg/Include/Library/EfiFileLib.h122
-rw-r--r--EmbeddedPkg/Include/Library/EfiResetSystemLib.h12
-rw-r--r--EmbeddedPkg/Include/Library/FdtLoadLib.h4
-rw-r--r--EmbeddedPkg/Include/Library/GdbSerialLib.h17
-rw-r--r--EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h123
-rw-r--r--EmbeddedPkg/Include/Library/NorFlashInfoLib.h49
-rw-r--r--EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h2
-rw-r--r--EmbeddedPkg/Include/Library/PrePiLib.h156
-rw-r--r--EmbeddedPkg/Include/Library/RealTimeClockLib.h29
-rw-r--r--EmbeddedPkg/Include/Library/TimeBaseLib.h16
-rw-r--r--EmbeddedPkg/Include/Ppi/EmbeddedGpio.h39
-rw-r--r--EmbeddedPkg/Include/Protocol/AndroidBootImg.h12
-rw-r--r--EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h28
-rw-r--r--EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h20
-rw-r--r--EmbeddedPkg/Include/Protocol/EmbeddedDevice.h23
-rw-r--r--EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h36
-rw-r--r--EmbeddedPkg/Include/Protocol/EmbeddedGpio.h95
-rw-r--r--EmbeddedPkg/Include/Protocol/FdtClient.h40
-rw-r--r--EmbeddedPkg/Include/Protocol/HardwareInterrupt.h36
-rw-r--r--EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h22
-rw-r--r--EmbeddedPkg/Include/Protocol/MmcHost.h175
-rw-r--r--EmbeddedPkg/Include/Protocol/PeCoffLoader.h41
-rw-r--r--EmbeddedPkg/Include/Protocol/PlatformBootManager.h8
-rw-r--r--EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h28
-rw-r--r--EmbeddedPkg/Include/Protocol/UsbDevice.h26
-rw-r--r--EmbeddedPkg/Include/fdt.h71
-rw-r--r--EmbeddedPkg/Include/libfdt.h1881
-rw-r--r--EmbeddedPkg/Include/libfdt_env.h132
41 files changed, 1905 insertions, 1483 deletions
diff --git a/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h b/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h
index daa208f8a6..2f1174c2b0 100644
--- a/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h
+++ b/EmbeddedPkg/Include/Guid/ConsolePrefFormSet.h
@@ -12,6 +12,6 @@
#define CONSOLE_PREF_FORMSET_GUID \
{ 0x2d2358b4, 0xe96c, 0x484d, { 0xb2, 0xdd, 0x7c, 0x2e, 0xdf, 0xc7, 0xd5, 0x6f } }
-extern EFI_GUID gConsolePrefFormSetGuid;
+extern EFI_GUID gConsolePrefFormSetGuid;
#endif
diff --git a/EmbeddedPkg/Include/Guid/DtPlatformDefaultDtbFile.h b/EmbeddedPkg/Include/Guid/DtPlatformDefaultDtbFile.h
index cd21900a20..d95863066e 100644
--- a/EmbeddedPkg/Include/Guid/DtPlatformDefaultDtbFile.h
+++ b/EmbeddedPkg/Include/Guid/DtPlatformDefaultDtbFile.h
@@ -12,6 +12,6 @@
#define DT_PLATFORM_DEFAULT_DTB_FILE_GUID \
{ 0x25462cda, 0x221f, 0x47df, { 0xac, 0x1d, 0x25, 0x9c, 0xfa, 0xa4, 0xe3, 0x26 } }
-extern EFI_GUID gDtPlatformDefaultDtbFileGuid;
+extern EFI_GUID gDtPlatformDefaultDtbFileGuid;
#endif
diff --git a/EmbeddedPkg/Include/Guid/DtPlatformFormSet.h b/EmbeddedPkg/Include/Guid/DtPlatformFormSet.h
index 1bafe8441a..5d751bbd96 100644
--- a/EmbeddedPkg/Include/Guid/DtPlatformFormSet.h
+++ b/EmbeddedPkg/Include/Guid/DtPlatformFormSet.h
@@ -12,6 +12,6 @@
#define DT_PLATFORM_FORMSET_GUID \
{ 0x2b7a240d, 0xd5ad, 0x4fd6, { 0xbe, 0x1c, 0xdf, 0xa4, 0x41, 0x5f, 0x55, 0x26 } }
-extern EFI_GUID gDtPlatformFormSetGuid;
+extern EFI_GUID gDtPlatformFormSetGuid;
#endif
diff --git a/EmbeddedPkg/Include/Guid/ExtractSection.h b/EmbeddedPkg/Include/Guid/ExtractSection.h
index f1781197e4..7346296fbc 100644
--- a/EmbeddedPkg/Include/Guid/ExtractSection.h
+++ b/EmbeddedPkg/Include/Guid/ExtractSection.h
@@ -11,20 +11,18 @@
#include <Library/ExtractGuidedSectionLib.h>
-
//
// 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_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;
+ 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
index 3c719189ae..e009146829 100644
--- a/EmbeddedPkg/Include/Guid/Fdt.h
+++ b/EmbeddedPkg/Include/Guid/Fdt.h
@@ -12,11 +12,11 @@
#define FDT_TABLE_GUID \
{ 0xb1b621d5, 0xf19c, 0x41a5, { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } }
-extern EFI_GUID gFdtTableGuid;
+extern EFI_GUID gFdtTableGuid;
#define FDT_VARIABLE_GUID \
{ 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0xc8, 0x4e, 0xfb, 0x3e, 0x57 } }
-extern EFI_GUID gFdtVariableGuid;
+extern EFI_GUID gFdtVariableGuid;
#endif /* __FDT_H__ */
diff --git a/EmbeddedPkg/Include/Guid/FdtHob.h b/EmbeddedPkg/Include/Guid/FdtHob.h
index f8719dbb94..2425a13ffe 100644
--- a/EmbeddedPkg/Include/Guid/FdtHob.h
+++ b/EmbeddedPkg/Include/Guid/FdtHob.h
@@ -10,11 +10,11 @@
#ifndef __FDT_HOB_H__
#define __FDT_HOB_H__
-#define FDT_HOB_GUID { \
+#define FDT_HOB_GUID {\
0x16958446, 0x19B7, 0x480B, \
{ 0xB0, 0x47, 0x74, 0x85, 0xAD, 0x3F, 0x71, 0x6D } \
}
-extern EFI_GUID gFdtHobGuid;
+extern EFI_GUID gFdtHobGuid;
#endif
diff --git a/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h b/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h
index 7728f9277f..96e1e91caf 100644
--- a/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h
+++ b/EmbeddedPkg/Include/Guid/NvVarStoreFormatted.h
@@ -18,7 +18,6 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
#ifndef __EDKII_NV_VAR_STORE_FORMATTED_H__
#define __EDKII_NV_VAR_STORE_FORMATTED_H__
@@ -28,6 +27,6 @@
{ 0x83, 0xcd, 0xdc, 0x2c, 0x29, 0xc8, 0x91, 0xa3 } \
}
-extern EFI_GUID gEdkiiNvVarStoreFormattedGuid;
+extern EFI_GUID gEdkiiNvVarStoreFormattedGuid;
#endif
diff --git a/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h b/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h
index 102a6b8cc3..d05f109039 100644
--- a/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h
+++ b/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h
@@ -14,7 +14,6 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
#ifndef __EDKII_PLATFORM_HAS_DEVICE_TREE_H__
#define __EDKII_PLATFORM_HAS_DEVICE_TREE_H__
@@ -24,6 +23,6 @@
{ 0xb2, 0xaf, 0x54, 0x1e, 0x1d, 0xce, 0x14, 0x8b } \
}
-extern EFI_GUID gEdkiiPlatformHasDeviceTreeGuid;
+extern EFI_GUID gEdkiiPlatformHasDeviceTreeGuid;
#endif
diff --git a/EmbeddedPkg/Include/Library/AcpiLib.h b/EmbeddedPkg/Include/Library/AcpiLib.h
index c142446d9d..4f2001bfc8 100644
--- a/EmbeddedPkg/Include/Library/AcpiLib.h
+++ b/EmbeddedPkg/Include/Library/AcpiLib.h
@@ -17,11 +17,11 @@
//
// 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 }
+#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)
@@ -48,7 +48,7 @@
// 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) \
+ 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, \
@@ -56,7 +56,7 @@
}
#define EFI_ACPI_6_0_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \
- GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency) \
+ GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency) \
{ \
EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_0_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
@@ -65,7 +65,7 @@
}
#define EFI_ACPI_6_3_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, PmuIrq, \
- GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency, SpeOvflIrq) \
+ GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency, SpeOvflIrq) \
{ \
EFI_ACPI_6_0_GIC, sizeof (EFI_ACPI_6_3_GIC_STRUCTURE), EFI_ACPI_RESERVED_WORD, \
GicId, AcpiCpuUid, Flags, 0, PmuIrq, 0, GicBase, GicVBase, GicHBase, \
@@ -82,7 +82,7 @@
// SBSA Generic Watchdog
//
#define EFI_ACPI_5_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT(RefreshFramePhysicalAddress, \
- ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \
+ ControlFramePhysicalAddress, WatchdogTimerGSIV, WatchdogTimerFlags) \
{ \
EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG, sizeof(EFI_ACPI_5_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \
EFI_ACPI_RESERVED_BYTE, RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \
@@ -91,7 +91,7 @@
typedef
BOOLEAN
-(EFIAPI *EFI_LOCATE_ACPI_CHECK) (
+(EFIAPI *EFI_LOCATE_ACPI_CHECK)(
IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader
);
@@ -109,7 +109,7 @@ BOOLEAN
**/
EFI_STATUS
LocateAndInstallAcpiFromFvConditional (
- IN CONST EFI_GUID* AcpiFile,
+ IN CONST EFI_GUID *AcpiFile,
IN EFI_LOCATE_ACPI_CHECK CheckAcpiTableFunction
);
@@ -125,7 +125,7 @@ LocateAndInstallAcpiFromFvConditional (
**/
EFI_STATUS
LocateAndInstallAcpiFromFv (
- IN CONST EFI_GUID* AcpiFile
+ IN CONST EFI_GUID *AcpiFile
);
#endif // __ACPI_LIB_H__
diff --git a/EmbeddedPkg/Include/Library/AndroidBootImgLib.h b/EmbeddedPkg/Include/Library/AndroidBootImgLib.h
index 5fb3339048..d58a4d2d32 100644
--- a/EmbeddedPkg/Include/Library/AndroidBootImgLib.h
+++ b/EmbeddedPkg/Include/Library/AndroidBootImgLib.h
@@ -19,32 +19,33 @@
#define ANDROID_BOOTIMG_KERNEL_ARGS_SIZE 512
-#define ANDROID_BOOT_MAGIC "ANDROID!"
-#define ANDROID_BOOT_MAGIC_LENGTH (sizeof (ANDROID_BOOT_MAGIC) - 1)
+#define ANDROID_BOOT_MAGIC "ANDROID!"
+#define ANDROID_BOOT_MAGIC_LENGTH (sizeof (ANDROID_BOOT_MAGIC) - 1)
// No documentation for this really - sizes of fields has been determined
// empirically.
#pragma pack(1)
/* https://android.googlesource.com/platform/system/core/+/master/mkbootimg/bootimg.h */
typedef struct {
- UINT8 BootMagic[ANDROID_BOOT_MAGIC_LENGTH];
- UINT32 KernelSize;
- UINT32 KernelAddress;
- UINT32 RamdiskSize;
- UINT32 RamdiskAddress;
- UINT32 SecondStageBootloaderSize;
- UINT32 SecondStageBootloaderAddress;
- UINT32 KernelTaggsAddress;
- UINT32 PageSize;
- UINT32 Reserved[2];
- CHAR8 ProductName[16];
- CHAR8 KernelArgs[ANDROID_BOOTIMG_KERNEL_ARGS_SIZE];
- UINT32 Id[32];
+ UINT8 BootMagic[ANDROID_BOOT_MAGIC_LENGTH];
+ UINT32 KernelSize;
+ UINT32 KernelAddress;
+ UINT32 RamdiskSize;
+ UINT32 RamdiskAddress;
+ UINT32 SecondStageBootloaderSize;
+ UINT32 SecondStageBootloaderAddress;
+ UINT32 KernelTaggsAddress;
+ UINT32 PageSize;
+ UINT32 Reserved[2];
+ CHAR8 ProductName[16];
+ CHAR8 KernelArgs[ANDROID_BOOTIMG_KERNEL_ARGS_SIZE];
+ UINT32 Id[32];
} ANDROID_BOOTIMG_HEADER;
#pragma pack ()
/* Check Val (unsigned) is a power of 2 (has only one bit set) */
-#define IS_POWER_OF_2(Val) ((Val) != 0 && (((Val) & ((Val) - 1)) == 0))
+#define IS_POWER_OF_2(Val) ((Val) != 0 && (((Val) & ((Val) - 1)) == 0))
+
/* Android boot image page size is not specified, but it should be power of 2
* and larger than boot header */
#define IS_VALID_ANDROID_PAGE_SIZE(Val) \
@@ -52,14 +53,14 @@ typedef struct {
EFI_STATUS
AndroidBootImgGetImgSize (
- IN VOID *BootImg,
- OUT UINTN *ImgSize
+ IN VOID *BootImg,
+ OUT UINTN *ImgSize
);
EFI_STATUS
AndroidBootImgBoot (
- IN VOID *Buffer,
- IN UINTN BufferSize
+ IN VOID *Buffer,
+ IN UINTN BufferSize
);
#endif /* __ABOOTIMG_H__ */
diff --git a/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h b/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h
index eb499dbc1b..d6f3b67d45 100644
--- a/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h
+++ b/EmbeddedPkg/Include/Library/DebugAgentTimerLib.h
@@ -12,8 +12,6 @@
#ifndef __GDB_TIMER_LIB__
#define __GDB_TIMER_LIB__
-
-
/**
Setup all the hardware needed for the debug agents timer.
@@ -26,7 +24,6 @@ DebugAgentTimerIntialize (
VOID
);
-
/**
Set the period for the debug agent timer. Zero means disable the timer.
@@ -39,7 +36,6 @@ 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.
@@ -52,5 +48,3 @@ DebugAgentTimerEndOfInterrupt (
);
#endif
-
-
diff --git a/EmbeddedPkg/Include/Library/DmaLib.h b/EmbeddedPkg/Include/Library/DmaLib.h
index 9f6e7a9d28..44bc71a1f6 100644
--- a/EmbeddedPkg/Include/Library/DmaLib.h
+++ b/EmbeddedPkg/Include/Library/DmaLib.h
@@ -51,9 +51,6 @@ typedef enum {
MapOperationMaximum
} DMA_MAP_OPERATION;
-
-
-
/**
Provides the DMA controller-specific addresses needed to access system memory.
@@ -77,16 +74,13 @@ typedef enum {
EFI_STATUS
EFIAPI
DmaMap (
- IN DMA_MAP_OPERATION Operation,
- IN VOID *HostAddress,
- IN OUT UINTN *NumberOfBytes,
- OUT PHYSICAL_ADDRESS *DeviceAddress,
- OUT VOID **Mapping
+ 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.
@@ -100,10 +94,9 @@ DmaMap (
EFI_STATUS
EFIAPI
DmaUnmap (
- IN VOID *Mapping
+ IN VOID *Mapping
);
-
/**
Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer.
mapping.
@@ -124,12 +117,11 @@ DmaUnmap (
EFI_STATUS
EFIAPI
DmaAllocateBuffer (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- OUT VOID **HostAddress
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress
);
-
/**
Frees memory that was allocated with DmaAllocateBuffer().
@@ -144,11 +136,10 @@ DmaAllocateBuffer (
EFI_STATUS
EFIAPI
DmaFreeBuffer (
- IN UINTN Pages,
- IN VOID *HostAddress
+ IN UINTN Pages,
+ IN VOID *HostAddress
);
-
/**
Allocates pages that are suitable for an DmaMap() of type
MapOperationBusMasterCommonBuffer mapping, at the requested alignment.
@@ -171,11 +162,10 @@ DmaFreeBuffer (
EFI_STATUS
EFIAPI
DmaAllocateAlignedBuffer (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN UINTN Alignment,
- OUT VOID **HostAddress
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN UINTN Alignment,
+ OUT VOID **HostAddress
);
-
#endif
diff --git a/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h b/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h
index 3beacf0b1e..1309d85186 100644
--- a/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h
+++ b/EmbeddedPkg/Include/Library/DtPlatformDtbLoaderLib.h
@@ -26,8 +26,8 @@
EFI_STATUS
EFIAPI
DtPlatformLoadDtb (
- OUT VOID **Dtb,
- OUT UINTN *DtbSize
+ OUT VOID **Dtb,
+ OUT UINTN *DtbSize
);
#endif
diff --git a/EmbeddedPkg/Include/Library/EfiFileLib.h b/EmbeddedPkg/Include/Library/EfiFileLib.h
index 0544b6e200..bae19ec78a 100644
--- a/EmbeddedPkg/Include/Library/EfiFileLib.h
+++ b/EmbeddedPkg/Include/Library/EfiFileLib.h
@@ -42,7 +42,7 @@
#include <Guid/FileInfo.h>
#include <Guid/FileSystemInfo.h>
-#define MAX_PATHNAME 0x200
+#define MAX_PATHNAME 0x200
/// Type of the file that has been opened
typedef enum {
@@ -55,52 +55,49 @@ typedef enum {
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 Version; // Common information
+ EFI_OPEN_FILE_TYPE Type;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_STATUS LastError;
+ EFI_HANDLE EfiHandle;
+ CHAR8 *DeviceName;
+ CHAR8 *FileName;
- UINTN BaseOffset; // Base offset for hexdump command
+ UINT64 CurrentPosition; // Information for Seek
+ UINT64 MaxPosition;
- UINTN Size; // Valid for all types other than l#:
- UINT8 *Buffer; // Information valid for A#:
+ UINTN BaseOffset; // Base offset for hexdump command
- 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;
+ UINTN Size; // Valid for all types other than l#:
+ UINT8 *Buffer; // Information valid for A#:
- EFI_PHYSICAL_ADDRESS FvStart;
- UINTN FvSize;
- UINTN FvHeaderSize;
+ 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_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#:
+ EFI_PHYSICAL_ADDRESS FvStart;
+ UINTN FvSize;
+ UINTN FvHeaderSize;
- UINTN DiskOffset; // Information valid for B#:
+ 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#:
- EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#:
+ UINTN DiskOffset; // Information valid for B#:
- EFI_IP_ADDRESS ServerIp; // Information valid for t:
- BOOLEAN IsDirty;
- BOOLEAN IsBufferValid;
+ 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,
@@ -109,7 +106,6 @@ typedef enum {
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
@@ -131,15 +127,15 @@ typedef enum {
**/
EFI_OPEN_FILE *
EfiOpen (
- IN CHAR8 *PathName,
- IN CONST UINT64 OpenMode,
- IN CONST EFI_SECTION_TYPE SectionType
+ IN CHAR8 *PathName,
+ IN CONST UINT64 OpenMode,
+ IN CONST EFI_SECTION_TYPE SectionType
);
EFI_STATUS
EfiCopyFile (
- IN CHAR8 *DestinationFile,
- IN CHAR8 *SourceFile
+ IN CHAR8 *DestinationFile,
+ IN CHAR8 *SourceFile
);
/**
@@ -154,11 +150,10 @@ EfiCopyFile (
**/
EFI_OPEN_FILE *
EfiDeviceOpenByType (
- IN EFI_OPEN_FILE_TYPE DeviceType,
- IN UINTN Index
+ IN EFI_OPEN_FILE_TYPE DeviceType,
+ IN UINTN Index
);
-
/**
Close a file handle opened by EfiOpen() and free all resources allocated by
EfiOpen().
@@ -171,10 +166,9 @@ EfiDeviceOpenByType (
**/
EFI_STATUS
EfiClose (
- IN EFI_OPEN_FILE *Stream
+ 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.
@@ -187,11 +181,10 @@ EfiClose (
**/
UINTN
EfiTell (
- IN EFI_OPEN_FILE *Stream,
- OUT UINT64 *CurrentPosition OPTIONAL
+ 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
@@ -215,12 +208,11 @@ EfiTell (
**/
EFI_STATUS
EfiSeek (
- IN EFI_OPEN_FILE *Stream,
- IN EFI_LBA Offset,
- IN EFI_SEEK_TYPE SeekType
+ 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.
@@ -239,12 +231,11 @@ EfiSeek (
**/
EFI_STATUS
EfiRead (
- IN EFI_OPEN_FILE *Stream,
- OUT VOID *Buffer,
- OUT UINTN *BufferSize
+ 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.
@@ -266,12 +257,11 @@ EfiRead (
**/
EFI_STATUS
EfiReadAllocatePool (
- IN EFI_OPEN_FILE *Stream,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize
+ IN EFI_OPEN_FILE *Stream,
+ OUT VOID **Buffer,
+ OUT UINTN *BufferSize
);
-
/**
Write data back to the file.
@@ -289,12 +279,11 @@ EfiReadAllocatePool (
**/
EFI_STATUS
EfiWrite (
- IN EFI_OPEN_FILE *Stream,
- OUT VOID *Buffer,
- OUT UINTN *BufferSize
+ IN EFI_OPEN_FILE *Stream,
+ OUT VOID *Buffer,
+ OUT UINTN *BufferSize
);
-
/**
Return the number of devices of the current type active in the system
@@ -305,10 +294,9 @@ EfiWrite (
**/
UINTN
EfiGetDeviceCounts (
- IN EFI_OPEN_FILE_TYPE Type
+ 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.
@@ -322,7 +310,7 @@ EfiGetDeviceCounts (
**/
EFI_STATUS
EfiSetCwd (
- IN CHAR8 *Cwd
+ IN CHAR8 *Cwd
);
/**
diff --git a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h b/EmbeddedPkg/Include/Library/EfiResetSystemLib.h
index aa5ec40175..5bfebfc638 100644
--- a/EmbeddedPkg/Include/Library/EfiResetSystemLib.h
+++ b/EmbeddedPkg/Include/Library/EfiResetSystemLib.h
@@ -6,11 +6,9 @@
**/
-
#ifndef __EFI_RESET_SYSTEM_LIB_H___
#define __EFI_RESET_SYSTEM_LIB_H___
-
/**
Resets the entire platform.
@@ -25,14 +23,12 @@
EFI_STATUS
EFIAPI
LibResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData OPTIONAL
+ IN EFI_RESET_TYPE ResetType,
+ IN EFI_STATUS ResetStatus,
+ IN UINTN DataSize,
+ IN CHAR16 *ResetData OPTIONAL
);
-
-
/**
Initialize any infrastructure required for LibResetSystem () to function.
diff --git a/EmbeddedPkg/Include/Library/FdtLoadLib.h b/EmbeddedPkg/Include/Library/FdtLoadLib.h
index a46469af5a..952dd8f751 100644
--- a/EmbeddedPkg/Include/Library/FdtLoadLib.h
+++ b/EmbeddedPkg/Include/Library/FdtLoadLib.h
@@ -21,7 +21,7 @@
**/
EFI_STATUS
InstallFdtFromSemihosting (
- IN CONST CHAR16* FileName
+ IN CONST CHAR16 *FileName
);
/**
@@ -36,7 +36,7 @@ InstallFdtFromSemihosting (
**/
EFI_STATUS
InstallFdtFromFv (
- IN CONST EFI_GUID *FileName
+ IN CONST EFI_GUID *FileName
);
#endif
diff --git a/EmbeddedPkg/Include/Library/GdbSerialLib.h b/EmbeddedPkg/Include/Library/GdbSerialLib.h
index b45645ae61..4845d6018c 100644
--- a/EmbeddedPkg/Include/Library/GdbSerialLib.h
+++ b/EmbeddedPkg/Include/Library/GdbSerialLib.h
@@ -10,8 +10,6 @@
#ifndef __GDB_SERIAL_LIB_H__
#define __GDB_SERIAL_LIB_H__
-
-
/**
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,
data buts, and stop bits on a serial device. This call is optional as the serial
@@ -34,13 +32,12 @@
RETURN_STATUS
EFIAPI
GdbSerialInit (
- IN UINT64 BaudRate,
- IN UINT8 Parity,
- IN UINT8 DataBits,
- IN UINT8 StopBits
+ 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().
@@ -67,7 +64,6 @@ GdbGetChar (
VOID
);
-
/**
Send a character to GDB. This function must be able to run in interrupt context.
@@ -79,10 +75,9 @@ GdbGetChar (
VOID
EFIAPI
GdbPutChar (
- IN CHAR8 Char
+ IN CHAR8 Char
);
-
/**
Send an ASCII string to GDB. This function must be able to run in interrupt context.
@@ -96,6 +91,4 @@ GdbPutString (
IN CHAR8 *String
);
-
#endif
-
diff --git a/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h b/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h
index 122541f686..be1c03bb10 100644
--- a/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h
+++ b/EmbeddedPkg/Include/Library/HalRuntimeServicesLib.h
@@ -6,15 +6,18 @@
**/
-
#ifndef __RUNTIME_SERVICES_LIB_H__
#define __RUNTIME_SERVICES_LIB_H__
VOID
-LibMtcInitialize (VOID);
+LibMtcInitialize (
+ VOID
+ );
VOID
-LibMtcVirtualAddressChangeEvent (VOID);
+LibMtcVirtualAddressChangeEvent (
+ VOID
+ );
EFI_STATUS
EFIAPI
@@ -27,21 +30,23 @@ LibMtcGetNextMonotonicCount (
OUT UINT64 *Count
);
-
-
VOID
-LibVariableInitialize (VOID);
+LibVariableInitialize (
+ VOID
+ );
VOID
-LibVariableVirtualAddressChangeEvent (VOID);
+LibVariableVirtualAddressChangeEvent (
+ VOID
+ );
EFI_STATUS
LibGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ OUT UINT32 *Attributes OPTIONAL,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
);
EFI_STATUS
@@ -53,49 +58,54 @@ LibGetNextVariableName (
EFI_STATUS
LibSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
+ 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
+ IN UINT32 Attributes,
+ OUT UINT64 *MaximumVariableStorageSize,
+ OUT UINT64 *RemainingVariableStorageSize,
+ OUT UINT64 *MaximumVariableSize
);
-
-
VOID
-LibResetInitializeReset (VOID);
+LibResetInitializeReset (
+ VOID
+ );
VOID
-LibResetVirtualAddressChangeEvent (VOID);
+LibResetVirtualAddressChangeEvent (
+ VOID
+ );
VOID
LibResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData OPTIONAL
+ IN EFI_RESET_TYPE ResetType,
+ IN EFI_STATUS ResetStatus,
+ IN UINTN DataSize,
+ IN CHAR16 *ResetData OPTIONAL
);
-
VOID
-LibCapsuleInitialize (VOID);
+LibCapsuleInitialize (
+ VOID
+ );
VOID
-LibCapsuleVirtualAddressChangeEvent (VOID);
+LibCapsuleVirtualAddressChangeEvent (
+ VOID
+ );
EFI_STATUS
LibUpdateCapsule (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
+ IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
+ IN UINTN CapsuleCount,
+ IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
);
EFI_STATUS
@@ -106,13 +116,15 @@ QueryCapsuleCapabilities (
OUT EFI_RESET_TYPE *ResetType
);
-
-
VOID
-LibRtcInitialize (VOID);
+LibRtcInitialize (
+ VOID
+ );
VOID
-LibRtcVirtualAddressChangeEvent (VOID);
+LibRtcVirtualAddressChangeEvent (
+ VOID
+ );
EFI_STATUS
LibGetTime (
@@ -122,38 +134,39 @@ LibGetTime (
EFI_STATUS
LibSetTime (
- IN EFI_TIME *Time
+ IN EFI_TIME *Time
);
EFI_STATUS
LibGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
+ OUT BOOLEAN *Enabled,
+ OUT BOOLEAN *Pending,
+ OUT EFI_TIME *Time
);
EFI_STATUS
LibSetWakeupTime (
- IN BOOLEAN Enabled,
- OUT EFI_TIME *Time
+ IN BOOLEAN Enabled,
+ OUT EFI_TIME *Time
);
-
VOID
-LibReportStatusCodeInitialize (VOID);
+LibReportStatusCodeInitialize (
+ VOID
+ );
VOID
-LibReportStatusCodeVirtualAddressChangeEvent (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
+ 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/NorFlashInfoLib.h b/EmbeddedPkg/Include/Library/NorFlashInfoLib.h
index e19039d870..9a26159d19 100644
--- a/EmbeddedPkg/Include/Library/NorFlashInfoLib.h
+++ b/EmbeddedPkg/Include/Library/NorFlashInfoLib.h
@@ -11,45 +11,45 @@
#include <Uefi/UefiBaseType.h>
-#define NOR_FLASH_MAX_ID_LEN 6
+#define NOR_FLASH_MAX_ID_LEN 6
typedef struct {
/* Device name */
- UINT16 *Name;
+ UINT16 *Name;
/*
* JEDEC ID
*/
- UINT8 Id[NOR_FLASH_MAX_ID_LEN];
- UINT8 IdLen;
+ UINT8 Id[NOR_FLASH_MAX_ID_LEN];
+ UINT8 IdLen;
- UINT16 PageSize;
+ UINT16 PageSize;
/*
* Below parameters can be referred as BlockSize
* and BlockCount, when treating the NorFlash as
* block device.
*/
- UINT32 SectorSize;
- UINT32 SectorCount;
-
- UINT16 Flags;
-#define NOR_FLASH_ERASE_4K (1 << 0) /* Use 4 KB erase blocks and CMD_ERASE_4K */
-#define NOR_FLASH_ERASE_32K (1 << 1) /* Use 32 KB erase blocks and CMD_ERASE_32K */
-#define NOR_FLASH_WRITE_FSR (1 << 2) /* Use flag status register for write */
-#define NOR_FLASH_4B_ADDR (1 << 3) /* Use 4B addressing */
+ UINT32 SectorSize;
+ UINT32 SectorCount;
+
+ UINT16 Flags;
+ #define NOR_FLASH_ERASE_4K (1 << 0) /* Use 4 KB erase blocks and CMD_ERASE_4K */
+ #define NOR_FLASH_ERASE_32K (1 << 1) /* Use 32 KB erase blocks and CMD_ERASE_32K */
+ #define NOR_FLASH_WRITE_FSR (1 << 2) /* Use flag status register for write */
+ #define NOR_FLASH_4B_ADDR (1 << 3) /* Use 4B addressing */
} NOR_FLASH_INFO;
/* Vendor IDs */
-#define NOR_FLASH_ID_ATMEL 0x1f
-#define NOR_FLASH_ID_EON 0x1c
-#define NOR_FLASH_ID_GIGADEVICE 0xc8
-#define NOR_FLASH_ID_ISSI 0x9d
-#define NOR_FLASH_ID_MACRONIX 0xc2
-#define NOR_FLASH_ID_SPANSION 0x01
-#define NOR_FLASH_ID_STMICRO 0x20
-#define NOR_FLASH_ID_SST 0xbf
-#define NOR_FLASH_ID_WINDBOND 0xef
+#define NOR_FLASH_ID_ATMEL 0x1f
+#define NOR_FLASH_ID_EON 0x1c
+#define NOR_FLASH_ID_GIGADEVICE 0xc8
+#define NOR_FLASH_ID_ISSI 0x9d
+#define NOR_FLASH_ID_MACRONIX 0xc2
+#define NOR_FLASH_ID_SPANSION 0x01
+#define NOR_FLASH_ID_STMICRO 0x20
+#define NOR_FLASH_ID_SST 0xbf
+#define NOR_FLASH_ID_WINDBOND 0xef
/**
Return an allocated copy pool of the NOR flash information structure.
@@ -70,9 +70,9 @@ typedef struct {
EFI_STATUS
EFIAPI
NorFlashGetInfo (
- IN UINT8 *Id,
+ IN UINT8 *Id,
IN OUT NOR_FLASH_INFO **FlashInfo,
- IN BOOLEAN AllocateForRuntime
+ IN BOOLEAN AllocateForRuntime
);
/**
@@ -87,4 +87,5 @@ EFIAPI
NorFlashPrintInfo (
IN NOR_FLASH_INFO *Info
);
+
#endif
diff --git a/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h b/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h
index cf26f08c05..a05ee8fd6b 100644
--- a/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h
+++ b/EmbeddedPkg/Include/Library/PrePiHobListPointerLib.h
@@ -32,7 +32,7 @@ PrePeiGetHobList (
EFI_STATUS
EFIAPI
PrePeiSetHobList (
- IN VOID *HobList
+ IN VOID *HobList
);
#endif
diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h
index 399a8d59a9..7b2cea296f 100644
--- a/EmbeddedPkg/Include/Library/PrePiLib.h
+++ b/EmbeddedPkg/Include/Library/PrePiLib.h
@@ -27,11 +27,10 @@
EFI_STATUS
EFIAPI
FfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
+ IN UINTN Instance,
+ IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
);
-
/**
This service enables discovery of additional firmware files.
@@ -48,12 +47,11 @@ FfsFindNextVolume (
EFI_STATUS
EFIAPI
FfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- IN OUT EFI_PEI_FILE_HANDLE *FileHandle
+ 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.
@@ -69,12 +67,11 @@ FfsFindNextFile (
EFI_STATUS
EFIAPI
FfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_PEI_FILE_HANDLE FileHandle,
- OUT VOID **SectionData
+ IN EFI_SECTION_TYPE SectionType,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData
);
-
/**
Find a file in the volume by name
@@ -96,12 +93,11 @@ FfsFindSectionData (
EFI_STATUS
EFIAPI
FfsFindFileByName (
- IN CONST EFI_GUID *FileName,
- IN CONST EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
+ 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.
@@ -121,11 +117,10 @@ FfsFindFileByName (
EFI_STATUS
EFIAPI
FfsGetFileInfo (
- IN CONST EFI_PEI_FILE_HANDLE FileHandle,
- OUT EFI_FV_FILE_INFO *FileInfo
+ IN CONST EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO *FileInfo
);
-
/**
Get Information about the volume by name
@@ -145,12 +140,10 @@ FfsGetFileInfo (
EFI_STATUS
EFIAPI
FfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_FV_INFO *VolumeInfo
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
+ OUT EFI_FV_INFO *VolumeInfo
);
-
-
/**
Get Fv image from the FV type file, then add FV & FV2 Hob.
@@ -163,10 +156,9 @@ FfsGetVolumeInfo (
EFI_STATUS
EFIAPI
FfsProcessFvFile (
- IN EFI_PEI_FILE_HANDLE FvFileHandle
+ IN EFI_PEI_FILE_HANDLE FvFileHandle
);
-
/**
Search through every FV until you find a file of type FileType
@@ -181,12 +173,11 @@ FfsProcessFvFile (
EFI_STATUS
EFIAPI
FfsAnyFvFindFirstFile (
- IN EFI_FV_FILETYPE FileType,
- OUT EFI_PEI_FV_HANDLE *VolumeHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
+ 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.
@@ -200,10 +191,9 @@ FfsAnyFvFindFirstFile (
EFI_STATUS
EFIAPI
FfsProcessFvFile (
- IN EFI_PEI_FILE_HANDLE FvFileHandle
+ IN EFI_PEI_FILE_HANDLE FvFileHandle
);
-
/**
This service enables PEIMs to ascertain the present value of the boot mode.
@@ -217,7 +207,6 @@ GetBootMode (
VOID
);
-
/**
This service enables PEIMs to update the boot mode variable.
@@ -229,7 +218,7 @@ GetBootMode (
EFI_STATUS
EFIAPI
SetBootMode (
- IN EFI_BOOT_MODE BootMode
+ IN EFI_BOOT_MODE BootMode
);
/**
@@ -247,7 +236,6 @@ GetHobList (
VOID
);
-
/**
Updates the pointer to the HOB list.
@@ -257,10 +245,10 @@ GetHobList (
EFI_STATUS
EFIAPI
SetHobList (
- IN VOID *HobList
+ IN VOID *HobList
);
-EFI_HOB_HANDOFF_INFO_TABLE*
+EFI_HOB_HANDOFF_INFO_TABLE *
HobConstructor (
IN VOID *EfiMemoryBegin,
IN UINTN EfiMemoryLength,
@@ -280,11 +268,10 @@ HobConstructor (
**/
VOID *
CreateHob (
- IN UINT16 HobType,
- IN UINT16 HobLenght
+ IN UINT16 HobType,
+ IN UINT16 HobLenght
);
-
/**
Returns the next instance of a HOB type from the starting HOB.
@@ -304,8 +291,8 @@ CreateHob (
VOID *
EFIAPI
GetNextHob (
- IN UINT16 Type,
- IN CONST VOID *HobStart
+ IN UINT16 Type,
+ IN CONST VOID *HobStart
);
/**
@@ -322,7 +309,7 @@ GetNextHob (
VOID *
EFIAPI
GetFirstHob (
- IN UINT16 Type
+ IN UINT16 Type
);
/**
@@ -347,8 +334,8 @@ GetFirstHob (
VOID *
EFIAPI
GetNextGuidHob (
- IN CONST EFI_GUID *Guid,
- IN CONST VOID *HobStart
+ IN CONST EFI_GUID *Guid,
+ IN CONST VOID *HobStart
);
/**
@@ -368,10 +355,9 @@ GetNextGuidHob (
VOID *
EFIAPI
GetFirstGuidHob (
- IN CONST EFI_GUID *Guid
+ IN CONST EFI_GUID *Guid
);
-
/**
Builds a HOB for a loaded PE32 module.
@@ -390,10 +376,10 @@ GetFirstGuidHob (
VOID
EFIAPI
BuildModuleHob (
- IN CONST EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
+ IN CONST EFI_GUID *ModuleName,
+ IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
+ IN UINT64 ModuleLength,
+ IN EFI_PHYSICAL_ADDRESS EntryPoint
);
/**
@@ -440,8 +426,8 @@ BuildResourceDescriptorHob (
VOID *
EFIAPI
BuildGuidHob (
- IN CONST EFI_GUID *Guid,
- IN UINTN DataLength
+ IN CONST EFI_GUID *Guid,
+ IN UINTN DataLength
);
/**
@@ -467,9 +453,9 @@ BuildGuidHob (
VOID *
EFIAPI
BuildGuidDataHob (
- IN CONST EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
+ IN CONST EFI_GUID *Guid,
+ IN VOID *Data,
+ IN UINTN DataLength
);
/**
@@ -487,8 +473,8 @@ BuildGuidDataHob (
VOID
EFIAPI
BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
);
/**
@@ -511,7 +497,6 @@ BuildFvHobs (
IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute OPTIONAL
);
-
/**
Builds a EFI_HOB_TYPE_FV2 HOB.
@@ -529,10 +514,10 @@ BuildFvHobs (
VOID
EFIAPI
BuildFv2Hob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN CONST EFI_GUID *FvName,
- IN CONST EFI_GUID *FileName
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length,
+ IN CONST EFI_GUID *FvName,
+ IN CONST EFI_GUID *FileName
);
/**
@@ -550,8 +535,8 @@ BuildFv2Hob (
VOID
EFIAPI
BuildCvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
);
/**
@@ -569,8 +554,8 @@ BuildCvHob (
VOID
EFIAPI
BuildCpuHob (
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
+ IN UINT8 SizeOfMemorySpace,
+ IN UINT8 SizeOfIoSpace
);
/**
@@ -588,8 +573,8 @@ BuildCpuHob (
VOID
EFIAPI
BuildStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
);
/**
@@ -601,11 +586,10 @@ BuildStackHob (
**/
VOID
UpdateStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
);
-
/**
Builds a HOB for the BSP store.
@@ -622,9 +606,9 @@ UpdateStackHob (
VOID
EFIAPI
BuildBspStoreHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length,
+ IN EFI_MEMORY_TYPE MemoryType
);
/**
@@ -643,18 +627,17 @@ BuildBspStoreHob (
VOID
EFIAPI
BuildMemoryAllocationHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
+ 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
+ IN EFI_GUID *Guid,
+ IN EXTRACT_GUIDED_SECTION_GET_INFO_HANDLER SectionGetInfo,
+ IN EXTRACT_GUIDED_SECTION_DECODE_HANDLER SectionExtraction
);
VOID
@@ -663,7 +646,6 @@ BuildPeCoffLoaderHob (
VOID
);
-
/**
Allocates one or more 4KB pages of type EfiBootServicesData.
@@ -680,7 +662,7 @@ BuildPeCoffLoaderHob (
VOID *
EFIAPI
AllocatePages (
- IN UINTN Pages
+ IN UINTN Pages
);
/**
@@ -701,7 +683,6 @@ AllocatePool (
IN UINTN AllocationSize
);
-
/**
Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
@@ -725,14 +706,13 @@ AllocateAlignedPages (
IN UINTN Alignment
);
-
EFI_STATUS
EFIAPI
LoadPeCoffImage (
- IN VOID *PeCoffImage,
- OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
- OUT UINT64 *ImageSize,
- OUT EFI_PHYSICAL_ADDRESS *EntryPoint
+ IN VOID *PeCoffImage,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint
);
EFI_STATUS
diff --git a/EmbeddedPkg/Include/Library/RealTimeClockLib.h b/EmbeddedPkg/Include/Library/RealTimeClockLib.h
index 948f0890ae..9cc26c40a8 100644
--- a/EmbeddedPkg/Include/Library/RealTimeClockLib.h
+++ b/EmbeddedPkg/Include/Library/RealTimeClockLib.h
@@ -12,7 +12,6 @@
#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.
@@ -33,7 +32,6 @@ LibGetTime (
OUT EFI_TIME_CAPABILITIES *Capabilities
);
-
/**
Sets the current local time and date information.
@@ -47,10 +45,9 @@ LibGetTime (
EFI_STATUS
EFIAPI
LibSetTime (
- IN EFI_TIME *Time
+ IN EFI_TIME *Time
);
-
/**
Returns the current wakeup alarm clock setting.
@@ -66,12 +63,11 @@ LibSetTime (
EFI_STATUS
EFIAPI
LibGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
+ OUT BOOLEAN *Enabled,
+ OUT BOOLEAN *Pending,
+ OUT EFI_TIME *Time
);
-
/**
Sets the system wakeup alarm clock time.
@@ -88,12 +84,10 @@ LibGetWakeupTime (
EFI_STATUS
EFIAPI
LibSetWakeupTime (
- IN BOOLEAN Enabled,
- OUT EFI_TIME *Time
+ 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.
@@ -107,11 +101,10 @@ LibSetWakeupTime (
EFI_STATUS
EFIAPI
LibRtcInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ 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
@@ -123,10 +116,8 @@ LibRtcInitialize (
VOID
EFIAPI
LibRtcVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
);
-
#endif
-
diff --git a/EmbeddedPkg/Include/Library/TimeBaseLib.h b/EmbeddedPkg/Include/Library/TimeBaseLib.h
index 10700d1a64..320a695b27 100644
--- a/EmbeddedPkg/Include/Library/TimeBaseLib.h
+++ b/EmbeddedPkg/Include/Library/TimeBaseLib.h
@@ -20,13 +20,13 @@
// in which case __DATE__ is defined as a "Mmm dd yyyy" 11 chars string,
// but add an explicit filter for compilers that have been validated.
//
-#if (defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__))
-#define TIME_BUILD_YEAR (__DATE__[7] == '?' ? 1900 \
+#if (defined (__GNUC__) || defined (_MSC_VER) || defined (__clang__))
+#define TIME_BUILD_YEAR (__DATE__[7] == '?' ? 1900\
: (((__DATE__[7] - '0') * 1000 ) \
+ (__DATE__[8] - '0') * 100 \
+ (__DATE__[9] - '0') * 10 \
+ __DATE__[10] - '0'))
-#define TIME_BUILD_MONTH ( __DATE__ [2] == '?' ? 1 \
+#define TIME_BUILD_MONTH ( __DATE__ [2] == '?' ? 1 \
: __DATE__ [2] == 'n' ? ( \
__DATE__ [1] == 'a' ? 1 : 6) \
: __DATE__ [2] == 'b' ? 2 \
@@ -39,19 +39,19 @@
: __DATE__ [2] == 't' ? 10 \
: __DATE__ [2] == 'v' ? 11 \
: 12)
-#define TIME_BUILD_DAY ( __DATE__[4] == '?' ? 1 \
+#define TIME_BUILD_DAY ( __DATE__[4] == '?' ? 1 \
: ((__DATE__[4] == ' ' ? 0 : \
((__DATE__[4] - '0') * 10)) \
+ __DATE__[5] - '0'))
#endif
// Define EPOCH (1970-JANUARY-01) in the Julian Date representation
-#define EPOCH_JULIAN_DATE 2440588
+#define EPOCH_JULIAN_DATE 2440588
// Seconds per unit
-#define SEC_PER_MIN ((UINTN) 60)
-#define SEC_PER_HOUR ((UINTN) 3600)
-#define SEC_PER_DAY ((UINTN) 86400)
+#define SEC_PER_MIN ((UINTN) 60)
+#define SEC_PER_HOUR ((UINTN) 3600)
+#define SEC_PER_DAY ((UINTN) 86400)
/**
Check if it is a leap year.
diff --git a/EmbeddedPkg/Include/Ppi/EmbeddedGpio.h b/EmbeddedPkg/Include/Ppi/EmbeddedGpio.h
index 03e512b888..b0d1b3703f 100644
--- a/EmbeddedPkg/Include/Ppi/EmbeddedGpio.h
+++ b/EmbeddedPkg/Include/Ppi/EmbeddedGpio.h
@@ -13,27 +13,27 @@
//
// Protocol interface structure
//
-typedef struct _EMBEDDED_GPIO_PPI EMBEDDED_GPIO_PPI;
+typedef struct _EMBEDDED_GPIO_PPI EMBEDDED_GPIO_PPI;
//
// 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))
+#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
+ 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 {
@@ -61,7 +61,7 @@ typedef enum {
**/
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET) (
+(EFIAPI *EMBEDDED_GPIO_GET)(
IN EMBEDDED_GPIO_PPI *This,
IN EMBEDDED_GPIO_PIN Gpio,
OUT UINTN *Value
@@ -82,13 +82,12 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET) (
+(EFIAPI *EMBEDDED_GPIO_SET)(
IN EMBEDDED_GPIO_PPI *This,
IN EMBEDDED_GPIO_PIN Gpio,
IN EMBEDDED_GPIO_MODE Mode
);
-
/**
Gets the mode (function) of a GPIO pin
@@ -104,13 +103,12 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET_MODE) (
+(EFIAPI *EMBEDDED_GPIO_GET_MODE)(
IN EMBEDDED_GPIO_PPI *This,
IN EMBEDDED_GPIO_PIN Gpio,
OUT EMBEDDED_GPIO_MODE *Mode
);
-
/**
Sets the pull-up / pull-down resistor of a GPIO pin
@@ -126,13 +124,12 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET_PULL) (
+(EFIAPI *EMBEDDED_GPIO_SET_PULL)(
IN EMBEDDED_GPIO_PPI *This,
IN EMBEDDED_GPIO_PIN Gpio,
IN EMBEDDED_GPIO_PULL Direction
);
-
struct _EMBEDDED_GPIO_PPI {
EMBEDDED_GPIO_GET Get;
EMBEDDED_GPIO_SET Set;
@@ -140,6 +137,6 @@ struct _EMBEDDED_GPIO_PPI {
EMBEDDED_GPIO_SET_PULL SetPull;
};
-extern EFI_GUID gEmbeddedGpioPpiGuid;
+extern EFI_GUID gEmbeddedGpioPpiGuid;
#endif
diff --git a/EmbeddedPkg/Include/Protocol/AndroidBootImg.h b/EmbeddedPkg/Include/Protocol/AndroidBootImg.h
index 37a895119a..128a5d8f0d 100644
--- a/EmbeddedPkg/Include/Protocol/AndroidBootImg.h
+++ b/EmbeddedPkg/Include/Protocol/AndroidBootImg.h
@@ -12,30 +12,30 @@
//
// Protocol interface structure
//
-typedef struct _ANDROID_BOOTIMG_PROTOCOL ANDROID_BOOTIMG_PROTOCOL;
+typedef struct _ANDROID_BOOTIMG_PROTOCOL ANDROID_BOOTIMG_PROTOCOL;
//
// Function Prototypes
//
typedef
EFI_STATUS
-(EFIAPI *ANDROID_BOOTIMG_APPEND_KERNEL_ARGS) (
+(EFIAPI *ANDROID_BOOTIMG_APPEND_KERNEL_ARGS)(
IN CHAR16 *Args,
IN UINTN Size
);
typedef
EFI_STATUS
-(EFIAPI *ANDROID_BOOTIMG_UPDATE_DTB) (
+(EFIAPI *ANDROID_BOOTIMG_UPDATE_DTB)(
IN EFI_PHYSICAL_ADDRESS OrigDtbBase,
OUT EFI_PHYSICAL_ADDRESS *NewDtbBase
);
struct _ANDROID_BOOTIMG_PROTOCOL {
- ANDROID_BOOTIMG_APPEND_KERNEL_ARGS AppendArgs;
- ANDROID_BOOTIMG_UPDATE_DTB UpdateDtb;
+ ANDROID_BOOTIMG_APPEND_KERNEL_ARGS AppendArgs;
+ ANDROID_BOOTIMG_UPDATE_DTB UpdateDtb;
};
-extern EFI_GUID gAndroidBootImgProtocolGuid;
+extern EFI_GUID gAndroidBootImgProtocolGuid;
#endif /* __ANDROID_BOOTIMG_PROTOCOL_H__ */
diff --git a/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h b/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h
index ec15a35264..e3e51ebefd 100644
--- a/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h
+++ b/EmbeddedPkg/Include/Protocol/AndroidFastbootPlatform.h
@@ -9,7 +9,7 @@
#ifndef __ANDROID_FASTBOOT_PLATFORM_H__
#define __ANDROID_FASTBOOT_PLATFORM_H__
-extern EFI_GUID gAndroidFastbootPlatformProtocolGuid;
+extern EFI_GUID gAndroidFastbootPlatformProtocolGuid;
/*
Protocol for platform-specific operations initiated by Android Fastboot.
@@ -58,9 +58,9 @@ VOID
typedef
EFI_STATUS
(*FASTBOOT_PLATFORM_FLASH) (
- IN CHAR8 *PartitionName,
- IN UINTN BufferSize,
- IN VOID *Buffer
+ IN CHAR8 *PartitionName,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
);
/*
@@ -74,7 +74,7 @@ EFI_STATUS
typedef
EFI_STATUS
(*FASTBOOT_PLATFORM_ERASE) (
- IN CHAR8 *PartitionName
+ IN CHAR8 *PartitionName
);
/*
@@ -98,8 +98,8 @@ EFI_STATUS
typedef
EFI_STATUS
(*FASTBOOT_PLATFORM_GETVAR) (
- IN CHAR8 *Name,
- OUT CHAR8 *Value
+ IN CHAR8 *Name,
+ OUT CHAR8 *Value
);
/*
@@ -124,16 +124,16 @@ EFI_STATUS
typedef
EFI_STATUS
(*FASTBOOT_PLATFORM_OEM_COMMAND) (
- IN CHAR8 *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_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
index dc19158878..b90d491d4a 100644
--- a/EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h
+++ b/EmbeddedPkg/Include/Protocol/AndroidFastbootTransport.h
@@ -15,7 +15,7 @@
#ifndef __ANDROID_FASTBOOT_TRANSPORT_H__
#define __ANDROID_FASTBOOT_TRANSPORT_H__
-extern EFI_GUID gAndroidFastbootTransportProtocolGuid;
+extern EFI_GUID gAndroidFastbootTransportProtocolGuid;
/*
Set up the transport system for use by Fastboot.
@@ -43,7 +43,7 @@ extern EFI_GUID gAndroidFastbootTransportProtocolGuid;
typedef
EFI_STATUS
(*FASTBOOT_TRANSPORT_START) (
- IN EFI_EVENT ReceiveEvent
+ IN EFI_EVENT ReceiveEvent
);
/*
@@ -60,7 +60,7 @@ EFI_STATUS
*/
typedef
EFI_STATUS
-(* FASTBOOT_TRANSPORT_STOP) (
+(*FASTBOOT_TRANSPORT_STOP) (
VOID
);
@@ -87,8 +87,8 @@ typedef
EFI_STATUS
(*FASTBOOT_TRANSPORT_SEND) (
IN UINTN BufferSize,
- IN CONST VOID *Buffer,
- IN EFI_EVENT *FatalErrorEvent
+ IN CONST VOID *Buffer,
+ IN EFI_EVENT *FatalErrorEvent
);
/*
@@ -112,14 +112,14 @@ typedef
EFI_STATUS
(*FASTBOOT_TRANSPORT_RECEIVE) (
OUT UINTN *BufferSize,
- OUT VOID **Buffer
+ 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_START Start;
+ FASTBOOT_TRANSPORT_STOP Stop;
+ FASTBOOT_TRANSPORT_SEND Send;
+ FASTBOOT_TRANSPORT_RECEIVE Receive;
} FASTBOOT_TRANSPORT_PROTOCOL;
#endif
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h b/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h
index b84f55bc8a..e6a1fdc2a1 100644
--- a/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h
+++ b/EmbeddedPkg/Include/Protocol/EmbeddedDevice.h
@@ -23,7 +23,6 @@
#ifndef __EMBEDDED_DEVICE_PROTOCOL_H__
#define __EMBEDDED_DEVICE_PROTOCOL_H__
-
//
// Protocol GUID
//
@@ -32,21 +31,17 @@
#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;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 RevisionId;
+ UINT16 SubsystemId;
+ UINT16 SubsystemVendorId;
+ UINT8 ClassCode[3];
+ UINT8 HeaderSize;
+ UINTN BaseAddress;
} EMBEDDED_DEVICE_PROTOCOL;
-extern EFI_GUID gEmbeddedDeviceGuid;
+extern EFI_GUID gEmbeddedDeviceGuid;
#endif
-
-
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h b/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h
index a197c572e7..52c7fb6723 100644
--- a/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h
+++ b/EmbeddedPkg/Include/Protocol/EmbeddedExternalDevice.h
@@ -12,7 +12,7 @@
//
// Protocol GUID
//
-#define EMBEDDED_EXTERNAL_DEVICE_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }}
+#define EMBEDDED_EXTERNAL_DEVICE_PROTOCOL_GUID { 0x735F8C64, 0xD696, 0x44D0, { 0xBD, 0xF2, 0x44, 0x7F, 0xD0, 0x5A, 0x54, 0x06 }}
//
// Protocol interface structure
@@ -24,12 +24,13 @@ typedef struct _EMBEDDED_EXTERNAL_DEVICE EMBEDDED_EXTERNAL_DEVICE;
//
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_READ) (
- IN EMBEDDED_EXTERNAL_DEVICE *This,
- IN UINTN Register,
- IN UINTN Length,
- OUT VOID *Buffer
- )
+(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_READ)(
+ IN EMBEDDED_EXTERNAL_DEVICE *This,
+ IN UINTN Register,
+ IN UINTN Length,
+ OUT VOID *Buffer
+ )
+
/*++
Routine Description:
@@ -52,12 +53,13 @@ Returns:
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_WRITE) (
- IN EMBEDDED_EXTERNAL_DEVICE *This,
- IN UINTN Register,
- IN UINTN Length,
- IN VOID *Buffer
- )
+(EFIAPI *EMBEDDED_EXTERNAL_DEVICE_WRITE)(
+ IN EMBEDDED_EXTERNAL_DEVICE *This,
+ IN UINTN Register,
+ IN UINTN Length,
+ IN VOID *Buffer
+ )
+
/*++
Routine Description:
@@ -79,10 +81,10 @@ Returns:
;
struct _EMBEDDED_EXTERNAL_DEVICE {
- EMBEDDED_EXTERNAL_DEVICE_READ Read;
- EMBEDDED_EXTERNAL_DEVICE_WRITE Write;
+ EMBEDDED_EXTERNAL_DEVICE_READ Read;
+ EMBEDDED_EXTERNAL_DEVICE_WRITE Write;
};
-extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid;
+extern EFI_GUID gEmbeddedExternalDeviceProtocolGuid;
-#endif // __EMBEDDED_EXTERNAL_DEVICE_H__
+#endif // __EMBEDDED_EXTERNAL_DEVICE_H__
diff --git a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
index 83854fc286..3cd5b74a48 100644
--- a/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
+++ b/EmbeddedPkg/Include/Protocol/EmbeddedGpio.h
@@ -12,27 +12,27 @@
//
// Protocol interface structure
//
-typedef struct _EMBEDDED_GPIO EMBEDDED_GPIO;
+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))
+#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
+ 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 {
@@ -46,11 +46,12 @@ typedef enum {
//
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET) (
+(EFIAPI *EMBEDDED_GPIO_GET)(
IN EMBEDDED_GPIO *This,
IN EMBEDDED_GPIO_PIN Gpio,
OUT UINTN *Value
);
+
/*++
Routine Description:
@@ -69,14 +70,14 @@ Returns:
--*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- IN EMBEDDED_GPIO_MODE Mode
- );
+(EFIAPI *EMBEDDED_GPIO_SET)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ IN EMBEDDED_GPIO_MODE Mode
+ );
+
/*++
Routine Description:
@@ -95,14 +96,14 @@ Returns:
--*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_GET_MODE) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- OUT EMBEDDED_GPIO_MODE *Mode
- );
+(EFIAPI *EMBEDDED_GPIO_GET_MODE)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ OUT EMBEDDED_GPIO_MODE *Mode
+ );
+
/*++
Routine Description:
@@ -121,14 +122,14 @@ Returns:
--*/
-
typedef
EFI_STATUS
-(EFIAPI *EMBEDDED_GPIO_SET_PULL) (
- IN EMBEDDED_GPIO *This,
- IN EMBEDDED_GPIO_PIN Gpio,
- IN EMBEDDED_GPIO_PULL Direction
- );
+(EFIAPI *EMBEDDED_GPIO_SET_PULL)(
+ IN EMBEDDED_GPIO *This,
+ IN EMBEDDED_GPIO_PIN Gpio,
+ IN EMBEDDED_GPIO_PULL Direction
+ );
+
/*++
Routine Description:
@@ -147,32 +148,30 @@ Returns:
--*/
-
-
struct _EMBEDDED_GPIO {
- EMBEDDED_GPIO_GET Get;
- EMBEDDED_GPIO_SET Set;
- EMBEDDED_GPIO_GET_MODE GetMode;
- EMBEDDED_GPIO_SET_PULL SetPull;
+ EMBEDDED_GPIO_GET Get;
+ EMBEDDED_GPIO_SET Set;
+ EMBEDDED_GPIO_GET_MODE GetMode;
+ EMBEDDED_GPIO_SET_PULL SetPull;
};
-extern EFI_GUID gEmbeddedGpioProtocolGuid;
+extern EFI_GUID gEmbeddedGpioProtocolGuid;
-typedef struct _GPIO_CONTROLLER GPIO_CONTROLLER;
-typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER;
+typedef struct _GPIO_CONTROLLER GPIO_CONTROLLER;
+typedef struct _PLATFORM_GPIO_CONTROLLER PLATFORM_GPIO_CONTROLLER;
struct _GPIO_CONTROLLER {
- UINTN RegisterBase;
- UINTN GpioIndex;
- UINTN InternalGpioCount;
+ UINTN RegisterBase;
+ UINTN GpioIndex;
+ UINTN InternalGpioCount;
};
struct _PLATFORM_GPIO_CONTROLLER {
- UINTN GpioCount;
- UINTN GpioControllerCount;
- GPIO_CONTROLLER *GpioController;
+ UINTN GpioCount;
+ UINTN GpioControllerCount;
+ GPIO_CONTROLLER *GpioController;
};
-extern EFI_GUID gPlatformGpioProtocolGuid;
+extern EFI_GUID gPlatformGpioProtocolGuid;
#endif
diff --git a/EmbeddedPkg/Include/Protocol/FdtClient.h b/EmbeddedPkg/Include/Protocol/FdtClient.h
index 08eb49639b..723be88cfc 100644
--- a/EmbeddedPkg/Include/Protocol/FdtClient.h
+++ b/EmbeddedPkg/Include/Protocol/FdtClient.h
@@ -12,7 +12,7 @@
#ifndef __FDT_CLIENT_H__
#define __FDT_CLIENT_H__
-#define FDT_CLIENT_PROTOCOL_GUID { \
+#define FDT_CLIENT_PROTOCOL_GUID {\
0xE11FACA0, 0x4710, 0x4C8E, {0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C} \
}
@@ -23,7 +23,7 @@ typedef struct _FDT_CLIENT_PROTOCOL FDT_CLIENT_PROTOCOL;
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY) (
+(EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY)(
IN FDT_CLIENT_PROTOCOL *This,
IN INT32 Node,
IN CONST CHAR8 *PropertyName,
@@ -33,7 +33,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY) (
+(EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY)(
IN FDT_CLIENT_PROTOCOL *This,
IN INT32 Node,
IN CONST CHAR8 *PropertyName,
@@ -43,7 +43,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE) (
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE)(
IN FDT_CLIENT_PROTOCOL *This,
IN CONST CHAR8 *CompatibleString,
OUT INT32 *Node
@@ -51,7 +51,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE) (
+(EFIAPI *FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE)(
IN FDT_CLIENT_PROTOCOL *This,
IN CONST CHAR8 *CompatibleString,
IN INT32 PrevNode,
@@ -60,7 +60,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY) (
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY)(
IN FDT_CLIENT_PROTOCOL *This,
IN CONST CHAR8 *CompatibleString,
IN CONST CHAR8 *PropertyName,
@@ -70,7 +70,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG) (
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG)(
IN FDT_CLIENT_PROTOCOL *This,
IN CONST CHAR8 *CompatibleString,
OUT CONST VOID **Reg,
@@ -81,7 +81,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG) (
+(EFIAPI *FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG)(
IN FDT_CLIENT_PROTOCOL *This,
IN INT32 PrevNode,
OUT INT32 *Node,
@@ -93,7 +93,7 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_FIND_MEMORY_NODE_REG) (
+(EFIAPI *FDT_CLIENT_FIND_MEMORY_NODE_REG)(
IN FDT_CLIENT_PROTOCOL *This,
OUT INT32 *Node,
OUT CONST VOID **Reg,
@@ -104,26 +104,26 @@ EFI_STATUS
typedef
EFI_STATUS
-(EFIAPI *FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE) (
+(EFIAPI *FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE)(
IN FDT_CLIENT_PROTOCOL *This,
OUT INT32 *Node
);
struct _FDT_CLIENT_PROTOCOL {
- FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty;
- FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty;
+ FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty;
+ FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty;
- FDT_CLIENT_FIND_COMPATIBLE_NODE FindCompatibleNode;
- FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE FindNextCompatibleNode;
- FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty;
- FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg;
+ FDT_CLIENT_FIND_COMPATIBLE_NODE FindCompatibleNode;
+ FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE FindNextCompatibleNode;
+ FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty;
+ FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg;
- FDT_CLIENT_FIND_MEMORY_NODE_REG FindMemoryNodeReg;
- FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG FindNextMemoryNodeReg;
+ FDT_CLIENT_FIND_MEMORY_NODE_REG FindMemoryNodeReg;
+ FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG FindNextMemoryNodeReg;
- FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode;
+ FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode;
};
-extern EFI_GUID gFdtClientProtocolGuid;
+extern EFI_GUID gFdtClientProtocolGuid;
#endif
diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h b/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h
index ca95fa93c4..412e99b6d1 100644
--- a/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h
+++ b/EmbeddedPkg/Include/Protocol/HardwareInterrupt.h
@@ -20,7 +20,6 @@
#include <Protocol/DebugSupport.h>
-
//
// Protocol GUID
//
@@ -29,13 +28,10 @@
#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.
@@ -48,12 +44,11 @@ typedef UINTN HARDWARE_INTERRUPT_SOURCE;
**/
typedef
VOID
-(EFIAPI *HARDWARE_INTERRUPT_HANDLER) (
+(EFIAPI *HARDWARE_INTERRUPT_HANDLER)(
IN HARDWARE_INTERRUPT_SOURCE Source,
IN EFI_SYSTEM_CONTEXT SystemContext
);
-
/**
Register Handler for the specified interrupt source.
@@ -67,13 +62,12 @@ VOID
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT_REGISTER) (
+(EFIAPI *HARDWARE_INTERRUPT_REGISTER)(
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN HARDWARE_INTERRUPT_HANDLER Handler
);
-
/**
Enable interrupt source Source.
@@ -86,13 +80,11 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT_ENABLE) (
+(EFIAPI *HARDWARE_INTERRUPT_ENABLE)(
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
-
-
/**
Disable interrupt source Source.
@@ -105,12 +97,11 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT_DISABLE) (
+(EFIAPI *HARDWARE_INTERRUPT_DISABLE)(
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
-
/**
Return current state of interrupt source Source.
@@ -124,7 +115,7 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE) (
+(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE)(
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN BOOLEAN *InterruptState
@@ -143,22 +134,19 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT_END_OF_INTERRUPT) (
+(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;
+ 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;
+extern EFI_GUID gHardwareInterruptProtocolGuid;
#endif
-
-
diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
index 2b1cb5f28e..d017a9e21f 100644
--- a/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
+++ b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
@@ -25,7 +25,7 @@ typedef enum {
} EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE;
typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL \
- EFI_HARDWARE_INTERRUPT2_PROTOCOL;
+ EFI_HARDWARE_INTERRUPT2_PROTOCOL;
/**
Register Handler for the specified interrupt source.
@@ -40,13 +40,12 @@ typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL \
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_REGISTER) (
+(EFIAPI *HARDWARE_INTERRUPT2_REGISTER)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN HARDWARE_INTERRUPT_HANDLER Handler
);
-
/**
Enable interrupt source Source.
@@ -59,12 +58,11 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_ENABLE) (
+(EFIAPI *HARDWARE_INTERRUPT2_ENABLE)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
-
/**
Disable interrupt source Source.
@@ -77,12 +75,11 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_DISABLE) (
+(EFIAPI *HARDWARE_INTERRUPT2_DISABLE)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
-
/**
Return current state of interrupt source Source.
@@ -96,7 +93,7 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE) (
+(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN BOOLEAN *InterruptState
@@ -115,7 +112,7 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_END_OF_INTERRUPT) (
+(EFIAPI *HARDWARE_INTERRUPT2_END_OF_INTERRUPT)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source
);
@@ -133,13 +130,12 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE) (
+(EFIAPI *HARDWARE_INTERRUPT2_GET_TRIGGER_TYPE)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
OUT EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE *TriggerType
);
-
/**
Configure the trigger type for an interrupt source
@@ -153,7 +149,7 @@ EFI_STATUS
**/
typedef
EFI_STATUS
-(EFIAPI *HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE) (
+(EFIAPI *HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE)(
IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
IN HARDWARE_INTERRUPT_SOURCE Source,
IN EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE TriggerType
@@ -171,6 +167,6 @@ struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL {
HARDWARE_INTERRUPT2_SET_TRIGGER_TYPE SetTriggerType;
};
-extern EFI_GUID gHardwareInterrupt2ProtocolGuid;
+extern EFI_GUID gHardwareInterrupt2ProtocolGuid;
#endif
diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h b/EmbeddedPkg/Include/Protocol/MmcHost.h
index 4772528cf1..881ae5e3d1 100644
--- a/EmbeddedPkg/Include/Protocol/MmcHost.h
+++ b/EmbeddedPkg/Include/Protocol/MmcHost.h
@@ -16,169 +16,166 @@
#define EMBEDDED_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;
+#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_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_CMD6 (MMC_INDX(6) | MMC_CMD_WAIT_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_CMD25 (MMC_INDX(25) | 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)
-#define MMC_ACMD51 (MMC_INDX(51) | MMC_CMD_WAIT_RESPONSE)
+#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_CMD6 (MMC_INDX(6) | MMC_CMD_WAIT_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_CMD25 (MMC_INDX(25) | 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)
+#define MMC_ACMD51 (MMC_INDX(51) | MMC_CMD_WAIT_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
+#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
-#define MMC_STATUS_APP_CMD (1 << 5)
+#define MMC_STATUS_APP_CMD (1 << 5)
typedef enum _MMC_STATE {
- MmcInvalidState = 0,
- MmcHwInitializationState,
- MmcIdleState,
- MmcReadyState,
- MmcIdentificationState,
- MmcStandByState,
- MmcTransferState,
- MmcSendingDataState,
- MmcReceiveDataState,
- MmcProgrammingState,
- MmcDisconnectState,
+ MmcInvalidState = 0,
+ MmcHwInitializationState,
+ MmcIdleState,
+ MmcReadyState,
+ MmcIdentificationState,
+ MmcStandByState,
+ MmcTransferState,
+ MmcSendingDataState,
+ MmcReceiveDataState,
+ MmcProgrammingState,
+ MmcDisconnectState,
} MMC_STATE;
-#define EMMCBACKWARD (0)
-#define EMMCHS26 (1 << 0) // High-Speed @26MHz at rated device voltages
-#define EMMCHS52 (1 << 1) // High-Speed @52MHz at rated device voltages
-#define EMMCHS52DDR1V8 (1 << 2) // High-Speed Dual Data Rate @52MHz 1.8V or 3V I/O
-#define EMMCHS52DDR1V2 (1 << 3) // High-Speed Dual Data Rate @52MHz 1.2V I/O
-#define EMMCHS200SDR1V8 (1 << 4) // HS200 Single Data Rate @200MHz 1.8V I/O
-#define EMMCHS200SDR1V2 (1 << 5) // HS200 Single Data Rate @200MHz 1.2V I/O
-#define EMMCHS400DDR1V8 (1 << 6) // HS400 Dual Data Rate @400MHz 1.8V I/O
-#define EMMCHS400DDR1V2 (1 << 7) // HS400 Dual Data Rate @400MHz 1.2V I/O
+#define EMMCBACKWARD (0)
+#define EMMCHS26 (1 << 0) // High-Speed @26MHz at rated device voltages
+#define EMMCHS52 (1 << 1) // High-Speed @52MHz at rated device voltages
+#define EMMCHS52DDR1V8 (1 << 2) // High-Speed Dual Data Rate @52MHz 1.8V or 3V I/O
+#define EMMCHS52DDR1V2 (1 << 3) // High-Speed Dual Data Rate @52MHz 1.2V I/O
+#define EMMCHS200SDR1V8 (1 << 4) // HS200 Single Data Rate @200MHz 1.8V I/O
+#define EMMCHS200SDR1V2 (1 << 5) // HS200 Single Data Rate @200MHz 1.2V I/O
+#define EMMCHS400DDR1V8 (1 << 6) // HS400 Dual Data Rate @400MHz 1.8V I/O
+#define EMMCHS400DDR1V2 (1 << 7) // HS400 Dual Data Rate @400MHz 1.2V I/O
///
/// Forward declaration for EFI_MMC_HOST_PROTOCOL
///
-typedef struct _EFI_MMC_HOST_PROTOCOL EFI_MMC_HOST_PROTOCOL;
+typedef struct _EFI_MMC_HOST_PROTOCOL EFI_MMC_HOST_PROTOCOL;
-typedef BOOLEAN (EFIAPI *MMC_ISCARDPRESENT) (
+typedef BOOLEAN (EFIAPI *MMC_ISCARDPRESENT)(
IN EFI_MMC_HOST_PROTOCOL *This
);
-typedef BOOLEAN (EFIAPI *MMC_ISREADONLY) (
+typedef BOOLEAN (EFIAPI *MMC_ISREADONLY)(
IN EFI_MMC_HOST_PROTOCOL *This
);
-typedef EFI_STATUS (EFIAPI *MMC_BUILDDEVICEPATH) (
+typedef EFI_STATUS (EFIAPI *MMC_BUILDDEVICEPATH)(
IN EFI_MMC_HOST_PROTOCOL *This,
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
);
-typedef EFI_STATUS (EFIAPI *MMC_NOTIFYSTATE) (
+typedef EFI_STATUS (EFIAPI *MMC_NOTIFYSTATE)(
IN EFI_MMC_HOST_PROTOCOL *This,
IN MMC_STATE State
);
-typedef EFI_STATUS (EFIAPI *MMC_SENDCOMMAND) (
+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) (
+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) (
+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) (
+typedef EFI_STATUS (EFIAPI *MMC_WRITEBLOCKDATA)(
IN EFI_MMC_HOST_PROTOCOL *This,
IN EFI_LBA Lba,
IN UINTN Length,
IN UINT32 *Buffer
);
-typedef EFI_STATUS (EFIAPI *MMC_SETIOS) (
+typedef EFI_STATUS (EFIAPI *MMC_SETIOS)(
IN EFI_MMC_HOST_PROTOCOL *This,
IN UINT32 BusClockFreq,
IN UINT32 BusWidth,
IN UINT32 TimingMode
);
-typedef BOOLEAN (EFIAPI *MMC_ISMULTIBLOCK) (
+typedef BOOLEAN (EFIAPI *MMC_ISMULTIBLOCK)(
IN EFI_MMC_HOST_PROTOCOL *This
);
struct _EFI_MMC_HOST_PROTOCOL {
+ UINT32 Revision;
+ MMC_ISCARDPRESENT IsCardPresent;
+ MMC_ISREADONLY IsReadOnly;
+ MMC_BUILDDEVICEPATH BuildDevicePath;
- UINT32 Revision;
- MMC_ISCARDPRESENT IsCardPresent;
- MMC_ISREADONLY IsReadOnly;
- MMC_BUILDDEVICEPATH BuildDevicePath;
+ MMC_NOTIFYSTATE NotifyState;
- MMC_NOTIFYSTATE NotifyState;
+ MMC_SENDCOMMAND SendCommand;
+ MMC_RECEIVERESPONSE ReceiveResponse;
- MMC_SENDCOMMAND SendCommand;
- MMC_RECEIVERESPONSE ReceiveResponse;
-
- MMC_READBLOCKDATA ReadBlockData;
- MMC_WRITEBLOCKDATA WriteBlockData;
-
- MMC_SETIOS SetIos;
- MMC_ISMULTIBLOCK IsMultiBlock;
+ MMC_READBLOCKDATA ReadBlockData;
+ MMC_WRITEBLOCKDATA WriteBlockData;
+ MMC_SETIOS SetIos;
+ MMC_ISMULTIBLOCK IsMultiBlock;
};
-#define MMC_HOST_PROTOCOL_REVISION 0x00010002 // 1.2
+#define MMC_HOST_PROTOCOL_REVISION 0x00010002 // 1.2
-#define MMC_HOST_HAS_SETIOS(Host) (Host->Revision >= MMC_HOST_PROTOCOL_REVISION && \
+#define MMC_HOST_HAS_SETIOS(Host) (Host->Revision >= MMC_HOST_PROTOCOL_REVISION &&\
Host->SetIos != NULL)
-#define MMC_HOST_HAS_ISMULTIBLOCK(Host) (Host->Revision >= MMC_HOST_PROTOCOL_REVISION && \
+#define MMC_HOST_HAS_ISMULTIBLOCK(Host) (Host->Revision >= MMC_HOST_PROTOCOL_REVISION &&\
Host->IsMultiBlock != NULL)
-extern EFI_GUID gEmbeddedMmcHostProtocolGuid;
+extern EFI_GUID gEmbeddedMmcHostProtocolGuid;
#endif
-
diff --git a/EmbeddedPkg/Include/Protocol/PeCoffLoader.h b/EmbeddedPkg/Include/Protocol/PeCoffLoader.h
index 56557901b0..08738e9927 100644
--- a/EmbeddedPkg/Include/Protocol/PeCoffLoader.h
+++ b/EmbeddedPkg/Include/Protocol/PeCoffLoader.h
@@ -16,11 +16,8 @@
#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.
@@ -46,11 +43,10 @@ typedef struct _PE_COFF_LOADER_PROTOCOL PE_COFF_LOADER_PROTOCOL;
**/
typedef
RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_GET_IMAGE_INFO) (
+(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().
@@ -83,11 +79,10 @@ RETURN_STATUS
**/
typedef
RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_RELOCATE_IMAGE) (
+(EFIAPI *PE_COFF_LOADER_RELOCATE_IMAGE)(
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
);
-
/**
Loads a PE/COFF image into memory.
@@ -121,12 +116,10 @@ RETURN_STATUS
**/
typedef
RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_LOAD_IMAGE) (
+(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.
@@ -152,15 +145,13 @@ RETURN_STATUS
**/
typedef
RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_READ_FROM_MEMORY) (
+(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 virtual calling at EFI
runtime.
@@ -186,15 +177,13 @@ RETURN_STATUS
**/
typedef
VOID
-(EFIAPI *PE_COFF_LOADER_RELOCATE_IMAGE_FOR_RUNTIME) (
+(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
@@ -213,23 +202,19 @@ VOID
**/
typedef
RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_UNLOAD_IMAGE) (
+(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;
+ 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;
-
+extern EFI_GUID gPeCoffLoaderProtocolGuid;
#endif
-
diff --git a/EmbeddedPkg/Include/Protocol/PlatformBootManager.h b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h
index 0167f4b35c..f1790d9742 100644
--- a/EmbeddedPkg/Include/Protocol/PlatformBootManager.h
+++ b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h
@@ -12,7 +12,7 @@
//
// Protocol interface structure
//
-typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL;
+typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL;
//
// Function Prototypes
@@ -65,16 +65,16 @@ typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL
*/
typedef
EFI_STATUS
-(EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) (
+(EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS)(
OUT UINTN *Count,
OUT EFI_BOOT_MANAGER_LOAD_OPTION **BootOptions,
OUT EFI_INPUT_KEY **BootKeys
);
struct _PLATFORM_BOOT_MANAGER_PROTOCOL {
- GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys;
+ GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys;
};
-extern EFI_GUID gPlatformBootManagerProtocolGuid;
+extern EFI_GUID gPlatformBootManagerProtocolGuid;
#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */
diff --git a/EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h b/EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h
index fc0ea09340..2123d3bc2e 100644
--- a/EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h
+++ b/EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h
@@ -12,48 +12,48 @@
//
// Protocol interface structure
//
-typedef struct _PLATFORM_VIRTUAL_KBD_PROTOCOL PLATFORM_VIRTUAL_KBD_PROTOCOL;
+typedef struct _PLATFORM_VIRTUAL_KBD_PROTOCOL PLATFORM_VIRTUAL_KBD_PROTOCOL;
-typedef struct _VIRTUAL_KBD_KEY VIRTUAL_KBD_KEY;
+typedef struct _VIRTUAL_KBD_KEY VIRTUAL_KBD_KEY;
-#define VIRTUAL_KEYBOARD_KEY_SIGNATURE SIGNATURE_32 ('v', 'k', 'b', 'd')
+#define VIRTUAL_KEYBOARD_KEY_SIGNATURE SIGNATURE_32 ('v', 'k', 'b', 'd')
struct _VIRTUAL_KBD_KEY {
- UINTN Signature;
- EFI_INPUT_KEY Key;
+ UINTN Signature;
+ EFI_INPUT_KEY Key;
};
typedef
EFI_STATUS
-(EFIAPI *PLATFORM_VIRTUAL_KBD_REGISTER) (
+(EFIAPI *PLATFORM_VIRTUAL_KBD_REGISTER)(
IN VOID
);
typedef
EFI_STATUS
-(EFIAPI *PLATFORM_VIRTUAL_KBD_RESET) (
+(EFIAPI *PLATFORM_VIRTUAL_KBD_RESET)(
IN VOID
);
typedef
BOOLEAN
-(EFIAPI *PLATFORM_VIRTUAL_KBD_QUERY) (
+(EFIAPI *PLATFORM_VIRTUAL_KBD_QUERY)(
IN VIRTUAL_KBD_KEY *VirtualKey
);
typedef
EFI_STATUS
-(EFIAPI *PLATFORM_VIRTUAL_KBD_CLEAR) (
+(EFIAPI *PLATFORM_VIRTUAL_KBD_CLEAR)(
IN VIRTUAL_KBD_KEY *VirtualKey
);
struct _PLATFORM_VIRTUAL_KBD_PROTOCOL {
- PLATFORM_VIRTUAL_KBD_REGISTER Register;
- PLATFORM_VIRTUAL_KBD_RESET Reset;
- PLATFORM_VIRTUAL_KBD_QUERY Query;
- PLATFORM_VIRTUAL_KBD_CLEAR Clear;
+ PLATFORM_VIRTUAL_KBD_REGISTER Register;
+ PLATFORM_VIRTUAL_KBD_RESET Reset;
+ PLATFORM_VIRTUAL_KBD_QUERY Query;
+ PLATFORM_VIRTUAL_KBD_CLEAR Clear;
};
-extern EFI_GUID gPlatformVirtualKeyboardProtocolGuid;
+extern EFI_GUID gPlatformVirtualKeyboardProtocolGuid;
#endif /* __PLATFORM_VIRTUAL_KEYBOARD_H__ */
diff --git a/EmbeddedPkg/Include/Protocol/UsbDevice.h b/EmbeddedPkg/Include/Protocol/UsbDevice.h
index 5936fb5e4c..b299ee10a7 100644
--- a/EmbeddedPkg/Include/Protocol/UsbDevice.h
+++ b/EmbeddedPkg/Include/Protocol/UsbDevice.h
@@ -11,7 +11,7 @@
#include <IndustryStandard/Usb.h>
-extern EFI_GUID gUsbDeviceProtocolGuid;
+extern EFI_GUID gUsbDeviceProtocolGuid;
/*
* Note: This Protocol is just the bare minimum for Android Fastboot. It
@@ -30,8 +30,8 @@ extern EFI_GUID gUsbDeviceProtocolGuid;
typedef
VOID
(*USB_DEVICE_RX_CALLBACK) (
- IN UINTN Size,
- IN VOID *Buffer
+ IN UINTN Size,
+ IN VOID *Buffer
);
/*
@@ -46,7 +46,7 @@ VOID
typedef
VOID
(*USB_DEVICE_TX_CALLBACK) (
- IN UINT8 EndpointIndex
+ IN UINT8 EndpointIndex
);
/*
@@ -64,9 +64,9 @@ VOID
typedef
EFI_STATUS
(*USB_DEVICE_SEND) (
- IN UINT8 EndpointIndex,
- IN UINTN Size,
- IN CONST VOID *Buffer
+ IN UINT8 EndpointIndex,
+ IN UINTN Size,
+ IN CONST VOID *Buffer
);
/*
@@ -96,15 +96,15 @@ EFI_STATUS
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
+ 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;
+ USB_DEVICE_START Start;
+ USB_DEVICE_SEND Send;
};
typedef struct _USB_DEVICE_PROTOCOL USB_DEVICE_PROTOCOL;
diff --git a/EmbeddedPkg/Include/fdt.h b/EmbeddedPkg/Include/fdt.h
index 0187749f19..120dbc8bc6 100644
--- a/EmbeddedPkg/Include/fdt.h
+++ b/EmbeddedPkg/Include/fdt.h
@@ -1,5 +1,6 @@
#ifndef _FDT_H
#define _FDT_H
+
/*
* libfdt - Flat Device Tree manipulation
* Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -55,57 +56,57 @@
#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 */
+ 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 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 */
+ /* version 17 fields below */
+ fdt32_t size_dt_struct; /* size of the structure block */
};
struct fdt_reserve_entry {
- fdt64_t address;
- fdt64_t size;
+ fdt64_t address;
+ fdt64_t size;
};
struct fdt_node_header {
- fdt32_t tag;
- char name[0];
+ fdt32_t tag;
+ char name[0];
};
struct fdt_property {
- fdt32_t tag;
- fdt32_t len;
- fdt32_t nameoff;
- char data[0];
+ 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_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_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))
+#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
index 141ecb579b..6105b9c075 100644
--- a/EmbeddedPkg/Include/libfdt.h
+++ b/EmbeddedPkg/Include/libfdt.h
@@ -1,5 +1,6 @@
#ifndef _LIBFDT_H
#define _LIBFDT_H
+
/*
* libfdt - Flat Device Tree manipulation
* Copyright (C) 2006 David Gibson, IBM Corporation.
@@ -54,119 +55,160 @@
#include <libfdt_env.h>
#include <fdt.h>
-#define FDT_FIRST_SUPPORTED_VERSION 0x10
-#define FDT_LAST_SUPPORTED_VERSION 0x11
+#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: Attempted 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. */
+#define FDT_ERR_NOTFOUND 1
+/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
+#define FDT_ERR_EXISTS 2
+
+/* FDT_ERR_EXISTS: Attempted 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.
- * This can be caused either by an invalid phandle property
- * length, or the phandle value was either 0 or -1, which 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. */
+#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.
+ * This can be caused either by an invalid phandle property
+ * length, or the phandle value was either 0 or -1, which 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. */
+#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_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. */
/* Errors in device tree content */
-#define FDT_ERR_BADNCELLS 14
- /* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
- * or similar property with a bad format or value */
+#define FDT_ERR_BADNCELLS 14
+
+/* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
+ * or similar property with a bad format or value */
-#define FDT_ERR_BADVALUE 15
- /* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
- * value. For example: a property expected to contain a string list
- * is not NUL-terminated within the length of its value. */
+#define FDT_ERR_BADVALUE 15
-#define FDT_ERR_BADOVERLAY 16
- /* FDT_ERR_BADOVERLAY: The device tree overlay, while
- * correctly structured, cannot be applied due to some
- * unexpected or missing value, property or node. */
+/* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
+ * value. For example: a property expected to contain a string list
+ * is not NUL-terminated within the length of its value. */
-#define FDT_ERR_NOPHANDLES 17
- /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
- * phandle available anymore without causing an overflow */
+#define FDT_ERR_BADOVERLAY 16
-#define FDT_ERR_MAX 17
+/* FDT_ERR_BADOVERLAY: The device tree overlay, while
+ * correctly structured, cannot be applied due to some
+ * unexpected or missing value, property or node. */
+
+#define FDT_ERR_NOPHANDLES 17
+
+/* FDT_ERR_NOPHANDLES: The device tree doesn't have any
+ * phandle available anymore without causing an overflow */
+
+#define FDT_ERR_MAX 17
/**********************************************************************/
/* Low-level functions (you probably don't need these) */
/**********************************************************************/
#ifndef SWIG /* This function is not useful in Python */
-const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
+const void *
+fdt_offset_ptr (
+ const void *fdt,
+ int offset,
+ unsigned int checklen
+ );
+
#endif
-static inline void *fdt_offset_ptr_w(void *fdt, int offset, 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);
+ return (void *)(uintptr_t)fdt_offset_ptr (fdt, offset, checklen);
}
-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+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);
+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
+ * @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);
+int
+fdt_first_subnode (
+ const void *fdt,
+ int offset
+ );
/**
* fdt_next_subnode() - get offset of next direct subnode
@@ -174,73 +216,77 @@ int fdt_first_subnode(const void *fdt, int offset);
* 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
+ * @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);
+int
+fdt_next_subnode (
+ const void *fdt,
+ int offset
+ );
/**
* fdt_for_each_subnode - iterate over all subnodes of a parent
*
- * @node: child node (int, lvalue)
- * @fdt: FDT blob (const void *)
- * @parent: parent node (int)
+ * @node: child node (int, lvalue)
+ * @fdt: FDT blob (const void *)
+ * @parent: parent node (int)
*
* This is actually a wrapper around a for loop and would be used like so:
*
- * fdt_for_each_subnode(node, fdt, parent) {
- * Use node
- * ...
- * }
+ * fdt_for_each_subnode(node, fdt, parent) {
+ * Use node
+ * ...
+ * }
*
- * if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) {
- * Error handling
- * }
+ * if ((node < 0) && (node != -FDT_ERR_NOT_FOUND)) {
+ * Error handling
+ * }
*
* Note that this is implemented as a macro and @node is used as
* iterator in the loop. The parent variable be constant or even a
* literal.
*
*/
-#define fdt_for_each_subnode(node, fdt, parent) \
- for (node = fdt_first_subnode(fdt, parent); \
- node >= 0; \
- node = fdt_next_subnode(fdt, node))
+#define fdt_for_each_subnode(node, fdt, parent) \
+ for (node = fdt_first_subnode(fdt, parent); \
+ node >= 0; \
+ node = fdt_next_subnode(fdt, node))
/**********************************************************************/
/* 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))
+ (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);
+ 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
/**
@@ -257,7 +303,10 @@ __fdt_set_hdr(size_dt_struct);
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings, as above
*/
-int fdt_check_header(const void *fdt);
+int
+fdt_check_header (
+ const void *fdt
+ );
/**
* fdt_move - move a device tree around in memory
@@ -278,7 +327,12 @@ int fdt_check_header(const void *fdt);
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
-int fdt_move(const void *fdt, void *buf, int bufsize);
+int
+fdt_move (
+ const void *fdt,
+ void *buf,
+ int bufsize
+ );
/**********************************************************************/
/* Read-only functions */
@@ -296,7 +350,11 @@ int fdt_move(const void *fdt, void *buf, int bufsize);
* a pointer to the string, on success
* NULL, if stroffset is out of bounds
*/
-const char *fdt_string(const void *fdt, int stroffset);
+const char *
+fdt_string (
+ const void *fdt,
+ int stroffset
+ );
/**
* fdt_get_max_phandle - retrieves the highest phandle in a tree
@@ -311,7 +369,10 @@ const char *fdt_string(const void *fdt, int stroffset);
* 0, if no phandle was found in the device tree
* -1, if an error occurred
*/
-uint32_t fdt_get_max_phandle(const void *fdt);
+uint32_t
+fdt_get_max_phandle (
+ const void *fdt
+ );
/**
* fdt_num_mem_rsv - retrieve the number of memory reserve map entries
@@ -324,7 +385,10 @@ uint32_t fdt_get_max_phandle(const void *fdt);
* returns:
* the number of entries
*/
-int fdt_num_mem_rsv(const void *fdt);
+int
+fdt_num_mem_rsv (
+ const void *fdt
+ );
/**
* fdt_get_mem_rsv - retrieve one memory reserve map entry
@@ -341,7 +405,13 @@ int fdt_num_mem_rsv(const void *fdt);
* -FDT_ERR_BADVERSION,
* -FDT_ERR_BADSTATE, standard meanings
*/
-int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+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
@@ -356,9 +426,16 @@ int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
* such as a full path.
*/
#ifndef SWIG /* Not available in Python */
-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
- const char *name, int namelen);
+int
+fdt_subnode_offset_namelen (
+ const void *fdt,
+ int parentoffset,
+ const char *name,
+ int namelen
+ );
+
#endif
+
/**
* fdt_subnode_offset - find a subnode of a given node
* @fdt: pointer to the device tree blob
@@ -373,17 +450,22 @@ int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
* 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.
+ * 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);
+int
+fdt_subnode_offset (
+ const void *fdt,
+ int parentoffset,
+ const char *name
+ );
/**
* fdt_path_offset_namelen - find a tree node by its full path
@@ -395,7 +477,13 @@ int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
* characters of path as the path name.
*/
#ifndef SWIG /* Not available in Python */
-int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
+int
+fdt_path_offset_namelen (
+ const void *fdt,
+ const char *path,
+ int namelen
+ );
+
#endif
/**
@@ -411,17 +499,21 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
* 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
+ * 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.
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings.
*/
-int fdt_path_offset(const void *fdt, const char *path);
+int
+fdt_path_offset (
+ const void *fdt,
+ const char *path
+ );
/**
* fdt_get_name - retrieve the name of a given node
@@ -435,18 +527,23 @@ int fdt_path_offset(const void *fdt, const char *path);
* 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);
+ * 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
@@ -457,16 +554,20 @@ const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
* 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
+ * 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.
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings.
*/
-int fdt_first_property_offset(const void *fdt, int nodeoffset);
+int
+fdt_first_property_offset (
+ const void *fdt,
+ int nodeoffset
+ );
/**
* fdt_next_property_offset - step through a node's properties
@@ -478,43 +579,47 @@ int fdt_first_property_offset(const void *fdt, int nodeoffset);
* 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
+ * 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.
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings.
*/
-int fdt_next_property_offset(const void *fdt, int offset);
+int
+fdt_next_property_offset (
+ const void *fdt,
+ int offset
+ );
/**
* fdt_for_each_property_offset - iterate over all properties of a node
*
- * @property_offset: property offset (int, lvalue)
- * @fdt: FDT blob (const void *)
- * @node: node offset (int)
+ * @property_offset: property offset (int, lvalue)
+ * @fdt: FDT blob (const void *)
+ * @node: node offset (int)
*
* This is actually a wrapper around a for loop and would be used like so:
*
- * fdt_for_each_property_offset(property, fdt, node) {
- * Use property
- * ...
- * }
+ * fdt_for_each_property_offset(property, fdt, node) {
+ * Use property
+ * ...
+ * }
*
- * if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) {
- * Error handling
- * }
+ * if ((property < 0) && (property != -FDT_ERR_NOT_FOUND)) {
+ * Error handling
+ * }
*
* Note that this is implemented as a macro and property is used as
* iterator in the loop. The node variable can be constant or even a
* literal.
*/
-#define fdt_for_each_property_offset(property, fdt, node) \
- for (property = fdt_first_property_offset(fdt, node); \
- property >= 0; \
- property = fdt_next_property_offset(fdt, property))
+#define fdt_for_each_property_offset(property, fdt, node) \
+ for (property = fdt_first_property_offset(fdt, node); \
+ property >= 0; \
+ property = fdt_next_property_offset(fdt, property))
/**
* fdt_get_property_by_offset - retrieve the property at a given offset
@@ -528,21 +633,24 @@ int fdt_next_property_offset(const void *fdt, int offset);
* 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);
+ * 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
@@ -556,10 +664,15 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
* characters of name for matching the property name.
*/
#ifndef SWIG /* Not available in Python */
-const struct fdt_property *fdt_get_property_namelen(const void *fdt,
- int nodeoffset,
- const char *name,
- int namelen, int *lenp);
+const struct fdt_property *
+fdt_get_property_namelen (
+ const void *fdt,
+ int nodeoffset,
+ const char *name,
+ int namelen,
+ int *lenp
+ );
+
#endif
/**
@@ -576,28 +689,38 @@ const struct fdt_property *fdt_get_property_namelen(const void *fdt,
* 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)
+ * 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);
+ return (struct fdt_property *)(uintptr_t)
+ fdt_get_property (fdt, nodeoffset, name, lenp);
}
/**
@@ -617,23 +740,29 @@ static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
* 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
+ * 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
*/
#ifndef SWIG /* This function is not useful in Python */
-const void *fdt_getprop_by_offset(const void *fdt, int offset,
- const char **namep, int *lenp);
+const void *
+fdt_getprop_by_offset (
+ const void *fdt,
+ int offset,
+ const char **namep,
+ int *lenp
+ );
+
#endif
/**
@@ -648,15 +777,33 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset,
* characters of name for matching the property name.
*/
#ifndef SWIG /* Not available in Python */
-const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
- const char *name, int namelen, int *lenp);
-static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
- const char *name, int namelen,
- int *lenp)
+const void *
+fdt_getprop_namelen (
+ const void *fdt,
+ int nodeoffset,
+ const char *name,
+ int namelen,
+ int *lenp
+ );
+
+static inline void *
+fdt_getprop_namelen_w (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ int namelen,
+ int *lenp
+ )
{
- return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name,
- namelen, lenp);
+ return (void *)(uintptr_t)fdt_getprop_namelen (
+ fdt,
+ nodeoffset,
+ name,
+ namelen,
+ lenp
+ );
}
+
#endif
/**
@@ -673,26 +820,37 @@ static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset,
* 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)
+ * 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);
+ return (void *)(uintptr_t)fdt_getprop (fdt, nodeoffset, name, lenp);
}
/**
@@ -704,10 +862,14 @@ static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
* 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
+ * 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);
+uint32_t
+fdt_get_phandle (
+ const void *fdt,
+ int nodeoffset
+ );
/**
* fdt_get_alias_namelen - get alias based on substring
@@ -719,8 +881,13 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
* characters of name for matching the alias name.
*/
#ifndef SWIG /* Not available in Python */
-const char *fdt_get_alias_namelen(const void *fdt,
- const char *name, int namelen);
+const char *
+fdt_get_alias_namelen (
+ const void *fdt,
+ const char *name,
+ int namelen
+ );
+
#endif
/**
@@ -732,10 +899,14 @@ const char *fdt_get_alias_namelen(const void *fdt,
* 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
+ * 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);
+const char *
+fdt_get_alias (
+ const void *fdt,
+ const char *name
+ );
/**
* fdt_get_path - determine the full path of a node
@@ -751,18 +922,24 @@ const char *fdt_get_alias(const void *fdt, const char *name);
* 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
+ * 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);
+int
+fdt_get_path (
+ const void *fdt,
+ int nodeoffset,
+ char *buf,
+ int buflen
+ );
/**
* fdt_supernode_atdepth_offset - find a specific ancestor of a node
@@ -774,28 +951,33 @@ int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
* 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);
+ * 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);
+ * 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
+ * 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);
+int
+fdt_supernode_atdepth_offset (
+ const void *fdt,
+ int nodeoffset,
+ int supernodedepth,
+ int *nodedepth
+ );
/**
* fdt_node_depth - find the depth of a given node
@@ -809,14 +991,18 @@ int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
* 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
+ * 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);
+int
+fdt_node_depth (
+ const void *fdt,
+ int nodeoffset
+ );
/**
* fdt_parent_offset - find the parent of a given node
@@ -831,15 +1017,19 @@ int fdt_node_depth(const void *fdt, int nodeoffset);
* 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
+ * 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);
+int
+fdt_parent_offset (
+ const void *fdt,
+ int nodeoffset
+ );
/**
* fdt_node_offset_by_prop_value - find nodes with a given property value
@@ -856,32 +1046,37 @@ int fdt_parent_offset(const void *fdt, int nodeoffset);
*
* 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);
- * }
+ * 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
+ * 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);
+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
@@ -894,15 +1089,19 @@ int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
* 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
+ * 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);
+int
+fdt_node_offset_by_phandle (
+ const void *fdt,
+ uint32_t phandle
+ );
/**
* fdt_node_check_compatible: check a node's compatible property
@@ -916,18 +1115,22 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
* 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
+ * 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);
+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
@@ -942,29 +1145,33 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
*
* 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);
- * }
+ * 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
+ * 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);
+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
@@ -978,7 +1185,12 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
*
* @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);
+int
+fdt_stringlist_contains (
+ const char *strlist,
+ int listlen,
+ const char *str
+ );
/**
* fdt_stringlist_count - count the number of strings in a string list
@@ -990,7 +1202,12 @@ int fdt_stringlist_contains(const char *strlist, int listlen, const char *str);
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist
*/
-int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
+int
+fdt_stringlist_count (
+ const void *fdt,
+ int nodeoffset,
+ const char *property
+ );
/**
* fdt_stringlist_search - find a string in a string list and return its index
@@ -1011,8 +1228,13 @@ int fdt_stringlist_count(const void *fdt, int nodeoffset, const char *property);
* -FDT_ERR_NOTFOUND if the property does not exist or does not contain
* the given string
*/
-int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
- const char *string);
+int
+fdt_stringlist_search (
+ const void *fdt,
+ int nodeoffset,
+ const char *property,
+ const char *string
+ );
/**
* fdt_stringlist_get() - obtain the string at a given index in a string list
@@ -1038,9 +1260,14 @@ int fdt_stringlist_search(const void *fdt, int nodeoffset, const char *property,
* -FDT_ERR_BADVALUE if the property value is not NUL-terminated
* -FDT_ERR_NOTFOUND if the property does not exist
*/
-const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
- const char *property, int index,
- int *lenp);
+const char *
+fdt_stringlist_get (
+ const void *fdt,
+ int nodeoffset,
+ const char *property,
+ int index,
+ int *lenp
+ );
/**********************************************************************/
/* Read-only functions (addressing related) */
@@ -1055,7 +1282,7 @@ const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
* Implementations may support larger values, but in practice higher
* values aren't used.
*/
-#define FDT_MAX_NCELLS 4
+#define FDT_MAX_NCELLS 4
/**
* fdt_address_cells - retrieve address size for a bus represented in the tree
@@ -1065,17 +1292,21 @@ const char *fdt_stringlist_get(const void *fdt, int nodeoffset,
* When the node has a valid #address-cells property, returns its value.
*
* returns:
- * 0 <= n < FDT_MAX_NCELLS, on success
+ * 0 <= n < FDT_MAX_NCELLS, on success
* 2, if the node has no #address-cells property
* -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
- * #address-cells property
- * -FDT_ERR_BADMAGIC,
- * -FDT_ERR_BADVERSION,
- * -FDT_ERR_BADSTATE,
- * -FDT_ERR_BADSTRUCTURE,
- * -FDT_ERR_TRUNCATED, standard meanings
+ * #address-cells property
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings
*/
-int fdt_address_cells(const void *fdt, int nodeoffset);
+int
+fdt_address_cells (
+ const void *fdt,
+ int nodeoffset
+ );
/**
* fdt_size_cells - retrieve address range size for a bus represented in the
@@ -1086,18 +1317,21 @@ int fdt_address_cells(const void *fdt, int nodeoffset);
* When the node has a valid #size-cells property, returns its value.
*
* returns:
- * 0 <= n < FDT_MAX_NCELLS, on success
+ * 0 <= n < FDT_MAX_NCELLS, on success
* 2, if the node has no #address-cells property
* -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
- * #size-cells property
- * -FDT_ERR_BADMAGIC,
- * -FDT_ERR_BADVERSION,
- * -FDT_ERR_BADSTATE,
- * -FDT_ERR_BADSTRUCTURE,
- * -FDT_ERR_TRUNCATED, standard meanings
+ * #size-cells property
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_TRUNCATED, standard meanings
*/
-int fdt_size_cells(const void *fdt, int nodeoffset);
-
+int
+fdt_size_cells (
+ const void *fdt,
+ int nodeoffset
+ );
/**********************************************************************/
/* Write-in-place functions */
@@ -1120,10 +1354,17 @@ int fdt_size_cells(const void *fdt, int nodeoffset);
* an array and you have a string that doesn't end with \0.
*/
#ifndef SWIG /* Not available in Python */
-int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
- const char *name, int namelen,
- uint32_t idx, const void *val,
- int len);
+int
+fdt_setprop_inplace_namelen_partial (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ int namelen,
+ uint32_t idx,
+ const void *val,
+ int len
+ );
+
#endif
/**
@@ -1144,19 +1385,26 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset,
* 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
+ * 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
*/
#ifndef SWIG /* Not available in Python */
-int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
- const void *val, int len);
+int
+fdt_setprop_inplace (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ const void *val,
+ int len
+ );
+
#endif
/**
@@ -1177,21 +1425,27 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
* 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)
+ * 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));
+ fdt32_t tmp = cpu_to_fdt32 (val);
+
+ return fdt_setprop_inplace (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1212,21 +1466,27 @@ static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
* 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)
+ * 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));
+ fdt64_t tmp = cpu_to_fdt64 (val);
+
+ return fdt_setprop_inplace (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1234,10 +1494,15 @@ static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
*
* 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)
+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);
+ return fdt_setprop_inplace_u32 (fdt, nodeoffset, name, val);
}
/**
@@ -1255,16 +1520,21 @@ static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
* 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
+ * 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);
+int
+fdt_nop_property (
+ void *fdt,
+ int nodeoffset,
+ const char *name
+ );
/**
* fdt_nop_node - replace a node (subtree) with nop tags
@@ -1280,39 +1550,95 @@ int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
* 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
+ * 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);
+int
+fdt_nop_node (
+ void *fdt,
+ int nodeoffset
+ );
/**********************************************************************/
/* Sequential write functions */
/**********************************************************************/
-int fdt_create(void *buf, int bufsize);
-int fdt_resize(void *fdt, 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)
+int
+fdt_create (
+ void *buf,
+ int bufsize
+ );
+
+int
+fdt_resize (
+ void *fdt,
+ 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));
+ 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)
+
+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));
+ 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)
+
+static inline int
+fdt_property_cell (
+ void *fdt,
+ const char *name,
+ uint32_t val
+ )
{
- return fdt_property_u32(fdt, name, val);
+ return fdt_property_u32 (fdt, name, val);
}
/**
@@ -1324,24 +1650,51 @@ static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
* @valp: returns a pointer to where where the value should be placed
*
* returns:
- * 0, on success
- * -FDT_ERR_BADMAGIC,
- * -FDT_ERR_NOSPACE, standard meanings
+ * 0, on success
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_NOSPACE, standard meanings
*/
-int fdt_property_placeholder(void *fdt, const char *name, int len, void **valp);
+int
+fdt_property_placeholder (
+ void *fdt,
+ const char *name,
+ int len,
+ void **valp
+ );
#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);
+ 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);
+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
@@ -1355,17 +1708,22 @@ int fdt_pack(void *fdt);
* 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
+ * 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);
+int
+fdt_add_mem_rsv (
+ void *fdt,
+ uint64_t address,
+ uint64_t size
+ );
/**
* fdt_del_mem_rsv - remove a memory reserve map entry
@@ -1379,17 +1737,21 @@ int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
* 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
+ * 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);
+int
+fdt_del_mem_rsv (
+ void *fdt,
+ int n
+ );
/**
* fdt_set_name - change the name of a given node
@@ -1407,15 +1769,20 @@ int fdt_del_mem_rsv(void *fdt, int n);
* 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
+ * 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);
+int
+fdt_set_name (
+ void *fdt,
+ int nodeoffset,
+ const char *name
+ );
/**
* fdt_setprop - create or change a property
@@ -1433,20 +1800,26 @@ int fdt_set_name(void *fdt, int nodeoffset, const char *name);
* 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);
+ * 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 _placeholder - allocate space for a property
@@ -1464,20 +1837,26 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,
* 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_placeholder(void *fdt, int nodeoffset, const char *name,
- int len, void **prop_data);
+ * 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_placeholder (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ int len,
+ void **prop_data
+ );
/**
* fdt_setprop_u32 - set a property to a 32-bit integer
@@ -1495,23 +1874,29 @@ int fdt_setprop_placeholder(void *fdt, int nodeoffset, const char *name,
* 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)
+ * 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));
+ fdt32_t tmp = cpu_to_fdt32 (val);
+
+ return fdt_setprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1530,23 +1915,29 @@ static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
* 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)
+ * 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));
+ fdt64_t tmp = cpu_to_fdt64 (val);
+
+ return fdt_setprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1554,10 +1945,15 @@ static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
*
* 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)
+static inline int
+fdt_setprop_cell (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ uint32_t val
+ )
{
- return fdt_setprop_u32(fdt, nodeoffset, name, val);
+ return fdt_setprop_u32 (fdt, nodeoffset, name, val);
}
/**
@@ -1576,21 +1972,20 @@ static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
* 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
+ * 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_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
/**
* fdt_setprop_empty - set a property to an empty value
@@ -1606,20 +2001,20 @@ static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
* 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
+ * 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_empty(fdt, nodeoffset, name) \
- fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
+ fdt_setprop((fdt), (nodeoffset), (name), NULL, 0)
/**
* fdt_appendprop - append to or create a property
@@ -1636,20 +2031,26 @@ static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
* 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);
+ * 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
@@ -1667,23 +2068,29 @@ int fdt_appendprop(void *fdt, int nodeoffset, const char *name,
* 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)
+ * 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));
+ fdt32_t tmp = cpu_to_fdt32 (val);
+
+ return fdt_appendprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1702,23 +2109,29 @@ static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
* 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)
+ * 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));
+ fdt64_t tmp = cpu_to_fdt64 (val);
+
+ return fdt_appendprop (fdt, nodeoffset, name, &tmp, sizeof (tmp));
}
/**
@@ -1726,10 +2139,15 @@ static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
*
* 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)
+static inline int
+fdt_appendprop_cell (
+ void *fdt,
+ int nodeoffset,
+ const char *name,
+ uint32_t val
+ )
{
- return fdt_appendprop_u32(fdt, nodeoffset, name, val);
+ return fdt_appendprop_u32 (fdt, nodeoffset, name, val);
}
/**
@@ -1747,20 +2165,20 @@ static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
* 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
+ * 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_appendprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
/**
* fdt_delprop - delete a property
@@ -1774,17 +2192,22 @@ static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
* 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
+ * 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);
+int
+fdt_delprop (
+ void *fdt,
+ int nodeoffset,
+ const char *name
+ );
/**
* fdt_add_subnode_namelen - creates a new node based on substring
@@ -1799,8 +2222,14 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name);
* full path.
*/
#ifndef SWIG /* Not available in Python */
-int fdt_add_subnode_namelen(void *fdt, int parentoffset,
- const char *name, int namelen);
+int
+fdt_add_subnode_namelen (
+ void *fdt,
+ int parentoffset,
+ const char *name,
+ int namelen
+ );
+
#endif
/**
@@ -1817,24 +2246,29 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,
* 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
+ * 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.
+ * -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);
+int
+fdt_add_subnode (
+ void *fdt,
+ int parentoffset,
+ const char *name
+ );
/**
* fdt_del_node - delete a node (subtree)
@@ -1848,16 +2282,20 @@ int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
* 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
+ * 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);
+int
+fdt_del_node (
+ void *fdt,
+ int nodeoffset
+ );
/**
* fdt_overlay_apply - Applies a DT overlay on a base DT
@@ -1871,29 +2309,36 @@ int fdt_del_node(void *fdt, int nodeoffset);
* returns an error.
*
* returns:
- * 0, on success
- * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
- * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
- * properties in the base DT
- * -FDT_ERR_BADPHANDLE,
- * -FDT_ERR_BADOVERLAY,
- * -FDT_ERR_NOPHANDLES,
- * -FDT_ERR_INTERNAL,
- * -FDT_ERR_BADLAYOUT,
- * -FDT_ERR_BADMAGIC,
- * -FDT_ERR_BADOFFSET,
- * -FDT_ERR_BADPATH,
- * -FDT_ERR_BADVERSION,
- * -FDT_ERR_BADSTRUCTURE,
- * -FDT_ERR_BADSTATE,
- * -FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_overlay_apply(void *fdt, void *fdto);
+ * 0, on success
+ * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
+ * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
+ * properties in the base DT
+ * -FDT_ERR_BADPHANDLE,
+ * -FDT_ERR_BADOVERLAY,
+ * -FDT_ERR_NOPHANDLES,
+ * -FDT_ERR_INTERNAL,
+ * -FDT_ERR_BADLAYOUT,
+ * -FDT_ERR_BADMAGIC,
+ * -FDT_ERR_BADOFFSET,
+ * -FDT_ERR_BADPATH,
+ * -FDT_ERR_BADVERSION,
+ * -FDT_ERR_BADSTRUCTURE,
+ * -FDT_ERR_BADSTATE,
+ * -FDT_ERR_TRUNCATED, standard meanings
+ */
+int
+fdt_overlay_apply (
+ void *fdt,
+ void *fdto
+ );
/**********************************************************************/
/* Debugging / informational functions */
/**********************************************************************/
-const char *fdt_strerror(int errval);
+const char *
+fdt_strerror (
+ int errval
+ );
#endif /* _LIBFDT_H */
diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_env.h
index c35ac73970..dfd3bac01f 100644
--- a/EmbeddedPkg/Include/libfdt_env.h
+++ b/EmbeddedPkg/Include/libfdt_env.h
@@ -12,79 +12,153 @@
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
-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)
+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)
+#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)
+#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) {
+#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) {
+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) {
+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) {
+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) {
+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) {
+static inline size_t
+strlen (
+ const char *str
+ )
+{
return AsciiStrLen (str);
}
-static inline char *strchr(const char *s, int c) {
- char pattern[2];
+static inline char *
+strchr (
+ const char *s,
+ int c
+ )
+{
+ char pattern[2];
+
pattern[0] = c;
pattern[1] = 0;
return AsciiStrStr (s, pattern);
}
-static inline size_t strnlen (const char* str, size_t strsz ) {
+static inline size_t
+strnlen (
+ const char *str,
+ size_t strsz
+ )
+{
return AsciiStrnLenS (str, strsz);
}
-static inline size_t strcmp (const char* str1, const char* str2) {
+static inline size_t
+strcmp (
+ const char *str1,
+ const char *str2
+ )
+{
return AsciiStrCmp (str1, str2);
}
-static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) {
+static inline size_t
+strncmp (
+ const char *str1,
+ const char *str2,
+ size_t strsz
+ )
+{
return AsciiStrnCmp (str1, str2, strsz);
}
-static inline size_t strncpy (char* dest, const char* source, size_t dest_max) {
+static inline size_t
+strncpy (
+ char *dest,
+ const char *source,
+ size_t dest_max
+ )
+{
return AsciiStrCpyS (dest, dest_max, source);
}