Skip to content

Commit

Permalink
AmpereSiliconPkg: Apply uncrustify changes
Browse files Browse the repository at this point in the history
This applies uncrustify changes to .c/.h files in the AmpereSiliconPkg
package.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
  • Loading branch information
nhivp committed Sep 19, 2024
1 parent b9c7885 commit 2e2c1b1
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
0xC4D6ED50, 0x769D, 0x4319, { 0xEB, 0xB7, 0xCC, 0xDD, 0xC8, 0x9D, 0x3D, 0x2D } \
}

extern EFI_GUID gBmcConfigFormSetGuid;
extern EFI_GUID gBmcConfigFormSetGuid;

#endif /* BMC_CONFIG_HII_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
0xE8887242, 0x4EFF, 0x4323, { 0x81, 0xF4, 0xC9, 0x5F, 0xD5, 0x8D, 0x80, 0xD5 } \
}

extern EFI_GUID gPlatformManagerFormsetGuid;
extern EFI_GUID gPlatformManagerEntryEventGuid;
extern EFI_GUID gPlatformManagerExitEventGuid;
extern EFI_GUID gPlatformManagerFormsetGuid;
extern EFI_GUID gPlatformManagerEntryEventGuid;
extern EFI_GUID gPlatformManagerExitEventGuid;

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

#include "PlatformManager.h"

