diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2022-03-15 14:46:34 -0400 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-05 00:42:38 +0000 |
commit | a298a84478053872ed9da660a75f182ce81b8ddc (patch) | |
tree | 95b97a9ee3a91ec1340c15e5e3264bd5f8723292 /PrmPkg/Samples/PrmSampleHardwareAccessModule | |
parent | f3c11224b55cbad10b357f83d0324588b85862bb (diff) | |
download | edk2-a298a84478053872ed9da660a75f182ce81b8ddc.tar.gz edk2-a298a84478053872ed9da660a75f182ce81b8ddc.tar.bz2 edk2-a298a84478053872ed9da660a75f182ce81b8ddc.zip |
PrmPkg: Apply uncrustify changes
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3737
Apply uncrustify changes to .c/.h files in PrmPkg.
Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
Diffstat (limited to 'PrmPkg/Samples/PrmSampleHardwareAccessModule')
3 files changed, 93 insertions, 86 deletions
diff --git a/PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h b/PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h index a4f8758516..d7298859f6 100644 --- a/PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h +++ b/PrmPkg/Samples/PrmSampleHardwareAccessModule/Hpet.h @@ -15,8 +15,8 @@ #ifndef HPET_REGISTER_H_
#define HPET_REGISTER_H_
-#define HPET_BASE_ADDRESS 0xFED00000
-#define HPET_RANGE_LENGTH 0x1000
+#define HPET_BASE_ADDRESS 0xFED00000
+#define HPET_RANGE_LENGTH 0x1000
///
/// HPET General Register Offsets
@@ -28,15 +28,15 @@ ///
/// HPET Timer Register Offsets
///
-#define HPET_MAIN_COUNTER_OFFSET 0x0F0
-#define HPET_TIMER_CONFIGURATION_OFFSET 0x100
-#define HPET_TIMER_COMPARATOR_OFFSET 0x108
-#define HPET_TIMER_MSI_ROUTE_OFFSET 0x110
+#define HPET_MAIN_COUNTER_OFFSET 0x0F0
+#define HPET_TIMER_CONFIGURATION_OFFSET 0x100
+#define HPET_TIMER_COMPARATOR_OFFSET 0x108
+#define HPET_TIMER_MSI_ROUTE_OFFSET 0x110
///
/// Stride between sets of HPET Timer Registers
///
-#define HPET_TIMER_STRIDE 0x20
+#define HPET_TIMER_STRIDE 0x20
#pragma pack(1)
@@ -45,15 +45,15 @@ ///
typedef union {
struct {
- UINT32 Revision:8;
- UINT32 NumberOfTimers:5;
- UINT32 CounterSize:1;
- UINT32 Reserved0:1;
- UINT32 LegacyRoute:1;
- UINT32 VendorId:16;
- UINT32 CounterClockPeriod:32;
+ UINT32 Revision : 8;
+ UINT32 NumberOfTimers : 5;
+ UINT32 CounterSize : 1;
+ UINT32 Reserved0 : 1;
+ UINT32 LegacyRoute : 1;
+ UINT32 VendorId : 16;
+ UINT32 CounterClockPeriod : 32;
} Bits;
- UINT64 Uint64;
+ UINT64 Uint64;
} HPET_GENERAL_CAPABILITIES_ID_REGISTER;
///
@@ -61,12 +61,12 @@ typedef union { ///
typedef union {
struct {
- UINT32 MainCounterEnable:1;
- UINT32 LegacyRouteEnable:1;
- UINT32 Reserved0:30;
- UINT32 Reserved1:32;
+ UINT32 MainCounterEnable : 1;
+ UINT32 LegacyRouteEnable : 1;
+ UINT32 Reserved0 : 30;
+ UINT32 Reserved1 : 32;
} Bits;
- UINT64 Uint64;
+ UINT64 Uint64;
} HPET_GENERAL_CONFIGURATION_REGISTER;
///
@@ -74,22 +74,22 @@ typedef union { ///
typedef union {
struct {
- UINT32 Reserved0:1;
- UINT32 LevelTriggeredInterrupt:1;
- UINT32 InterruptEnable:1;
- UINT32 PeriodicInterruptEnable:1;
- UINT32 PeriodicInterruptCapability:1;
- UINT32 CounterSizeCapability:1;
- UINT32 ValueSetEnable:1;
- UINT32 Reserved1:1;
- UINT32 CounterSizeEnable:1;
- UINT32 InterruptRoute:5;
- UINT32 MsiInterruptEnable:1;
- UINT32 MsiInterruptCapability:1;
- UINT32 Reserved2:16;
- UINT32 InterruptRouteCapability;
+ UINT32 Reserved0 : 1;
+ UINT32 LevelTriggeredInterrupt : 1;
+ UINT32 InterruptEnable : 1;
+ UINT32 PeriodicInterruptEnable : 1;
+ UINT32 PeriodicInterruptCapability : 1;
+ UINT32 CounterSizeCapability : 1;
+ UINT32 ValueSetEnable : 1;
+ UINT32 Reserved1 : 1;
+ UINT32 CounterSizeEnable : 1;
+ UINT32 InterruptRoute : 5;
+ UINT32 MsiInterruptEnable : 1;
+ UINT32 MsiInterruptCapability : 1;
+ UINT32 Reserved2 : 16;
+ UINT32 InterruptRouteCapability;
} Bits;
- UINT64 Uint64;
+ UINT64 Uint64;
} HPET_TIMER_CONFIGURATION_REGISTER;
///
@@ -97,10 +97,10 @@ typedef union { ///
typedef union {
struct {
- UINT32 Value:32;
- UINT32 Address:32;
+ UINT32 Value : 32;
+ UINT32 Address : 32;
} Bits;
- UINT64 Uint64;
+ UINT64 Uint64;
} HPET_TIMER_MSI_ROUTE_REGISTER;
#pragma pack()
diff --git a/PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardwareAccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c b/PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardwareAccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c index c00ab9ffbb..1dc9a8df98 100644 --- a/PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardwareAccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c +++ b/PrmPkg/Samples/PrmSampleHardwareAccessModule/Library/DxeHardwareAccessModuleConfigLib/DxeHardwareAccessModuleConfigLib.c @@ -18,7 +18,9 @@ STATIC EFI_HANDLE mPrmConfigProtocolHandle;
// {0ef93ed7-14ae-425b-928f-b85a6213b57e}
-STATIC CONST EFI_GUID mPrmModuleGuid = {0x0ef93ed7, 0x14ae, 0x425b, {0x92, 0x8f, 0xb8, 0x5a, 0x62, 0x13, 0xb5, 0x7e}};
+STATIC CONST EFI_GUID mPrmModuleGuid = {
+ 0x0ef93ed7, 0x14ae, 0x425b, { 0x92, 0x8f, 0xb8, 0x5a, 0x62, 0x13, 0xb5, 0x7e }
+};
/**
Constructor of the PRM configuration library.
@@ -32,13 +34,13 @@ STATIC CONST EFI_GUID mPrmModuleGuid = {0x0ef93ed7, 0x14ae, 0x425b, {0x92, 0x8f, EFI_STATUS
EFIAPI
HardwareAccessModuleConfigLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges;
- PRM_CONFIG_PROTOCOL *PrmConfigProtocol;
+ EFI_STATUS Status;
+ PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges;
+ PRM_CONFIG_PROTOCOL *PrmConfigProtocol;
RuntimeMmioRanges = NULL;
PrmConfigProtocol = NULL;
@@ -70,12 +72,13 @@ HardwareAccessModuleConfigLibConstructor ( Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
+
CopyGuid (&PrmConfigProtocol->ModuleContextBuffers.ModuleGuid, &mPrmModuleGuid);
// Populate the Runtime MMIO Ranges structure
- RuntimeMmioRanges->Count = 1;
+ RuntimeMmioRanges->Count = 1;
RuntimeMmioRanges->Range[0].PhysicalBaseAddress = HPET_BASE_ADDRESS;
- RuntimeMmioRanges->Range[0].Length = HPET_RANGE_LENGTH;
+ RuntimeMmioRanges->Range[0].Length = HPET_RANGE_LENGTH;
PrmConfigProtocol->ModuleContextBuffers.RuntimeMmioRanges = RuntimeMmioRanges;
@@ -87,7 +90,7 @@ HardwareAccessModuleConfigLibConstructor ( &mPrmConfigProtocolHandle,
&gPrmConfigProtocolGuid,
EFI_NATIVE_INTERFACE,
- (VOID *) PrmConfigProtocol
+ (VOID *)PrmConfigProtocol
);
Done:
@@ -95,6 +98,7 @@ Done: if (RuntimeMmioRanges != NULL) {
FreePool (RuntimeMmioRanges);
}
+
if (PrmConfigProtocol != NULL) {
FreePool (PrmConfigProtocol);
}
diff --git a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c index 14d1e56ab8..1a1e735029 100644 --- a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c +++ b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c @@ -24,18 +24,18 @@ //
// {2120cd3c-848b-4d8f-abbb-4b74ce64ac89}
-#define MSR_ACCESS_MICROCODE_SIGNATURE_PRM_HANDLER_GUID {0x2120cd3c, 0x848b, 0x4d8f, {0xab, 0xbb, 0x4b, 0x74, 0xce, 0x64, 0xac, 0x89}}
+#define MSR_ACCESS_MICROCODE_SIGNATURE_PRM_HANDLER_GUID {0x2120cd3c, 0x848b, 0x4d8f, {0xab, 0xbb, 0x4b, 0x74, 0xce, 0x64, 0xac, 0x89}}
// {ea0935a7-506b-4159-bbbb-48deeecb6f58}
-#define MSR_ACCESS_MTRR_DUMP_PRM_HANDLER_GUID {0xea0935a7, 0x506b, 0x4159, {0xbb, 0xbb, 0x48, 0xde, 0xee, 0xcb, 0x6f, 0x58}}
+#define MSR_ACCESS_MTRR_DUMP_PRM_HANDLER_GUID {0xea0935a7, 0x506b, 0x4159, {0xbb, 0xbb, 0x48, 0xde, 0xee, 0xcb, 0x6f, 0x58}}
// {1bd1bda9-909a-4614-9699-25ec0c2783f7}
-#define MMIO_ACCESS_HPET_PRM_HANDLER_GUID {0x1bd1bda9, 0x909a, 0x4614, {0x96, 0x99, 0x25, 0xec, 0x0c, 0x27, 0x83, 0xf7}}
+#define MMIO_ACCESS_HPET_PRM_HANDLER_GUID {0x1bd1bda9, 0x909a, 0x4614, {0x96, 0x99, 0x25, 0xec, 0x0c, 0x27, 0x83, 0xf7}}
//
// BEGIN: MtrrLib internal library globals and function prototypes here for testing
//
-extern CONST CHAR8 *mMtrrMemoryCacheTypeShortName[];
+extern CONST CHAR8 *mMtrrMemoryCacheTypeShortName[];
/**
Initializes the valid bits mask and valid address mask for MTRRs.
@@ -48,8 +48,8 @@ extern CONST CHAR8 *mMtrrMemoryCacheTypeShortName[]; **/
VOID
MtrrLibInitializeMtrrMask (
- OUT UINT64 *MtrrValidBitsMask,
- OUT UINT64 *MtrrValidAddressMask
+ OUT UINT64 *MtrrValidBitsMask,
+ OUT UINT64 *MtrrValidAddressMask
);
/**
@@ -109,11 +109,11 @@ MtrrLibApplyFixedMtrrs ( **/
RETURN_STATUS
MtrrLibApplyVariableMtrrs (
- IN CONST MTRR_MEMORY_RANGE *VariableMtrr,
- IN UINT32 VariableMtrrCount,
- IN OUT MTRR_MEMORY_RANGE *Ranges,
- IN UINTN RangeCapacity,
- IN OUT UINTN *RangeCount
+ IN CONST MTRR_MEMORY_RANGE *VariableMtrr,
+ IN UINT32 VariableMtrrCount,
+ IN OUT MTRR_MEMORY_RANGE *Ranges,
+ IN UINTN RangeCapacity,
+ IN OUT UINTN *RangeCount
);
//
@@ -130,17 +130,17 @@ AccessAllMtrrs ( VOID
)
{
- MTRR_SETTINGS LocalMtrrs;
- MTRR_SETTINGS *Mtrrs;
- UINTN RangeCount;
- UINT64 MtrrValidBitsMask;
- UINT64 MtrrValidAddressMask;
- UINT32 VariableMtrrCount;
-
- MTRR_MEMORY_RANGE Ranges[
- MTRR_NUMBER_OF_FIXED_MTRR * sizeof (UINT64) + 2 * ARRAY_SIZE (Mtrrs->Variables.Mtrr) + 1
- ];
- MTRR_MEMORY_RANGE RawVariableRanges[ARRAY_SIZE (Mtrrs->Variables.Mtrr)];
+ MTRR_SETTINGS LocalMtrrs;
+ MTRR_SETTINGS *Mtrrs;
+ UINTN RangeCount;
+ UINT64 MtrrValidBitsMask;
+ UINT64 MtrrValidAddressMask;
+ UINT32 VariableMtrrCount;
+
+ MTRR_MEMORY_RANGE Ranges[
+ MTRR_NUMBER_OF_FIXED_MTRR * sizeof (UINT64) + 2 * ARRAY_SIZE (Mtrrs->Variables.Mtrr) + 1
+ ];
+ MTRR_MEMORY_RANGE RawVariableRanges[ARRAY_SIZE (Mtrrs->Variables.Mtrr)];
if (!IsMtrrSupported ()) {
return;
@@ -155,15 +155,21 @@ AccessAllMtrrs ( Ranges[0].BaseAddress = 0;
Ranges[0].Length = MtrrValidBitsMask + 1;
Ranges[0].Type = MtrrGetDefaultMemoryType ();
- RangeCount = 1;
+ RangeCount = 1;
MtrrLibGetRawVariableRanges (
- &Mtrrs->Variables, VariableMtrrCount,
- MtrrValidBitsMask, MtrrValidAddressMask, RawVariableRanges
+ &Mtrrs->Variables,
+ VariableMtrrCount,
+ MtrrValidBitsMask,
+ MtrrValidAddressMask,
+ RawVariableRanges
);
MtrrLibApplyVariableMtrrs (
- RawVariableRanges, VariableMtrrCount,
- Ranges, ARRAY_SIZE (Ranges), &RangeCount
+ RawVariableRanges,
+ VariableMtrrCount,
+ Ranges,
+ ARRAY_SIZE (Ranges),
+ &RangeCount
);
MtrrLibApplyFixedMtrrs (&Mtrrs->Fixed, Ranges, ARRAY_SIZE (Ranges), &RangeCount);
@@ -187,11 +193,11 @@ AccessAllMtrrs ( UINT64
EFIAPI
HpetRead (
- IN UINTN Offset
+ IN UINTN Offset
)
{
- UINTN Address;
- UINT64 Value;
+ UINTN Address;
+ UINT64 Value;
Address = HPET_BASE_ADDRESS + Offset;
@@ -200,7 +206,7 @@ HpetRead ( }
MemoryFence ();
- Value = *(volatile UINT64*)Address;
+ Value = *(volatile UINT64 *)Address;
MemoryFence ();
return Value;
@@ -251,8 +257,7 @@ GetMicrocodeSignature ( @retval Others An error occurred in the PRM handler.
**/
-PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler)
-{
+PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler) {
UINT32 MicrocodeSignature;
MicrocodeSignature = 0;
@@ -277,8 +282,7 @@ PRM_HANDLER_EXPORT (MsrAccessMicrocodeSignaturePrmHandler) @retval Others An error occurred in the PRM handler.
**/
-PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler)
-{
+PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler) {
AccessAllMtrrs ();
return EFI_SUCCESS;
@@ -296,8 +300,7 @@ PRM_HANDLER_EXPORT (MsrAccessMtrrDumpPrmHandler) @retval Others An error occurred in the PRM handler.
**/
-PRM_HANDLER_EXPORT (MmioAccessHpetPrmHandler)
-{
+PRM_HANDLER_EXPORT (MmioAccessHpetPrmHandler) {
AccessHpetConfiguration ();
return EFI_SUCCESS;
@@ -324,8 +327,8 @@ PRM_MODULE_EXPORT ( EFI_STATUS
EFIAPI
PrmSampleHardwareAccessModuleInit (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
return EFI_SUCCESS;
|