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>
This commit is contained in:
Michael Kubacki
2021-12-05 14:53:56 -08:00
committed by mergify[bot]
parent 731c67e1d7
commit e7108d0e96
106 changed files with 9242 additions and 7648 deletions

View File

@@ -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__

View File

@@ -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__ */

View File

@@ -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

View File

@@ -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

View File

@@ -26,8 +26,8 @@
EFI_STATUS
EFIAPI
DtPlatformLoadDtb (
OUT VOID **Dtb,
OUT UINTN *DtbSize
OUT VOID **Dtb,
OUT UINTN *DtbSize
);
#endif

View File

@@ -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;
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;
UINT64 CurrentPosition; // Information for Seek
UINT64 MaxPosition;
UINTN BaseOffset; // Base offset for hexdump command
UINTN BaseOffset; // Base offset for hexdump command
UINTN Size; // Valid for all types other than l#:
UINT8 *Buffer; // Information valid for A#:
UINTN Size; // Valid for all types other than l#:
UINT8 *Buffer; // Information valid for A#:
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#:
EFI_GUID FvNameGuid;
EFI_SECTION_TYPE FvSectionType;
EFI_FV_FILETYPE FvType;
EFI_FV_FILE_ATTRIBUTES FvAttributes;
EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#:
EFI_GUID FvNameGuid;
EFI_SECTION_TYPE FvSectionType;
EFI_FV_FILETYPE FvType;
EFI_FV_FILE_ATTRIBUTES FvAttributes;
EFI_PHYSICAL_ADDRESS FvStart;
UINTN FvSize;
UINTN FvHeaderSize;
EFI_PHYSICAL_ADDRESS FvStart;
UINTN FvSize;
UINTN FvHeaderSize;
EFI_FILE *FsFileHandle; // Information valid for Fs#:
EFI_FILE_SYSTEM_INFO *FsInfo;
EFI_FILE_INFO *FsFileInfo;
EFI_BLOCK_IO_MEDIA *FsBlockIoMedia; // Information valid for Fs#: or B#:
EFI_BLOCK_IO_PROTOCOL *FsBlockIo; // Information valid for Fs#: or B#:
EFI_FILE *FsFileHandle; // Information valid for Fs#:
EFI_FILE_SYSTEM_INFO *FsInfo;
EFI_FILE_INFO *FsFileInfo;
EFI_BLOCK_IO_MEDIA *FsBlockIoMedia; // Information valid for Fs#: or B#:
EFI_BLOCK_IO_PROTOCOL *FsBlockIo; // Information valid for Fs#: or B#:
UINTN DiskOffset; // Information valid for B#:
UINTN DiskOffset; // Information valid for B#:
EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#:
EFI_IP_ADDRESS ServerIp; // Information valid for t:
BOOLEAN IsDirty;
BOOLEAN IsBufferValid;
EFI_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
);
/**

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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
);
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
);
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
);
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
);
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
);
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

View File

@@ -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;
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 */
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

View File

@@ -32,7 +32,7 @@ PrePeiGetHobList (
EFI_STATUS
EFIAPI
PrePeiSetHobList (
IN VOID *HobList
IN VOID *HobList
);
#endif

View File

@@ -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

View File

@@ -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

View File

@@ -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.