From 11c20f4e06d252feaa65aa5e526686baf015762d Mon Sep 17 00:00:00 2001 From: oliviermartin Date: Thu, 22 Sep 2011 22:53:54 +0000 Subject: Arm Packages: Fixed coding style/Line endings to follow EDK2 coding convention Arm Packages: Fixed mispelling Arm Packages: Reduced warnings all over the code git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12407 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Library/ArmTrustZoneLib/ArmTrustZone.c | 70 +++++++++++++++------- .../DefaultExceptionHandler.c | 21 +++---- .../RvdPeCoffExtraActionLib.c | 2 +- 3 files changed, 58 insertions(+), 35 deletions(-) (limited to 'ArmPkg/Library') diff --git a/ArmPkg/Library/ArmTrustZoneLib/ArmTrustZone.c b/ArmPkg/Library/ArmTrustZoneLib/ArmTrustZone.c index 56d1311f84..8319441f29 100644 --- a/ArmPkg/Library/ArmTrustZoneLib/ArmTrustZone.c +++ b/ArmPkg/Library/ArmTrustZoneLib/ArmTrustZone.c @@ -29,51 +29,77 @@ /** FIXME: Need documentation **/ -EFI_STATUS TZPCSetDecProtBits(UINTN TzpcBase, UINTN TzpcId, UINTN Bits) { - if (TzpcId > TZPC_DECPROT_MAX) { - return EFI_INVALID_PARAMETER; - } +EFI_STATUS +TZPCSetDecProtBits ( + IN UINTN TzpcBase, + IN UINTN TzpcId, + IN UINTN Bits + ) +{ + if (TzpcId > TZPC_DECPROT_MAX) { + return EFI_INVALID_PARAMETER; + } - MmioWrite32((UINTN)TzpcBase + TZPC_DECPROT0_SET_REG + (TzpcId * 0x0C), Bits); + MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_SET_REG + (TzpcId * 0x0C), Bits); - return EFI_SUCCESS; + return EFI_SUCCESS; } /** FIXME: Need documentation **/ -EFI_STATUS TZPCClearDecProtBits(UINTN TzpcBase, UINTN TzpcId, UINTN Bits) { - if (TzpcId> TZPC_DECPROT_MAX) { - return EFI_INVALID_PARAMETER; - } +EFI_STATUS +TZPCClearDecProtBits ( + IN UINTN TzpcBase, + IN UINTN TzpcId, + IN UINTN Bits + ) +{ + if (TzpcId> TZPC_DECPROT_MAX) { + return EFI_INVALID_PARAMETER; + } - MmioWrite32((UINTN)TzpcBase + TZPC_DECPROT0_CLEAR_REG + (TzpcId * 0x0C), Bits); + MmioWrite32 ((UINTN)TzpcBase + TZPC_DECPROT0_CLEAR_REG + (TzpcId * 0x0C), Bits); - return EFI_SUCCESS; + return EFI_SUCCESS; } /** FIXME: Need documentation **/ -UINT32 TZASCGetNumRegions(UINTN TzascBase) { - return (MmioRead32((UINTN)TzascBase + TZASC_CONFIGURATION_REG) & 0xF); +UINT32 +TZASCGetNumRegions ( + IN UINTN TzascBase + ) +{ + return (MmioRead32 ((UINTN)TzascBase + TZASC_CONFIGURATION_REG) & 0xF); } /** FIXME: Need documentation **/ -EFI_STATUS TZASCSetRegion(UINTN TzascBase, UINTN RegionId, UINTN Enabled, UINTN LowAddress, UINTN HighAddress, UINTN Size, UINTN Security) { - UINT32* Region; +EFI_STATUS +TZASCSetRegion ( + IN INTN TzascBase, + IN UINTN RegionId, + IN UINTN Enabled, + IN UINTN LowAddress, + IN UINTN HighAddress, + IN UINTN Size, + IN UINTN Security + ) +{ + UINT32* Region; - if (RegionId > TZASCGetNumRegions(TzascBase)) { - return EFI_INVALID_PARAMETER; - } + if (RegionId > TZASCGetNumRegions(TzascBase)) { + return EFI_INVALID_PARAMETER; + } - Region = (UINT32*)((UINTN)TzascBase + TZASC_REGIONS_REG + (RegionId * 0x10)); + Region = (UINT32*)((UINTN)TzascBase + TZASC_REGIONS_REG + (RegionId * 0x10)); - MmioWrite32((UINTN)(Region), LowAddress&0xFFFF8000); + MmioWrite32((UINTN)(Region), LowAddress&0xFFFF8000); MmioWrite32((UINTN)(Region+1), HighAddress); MmioWrite32((UINTN)(Region+2), ((Security & 0xF) <<28) | ((Size & 0x3F) << 1) | (Enabled & 0x1)); - return EFI_SUCCESS; + return EFI_SUCCESS; } diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c index e969dfa763..07e31ea597 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandler.c @@ -33,8 +33,6 @@ typedef struct { CHAR8 Char; } CPSR_CHAR; - - /** Use the EFI Debug Image Table to lookup the FaultAddress and find which PE/COFF image @@ -61,7 +59,6 @@ GetImageName ( UINTN Entry; CHAR8 *Address; - DebugTable = gDebugImageTableHeader->EfiDebugImageInfoTable; if (DebugTable == NULL) { return NULL; @@ -102,9 +99,9 @@ CpsrString ( OUT CHAR8 *ReturnStr ) { - UINTN Index; - CHAR8 *Str = ReturnStr; - CHAR8 *ModeStr; + UINTN Index; + CHAR8* Str; + CHAR8* ModeStr; CPSR_CHAR CpsrChar[] = { { 31, 'n' }, { 30, 'z' }, @@ -119,6 +116,8 @@ CpsrString ( { 0, '?' } }; + Str = ReturnStr; + for (Index = 0; CpsrChar[Index].BIT != 0; Index++, Str++) { *Str = CpsrChar[Index].Char; if ((Cpsr & (1 << CpsrChar[Index].BIT)) != 0) { @@ -194,8 +193,7 @@ FaultStatusToString ( return FaultSource; } - -CHAR8 *gExceptionTypeString[] = { +STATIC CHAR8 *gExceptionTypeString[] = { "Reset", "Undefined OpCode", "SWI", @@ -206,7 +204,6 @@ CHAR8 *gExceptionTypeString[] = { "FIQ" }; - /** This is the default action to take on an unexpected exception @@ -228,7 +225,7 @@ DefaultExceptionHandler ( BOOLEAN DfsrWrite; UINT32 PcAdjust = 0; - DEBUG ((EFI_D_ERROR, "\n%a Exception PC at 0x%08x CPSR 0x%08x ", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR)); + Print(L"\n%a Exception PC at 0x%08x CPSR 0x%08x ", gExceptionTypeString[ExceptionType], SystemContext.SystemContextArm->PC, SystemContext.SystemContextArm->CPSR); DEBUG_CODE_BEGIN (); CHAR8 *Pdb; UINT32 ImageBase; @@ -249,10 +246,10 @@ DefaultExceptionHandler ( // // A PE/COFF image loads its headers into memory so the headers are - // included in the linked addressess. ELF and Mach-O images do not + // included in the linked addresses. ELF and Mach-O images do not // include the headers so the first byte of the image is usually // text (code). If you look at link maps from ELF or Mach-O images - // you need to subtact out the size of the PE/COFF header to get + // you need to subtract out the size of the PE/COFF header to get // get the offset that matches the link map. // DEBUG ((EFI_D_ERROR, "loaded at 0x%08x (PE/COFF offset) 0x%x (ELF or Mach-O offset) 0x%x", ImageBase, Offset, Offset - PeCoffSizeOfHeader)); diff --git a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c index 531cfa1e7b..161ac2dfb2 100644 --- a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c +++ b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c @@ -89,7 +89,7 @@ DeCygwinPathIfNeeded ( Ptr[9] = Ptr[10]; Ptr[10] = ':'; - // switch path seperators + // switch path separators for (Index = 11; Index < Len; Index++) { if (Ptr[Index] == '/') { Ptr[Index] = '\\' ; -- cgit v1.2.3