diff --git a/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf b/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf index 93b88f4ef0..6a85c36885 100644 --- a/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf +++ b/ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = ArmCacheMaintenanceLib diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf b/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf index 8042e4dd31..39d0bef800 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = Arm11ArmLib diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf b/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf index 040179e445..11443d8358 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11ArmLibPrePi.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = Arm11ArmLib diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S index eec8f20b4e..e3b7746317 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S @@ -23,6 +23,7 @@ .globl ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA) .globl ASM_PFX(ArmEnableMmu) .globl ASM_PFX(ArmDisableMmu) +.globl ASM_PFX(ArmMmuEnabled) .globl ASM_PFX(ArmEnableDataCache) .globl ASM_PFX(ArmDisableDataCache) .globl ASM_PFX(ArmEnableInstructionCache) @@ -76,6 +77,11 @@ ASM_PFX(ArmEnableMmu): mcr p15,0,R0,c1,c0,0 bx LR +ASM_PFX(ArmMmuEnabled): + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + ASM_PFX(ArmDisableMmu): mrc p15,0,R0,c1,c0,0 bic R0,R0,#1 diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm index e0be8f0c07..a2ed2e6f2a 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm @@ -21,6 +21,7 @@ EXPORT ArmCleanInvalidateDataCacheEntryByMVA EXPORT ArmEnableMmu EXPORT ArmDisableMmu + EXPORT ArmMmuEnabled EXPORT ArmEnableDataCache EXPORT ArmDisableDataCache EXPORT ArmEnableInstructionCache @@ -80,6 +81,11 @@ ArmEnableMmu mcr p15,0,R0,c1,c0,0 bx LR +ArmMmuEnabled + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + ArmDisableMmu mrc p15,0,R0,c1,c0,0 bic R0,R0,#1 diff --git a/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf b/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf index 9a940394e2..467e9ba621 100644 --- a/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf +++ b/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = Arm9ArmLib diff --git a/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf b/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf index 909ce27616..900e20423d 100755 --- a/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf +++ b/ArmPkg/Library/ArmLib/Arm9/Arm9ArmLibPrePi.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = Arm9ArmLibPrePi diff --git a/ArmPkg/Library/ArmLib/Arm9/Arm9Support.S b/ArmPkg/Library/ArmLib/Arm9/Arm9Support.S index 5c9afe9347..d76afb90f5 100644 --- a/ArmPkg/Library/ArmLib/Arm9/Arm9Support.S +++ b/ArmPkg/Library/ArmLib/Arm9/Arm9Support.S @@ -23,6 +23,7 @@ .globl ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA) .globl ASM_PFX(ArmEnableMmu) .globl ASM_PFX(ArmDisableMmu) +.globl ASM_PFX(ArmMmuEnabled) .globl ASM_PFX(ArmEnableDataCache) .globl ASM_PFX(ArmDisableDataCache) .globl ASM_PFX(ArmEnableInstructionCache) @@ -75,6 +76,11 @@ ASM_PFX(ArmEnableMmu): mcr p15,0,R0,c1,c0,0 bx LR +ASM_PFX(ArmMmuEnabled): + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + ASM_PFX(ArmDisableMmu): mrc p15,0,R0,c1,c0,0 bic R0,R0,#1 diff --git a/ArmPkg/Library/ArmLib/Arm9/Arm9Support.asm b/ArmPkg/Library/ArmLib/Arm9/Arm9Support.asm index 3204d6607f..82634c7929 100644 --- a/ArmPkg/Library/ArmLib/Arm9/Arm9Support.asm +++ b/ArmPkg/Library/ArmLib/Arm9/Arm9Support.asm @@ -21,6 +21,7 @@ EXPORT ArmCleanInvalidateDataCacheEntryByMVA EXPORT ArmEnableMmu EXPORT ArmDisableMmu + EXPORT ArmMmuEnabled EXPORT ArmEnableDataCache EXPORT ArmDisableDataCache EXPORT ArmEnableInstructionCache @@ -77,6 +78,11 @@ ArmEnableMmu mcr p15,0,R0,c1,c0,0 bx LR +ArmMmuEnabled + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + ArmDisableMmu mrc p15,0,R0,c1,c0,0 bic R0,R0,#1 diff --git a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexALib.c b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexALib.c index 4dfa18db58..c9bc49d040 100644 --- a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexALib.c +++ b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexALib.c @@ -50,8 +50,7 @@ FillTranslationTable ( Entry = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(TranslationTable, MemoryRegion->VirtualBase); Sections = MemoryRegion->Length / TT_DESCRIPTOR_SECTION_SIZE; - for (Index = 0; Index < Sections; Index++) - { + for (Index = 0; Index < Sections; Index++) { *Entry++ = TT_DESCRIPTOR_SECTION_BASE_ADDRESS(PhysicalBase) | Attributes; PhysicalBase += TT_DESCRIPTOR_SECTION_SIZE; } diff --git a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.S b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.S index 0e24f6341c..90d2c4b92f 100644 --- a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.S +++ b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.S @@ -24,6 +24,7 @@ .globl ASM_PFX(ArmDrainWriteBuffer) .globl ASM_PFX(ArmEnableMmu) .globl ASM_PFX(ArmDisableMmu) +.globl ASM_PFX(ArmMmuEnabled) .globl ASM_PFX(ArmEnableDataCache) .globl ASM_PFX(ArmDisableDataCache) .globl ASM_PFX(ArmEnableInstructionCache) @@ -85,6 +86,12 @@ ASM_PFX(ArmEnableMmu): mcr p15,0,R0,c1,c0,0 bx LR +ASM_PFX(ArmMmuEnabled): + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + + ASM_PFX(ArmDisableMmu): mov R0,#0 mcr p15,0,R0,c13,c0,0 @FCSE PID register must be cleared before disabling MMU diff --git a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.asm b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.asm index dbd8bd246a..700942dd17 100644 --- a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.asm +++ b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexASupport.asm @@ -22,6 +22,7 @@ EXPORT ArmDrainWriteBuffer EXPORT ArmEnableMmu EXPORT ArmDisableMmu + EXPORT ArmMmuEnabled EXPORT ArmEnableDataCache EXPORT ArmDisableDataCache EXPORT ArmEnableInstructionCache @@ -86,6 +87,11 @@ ArmEnableMmu mcr p15,0,R0,c1,c0,0 bx LR +ArmMmuEnabled + mrc p15,0,R0,c1,c0,0 + and R0,R0,#1 + bx LR + ArmDisableMmu mov R0,#0 mcr p15,0,R0,c13,c0,0 ;FCSE PID register must be cleared before disabling MMU diff --git a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLib.inf b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLib.inf index 54b77e31b4..de3edb0be7 100644 --- a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLib.inf +++ b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = ArmCortexArmLib diff --git a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLibPrePi.inf b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLibPrePi.inf index 450dfe5936..94436bb08d 100644 --- a/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLibPrePi.inf +++ b/ArmPkg/Library/ArmLib/ArmCortexA/ArmCortexArmLibPrePi.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = ArmCortexArmLibPrePi diff --git a/ArmPkg/Library/ArmLib/Common/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Common/ArmLibSupport.S index d80100c788..57d2734528 100644 --- a/ArmPkg/Library/ArmLib/Common/ArmLibSupport.S +++ b/ArmPkg/Library/ArmLib/Common/ArmLibSupport.S @@ -21,6 +21,7 @@ .globl ASM_PFX(ArmGetInterruptState) .globl ASM_PFX(ArmInvalidateTlb) .globl ASM_PFX(ArmSetTranslationTableBaseAddress) +.globl ASM_PFX(ArmGetTranslationTableBaseAddress) .globl ASM_PFX(ArmSetDomainAccessControl) .globl ASM_PFX(CPSRMaskInsert) .globl ASM_PFX(CPSRRead) @@ -66,6 +67,11 @@ ASM_PFX(ArmSetTranslationTableBaseAddress): mcr p15,0,r0,c2,c0,0 bx lr +ASM_PFX(ArmGetTranslationTableBaseAddress): + mrc p15,0,r0,c2,c0,0 + bx lr + + ASM_PFX(ArmSetDomainAccessControl): mcr p15,0,r0,c3,c0,0 bx lr diff --git a/ArmPkg/Library/ArmLib/Common/ArmLibSupport.asm b/ArmPkg/Library/ArmLib/Common/ArmLibSupport.asm index ec7db638af..ecae8a31a2 100644 --- a/ArmPkg/Library/ArmLib/Common/ArmLibSupport.asm +++ b/ArmPkg/Library/ArmLib/Common/ArmLibSupport.asm @@ -20,6 +20,7 @@ EXPORT ArmGetInterruptState EXPORT ArmInvalidateTlb EXPORT ArmSetTranslationTableBaseAddress + EXPORT ArmGetTranslationTableBaseAddress EXPORT ArmSetDomainAccessControl EXPORT CPSRMaskInsert EXPORT CPSRRead @@ -65,6 +66,10 @@ ArmSetTranslationTableBaseAddress mcr p15,0,r0,c2,c0,0 bx lr +ArmSetTranslationTableBaseAddress + mrc p15,0,r0,c2,c0,0 + bx lr + ArmSetDomainAccessControl mcr p15,0,r0,c3,c0,0 bx lr diff --git a/ArmPkg/Library/ArmLib/Null/NullArmLib.inf b/ArmPkg/Library/ArmLib/Null/NullArmLib.inf index ff31b9cecb..304dbcb68e 100644 --- a/ArmPkg/Library/ArmLib/Null/NullArmLib.inf +++ b/ArmPkg/Library/ArmLib/Null/NullArmLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = NullArmLib diff --git a/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf b/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf index 683f03f2f3..d661c37e17 100644 --- a/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf +++ b/ArmPkg/Library/SemiHostingDebugLib/SemiHostingDebugLib.inf @@ -1,4 +1,4 @@ -#%HEADER% + #/** @file # Debug Library for UEFI drivers # diff --git a/ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf b/ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf index c0a540342a..d0b7d0ad9d 100644 --- a/ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf +++ b/ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf @@ -1,4 +1,3 @@ -#%HEADER% #/** @file # Semihosting serail port lib # diff --git a/ArmPkg/Library/SemihostLib/SemihostLib.inf b/ArmPkg/Library/SemihostLib/SemihostLib.inf index cb278083c0..d05188c771 100644 --- a/ArmPkg/Library/SemihostLib/SemihostLib.inf +++ b/ArmPkg/Library/SemihostLib/SemihostLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = SemihostLib diff --git a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf index 1a62eb4231..7522b1e358 100644 --- a/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf +++ b/ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf @@ -1,4 +1,18 @@ -#%HEADER% +#/** @file +# Semihosting serail port lib +# +# Copyright (c) 2008 - 2010, Apple Inc. +# +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# +#**/ + [Defines] INF_VERSION = 0x00010005 BASE_NAME = UncachedMemoryAllocationLib