PLATFORM_MANAGER_CALLBACK_DATA gPlatformManagerPrivate = {
PLATFORM_MANAGER_CALLBACK_DATA gPlatformManagerPrivate = {
NULL,
NULL
};

EFI_GUID mPlatformManagerGuid = FORMSET_GUID;
EFI_GUID mPlatformManagerGuid = FORMSET_GUID;

HII_VENDOR_DEVICE_PATH mPlatformManagerHiiVendorDevicePath = {
HII_VENDOR_DEVICE_PATH mPlatformManagerHiiVendorDevicePath = {
{
{
HARDWARE_DEVICE_PATH,
Expand All @@ -28,7 +28,8 @@ HII_VENDOR_DEVICE_PATH mPlatformManagerHiiVendorDevicePath = {
//
// {FC587265-0750-44D1-B68D-D1DDD3F29B0B}
//
{ 0xFC587265, 0x0750, 0x44D1, {0xB6, 0x8D, 0xD1, 0xDD, 0xD3, 0xF2, 0x9B, 0x0B} }
{ 0xFC587265, 0x0750, 0x44D1, { 0xB6, 0x8D, 0xD1, 0xDD, 0xD3, 0xF2, 0x9B, 0x0B }
}
},
{
END_DEVICE_PATH_TYPE,
Expand All @@ -51,11 +52,11 @@ HII_VENDOR_DEVICE_PATH mPlatformManagerHiiVendorDevicePath = {
**/
CHAR16 *
PmExtractDevicePathFromHiiHandle (
IN EFI_HII_HANDLE Handle
IN EFI_HII_HANDLE Handle
)
{
EFI_STATUS Status;
EFI_HANDLE DriverHandle;
EFI_STATUS Status;
EFI_HANDLE DriverHandle;

ASSERT (Handle != NULL);

Expand All @@ -67,6 +68,7 @@ PmExtractDevicePathFromHiiHandle (
if (EFI_ERROR (Status)) {
return NULL;
}

//
// Get device path string.
//
Expand All @@ -81,33 +83,33 @@ PmExtractDevicePathFromHiiHandle (
**/
VOID
CreatePlatformManagerForm (
IN EFI_FORM_ID NextShowFormId
IN EFI_FORM_ID NextShowFormId
)
{
UINTN Index;
EFI_STRING String;
EFI_STRING_ID Token;
EFI_STRING_ID TokenHelp;
EFI_HII_HANDLE *HiiHandles;
EFI_HII_HANDLE HiiHandle;
EFI_GUID FormSetGuid;
VOID *StartOpCodeHandle;
VOID *EndOpCodeHandle;
EFI_IFR_GUID_LABEL *StartLabel;
EFI_IFR_GUID_LABEL *EndLabel;
CHAR16 *DevicePathStr;
EFI_STRING_ID DevicePathId;
EFI_IFR_FORM_SET *Buffer;
UINTN BufferSize;
UINT8 ClassGuidNum;
EFI_GUID *ClassGuid;
UINTN TempSize;
UINT8 *Ptr;
EFI_STATUS Status;

TempSize = 0;
UINTN Index;
EFI_STRING String;
EFI_STRING_ID Token;
EFI_STRING_ID TokenHelp;
EFI_HII_HANDLE *HiiHandles;
EFI_HII_HANDLE HiiHandle;
EFI_GUID FormSetGuid;
VOID *StartOpCodeHandle;
VOID *EndOpCodeHandle;
EFI_IFR_GUID_LABEL *StartLabel;
EFI_IFR_GUID_LABEL *EndLabel;
CHAR16 *DevicePathStr;
EFI_STRING_ID DevicePathId;
EFI_IFR_FORM_SET *Buffer;
UINTN BufferSize;
UINT8 ClassGuidNum;
EFI_GUID *ClassGuid;
UINTN TempSize;
UINT8 *Ptr;
EFI_STATUS Status;

TempSize = 0;
BufferSize = 0;
Buffer = NULL;
Buffer = NULL;

HiiHandle = gPlatformManagerPrivate.HiiHandle;

Expand All @@ -134,7 +136,7 @@ CreatePlatformManagerForm (
//
// According to the next show Form id(mNextShowFormId) to decide which form need to update.
//
StartLabel->Number = (UINT16)(LABEL_FORM_ID_OFFSET + NextShowFormId);
StartLabel->Number = (UINT16)(LABEL_FORM_ID_OFFSET + NextShowFormId);

//
// Create Hii Extend Label OpCode as the end opcode
Expand All @@ -159,24 +161,24 @@ CreatePlatformManagerForm (
// Search for formset of each class type
//
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
Status = HiiGetFormSetFromHiiHandle (HiiHandles[Index], &Buffer,&BufferSize);
Status = HiiGetFormSetFromHiiHandle (HiiHandles[Index], &Buffer, &BufferSize);
if (EFI_ERROR (Status)) {
continue;
}

Ptr = (UINT8 *)Buffer;

while(TempSize < BufferSize) {
while (TempSize < BufferSize) {
TempSize += ((EFI_IFR_OP_HEADER *)Ptr)->Length;
if (((EFI_IFR_OP_HEADER *)Ptr)->Length <= OFFSET_OF (EFI_IFR_FORM_SET, Flags)) {
Ptr += ((EFI_IFR_OP_HEADER *)Ptr)->Length;
continue;
}

ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)Ptr)->Flags & 0x3);
ClassGuid = (EFI_GUID *)(VOID *)(Ptr + sizeof (EFI_IFR_FORM_SET));
ClassGuid = (EFI_GUID *)(VOID *)(Ptr + sizeof (EFI_IFR_FORM_SET));
while (ClassGuidNum-- > 0) {
if (CompareGuid (&gPlatformManagerFormsetGuid, ClassGuid)== 0) {
if (CompareGuid (&gPlatformManagerFormsetGuid, ClassGuid) == 0) {
ClassGuid++;
continue;
}
Expand All @@ -186,6 +188,7 @@ CreatePlatformManagerForm (
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_MISSING_STRING), NULL);
ASSERT (String != NULL);
}

Token = HiiSetString (HiiHandle, 0, String, NULL);
FreePool (String);

Expand All @@ -194,6 +197,7 @@ CreatePlatformManagerForm (
String = HiiGetString (HiiHandle, STRING_TOKEN (STR_MISSING_STRING), NULL);
ASSERT (String != NULL);
}

TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
FreePool (String);

Expand All @@ -219,15 +223,16 @@ CreatePlatformManagerForm (
DevicePathId
);
}

break;
}

Ptr += ((EFI_IFR_OP_HEADER *)Ptr)->Length;
}

FreePool (Buffer);
Buffer = NULL;
TempSize = 0;
Buffer = NULL;
TempSize = 0;
BufferSize = 0;
}

Expand Down Expand Up @@ -257,20 +262,20 @@ CreatePlatformManagerForm (
EFI_STATUS
EFIAPI
PlatformManagerUiLibConstructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_EVENT PlatformUiEntryEvent;
EFI_STATUS Status;
EFI_EVENT PlatformUiEntryEvent;

gPlatformManagerPrivate.DriverHandle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
&gPlatformManagerPrivate.DriverHandle,
&gEfiDevicePathProtocolGuid,
&mPlatformManagerHiiVendorDevicePath,
NULL
);
Status = gBS->InstallMultipleProtocolInterfaces (
&gPlatformManagerPrivate.DriverHandle,
&gEfiDevicePathProtocolGuid,
&mPlatformManagerHiiVendorDevicePath,
NULL
);
ASSERT_EFI_ERROR (Status);

//
Expand Down Expand Up @@ -320,12 +325,12 @@ PlatformManagerUiLibConstructor (
EFI_STATUS
EFIAPI
PlatformManagerUiLibDestructor (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_EVENT PlatformUiExitEvent;
EFI_STATUS Status;
EFI_EVENT PlatformUiExitEvent;

Status = gBS->UninstallMultipleProtocolInterfaces (
gPlatformManagerPrivate.DriverHandle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,23 @@
//
// These are the VFR compiler generated data representing our VFR data.
//
extern UINT8 PlatformManagerVfrBin[];
extern UINT8 PlatformManagerUiLibStrings[];
extern UINT8 PlatformManagerVfrBin[];
extern UINT8 PlatformManagerUiLibStrings[];

///
/// HII specific Vendor Device Path definition.
///
typedef struct {
VENDOR_DEVICE_PATH VendorDevicePath;
EFI_DEVICE_PATH_PROTOCOL End;
VENDOR_DEVICE_PATH VendorDevicePath;
EFI_DEVICE_PATH_PROTOCOL End;
} HII_VENDOR_DEVICE_PATH;

typedef struct {
///
/// Platform Manager HII relative handles
///
EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;

EFI_HII_HANDLE HiiHandle;
EFI_HANDLE DriverHandle;
} PLATFORM_MANAGER_CALLBACK_DATA;

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
//
// These are defined as the same with vfr file
//
#define LABEL_FORM_ID_OFFSET 0x0100
#define ENTRY_KEY_OFFSET 0x4000
#define LABEL_FORM_ID_OFFSET 0x0100
#define ENTRY_KEY_OFFSET 0x4000

#define PLATFORM_MANAGER_FORM_ID 0x1000
#define PLATFORM_MANAGER_FORM_ID 0x1000

#define LABEL_ENTRY_LIST 0x1100
#define LABEL_END 0xffff
#define LABEL_ENTRY_LIST 0x1100
#define LABEL_END 0xffff

#endif /* PLATFORM_MANAGER_VFR_H_ */

0 comments on commit 2e2c1b1

Please sign in to comment.