#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
\r
[BuildOptions]\r
XCODE:*_*_ARM_PLATFORM_FLAGS == -arch armv7\r
- XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG \r
- \r
+ XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
+\r
GCC:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a -mfpu=neon\r
- GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG \r
+ GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A8\r
- RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG \r
+ RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG\r
\r
[LibraryClasses.common]\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
\r
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf\r
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf\r
- \r
+\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
\r
[LibraryClasses.ARM]\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = ArmGicDxe\r
- FILE_GUID = DE371F7C-DEC4-4D21-ADF1-593ABCC15882 \r
+ FILE_GUID = DE371F7C-DEC4-4D21-ADF1-593ABCC15882\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
stmfd SP!,{LR} @ Store the link register for the current mode\r
sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} @ Store the register state\r
- \r
+\r
mov R0,#0\r
ldr R1,ASM_PFX(CommonExceptionEntry)\r
bx R1\r
\r
ASM_PFX(AsmCommonExceptionEntry):\r
mrc p15, 0, R1, c6, c0, 2 @ Read IFAR\r
- str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 @ Read IFSR\r
str R1, [SP, #0x4c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 @ Read DFAR\r
str R1, [SP, #0x48] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 @ Read DFSR\r
str R1, [SP, #0x44] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] @ Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
and r1, r1, #0x1f @ Check to see if User or System Mode\r
cmp r1, #0x1f\r
ldmneed r2, {lr}^ @ User or System mode, use unbanked register\r
ldmneed r2, {lr} @ All other modes used banked register\r
\r
- ldr R1, [SP, #0x58] @ PC is the LR pushed by srsdb \r
+ ldr R1, [SP, #0x58] @ PC is the LR pushed by srsdb\r
str R1, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
- sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack \r
+\r
+ sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack\r
str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- @ R0 is exception type \r
+\r
+ @ R0 is exception type\r
mov R1,SP @ Prepare System Context pointer as an argument for the exception handler\r
blx ASM_PFX(CommonCExceptionHandler) @ Call exception handler\r
- \r
+\r
ldr R2,[SP,#0x40] @ EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R2,[SP,#0x5c] @ Store it back to srsdb stack slot so it can be restored \r
+ str R2,[SP,#0x5c] @ Store it back to srsdb stack slot so it can be restored\r
\r
ldr R2,[SP,#0x3c] @ EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R2,[SP,#0x58] @ Store it back to srsdb stack slot so it can be restored \r
+ str R2,[SP,#0x58] @ Store it back to srsdb stack slot so it can be restored\r
\r
ldmfd SP!,{R0-R12} @ Restore general purpose registers\r
@ Exception handler can not change SP or LR as we would blow chunks\r
- \r
+\r
add SP,SP,#0x20 @ Clear out the remaining stack space\r
ldmfd SP!,{LR} @ restore the link register for this context\r
rfefd SP! @ return from exception via srsdb stack slot\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
PRESERVE8\r
AREA DxeExceptionHandlers, CODE, READONLY\r
- \r
+\r
ExceptionHandlersStart\r
\r
Reset\r
AsmCommonExceptionEntry\r
mrc p15, 0, r1, c6, c0, 2 ; Read IFAR\r
stmfd SP!,{R1} ; Store the IFAR\r
- \r
+\r
mrc p15, 0, r1, c5, c0, 1 ; Read IFSR\r
stmfd SP!,{R1} ; Store the IFSR\r
- \r
+\r
mrc p15, 0, r1, c6, c0, 0 ; Read DFAR\r
stmfd SP!,{R1} ; Store the DFAR\r
- \r
+\r
mrc p15, 0, r1, c5, c0, 0 ; Read DFSR\r
stmfd SP!,{R1} ; Store the DFSR\r
- \r
+\r
mrs R1,SPSR ; Read SPSR (which is the pre-exception CPSR)\r
stmfd SP!,{R1} ; Store the SPSR\r
- \r
+\r
stmfd SP!,{LR} ; Store the link register (which is the pre-exception PC)\r
stmfd SP,{SP,LR}^ ; Store user/system mode stack pointer and link register\r
nop ; Required by ARM architecture\r
SUB SP,SP,#0x08 ; Adjust stack pointer\r
stmfd SP!,{R2-R12} ; Store general purpose registers\r
- \r
+\r
ldr R3,[SP,#0x50] ; Read saved R1 from the stack (it was saved by the exception entry routine)\r
ldr R2,[SP,#0x4C] ; Read saved R0 from the stack (it was saved by the exception entry routine)\r
stmfd SP!,{R2-R3} ; Store general purpose registers R0 and R1\r
- \r
+\r
mov R1,SP ; Prepare System Context pointer as an argument for the exception handler\r
- \r
+\r
sub SP,SP,#4 ; Adjust SP to preserve 8-byte alignment\r
blx CommonCExceptionHandler ; Call exception handler\r
add SP,SP,#4 ; Adjust SP back to where we were\r
- \r
+\r
ldr R2,[SP,#0x40] ; Load CPSR from context, in case it has changed\r
MSR SPSR_cxsf,R2 ; Store it back to the SPSR to be restored when exiting this handler\r
\r
ldmfd SP!,{LR} ; Restore the link register (which is the pre-exception PC)\r
add SP,SP,#0x1C ; Clear out the remaining stack space\r
movs PC,LR ; Return from exception\r
- \r
+\r
END\r
\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2014, ARM Limited. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
-#include "CpuDxe.h" \r
+#include "CpuDxe.h"\r
\r
//FIXME: Will not compile on non-ARMv7 builds\r
#include <Chipset/ArmV7.h>\r
\r
\r
/**\r
- This function registers and enables the handler specified by InterruptHandler for a processor \r
- interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
- handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
+ This function registers and enables the handler specified by InterruptHandler for a processor\r
+ interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r
+ handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r
The installed handler is called once for each processor interrupt or exception.\r
\r
@param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
DEBUG ((EFI_D_ERROR, "Unknown exception type %d from %08x\n", ExceptionType, SystemContext.SystemContextArm->PC));\r
ASSERT (FALSE);\r
}\r
- \r
+\r
if (ExceptionType == EXCEPT_ARM_SOFTWARE_INTERRUPT) {\r
//\r
// ARM JTAG debuggers some times use this vector, so it is not an error to get one\r
Cpu->DisableInterrupt (Cpu);\r
\r
//\r
- // EFI does not use the FIQ, but a debugger might so we must disable \r
- // as we take over the exception vectors. \r
+ // EFI does not use the FIQ, but a debugger might so we must disable\r
+ // as we take over the exception vectors.\r
//\r
FiqEnabled = ArmGetFiqState ();\r
ArmDisableFiq ();\r
}\r
\r
if (IrqEnabled) {\r
- // \r
+ //\r
// Restore interrupt state\r
//\r
Status = Cpu->EnableInterrupt (Cpu);\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Use ARMv6 instruction to operate on a single stack\r
#\r
This is the stack constructed by the exception handler (low address to high address)\r
# R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM\r
Reg Offset\r
- === ====== \r
+ === ======\r
R0 0x00 # stmfd SP!,{R0-R12}\r
R1 0x04\r
R2 0x08\r
DFAR 0x48\r
IFSR 0x4c\r
IFAR 0x50\r
- \r
+\r
LR 0x54 # SVC Link register (we need to restore it)\r
- \r
- LR 0x58 # pushed by srsfd \r
- CPSR 0x5c \r
+\r
+ LR 0x58 # pushed by srsfd\r
+ CPSR 0x5c\r
\r
*/\r
- \r
+\r
\r
GCC_ASM_EXPORT(ExceptionHandlersStart)\r
GCC_ASM_EXPORT(ExceptionHandlersEnd)\r
stmfd SP!,{LR} @ Store the link register for the current mode\r
sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} @ Store the register state\r
- \r
+\r
mov R0,#0 @ ExceptionType\r
ldr R1,ASM_PFX(CommonExceptionEntry)\r
bx R1\r
ASM_PFX(ExceptionHandlersEnd):\r
\r
//\r
-// This code runs from CpuDxe driver loaded address. It is patched into \r
+// This code runs from CpuDxe driver loaded address. It is patched into\r
// CommonExceptionEntry.\r
//\r
ASM_PFX(AsmCommonExceptionEntry):\r
mrc p15, 0, R1, c6, c0, 2 @ Read IFAR\r
- str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 @ Read IFSR\r
str R1, [SP, #0x4c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 @ Read DFAR\r
str R1, [SP, #0x48] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 @ Read DFSR\r
str R1, [SP, #0x44] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] @ Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
\r
add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R3, R1, #0x1f @ Check CPSR to see if User or System Mode\r
cmp R3, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R3, #0x10 @ \r
+ cmpne R3, #0x10 @\r
stmeqed R2, {lr}^ @ save unbanked lr\r
- @ else \r
+ @ else\r
stmneed R2, {lr} @ save SVC lr\r
\r
\r
- ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd \r
+ ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd\r
@ Check to see if we have to adjust for Thumb entry\r
sub r4, r0, #1 @ if (ExceptionType == 1 || ExceptionType == 2)) {\r
- cmp r4, #1 @ // UND & SVC have differnt LR adjust for Thumb \r
+ cmp r4, #1 @ // UND & SVC have differnt LR adjust for Thumb\r
bhi NoAdjustNeeded\r
- \r
- tst r1, #0x20 @ if ((CPSR & T)) == T) { // Thumb Mode on entry \r
+\r
+ tst r1, #0x20 @ if ((CPSR & T)) == T) { // Thumb Mode on entry\r
addne R5, R5, #2 @ PC += 2;\r
strne R5,[SP,#0x58] @ Update LR value pushed by srsfd\r
- \r
+\r
NoAdjustNeeded:\r
\r
str R5, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
+\r
add R1, SP, #0x60 @ We pushed 0x60 bytes on the stack\r
str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- @ R0 is ExceptionType \r
- mov R1,SP @ R1 is SystemContext \r
+\r
+ @ R0 is ExceptionType\r
+ mov R1,SP @ R1 is SystemContext\r
\r
#if (FixedPcdGet32(PcdVFPEnabled))\r
vpush {d0-d15} @ save vstm registers in case they are used in optimizations\r
tst R4, #4\r
subne SP, SP, #4 @ Adjust SP if not 8-byte aligned\r
\r
-/* \r
+/*\r
VOID\r
EFIAPI\r
CommonCExceptionHandler (\r
IN OUT EFI_SYSTEM_CONTEXT SystemContext R1\r
)\r
\r
-*/ \r
+*/\r
blx ASM_PFX(CommonCExceptionHandler) @ Call exception handler\r
\r
mov SP, R4 @ Restore SP\r
\r
#if (FixedPcdGet32(PcdVFPEnabled))\r
- vpop {d0-d15} \r
+ vpop {d0-d15}\r
#endif\r
\r
ldr R1, [SP, #0x4c] @ Restore EFI_SYSTEM_CONTEXT_ARM.IFSR\r
\r
ldr R1, [SP, #0x44] @ Restore EFI_SYSTEM_CONTEXT_ARM.DFSR\r
mcr p15, 0, R1, c5, c0, 0 @ Write DFSR\r
- \r
+\r
ldr R1,[SP,#0x3c] @ EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R1,[SP,#0x58] @ Store it back to srsfd stack slot so it can be restored \r
+ str R1,[SP,#0x58] @ Store it back to srsfd stack slot so it can be restored\r
\r
ldr R1,[SP,#0x40] @ EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R1,[SP,#0x5c] @ Store it back to srsfd stack slot so it can be restored \r
- \r
+ str R1,[SP,#0x5c] @ Store it back to srsfd stack slot so it can be restored\r
+\r
add R3, SP, #0x54 @ Make R3 point to SVC LR saved on entry\r
add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R1, R1, #0x1f @ Check to see if User or System Mode\r
cmp R1, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R1, #0x10 @ \r
+ cmpne R1, #0x10 @\r
ldmeqed R2, {lr}^ @ restore unbanked lr\r
@ else\r
ldmneed R3, {lr} @ restore SVC lr, via ldmfd SP!, {LR}\r
- \r
+\r
ldmfd SP!,{R0-R12} @ Restore general purpose registers\r
@ Exception handler can not change SP\r
- \r
+\r
add SP,SP,#0x20 @ Clear out the remaining stack space\r
ldmfd SP!,{LR} @ restore the link register for this context\r
rfefd SP! @ return from exception via srsfd stack slot\r
- \r
+\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Use ARMv6 instruction to operate on a single stack\r
//\r
This is the stack constructed by the exception handler (low address to high address)\r
# R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM\r
Reg Offset\r
- === ====== \r
+ === ======\r
R0 0x00 # stmfd SP!,{R0-R12}\r
R1 0x04\r
R2 0x08\r
DFAR 0x48\r
IFSR 0x4c\r
IFAR 0x50\r
- \r
+\r
LR 0x54 # SVC Link register (we need to restore it)\r
- \r
- LR 0x58 # pushed by srsfd \r
- CPSR 0x5c \r
+\r
+ LR 0x58 # pushed by srsfd\r
+ CPSR 0x5c\r
\r
*/\r
- \r
- \r
+\r
+\r
EXPORT ExceptionHandlersStart\r
EXPORT ExceptionHandlersEnd\r
EXPORT CommonExceptionEntry\r
\r
PRESERVE8\r
AREA DxeExceptionHandlers, CODE, READONLY, CODEALIGN, ALIGN=5\r
- \r
+\r
//\r
// This code gets copied to the ARM vector table\r
// ExceptionHandlersStart - ExceptionHandlersEnd gets copied\r
stmfd SP!,{LR} ; Store the link register for the current mode\r
sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} ; Store the register state\r
- \r
+\r
mov R0,#0 ; ExceptionType\r
ldr R1,CommonExceptionEntry\r
bx R1\r
stmfd SP!,{R0-R12} ; Store the register state\r
\r
mov R0,#1 ; ExceptionType\r
- ldr R1,CommonExceptionEntry; \r
+ ldr R1,CommonExceptionEntry;\r
bx R1\r
\r
SoftwareInterruptEntry\r
ExceptionHandlersEnd\r
\r
//\r
-// This code runs from CpuDxe driver loaded address. It is patched into \r
+// This code runs from CpuDxe driver loaded address. It is patched into\r
// CommonExceptionEntry.\r
//\r
AsmCommonExceptionEntry\r
mrc p15, 0, R1, c6, c0, 2 ; Read IFAR\r
- str R1, [SP, #0x50] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 ; Read IFSR\r
str R1, [SP, #0x4c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 ; Read DFAR\r
str R1, [SP, #0x48] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 ; Read DFSR\r
str R1, [SP, #0x44] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] ; srsfd saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] ; srsfd saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] ; Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
\r
add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R3, R1, #0x1f ; Check CPSR to see if User or System Mode\r
cmp R3, #0x1f ; if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R3, #0x10 ; \r
+ cmpne R3, #0x10 ;\r
stmeqed R2, {lr}^ ; save unbanked lr\r
- ; else \r
+ ; else\r
stmneed R2, {lr} ; save SVC lr\r
\r
\r
- ldr R5, [SP, #0x58] ; PC is the LR pushed by srsfd \r
+ ldr R5, [SP, #0x58] ; PC is the LR pushed by srsfd\r
; Check to see if we have to adjust for Thumb entry\r
sub r4, r0, #1 ; if (ExceptionType == 1 || ExceptionType == 2)) {\r
- cmp r4, #1 ; // UND & SVC have differnt LR adjust for Thumb \r
+ cmp r4, #1 ; // UND & SVC have differnt LR adjust for Thumb\r
bhi NoAdjustNeeded\r
- \r
- tst r1, #0x20 ; if ((CPSR & T)) == T) { // Thumb Mode on entry \r
+\r
+ tst r1, #0x20 ; if ((CPSR & T)) == T) { // Thumb Mode on entry\r
addne R5, R5, #2 ; PC += 2;\r
strne R5,[SP,#0x58] ; Update LR value pushed by srsfd\r
- \r
+\r
NoAdjustNeeded\r
\r
str R5, [SP, #0x3c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
+\r
add R1, SP, #0x60 ; We pushed 0x60 bytes on the stack\r
str R1, [SP, #0x34] ; Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- ; R0 is ExceptionType \r
- mov R1,SP ; R1 is SystemContext \r
+\r
+ ; R0 is ExceptionType\r
+ mov R1,SP ; R1 is SystemContext\r
\r
#if (FixedPcdGet32(PcdVFPEnabled))\r
vpush {d0-d15} ; save vstm registers in case they are used in optimizations\r
tst R4, #4\r
subne SP, SP, #4 ; Adjust SP if not 8-byte aligned\r
\r
-/* \r
+/*\r
VOID\r
EFIAPI\r
CommonCExceptionHandler (\r
#if (FixedPcdGet32(PcdVFPEnabled))\r
vpop {d0-d15}\r
#endif\r
- \r
+\r
ldr R1, [SP, #0x4c] ; Restore EFI_SYSTEM_CONTEXT_ARM.IFSR\r
mcr p15, 0, R1, c5, c0, 1 ; Write IFSR\r
\r
ldr R1, [SP, #0x44] ; Restore EFI_SYSTEM_CONTEXT_ARM.DFSR\r
mcr p15, 0, R1, c5, c0, 0 ; Write DFSR\r
- \r
+\r
ldr R1,[SP,#0x3c] ; EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R1,[SP,#0x58] ; Store it back to srsfd stack slot so it can be restored \r
+ str R1,[SP,#0x58] ; Store it back to srsfd stack slot so it can be restored\r
\r
ldr R1,[SP,#0x40] ; EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R1,[SP,#0x5c] ; Store it back to srsfd stack slot so it can be restored \r
- \r
+ str R1,[SP,#0x5c] ; Store it back to srsfd stack slot so it can be restored\r
+\r
add R3, SP, #0x54 ; Make R3 point to SVC LR saved on entry\r
add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R1, R1, #0x1f ; Check to see if User or System Mode\r
cmp R1, #0x1f ; if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R1, #0x10 ; \r
+ cmpne R1, #0x10 ;\r
ldmeqed R2, {lr}^ ; restore unbanked lr\r
; else\r
ldmneed R3, {lr} ; restore SVC lr, via ldmfd SP!, {LR}\r
- \r
+\r
ldmfd SP!,{R0-R12} ; Restore general purpose registers\r
; Exception handler can not change SP\r
- \r
+\r
add SP,SP,#0x20 ; Clear out the remaining stack space\r
ldmfd SP!,{LR} ; restore the link register for this context\r
rfefd SP! ; return from exception via srsfd stack slot\r
- \r
+\r
END\r
\r
\r
// Second Level Descriptors\r
typedef UINT32 ARM_PAGE_TABLE_ENTRY;\r
\r
-EFI_STATUS \r
+EFI_STATUS\r
SectionToGcdAttributes (\r
IN UINT32 SectionAttributes,\r
OUT UINT64 *GcdAttributes\r
\r
// Calculate number of 4KB page table entries to change\r
NumPageEntries = Length / TT_DESCRIPTOR_PAGE_SIZE;\r
- \r
+\r
// Iterate for the number of 4KB pages to change\r
Offset = 0;\r
for(p = 0; p < NumPageEntries; p++) {\r
// Calculate index into first level translation table for page table value\r
- \r
+\r
FirstLevelIdx = TT_DESCRIPTOR_SECTION_BASE_ADDRESS(BaseAddress + Offset) >> TT_DESCRIPTOR_SECTION_BASE_SHIFT;\r
ASSERT (FirstLevelIdx < TRANSLATION_TABLE_SECTION_COUNT);\r
\r
Status = ConvertSectionToPages (FirstLevelIdx << TT_DESCRIPTOR_SECTION_BASE_SHIFT);\r
if (EFI_ERROR(Status)) {\r
// Exit for loop\r
- break; \r
- } \r
- \r
+ break;\r
+ }\r
+\r
// Re-read descriptor\r
Descriptor = FirstLevelTable[FirstLevelIdx];\r
}\r
// Make this virtual address point at a physical page\r
PageTableEntry &= ~VirtualMask;\r
}\r
- \r
+\r
if (CurrentPageTableEntry != PageTableEntry) {\r
Mva = (VOID *)(UINTN)((((UINTN)FirstLevelIdx) << TT_DESCRIPTOR_SECTION_BASE_SHIFT) + (PageTableIndex << TT_DESCRIPTOR_PAGE_BASE_SHIFT));\r
if ((CurrentPageTableEntry & TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) == TT_DESCRIPTOR_PAGE_CACHEABLE_MASK) {\r
WriteBackInvalidateDataCacheRange (Mva, TT_DESCRIPTOR_PAGE_SIZE);\r
}\r
\r
- // Only need to update if we are changing the entry \r
- PageTable[PageTableIndex] = PageTableEntry; \r
+ // Only need to update if we are changing the entry\r
+ PageTable[PageTableIndex] = PageTableEntry;\r
ArmUpdateTranslationTableEntry ((VOID *)&PageTable[PageTableIndex], Mva);\r
}\r
\r
Status = EFI_SUCCESS;\r
Offset += TT_DESCRIPTOR_PAGE_SIZE;\r
- \r
+\r
} // End first level translation table loop\r
\r
return Status;\r
// EntryMask: bitmask of values to change (1 = change this value, 0 = leave alone)\r
// EntryValue: values at bit positions specified by EntryMask\r
\r
- // Make sure we handle a section range that is unmapped \r
+ // Make sure we handle a section range that is unmapped\r
EntryMask = TT_DESCRIPTOR_SECTION_TYPE_MASK;\r
EntryValue = TT_DESCRIPTOR_SECTION_TYPE_SECTION;\r
\r
\r
// calculate number of 1MB first level entries this applies to\r
NumSections = Length / TT_DESCRIPTOR_SECTION_SIZE;\r
- \r
+\r
// iterate through each descriptor\r
for(i=0; i<NumSections; i++) {\r
CurrentDescriptor = FirstLevelTable[FirstLevelIdx + i];\r
Status = UpdatePageEntries ((FirstLevelIdx + i) << TT_DESCRIPTOR_SECTION_BASE_SHIFT, TT_DESCRIPTOR_SECTION_SIZE, Attributes, VirtualMask);\r
} else {\r
// still a section entry\r
- \r
+\r
// mask off appropriate fields\r
Descriptor = CurrentDescriptor & ~EntryMask;\r
\r
WriteBackInvalidateDataCacheRange (Mva, SIZE_1MB);\r
}\r
\r
- // Only need to update if we are changing the descriptor \r
+ // Only need to update if we are changing the descriptor\r
FirstLevelTable[FirstLevelIdx + i] = Descriptor;\r
ArmUpdateTranslationTableEntry ((VOID *)&FirstLevelTable[FirstLevelIdx + i], Mva);\r
}\r
return Status;\r
}\r
\r
-EFI_STATUS \r
+EFI_STATUS\r
ConvertSectionToPages (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress\r
)\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) {\r
// Is the base and length a multiple of 1 MB?\r
DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
\r
/**\r
- This function flushes the range of addresses from Start to Start+Length \r
- from the processor's data cache. If Start is not aligned to a cache line \r
- boundary, then the bytes before Start to the preceding cache line boundary \r
- are also flushed. If Start+Length is not aligned to a cache line boundary, \r
- then the bytes past Start+Length to the end of the next cache line boundary \r
- are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
- supported. If the data cache is fully coherent with all DMA operations, then \r
- this function can just return EFI_SUCCESS. If the processor does not support \r
+ This function flushes the range of addresses from Start to Start+Length\r
+ from the processor's data cache. If Start is not aligned to a cache line\r
+ boundary, then the bytes before Start to the preceding cache line boundary\r
+ are also flushed. If Start+Length is not aligned to a cache line boundary,\r
+ then the bytes past Start+Length to the end of the next cache line boundary\r
+ are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be\r
+ supported. If the data cache is fully coherent with all DMA operations, then\r
+ this function can just return EFI_SUCCESS. If the processor does not support\r
flushing a range of the data cache, then the entire data cache can be flushed.\r
\r
@param This The EFI_CPU_ARCH_PROTOCOL instance.\r
default:\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
\r
/**\r
- This function enables interrupt processing by the processor. \r
+ This function enables interrupt processing by the processor.\r
\r
@param This The EFI_CPU_ARCH_PROTOCOL instance.\r
\r
\r
\r
/**\r
- This function retrieves the processor's current interrupt state a returns it in \r
- State. If interrupts are currently enabled, then TRUE is returned. If interrupts \r
+ This function retrieves the processor's current interrupt state a returns it in\r
+ State. If interrupts are currently enabled, then TRUE is returned. If interrupts\r
are currently disabled, then FALSE is returned.\r
\r
@param This The EFI_CPU_ARCH_PROTOCOL instance.\r
\r
/**\r
This function generates an INIT on the processor. If this function succeeds, then the\r
- processor will be reset, and control will not be returned to the caller. If InitType is \r
- not supported by this processor, or the processor cannot programmatically generate an \r
- INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error \r
+ processor will be reset, and control will not be returned to the caller. If InitType is\r
+ not supported by this processor, or the processor cannot programmatically generate an\r
+ INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error\r
occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.\r
\r
@param This The EFI_CPU_ARCH_PROTOCOL instance.\r
\r
/**\r
Callback function for idle events.\r
- \r
+\r
@param Event Event whose notification function is being invoked.\r
@param Context The pointer to the notification function's context,\r
which is implementation-dependent.\r
EFI_STATUS Status;\r
EFI_EVENT IdleLoopEvent;\r
\r
- InitializeExceptions (&mCpu); \r
- \r
+ InitializeExceptions (&mCpu);\r
+\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &mCpuHandle, \r
- &gEfiCpuArchProtocolGuid, &mCpu, \r
+ &mCpuHandle,\r
+ &gEfiCpuArchProtocolGuid, &mCpu,\r
&gVirtualUncachedPagesProtocolGuid, &gVirtualUncachedPages,\r
NULL\r
);\r
- \r
+\r
//\r
// Make sure GCD and MMU settings match. This API calls gDS->SetMemorySpaceAttributes ()\r
// and that calls EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes, so this code needs to go\r
// after the protocol is installed\r
//\r
SyncCacheConfig (&mCpu);\r
- \r
+\r
// If the platform is a MPCore system then install the Configuration Table describing the\r
// secondary core states\r
if (ArmIsMpCore()) {\r
\r
\r
/**\r
- This function registers and enables the handler specified by InterruptHandler for a processor \r
- interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
- handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
+ This function registers and enables the handler specified by InterruptHandler for a processor\r
+ interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r
+ handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r
The installed handler is called once for each processor interrupt or exception.\r
\r
@param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
\r
\r
/**\r
- This function registers and enables the handler specified by InterruptHandler for a processor \r
- interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
- handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
+ This function registers and enables the handler specified by InterruptHandler for a processor\r
+ interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the\r
+ handler for the processor interrupt or exception type specified by InterruptType is uninstalled.\r
The installed handler is called once for each processor interrupt or exception.\r
\r
@param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol\r
);\r
\r
-EFI_STATUS \r
+EFI_STATUS\r
ConvertSectionToPages (\r
IN EFI_PHYSICAL_ADDRESS BaseAddress\r
);\r
#/** @file\r
-# \r
+#\r
# DXE CPU driver\r
-# \r
+#\r
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
#\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[Pcd.common]\r
gArmTokenSpaceGuid.PcdVFPEnabled\r
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress\r
- \r
+\r
[FeaturePcd.common]\r
gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport\r
gArmTokenSpaceGuid.PcdRelocateVectorTable\r
Copyright (c) 2011 Hewlett Packard Corporation. All rights reserved.<BR>\r
Copyright (c) 2011-2013, ARM Limited. All rights reserved.<BR>\r
\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
MemoryInit.c\r
- \r
+\r
Abstract:\r
\r
PEIM to provide fake memory init\r
\r
FileHandle - Handle of the file being invoked.\r
PeiServices - Describes the list of possible PEI Services.\r
- \r
+\r
Returns:\r
\r
Status - EFI_SUCCESS if the boot mode could be set\r
\r
[Ppis]\r
gArmMpCoreInfoPpiGuid\r
- \r
+\r
[Guids]\r
gArmMpCoreInfoGuid\r
\r
\r
[Depex]\r
gEfiPeiMemoryDiscoveredPpiGuid\r
- \r
+\r
EFI_HARDWARE_INTERRUPT_PROTOCOL *gInterrupt = NULL;\r
\r
/**\r
- This function registers the handler NotifyFunction so it is called every time \r
- the timer interrupt fires. It also passes the amount of time since the last \r
- handler call to the NotifyFunction. If NotifyFunction is NULL, then the \r
- handler is unregistered. If the handler is registered, then EFI_SUCCESS is \r
- returned. If the CPU does not support registering a timer interrupt handler, \r
- then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler \r
- when a handler is already registered, then EFI_ALREADY_STARTED is returned. \r
- If an attempt is made to unregister a handler when a handler is not registered, \r
- then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to \r
- register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
+ This function registers the handler NotifyFunction so it is called every time\r
+ the timer interrupt fires. It also passes the amount of time since the last\r
+ handler call to the NotifyFunction. If NotifyFunction is NULL, then the\r
+ handler is unregistered. If the handler is registered, then EFI_SUCCESS is\r
+ returned. If the CPU does not support registering a timer interrupt handler,\r
+ then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler\r
+ when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
+ If an attempt is made to unregister a handler when a handler is not registered,\r
+ then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to\r
+ register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR\r
is returned.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
\r
/**\r
\r
- This function adjusts the period of timer interrupts to the value specified \r
- by TimerPeriod. If the timer period is updated, then the selected timer \r
- period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If \r
- the timer hardware is not programmable, then EFI_UNSUPPORTED is returned. \r
- If an error occurs while attempting to update the timer period, then the \r
- timer hardware will be put back in its state prior to this call, and \r
- EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt \r
- is disabled. This is not the same as disabling the CPU's interrupts. \r
- Instead, it must either turn off the timer hardware, or it must adjust the \r
- interrupt controller so that a CPU interrupt is not generated when the timer \r
- interrupt fires. \r
+ This function adjusts the period of timer interrupts to the value specified\r
+ by TimerPeriod. If the timer period is updated, then the selected timer\r
+ period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If\r
+ the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.\r
+ If an error occurs while attempting to update the timer period, then the\r
+ timer hardware will be put back in its state prior to this call, and\r
+ EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt\r
+ is disabled. This is not the same as disabling the CPU's interrupts.\r
+ Instead, it must either turn off the timer hardware, or it must adjust the\r
+ interrupt controller so that a CPU interrupt is not generated when the timer\r
+ interrupt fires.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
@param TimerPeriod The rate to program the timer interrupt in 100 nS units. If\r
)\r
{\r
UINT64 TimerTicks;\r
- \r
+\r
// Always disable the timer\r
ArmArchTimerDisableTimer ();\r
\r
}\r
\r
/**\r
- This function retrieves the period of timer interrupts in 100 ns units, \r
- returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod \r
- is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is \r
+ This function retrieves the period of timer interrupts in 100 ns units,\r
+ returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod\r
+ is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is\r
returned, then the timer is currently disabled.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
}\r
\r
/**\r
- This function generates a soft timer interrupt. If the platform does not support soft \r
- timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
- If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
- service, then a soft timer interrupt will be generated. If the timer interrupt is \r
- enabled when this service is called, then the registered handler will be invoked. The \r
- registered handler should not be able to distinguish a hardware-generated timer \r
+ This function generates a soft timer interrupt. If the platform does not support soft\r
+ timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.\r
+ If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()\r
+ service, then a soft timer interrupt will be generated. If the timer interrupt is\r
+ enabled when this service is called, then the registered handler will be invoked. The\r
+ registered handler should not be able to distinguish a hardware-generated timer\r
interrupt from a software-generated timer interrupt.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
#/** @file\r
-# \r
+#\r
# Component description file for Timer DXE module\r
-# \r
+#\r
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = ArmTimerDxe\r
- FILE_GUID = 49ea041e-6752-42ca-b0b1-7344fe2546b7 \r
+ FILE_GUID = 49ea041e-6752-42ca-b0b1-7344fe2546b7\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
\r
BaseMemoryLib\r
DebugLib\r
UefiDriverEntryPoint\r
- IoLib \r
+ IoLib\r
\r
[Guids]\r
\r
[Protocols]\r
- gEfiTimerArchProtocolGuid \r
+ gEfiTimerArchProtocolGuid\r
gHardwareInterruptProtocolGuid\r
\r
[Pcd.common]\r
gEmbeddedTokenSpaceGuid.PcdTimerPeriod\r
- gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum \r
+ gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum\r
gArmTokenSpaceGuid.PcdArmArchTimerIntrNum\r
- gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz \r
+ gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz\r
\r
[Depex]\r
gHardwareInterruptProtocolGuid\r
- \r
\ No newline at end of file
#include <Guid/FileSystemVolumeLabelInfo.h>\r
\r
#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h> \r
+#include <Library/BaseMemoryLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/SemihostLib.h>\r
)\r
{\r
SEMIHOST_FCB *RootFcb = NULL;\r
- \r
+\r
if (Root == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
if (RootFcb == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
RootFcb->IsRoot = TRUE;\r
RootFcb->Info.Attribute = EFI_FILE_READ_ONLY | EFI_FILE_DIRECTORY;\r
\r
if (EFI_ERROR(Status)) {\r
return Status;\r
}\r
- \r
+\r
IsRoot = FALSE;\r
}\r
\r
FreeFCB (Fcb);\r
}\r
}\r
- \r
+\r
return Status;\r
}\r
\r
*BufferSize -= WriteSize;\r
Fcb->Position += *BufferSize;\r
}\r
- \r
+\r
return Status;\r
}\r
\r
)\r
{\r
SEMIHOST_FCB *Fcb = NULL;\r
- \r
+\r
if (Position == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
Info->FileName[0] = L'\0';\r
} else {\r
for (Index = 0; Index < NameSize; Index++) {\r
- Info->FileName[Index] = Fcb->FileName[Index]; \r
+ Info->FileName[Index] = Fcb->FileName[Index];\r
}\r
}\r
\r
- *BufferSize = ResultSize; \r
+ *BufferSize = ResultSize;\r
\r
return EFI_SUCCESS;\r
}\r
EFI_FILE_SYSTEM_INFO *Info = NULL;\r
EFI_STATUS Status;\r
UINTN ResultSize = SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (mSemihostFsLabel);\r
- \r
+\r
if (*BufferSize >= ResultSize) {\r
ZeroMem (Buffer, ResultSize);\r
Status = EFI_SUCCESS;\r
- \r
+\r
Info = Buffer;\r
\r
Info->Size = ResultSize;\r
Status = EFI_BUFFER_TOO_SMALL;\r
}\r
\r
- *BufferSize = ResultSize; \r
+ *BufferSize = ResultSize;\r
return Status;\r
}\r
\r
SEMIHOST_FCB *Fcb;\r
EFI_STATUS Status;\r
UINTN ResultSize;\r
- \r
+\r
Fcb = SEMIHOST_FCB_FROM_THIS(File);\r
- \r
+\r
if (CompareGuid (InformationType, &gEfiFileSystemInfoGuid) != 0) {\r
Status = GetFilesystemInfo (Fcb, BufferSize, Buffer);\r
} else if (CompareGuid (InformationType, &gEfiFileInfoGuid) != 0) {\r
}\r
\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &gInstallHandle, \r
- &gEfiSimpleFileSystemProtocolGuid, &gSemihostFs, \r
+ &gInstallHandle,\r
+ &gEfiSimpleFileSystemProtocolGuid, &gSemihostFs,\r
&gEfiDevicePathProtocolGuid, &gDevicePath,\r
NULL\r
);\r
FreePool (mSemihostFsLabel);\r
}\r
}\r
- \r
+\r
return Status;\r
}\r
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.\r
#\r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
\r
[Sources.ARM, Sources.AARCH64]\r
Arm/SemihostFs.c\r
- \r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
ArmPkg/ArmPkg.dec\r
[Protocols]\r
gEfiSimpleFileSystemProtocolGuid\r
gEfiDevicePathProtocolGuid\r
- \r
+\r
ldr r1, =Address ; \\r
ldr r0, =Data ; \\r
str r0, [r1]\r
- \r
+\r
#define MmioOr32(Address, OrData) \\r
ldr r1, =Address ; \\r
ldr r2, =OrData ; \\r
and r0, r0, r2 ; \\r
ldr r2, =OrData ; \\r
orr r0, r0, r2 ; \\r
- str r0, [r1] \r
+ str r0, [r1]\r
\r
#define MmioWriteFromReg32(Address, Reg) \\r
ldr r1, =Address ; \\r
#else\r
\r
//\r
-// Use ARM assembly macros, form armasam \r
+// Use ARM assembly macros, form armasam\r
//\r
// Less magic in the macros if ldr reg, =expr works\r
//\r
\r
// returns Data in R0 and Address in R1, and OrData in r2\r
#define MmioOr32(Address, OrData) MmioOr32Macro Address, OrData\r
- \r
+\r
\r
// returns _Data in R0 and _Address in R1, and _OrData in r2\r
\r
; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
;\r
-; This program and the accompanying materials \r
-; are licensed and made available under the terms and conditions of the BSD License \r
-; which accompanies this distribution. The full text of the license may be found at \r
-; http://opensource.org/licenses/bsd-license.php \r
-; \r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+; This program and the accompanying materials\r
+; are licensed and made available under the terms and conditions of the BSD License\r
+; which accompanies this distribution. The full text of the license may be found at\r
+; http://opensource.org/licenses/bsd-license.php\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
;\r
;**/\r
\r
\r
- MACRO \r
- MmioWrite32Macro $Address, $Data \r
- ldr r1, = ($Address) \r
- ldr r0, = ($Data) \r
- str r0, [r1] \r
+ MACRO\r
+ MmioWrite32Macro $Address, $Data\r
+ ldr r1, = ($Address)\r
+ ldr r0, = ($Data)\r
+ str r0, [r1]\r
MEND\r
- \r
- MACRO \r
- MmioOr32Macro $Address, $OrData \r
- ldr r1, =($Address) \r
- ldr r2, =($OrData) \r
- ldr r0, [r1] \r
- orr r0, r0, r2 \r
- str r0, [r1] \r
+\r
+ MACRO\r
+ MmioOr32Macro $Address, $OrData\r
+ ldr r1, =($Address)\r
+ ldr r2, =($OrData)\r
+ ldr r0, [r1]\r
+ orr r0, r0, r2\r
+ str r0, [r1]\r
MEND\r
\r
- MACRO \r
- MmioAnd32Macro $Address, $AndData \r
- ldr r1, =($Address) \r
- ldr r2, =($AndData) \r
- ldr r0, [r1] \r
- and r0, r0, r2 \r
- str r0, [r1] \r
+ MACRO\r
+ MmioAnd32Macro $Address, $AndData\r
+ ldr r1, =($Address)\r
+ ldr r2, =($AndData)\r
+ ldr r0, [r1]\r
+ and r0, r0, r2\r
+ str r0, [r1]\r
MEND\r
\r
- MACRO \r
- MmioAndThenOr32Macro $Address, $AndData, $OrData \r
- ldr r1, =($Address) \r
- ldr r0, [r1] \r
- ldr r2, =($AndData) \r
- and r0, r0, r2 \r
- ldr r2, =($OrData) \r
- orr r0, r0, r2 \r
- str r0, [r1] \r
+ MACRO\r
+ MmioAndThenOr32Macro $Address, $AndData, $OrData\r
+ ldr r1, =($Address)\r
+ ldr r0, [r1]\r
+ ldr r2, =($AndData)\r
+ and r0, r0, r2\r
+ ldr r2, =($OrData)\r
+ orr r0, r0, r2\r
+ str r0, [r1]\r
MEND\r
\r
- MACRO \r
- MmioWriteFromReg32Macro $Address, $Reg \r
- ldr r1, =($Address) \r
- str $Reg, [r1] \r
+ MACRO\r
+ MmioWriteFromReg32Macro $Address, $Reg\r
+ ldr r1, =($Address)\r
+ str $Reg, [r1]\r
MEND\r
\r
- MACRO \r
- MmioRead32Macro $Address \r
- ldr r1, =($Address) \r
- ldr r0, [r1] \r
+ MACRO\r
+ MmioRead32Macro $Address\r
+ ldr r1, =($Address)\r
+ ldr r0, [r1]\r
+ MEND\r
+\r
+ MACRO\r
+ MmioReadToReg32Macro $Address, $Reg\r
+ ldr r1, =($Address)\r
+ ldr $Reg, [r1]\r
MEND\r
\r
- MACRO \r
- MmioReadToReg32Macro $Address, $Reg \r
- ldr r1, =($Address) \r
- ldr $Reg, [r1] \r
+ MACRO\r
+ LoadConstantMacro $Data\r
+ ldr r0, =($Data)\r
MEND\r
\r
- MACRO \r
- LoadConstantMacro $Data \r
- ldr r0, =($Data) \r
+ MACRO\r
+ LoadConstantToRegMacro $Data, $Reg\r
+ ldr $Reg, =($Data)\r
MEND\r
\r
- MACRO \r
- LoadConstantToRegMacro $Data, $Reg \r
- ldr $Reg, =($Data) \r
- MEND \r
- \r
; The reserved place must be 8-bytes aligned for pushing 64-bit variable on the stack\r
; Note: Global Size will be modified\r
MACRO\r
#define TT_DESCRIPTOR_SECTION_WRITE_BACK (TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE | \\r
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_BACK | \\r
- TT_DESCRIPTOR_TYPE_SECTION) \r
+ TT_DESCRIPTOR_TYPE_SECTION)\r
#define TT_DESCRIPTOR_SECTION_WRITE_THROUGH (TT_DESCRIPTOR_SECTION_ACCESS_PERMISSION_READ_WRITE | \\r
TT_DESCRIPTOR_SECTION_DOMAIN(0) | \\r
TT_DESCRIPTOR_SECTION_CACHE_POLICY_WRITE_THROUGH | \\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
VOID\r
);\r
\r
-UINTN \r
+UINTN\r
EFIAPI\r
ArmReadCbar (\r
VOID\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#define __ARM_DISASSEBLER_LIB_H__\r
\r
/**\r
- Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to \r
- point to next instructin. \r
- \r
- We cheat and only decode instructions that access \r
+ Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to\r
+ point to next instructin.\r
+\r
+ We cheat and only decode instructions that access\r
memory. If the instruction is not found we dump the instruction in hex.\r
- \r
- @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble. \r
+\r
+ @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble.\r
@param Thumb TRUE for Thumb(2), FALSE for ARM instruction stream\r
@param Extended TRUE dump hex for instruction too.\r
@param ItBlock Size of IT Block\r
@param Buf Buffer to sprintf disassembly into.\r
- @param Size Size of Buf in bytes. \r
- \r
+ @param Size Size of Buf in bytes.\r
+\r
**/\r
VOID\r
DisassembleInstruction (\r
OUT CHAR8 *Buf,\r
OUT UINTN Size\r
);\r
- \r
-#endif \r
+\r
+#endif\r
ArmDataCachePresent (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheSize (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheAssociativity (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheLineLength (\r
VOID\r
);\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmInstructionCachePresent (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheSize (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheAssociativity (\r
VOID\r
);\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheLineLength (\r
ArmDisableInstructionCache (\r
VOID\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmEnableMmu (\r
ArmDisableFiq (\r
VOID\r
);\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmGetFiqState (\r
ArmInvalidateTlb (\r
VOID\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmUpdateTranslationTableEntry (\r
IN VOID *TranslationTableEntry,\r
IN VOID *Mva\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmSetDomainAccessControl (\r
OUT VOID **TranslationTableBase OPTIONAL,\r
OUT UINTN *TranslationTableSize OPTIONAL\r
);\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmMmuEnabled (\r
VOID\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmEnableBranchPrediction (\r
ArmDataMemoryBarrier (\r
VOID\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmDataSyncronizationBarrier (\r
VOID\r
);\r
- \r
+\r
VOID\r
EFIAPI\r
ArmInstructionSynchronizationBarrier (\r
IN EFI_EXCEPTION_TYPE ExceptionType,\r
IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
- \r
-#endif \r
+\r
+#endif\r
* about the semihosting interface.\r
*\r
*/\r
- \r
+\r
#define SEMIHOST_FILE_MODE_READ (0 << 2)\r
#define SEMIHOST_FILE_MODE_WRITE (1 << 2)\r
#define SEMIHOST_FILE_MODE_APPEND (2 << 2)\r
SemihostWriteString (\r
IN CHAR8 *String\r
);\r
- \r
+\r
UINT32\r
SemihostSystem (\r
IN CHAR8 *CommandLine\r
);\r
- \r
+\r
#endif // __SEMIHOSTING_H__\r
If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r
then ASSERT().\r
If Pages is zero, then ASSERT().\r
- \r
+\r
@param Buffer Pointer to the buffer of pages to free.\r
@param Pages The number of 4 KB pages to free.\r
\r
If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r
Library, then ASSERT().\r
If Pages is zero, then ASSERT().\r
- \r
+\r
@param Buffer Pointer to the buffer of pages to free.\r
@param Pages The number of 4 KB pages to free.\r
\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r
is not enough memory remaining to satisfy the request, then NULL is returned.\r
If Buffer is NULL, then ASSERT().\r
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param AllocationSize The number of bytes to allocate and zero.\r
@param Buffer The buffer to copy to the allocated buffer.\r
);\r
\r
/**\r
- Frees a buffer that was previously allocated with one of the aligned pool allocation functions \r
+ Frees a buffer that was previously allocated with one of the aligned pool allocation functions\r
in the Memory Allocation Library.\r
\r
Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the\r
IN EFI_PHYSICAL_ADDRESS VirtualMask,\r
OUT UINT64 *Attributes OPTIONAL\r
);\r
- \r
+\r
typedef\r
EFI_STATUS\r
(EFIAPI *FREE_CONVERTED_PAGES) (\r
\r
extern EFI_GUID gVirtualUncachedPagesProtocolGuid;\r
\r
-#endif \r
+#endif\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
FILE_GUID = 82da1b44-d2d6-4a7d-bbf0-a0cb67964034\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = TimerLib \r
+ LIBRARY_CLASS = TimerLib\r
CONSTRUCTOR = TimerConstructor\r
\r
[Sources.common]\r
MdePkg/MdePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
ArmPkg/ArmPkg.dec\r
- \r
+\r
\r
[LibraryClasses]\r
DebugLib\r
IoLib\r
ArmLib\r
- BaseLib \r
- \r
+ BaseLib\r
+\r
[Protocols]\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN ArmCacheLineLength = ArmDataCacheLineLength();\r
UINTN ArmCacheLineAlignmentMask = ArmCacheLineLength - 1;\r
UINTN ArmCacheOperationThreshold = PcdGet32(PcdArmCacheOperationThreshold);\r
- \r
+\r
if ((CacheOperation != NULL) && (Length >= ArmCacheOperationThreshold)) {\r
ArmDrainWriteBuffer ();\r
CacheOperation ();\r
Default exception handler\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN Index, Start, End;\r
CHAR8 *Str;\r
BOOLEAN First;\r
- \r
+\r
Str = mMregListStr;\r
*Str = '\0';\r
AsciiStrCat (Str, "{");\r
for (Index++; ((OpCode & (1 << Index)) != 0) && Index <= 15; Index++) {\r
End = Index;\r
}\r
- \r
+\r
if (!First) {\r
AsciiStrCat (Str, ",");\r
} else {\r
First = FALSE;\r
}\r
- \r
+\r
if (Start == End) {\r
AsciiStrCat (Str, gReg[Start]);\r
AsciiStrCat (Str, ", ");\r
AsciiStrCat (Str, "ERROR");\r
}\r
AsciiStrCat (Str, "}");\r
- \r
+\r
// BugBug: Make caller pass in buffer it is cleaner\r
return mMregListStr;\r
}\r
\r
\r
/**\r
- Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to \r
- point to next instructin. \r
- \r
- We cheat and only decode instructions that access \r
+ Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to\r
+ point to next instructin.\r
+\r
+ We cheat and only decode instructions that access\r
memory. If the instruction is not found we dump the instruction in hex.\r
- \r
- @param OpCodePtr Pointer to pointer of ARM instruction to disassemble. \r
+\r
+ @param OpCodePtr Pointer to pointer of ARM instruction to disassemble.\r
@param Buf Buffer to sprintf disassembly into.\r
- @param Size Size of Buf in bytes. \r
+ @param Size Size of Buf in bytes.\r
@param Extended TRUE dump hex for instruction too.\r
- \r
+\r
**/\r
VOID\r
DisassembleArmInstruction (\r
P = (OpCode & BIT24) == BIT24;\r
U = (OpCode & BIT23) == BIT23;\r
B = (OpCode & BIT22) == BIT22; // Also called S\r
- W = (OpCode & BIT21) == BIT21; \r
+ W = (OpCode & BIT21) == BIT21;\r
L = (OpCode & BIT20) == BIT20;\r
S = (OpCode & BIT6) == BIT6;\r
H = (OpCode & BIT5) == BIT5;\r
// LDREX, STREX\r
if ((OpCode & 0x0fe000f0) == 0x01800090) {\r
if (L) {\r
- // A4.1.27 LDREX{<cond>} <Rd>, [<Rn>] \r
- AsciiSPrint (Buf, Size, "LDREX%a %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn]); \r
+ // A4.1.27 LDREX{<cond>} <Rd>, [<Rn>]\r
+ AsciiSPrint (Buf, Size, "LDREX%a %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn]);\r
} else {\r
// A4.1.103 STREX{<cond>} <Rd>, <Rm>, [<Rn>]\r
- AsciiSPrint (Buf, Size, "STREX%a %a, %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn], gReg[Rn]); \r
- } \r
+ AsciiSPrint (Buf, Size, "STREX%a %a, %a, [%a]", COND (OpCode), gReg[Rd], gReg[Rn], gReg[Rn]);\r
+ }\r
return;\r
}\r
- \r
+\r
// LDM/STM\r
if ((OpCode & 0x0e000000) == 0x08000000) {\r
if (L) {\r
// A4.1.20 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers>\r
// A4.1.21 LDM{<cond>}<addressing_mode> <Rn>, <registers_without_pc>^\r
// A4.1.22 LDM{<cond>}<addressing_mode> <Rn>{!}, <registers_and_pc>^\r
- AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B)); \r
+ AsciiSPrint (Buf, Size, "LDM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));\r
} else {\r
// A4.1.97 STM{<cond>}<addressing_mode> <Rn>{!}, <registers>\r
// A4.1.98 STM{<cond>}<addressing_mode> <Rn>, <registers>^\r
- AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B)); \r
- } \r
+ AsciiSPrint (Buf, Size, "STM%a%a, %a%a, %a", COND (OpCode), LDM_EXT (Rn ,(OpCode >> 23) & 3), gReg[Rn], WRITE (W), MRegList (OpCode), USER (B));\r
+ }\r
return;\r
}\r
\r
if ((OpCode & 0xfd70f000 ) == 0xf550f000) {\r
Index = AsciiSPrint (Buf, Size, "PLD");\r
} else {\r
- Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", L ? "LDR" : "STR", COND (OpCode), BYTE (B), (!(P) && W) ? "T":"", gReg[Rd]); \r
+ Index = AsciiSPrint (Buf, Size, "%a%a%a%a %a, ", L ? "LDR" : "STR", COND (OpCode), BYTE (B), (!(P) && W) ? "T":"", gReg[Rd]);\r
}\r
if (P) {\r
if (!I) {\r
} else {\r
Type = "ROR";\r
}\r
- \r
+\r
AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a%a, %a, #%d]%a", gReg[Rn], SIGN (U), gReg[Rm], Type, shift_imm, WRITE (W));\r
}\r
} else { // !P\r
} else {\r
Type = "ROR";\r
}\r
- \r
+\r
AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a%a, %a, #%d", gReg[Rn], SIGN (U), gReg[Rm], Type, shift_imm);\r
}\r
}\r
- return; \r
+ return;\r
}\r
- \r
+\r
if ((OpCode & 0x0e000000) == 0x00000000) {\r
// LDR/STR address mode 3\r
// LDR|STR{<cond>}H|SH|SB|D <Rd>, <addressing_mode>\r
Root = "STR%aD %a ";\r
}\r
}\r
- \r
- Index = AsciiSPrint (Buf, Size, Root, COND (OpCode), gReg[Rd]); \r
+\r
+ Index = AsciiSPrint (Buf, Size, Root, COND (OpCode), gReg[Rd]);\r
\r
S = (OpCode & BIT6) == BIT6;\r
H = (OpCode & BIT5) == BIT5;\r
AsciiSPrint (Buf, Size, "SWP%a%a %a, %a, [%a]", COND (OpCode), BYTE (B), gReg[Rd], gReg[Rm], gReg[Rn]);\r
return;\r
}\r
- \r
+\r
if ((OpCode & 0xfe5f0f00) == 0xf84d0500) {\r
// A4.1.90 SRS SRS<addressing_mode> #<mode>{!}\r
AsciiSPrint (Buf, Size, "SRS%a #0x%x%a", gLdmStack[(OpCode >> 23) & 3], OpCode & 0x1f, WRITE (W));\r
AsciiSPrint (Buf, Size, "RFE%a %a", gLdmStack[(OpCode >> 23) & 3], gReg[Rn], WRITE (W));\r
return;\r
}\r
- \r
+\r
if ((OpCode & 0xfff000f0) == 0xe1200070) {\r
// A4.1.7 BKPT <immed_16>\r
AsciiSPrint (Buf, Size, "BKPT %x", ((OpCode >> 8) | (OpCode & 0xf)) & 0xffff);\r
return;\r
- } \r
- \r
+ }\r
+\r
if ((OpCode & 0xfff10020) == 0xf1000000) {\r
// A4.1.16 CPS<effect> <iflags> {, #<mode>}\r
if (((OpCode >> 6) & 0x7) == 0) {\r
}\r
}\r
return;\r
- } \r
- \r
+ }\r
+\r
if ((OpCode & 0x0f000000) == 0x0f000000) {\r
// A4.1.107 SWI{<cond>} <immed_24>\r
AsciiSPrint (Buf, Size, "SWI%a %x", COND (OpCode), OpCode & 0x00ffffff);\r
return;\r
- } \r
+ }\r
\r
if ((OpCode & 0x0fb00000) == 0x01000000) {\r
// A4.1.38 MRS{<cond>} <Rd>, CPSR MRS{<cond>} <Rd>, SPSR\r
AsciiSPrint (Buf, Size, "MRS%a %a, %a", COND (OpCode), gReg[Rd], B ? "SPSR" : "CPSR");\r
return;\r
- } \r
+ }\r
\r
\r
if ((OpCode & 0x0db00000) == 0x03200000) {\r
AsciiSPrint (Buf, Size, "MRS%a %a_%a, %a", COND (OpCode), B ? "SPSR" : "CPSR", gReg[Rd]);\r
}\r
return;\r
- } \r
+ }\r
\r
if ((OpCode & 0xff000010) == 0xfe000000) {\r
// A4.1.13 CDP{<cond>} <coproc>, <opcode_1>, <CRd>, <CRn>, <CRm>, <opcode_2>\r
AsciiSPrint (Buf, Size, "CDP%a 0x%x, 0x%x, CR%d, CR%d, CR%d, 0x%x", COND (OpCode), (OpCode >> 8) & 0xf, (OpCode >> 20) & 0xf, Rn, Rd, Rm, (OpCode >> 5) &0x7);\r
return;\r
}\r
- \r
+\r
if ((OpCode & 0x0e000000) == 0x0c000000) {\r
// A4.1.19 LDC and A4.1.96 SDC\r
if ((OpCode & 0xf0000000) == 0xf0000000) {\r
} else {\r
Index = AsciiSPrint (Buf, Size, "%a%a 0x%x, CR%d, ", L ? "LDC":"SDC", COND (OpCode), (OpCode >> 8) & 0xf, Rd);\r
}\r
- \r
+\r
if (!P) {\r
- if (!W) { \r
+ if (!W) {\r
// A5.5.5.5 [<Rn>], <option>\r
- AsciiSPrint (&Buf[Index], Size - Index, "[%a], {0x%x}", gReg[Rn], OpCode & 0xff); \r
+ AsciiSPrint (&Buf[Index], Size - Index, "[%a], {0x%x}", gReg[Rn], OpCode & 0xff);\r
} else {\r
// A.5.5.4 [<Rn>], #+/-<offset_8>*4\r
- AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x*4", gReg[Rn], SIGN (U), OpCode & 0xff); \r
+ AsciiSPrint (&Buf[Index], Size - Index, "[%a], #%a0x%x*4", gReg[Rn], SIGN (U), OpCode & 0xff);\r
}\r
} else {\r
// A5.5.5.2 [<Rn>, #+/-<offset_8>*4 ]!\r
- AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x*4]%a", gReg[Rn], SIGN (U), OpCode & 0xff, WRITE (W)); \r
+ AsciiSPrint (&Buf[Index], Size - Index, "[%a, #%a0x%x*4]%a", gReg[Rn], SIGN (U), OpCode & 0xff, WRITE (W));\r
}\r
- \r
+\r
}\r
- \r
+\r
if ((OpCode & 0x0f000010) == 0x0e000010) {\r
- // A4.1.32 MRC2, MCR2 \r
+ // A4.1.32 MRC2, MCR2\r
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, CR%d, CR%d, 0x%x", L ? "MRC":"MCR", COND (OpCode), (OpCode >> 8) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], Rn, Rm, (OpCode >> 5) &0x7);\r
- return; \r
+ return;\r
}\r
\r
if ((OpCode & 0x0ff00000) == 0x0c400000) {\r
- // A4.1.33 MRRC2, MCRR2 \r
+ // A4.1.33 MRRC2, MCRR2\r
AsciiSPrint (Buf, Size, "%a%a 0x%x, 0x%x, %a, %a, CR%d", L ? "MRRC":"MCRR", COND (OpCode), (OpCode >> 4) & 0xf, (OpCode >> 20) & 0xf, gReg[Rd], gReg[Rn], Rm);\r
- return; \r
+ return;\r
}\r
\r
AsciiSPrint (Buf, Size, "Faulting OpCode 0x%08x", OpCode);\r
- \r
+\r
*OpCodePtr += 1;\r
return;\r
}\r
/** @file\r
Thumb Dissassembler. Still a work in progress.\r
\r
- Wrong output is a bug, so please fix it. \r
+ Wrong output is a bug, so please fix it.\r
Hex output means there is not yet an entry or a decode bug.\r
- gOpThumb[] are Thumb 16-bit, and gOpThumb2[] work on the 32-bit \r
- 16-bit stream of Thumb2 instruction. Then there are big case \r
+ gOpThumb[] are Thumb 16-bit, and gOpThumb2[] work on the 32-bit\r
+ 16-bit stream of Thumb2 instruction. Then there are big case\r
statements to print everything out. If you are adding instructions\r
try to reuse existing case entries if possible.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Thumb address modes\r
#define LOAD_STORE_FORMAT1 1\r
#define LOAD_STORE_FORMAT1_H 101\r
-#define LOAD_STORE_FORMAT1_B 111 \r
+#define LOAD_STORE_FORMAT1_B 111\r
#define LOAD_STORE_FORMAT2 2\r
#define LOAD_STORE_FORMAT3 3\r
#define LOAD_STORE_FORMAT4 4\r
-#define LOAD_STORE_MULTIPLE_FORMAT1 5 \r
-#define PUSH_FORMAT 6 \r
-#define POP_FORMAT 106 \r
+#define LOAD_STORE_MULTIPLE_FORMAT1 5\r
+#define PUSH_FORMAT 6\r
+#define POP_FORMAT 106\r
#define IMMED_8 7\r
#define CONDITIONAL_BRANCH 8\r
#define UNCONDITIONAL_BRANCH 9\r
#define THUMB2_4REGS 230\r
#define ADD_IMM12_1REG 231\r
#define THUMB2_IMM16 232\r
-#define MRC_THUMB2 233 \r
-#define MRRC_THUMB2 234 \r
+#define MRC_THUMB2 233\r
+#define MRRC_THUMB2 234\r
#define THUMB2_MRS 235\r
#define THUMB2_MSR 236\r
\r
{ "ADD" , 0x1800, 0xfe00, DATA_FORMAT1 },\r
{ "ADD" , 0x4400, 0xff00, DATA_FORMAT8 }, // A8.6.9\r
{ "ADD" , 0xa000, 0xf100, DATA_FORMAT6_PC },\r
- { "ADD" , 0xa800, 0xf800, DATA_FORMAT6_SP }, \r
+ { "ADD" , 0xa800, 0xf800, DATA_FORMAT6_SP },\r
{ "ADD" , 0xb000, 0xff80, DATA_FORMAT7 },\r
\r
{ "AND" , 0x4000, 0xffc0, DATA_FORMAT5 },\r
{ "LDRH" , 0x7a00, 0xfe00, LOAD_STORE_FORMAT2 },\r
{ "LDRSB" , 0x5600, 0xfe00, LOAD_STORE_FORMAT2 }, // STR <Rt>, [<Rn>, <Rm>]\r
{ "LDRSH" , 0x5e00, 0xfe00, LOAD_STORE_FORMAT2 },\r
- \r
+\r
{ "MOVS", 0x0000, 0xffc0, DATA_FORMAT5 }, // LSL with imm5 == 0 is a MOVS, so this must go before LSL\r
{ "LSL" , 0x0000, 0xf800, DATA_FORMAT4 },\r
{ "LSL" , 0x4080, 0xffc0, DATA_FORMAT5 },\r
\r
THUMB_INSTRUCTIONS gOpThumb2[] = {\r
//Instruct OpCode OpCode Mask Addressig Mode\r
- \r
- { "ADR", 0xf2af0000, 0xfbff8000, ADR_THUMB2 }, // ADDR <Rd>, <label> ;Needs to go before ADDW \r
+\r
+ { "ADR", 0xf2af0000, 0xfbff8000, ADR_THUMB2 }, // ADDR <Rd>, <label> ;Needs to go before ADDW\r
{ "CMN", 0xf1100f00, 0xfff08f00, CMN_THUMB2 }, // CMN <Rn>, #<const> ;Needs to go before ADD\r
{ "CMN", 0xeb100f00, 0xfff08f00, ADD_IMM5_2REG }, // CMN <Rn>, <Rm> {,<shift> #<const>}\r
{ "CMP", 0xf1a00f00, 0xfff08f00, CMN_THUMB2 }, // CMP <Rn>, #<const>\r
{ "MOV", 0xf04f0000, 0xfbef8000, ADD_IMM12_1REG }, // MOV <Rd>, #<const>\r
{ "MOVW", 0xf2400000, 0xfbe08000, THUMB2_IMM16 }, // MOVW <Rd>, #<const>\r
{ "MOVT", 0xf2c00000, 0xfbe08000, THUMB2_IMM16 }, // MOVT <Rd>, #<const>\r
- \r
+\r
{ "ADC", 0xf1400000, 0xfbe08000, ADD_IMM12 }, // ADC{S} <Rd>, <Rn>, #<const>\r
{ "ADC", 0xeb400000, 0xffe08000, ADD_IMM5 }, // ADC{S} <Rd>, <Rn>, <Rm> {,<shift> #<const>}\r
{ "ADD", 0xf1000000, 0xfbe08000, ADD_IMM12 }, // ADD{S} <Rd>, <Rn>, #<const>\r
{ "SUB", 0xeba00000, 0xffe08000, ADD_IMM5 }, // SUB{S} <Rd>, <Rn>, <Rm> {,<shift> #<const>}\r
\r
{ "ASR", 0xea4f0020, 0xffef8030, ASR_IMM5 }, // ARS <Rd>, <Rm> #<const>} imm3:imm2\r
- { "ASR", 0xfa40f000, 0xffe0f0f0, ASR_3REG }, // ARS <Rd>, <Rn>, <Rm> \r
+ { "ASR", 0xfa40f000, 0xffe0f0f0, ASR_3REG }, // ARS <Rd>, <Rn>, <Rm>\r
{ "LSR", 0xea4f0010, 0xffef8030, ASR_IMM5 }, // LSR <Rd>, <Rm> #<const>} imm3:imm2\r
- { "LSR", 0xfa20f000, 0xffe0f0f0, ASR_3REG }, // LSR <Rd>, <Rn>, <Rm> \r
+ { "LSR", 0xfa20f000, 0xffe0f0f0, ASR_3REG }, // LSR <Rd>, <Rn>, <Rm>\r
{ "ROR", 0xea4f0030, 0xffef8030, ASR_IMM5 }, // ROR <Rd>, <Rm> #<const>} imm3:imm2\r
- { "ROR", 0xfa60f000, 0xffe0f0f0, ASR_3REG }, // ROR <Rd>, <Rn>, <Rm> \r
+ { "ROR", 0xfa60f000, 0xffe0f0f0, ASR_3REG }, // ROR <Rd>, <Rn>, <Rm>\r
\r
{ "BFC", 0xf36f0000, 0xffff8010, BFC_THUMB2 }, // BFC <Rd>, #<lsb>, #<width>\r
{ "BIC", 0xf3600000, 0xfff08010, BFC_THUMB2 }, // BIC <Rn>, <Rd>, #<lsb>, #<width>\r
{ "STMDB", 0xe9800000, 0xffd0a000, STM_FORMAT }, // STMDB <Rn>{!},<registers>\r
{ "LDM" , 0xe8900000, 0xffd02000, STM_FORMAT }, // LDM <Rn>{!},<registers>\r
{ "LDMDB", 0xe9100000, 0xffd02000, STM_FORMAT }, // LDMDB <Rn>{!},<registers>\r
- \r
+\r
{ "LDR", 0xf8d00000, 0xfff00000, LDM_REG_IMM12 }, // LDR <rt>, [<rn>, {, #<imm12>]}\r
{ "LDRB", 0xf8900000, 0xfff00000, LDM_REG_IMM12 }, // LDRB <rt>, [<rn>, {, #<imm12>]}\r
{ "LDRH", 0xf8b00000, 0xfff00000, LDM_REG_IMM12 }, // LDRH <rt>, [<rn>, {, #<imm12>]}\r
{ "LDRSB", 0xf9900000, 0xfff00000, LDM_REG_IMM12 }, // LDRSB <rt>, [<rn>, {, #<imm12>]}\r
{ "LDRSH", 0xf9b00000, 0xfff00000, LDM_REG_IMM12 }, // LDRSH <rt>, [<rn>, {, #<imm12>]}\r
\r
- { "LDR", 0xf85f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDR <Rt>, <label> \r
- { "LDRB", 0xf81f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRB <Rt>, <label> \r
- { "LDRH", 0xf83f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRH <Rt>, <label> \r
- { "LDRSB", 0xf91f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRSB <Rt>, <label> \r
- { "LDRSH", 0xf93f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRSB <Rt>, <label> \r
- \r
+ { "LDR", 0xf85f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDR <Rt>, <label>\r
+ { "LDRB", 0xf81f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRB <Rt>, <label>\r
+ { "LDRH", 0xf83f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRH <Rt>, <label>\r
+ { "LDRSB", 0xf91f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRSB <Rt>, <label>\r
+ { "LDRSH", 0xf93f0000, 0xff7f0000, LDM_REG_IMM12_SIGNED }, // LDRSB <Rt>, <label>\r
+\r
{ "LDR", 0xf8500000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // LDR <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "LDRB", 0xf8100000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // LDRB <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "LDRH", 0xf8300000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // LDRH <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "LDR", 0xf8500800, 0xfff00800, LDM_REG_IMM8 }, // LDR <rt>, [<rn>, {, #<imm8>]}\r
{ "LDRBT", 0xf8100e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRBT <rt>, [<rn>, {, #<imm8>]}\r
{ "LDRHT", 0xf8300e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRHT <rt>, [<rn>, {, #<imm8>]}\r
- { "LDRSB", 0xf9100800, 0xfff00800, LDM_REG_IMM8 }, // LDRHT <rt>, [<rn>, {, #<imm8>]} {!} form? \r
- { "LDRSBT",0xf9100e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRHBT <rt>, [<rn>, {, #<imm8>]} {!} form? \r
- { "LDRSH" ,0xf9300800, 0xfff00800, LDM_REG_IMM8 }, // LDRSH <rt>, [<rn>, {, #<imm8>]} \r
- { "LDRSHT",0xf9300e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRSHT <rt>, [<rn>, {, #<imm8>]} \r
- { "LDRT", 0xf8500e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRT <rt>, [<rn>, {, #<imm8>]} \r
+ { "LDRSB", 0xf9100800, 0xfff00800, LDM_REG_IMM8 }, // LDRHT <rt>, [<rn>, {, #<imm8>]} {!} form?\r
+ { "LDRSBT",0xf9100e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRHBT <rt>, [<rn>, {, #<imm8>]} {!} form?\r
+ { "LDRSH" ,0xf9300800, 0xfff00800, LDM_REG_IMM8 }, // LDRSH <rt>, [<rn>, {, #<imm8>]}\r
+ { "LDRSHT",0xf9300e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRSHT <rt>, [<rn>, {, #<imm8>]}\r
+ { "LDRT", 0xf8500e00, 0xfff00f00, LDM_REG_IMM8 }, // LDRT <rt>, [<rn>, {, #<imm8>]}\r
\r
{ "LDRD", 0xe8500000, 0xfe500000, LDRD_REG_IMM8_SIGNED }, // LDRD <rt>, <rt2>, [<rn>, {, #<imm8>]}{!}\r
{ "LDRD", 0xe8500000, 0xfe500000, LDRD_REG_IMM8 }, // LDRD <rt>, <rt2>, <label>\r
- \r
- { "LDREX", 0xe8500f00, 0xfff00f00, LDM_REG_IMM8 }, // LDREX <Rt>, [Rn, {#imm8}]] \r
- { "LDREXB", 0xe8d00f4f, 0xfff00fff, LDREXB }, // LDREXB <Rt>, [<Rn>] \r
- { "LDREXH", 0xe8d00f5f, 0xfff00fff, LDREXB }, // LDREXH <Rt>, [<Rn>] \r
- \r
- { "LDREXD", 0xe8d00f4f, 0xfff00fff, LDREXD }, // LDREXD <Rt>, <Rt2>, [<Rn>] \r
-\r
- { "STR", 0xf8c00000, 0xfff00000, LDM_REG_IMM12 }, // STR <rt>, [<rn>, {, #<imm12>]} \r
+\r
+ { "LDREX", 0xe8500f00, 0xfff00f00, LDM_REG_IMM8 }, // LDREX <Rt>, [Rn, {#imm8}]]\r
+ { "LDREXB", 0xe8d00f4f, 0xfff00fff, LDREXB }, // LDREXB <Rt>, [<Rn>]\r
+ { "LDREXH", 0xe8d00f5f, 0xfff00fff, LDREXB }, // LDREXH <Rt>, [<Rn>]\r
+\r
+ { "LDREXD", 0xe8d00f4f, 0xfff00fff, LDREXD }, // LDREXD <Rt>, <Rt2>, [<Rn>]\r
+\r
+ { "STR", 0xf8c00000, 0xfff00000, LDM_REG_IMM12 }, // STR <rt>, [<rn>, {, #<imm12>]}\r
{ "STRB", 0xf8800000, 0xfff00000, LDM_REG_IMM12 }, // STRB <rt>, [<rn>, {, #<imm12>]}\r
{ "STRH", 0xf8a00000, 0xfff00000, LDM_REG_IMM12 }, // STRH <rt>, [<rn>, {, #<imm12>]}\r
- \r
+\r
{ "STR", 0xf8400000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // STR <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "STRB", 0xf8000000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // STRB <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "STRH", 0xf8200000, 0xfff00fc0, LDM_REG_INDIRECT_LSL }, // STRH <rt>, [<rn>, <rm> {, LSL #<imm2>]}\r
{ "STRH", 0xf8200800, 0xfff00800, LDM_REG_IMM8 }, // STRH <rt>, [<rn>, {, #<imm8>]}\r
{ "STRBT", 0xf8000e00, 0xfff00f00, LDM_REG_IMM8 }, // STRBT <rt>, [<rn>, {, #<imm8>]}\r
{ "STRHT", 0xf8200e00, 0xfff00f00, LDM_REG_IMM8 }, // STRHT <rt>, [<rn>, {, #<imm8>]}\r
- { "STRT", 0xf8400e00, 0xfff00f00, LDM_REG_IMM8 }, // STRT <rt>, [<rn>, {, #<imm8>]} \r
+ { "STRT", 0xf8400e00, 0xfff00f00, LDM_REG_IMM8 }, // STRT <rt>, [<rn>, {, #<imm8>]}\r
\r
{ "STRD", 0xe8400000, 0xfe500000, LDRD_REG_IMM8_SIGNED }, // STRD <rt>, <rt2>, [<rn>, {, #<imm8>]}{!}\r
\r
- { "STREX", 0xe8400f00, 0xfff00f00, LDM_REG_IMM8 }, // STREX <Rt>, [Rn, {#imm8}]] \r
- { "STREXB", 0xe8c00f4f, 0xfff00fff, LDREXB }, // STREXB <Rd>, <Rt>, [<Rn>] \r
- { "STREXH", 0xe8c00f5f, 0xfff00fff, LDREXB }, // STREXH <Rd>, <Rt>, [<Rn>] \r
- \r
- { "STREXD", 0xe8d00f4f, 0xfff00fff, LDREXD }, // STREXD <Rd>, <Rt>, <Rt2>, [<Rn>] \r
+ { "STREX", 0xe8400f00, 0xfff00f00, LDM_REG_IMM8 }, // STREX <Rt>, [Rn, {#imm8}]]\r
+ { "STREXB", 0xe8c00f4f, 0xfff00fff, LDREXB }, // STREXB <Rd>, <Rt>, [<Rn>]\r
+ { "STREXH", 0xe8c00f5f, 0xfff00fff, LDREXB }, // STREXH <Rd>, <Rt>, [<Rn>]\r
+\r
+ { "STREXD", 0xe8d00f4f, 0xfff00fff, LDREXD }, // STREXD <Rd>, <Rt>, <Rt2>, [<Rn>]\r
\r
{ "SRSDB", 0xe80dc000, 0xffdffff0, SRS_FORMAT }, // SRSDB<c> SP{!},#<mode>\r
{ "SRS" , 0xe98dc000, 0xffdffff0, SRS_FORMAT }, // SRS{IA}<c> SP{!},#<mode>\r
UINTN Index, Start, End;\r
CHAR8 *Str;\r
BOOLEAN First;\r
- \r
+\r
Str = mThumbMregListStr;\r
*Str = '\0';\r
AsciiStrCat (Str, "{");\r
- \r
+\r
for (Index = 0, First = TRUE; Index <= 15; Index++) {\r
if ((RegBitMask & (1 << Index)) != 0) {\r
Start = End = Index;\r
for (Index++; ((RegBitMask & (1 << Index)) != 0) && (Index <= 9); Index++) {\r
End = Index;\r
}\r
- \r
+\r
if (!First) {\r
AsciiStrCat (Str, ",");\r
} else {\r
First = FALSE;\r
}\r
- \r
+\r
if (Start == End) {\r
AsciiStrCat (Str, gReg[Start]);\r
} else {\r
AsciiStrCat (Str, "ERROR");\r
}\r
AsciiStrCat (Str, "}");\r
- \r
+\r
// BugBug: Make caller pass in buffer it is cleaner\r
return mThumbMregListStr;\r
}\r
if (((Data & TopBit) == 0) || (TopBit == BIT31)) {\r
return Data;\r
}\r
- \r
+\r
do {\r
TopBit <<= 1;\r
- Data |= TopBit; \r
+ Data |= TopBit;\r
} while ((TopBit & BIT31) != BIT31);\r
\r
return Data;\r
}\r
\r
//\r
-// Some instructions specify the PC is always considered aligned \r
+// Some instructions specify the PC is always considered aligned\r
// The PC is after the instruction that is excuting. So you pass\r
// in the instruction address and you get back the aligned answer\r
//\r
}\r
\r
/**\r
- Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to \r
- point to next instructin. \r
- \r
- We cheat and only decode instructions that access \r
+ Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to\r
+ point to next instructin.\r
+\r
+ We cheat and only decode instructions that access\r
memory. If the instruction is not found we dump the instruction in hex.\r
- \r
- @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble. \r
+\r
+ @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble.\r
@param Buf Buffer to sprintf disassembly into.\r
- @param Size Size of Buf in bytes. \r
+ @param Size Size of Buf in bytes.\r
@param Extended TRUE dump hex for instruction too.\r
- \r
+\r
**/\r
VOID\r
DisassembleThumbInstruction (\r
UINT32 PC, Target, msbit, lsbit;\r
CHAR8 *Cond;\r
BOOLEAN S, J1, J2, P, U, W;\r
- UINT32 coproc, opc1, opc2, CRd, CRn, CRm; \r
+ UINT32 coproc, opc1, opc2, CRd, CRn, CRm;\r
UINT32 Mask;\r
\r
OpCodePtr = *OpCodePtrPtr;\r
OpCode = **OpCodePtrPtr;\r
- \r
+\r
// Thumb2 is a stream of 16-bit instructions not a 32-bit instruction.\r
OpCode32 = (((UINT32)OpCode) << 16) | *(OpCodePtr + 1);\r
\r
\r
// Increment by the minimum instruction size, Thumb2 could be bigger\r
*OpCodePtrPtr += 1;\r
- \r
+\r
// Manage IT Block ItFlag TRUE means we are in an IT block\r
/*if (*ItBlock != 0) {\r
ItFlag = TRUE;\r
for (Index = 0; Index < sizeof (gOpThumb)/sizeof (THUMB_INSTRUCTIONS); Index++) {\r
if ((OpCode & gOpThumb[Index].Mask) == gOpThumb[Index].OpCode) {\r
if (Extended) {\r
- Offset = AsciiSPrint (Buf, Size, "0x%04x %-6a", OpCode, gOpThumb[Index].Start); \r
+ Offset = AsciiSPrint (Buf, Size, "0x%04x %-6a", OpCode, gOpThumb[Index].Start);\r
} else {\r
- Offset = AsciiSPrint (Buf, Size, "%-6a", gOpThumb[Index].Start); \r
+ Offset = AsciiSPrint (Buf, Size, "%-6a", gOpThumb[Index].Start);\r
}\r
switch (gOpThumb[Index].AddressMode) {\r
case LOAD_STORE_FORMAT1:\r
// A6.5.1 <Rd>, [<Rn>, #<5_bit_offset>]\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 4) & 0x7c); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 4) & 0x7c);\r
return;\r
case LOAD_STORE_FORMAT1_H:\r
// A6.5.1 <Rd>, [<Rn>, #<5_bit_offset>]\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 5) & 0x3e); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 5) & 0x3e);\r
return;\r
case LOAD_STORE_FORMAT1_B:\r
// A6.5.1 <Rd>, [<Rn>, #<5_bit_offset>]\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 6) & 0x1f); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d #0x%x]", Rd, Rn, (OpCode >> 6) & 0x1f);\r
return;\r
\r
case LOAD_STORE_FORMAT2:\r
// A6.5.1 <Rd>, [<Rn>, <Rm>]\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d, r%d]", Rd, Rn, Rm); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [r%d, r%d]", Rd, Rn, Rm);\r
return;\r
case LOAD_STORE_FORMAT3:\r
// A6.5.1 <Rd>, [PC, #<8_bit_offset>]\r
Target = (OpCode & 0xff) << 2;\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [pc, #0x%x] ;0x%08x", (OpCode >> 8) & 7, Target, PCAlign4 (PC) + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [pc, #0x%x] ;0x%08x", (OpCode >> 8) & 7, Target, PCAlign4 (PC) + Target);\r
return;\r
case LOAD_STORE_FORMAT4:\r
// Rt, [SP, #imm8]\r
Target = (OpCode & 0xff) << 2;\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [sp, #0x%x]", (OpCode >> 8) & 7, Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, [sp, #0x%x]", (OpCode >> 8) & 7, Target);\r
return;\r
- \r
+\r
case LOAD_STORE_MULTIPLE_FORMAT1:\r
// <Rn>!, {r0-r7}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d!, %a", (OpCode >> 8) & 7, ThumbMRegList (OpCode & 0xff)); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d!, %a", (OpCode >> 8) & 7, ThumbMRegList (OpCode & 0xff));\r
return;\r
- \r
+\r
case POP_FORMAT:\r
// POP {r0-r7,pc}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a", ThumbMRegList ((OpCode & 0xff) | ((OpCode & BIT8) == BIT8 ? BIT15 : 0))); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a", ThumbMRegList ((OpCode & 0xff) | ((OpCode & BIT8) == BIT8 ? BIT15 : 0)));\r
return;\r
\r
case PUSH_FORMAT:\r
// PUSH {r0-r7,lr}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a", ThumbMRegList ((OpCode & 0xff) | ((OpCode & BIT8) == BIT8 ? BIT14 : 0))); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a", ThumbMRegList ((OpCode & 0xff) | ((OpCode & BIT8) == BIT8 ? BIT14 : 0)));\r
return;\r
\r
- \r
+\r
case IMMED_8:\r
// A6.7 <immed_8>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%x", OpCode & 0xff); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%x", OpCode & 0xff);\r
return;\r
\r
case CONDITIONAL_BRANCH:\r
Cond = gCondition[(OpCode >> 8) & 0xf];\r
Buf[Offset-5] = *Cond++;\r
Buf[Offset-4] = *Cond;\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0xff) << 1, BIT8)); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0xff) << 1, BIT8));\r
return;\r
case UNCONDITIONAL_BRANCH_SHORT:\r
// A6.3.2 B <target_address>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0x3ff) << 1, BIT11)); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%04x", PC + 4 + SignExtend32 ((OpCode & 0x3ff) << 1, BIT11));\r
return;\r
- \r
+\r
case BRANCH_EXCHANGE:\r
// A6.3.3 BX|BLX <Rm>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gReg[Rn | (H2 ? 8:0)]); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gReg[Rn | (H2 ? 8:0)]);\r
return;\r
\r
case DATA_FORMAT1:\r
// A6.4.3 <Rd>, <Rn>, <Rm>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, r%d", Rd, Rn, Rm); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, r%d", Rd, Rn, Rm);\r
return;\r
case DATA_FORMAT2:\r
// A6.4.3 <Rd>, <Rn>, #3_bit_immed\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, 0x%x", Rd, Rn, Rm); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, 0x%x", Rd, Rn, Rm);\r
return;\r
case DATA_FORMAT3:\r
// A6.4.3 <Rd>|<Rn>, #imm8\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, #0x%x", (OpCode >> 8) & 7, OpCode & 0xff); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, #0x%x", (OpCode >> 8) & 7, OpCode & 0xff);\r
return;\r
case DATA_FORMAT4:\r
// A6.4.3 <Rd>|<Rm>, #immed_5\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, 0x%x", Rn, Rd, (OpCode >> 6) & 0x1f); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d, 0x%x", Rn, Rd, (OpCode >> 6) & 0x1f);\r
return;\r
case DATA_FORMAT5:\r
// A6.4.3 <Rd>|<Rm>, <Rm>|<Rs>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d", Rd, Rn); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, r%d", Rd, Rn);\r
return;\r
case DATA_FORMAT6_SP:\r
// A6.4.3 <Rd>, <reg>, #<8_Bit_immed>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, sp, 0x%x", (OpCode >> 8) & 7, (OpCode & 0xff) << 2); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, sp, 0x%x", (OpCode >> 8) & 7, (OpCode & 0xff) << 2);\r
return;\r
case DATA_FORMAT6_PC:\r
// A6.4.3 <Rd>, <reg>, #<8_Bit_immed>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, pc, 0x%x", (OpCode >> 8) & 7, (OpCode & 0xff) << 2); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " r%d, pc, 0x%x", (OpCode >> 8) & 7, (OpCode & 0xff) << 2);\r
return;\r
case DATA_FORMAT7:\r
// A6.4.3 SP, SP, #<7_Bit_immed>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " sp, sp, 0x%x", (OpCode & 0x7f)*4); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " sp, sp, 0x%x", (OpCode & 0x7f)*4);\r
return;\r
case DATA_FORMAT8:\r
// A6.4.3 <Rd>|<Rn>, <Rm>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rd | (H1 ? 8:0)], gReg[Rn | (H2 ? 8:0)]); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rd | (H1 ? 8:0)], gReg[Rn | (H2 ? 8:0)]);\r
return;\r
- \r
+\r
case CPS_FORMAT:\r
// A7.1.24\r
- AsciiSPrint (&Buf[Offset], Size - Offset, "%a %a%a%a", imod ? "ID":"IE", ((OpCode & BIT2) == 0) ? "":"a", ((OpCode & BIT1) == 0) ? "":"i", ((OpCode & BIT0) == 0) ? "":"f"); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, "%a %a%a%a", imod ? "ID":"IE", ((OpCode & BIT2) == 0) ? "":"a", ((OpCode & BIT1) == 0) ? "":"i", ((OpCode & BIT0) == 0) ? "":"f");\r
return;\r
\r
case ENDIAN_FORMAT:\r
// A7.1.24\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a", (OpCode & BIT3) == 0 ? "LE":"BE"); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a", (OpCode & BIT3) == 0 ? "LE":"BE");\r
return;\r
\r
case DATA_CBZ:\r
// CB{N}Z <Rn>, <Lable>\r
Target = ((OpCode >> 2) & 0x3e) | (((OpCode & BIT9) == BIT9) ? BIT6 : 0);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[Rd], PC + 4 + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[Rd], PC + 4 + Target);\r
return;\r
\r
case ADR_FORMAT:\r
// ADR <Rd>, <Label>\r
Target = (OpCode & 0xff) << 2;\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[(OpCode >> 8) & 7], PCAlign4 (PC) + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %08x", gReg[(OpCode >> 8) & 7], PCAlign4 (PC) + Target);\r
return;\r
\r
case IT_BLOCK:\r
// ITSTATE = cond:mask OpCode[7:4]:OpCode[3:0]\r
// ITSTATE[7:5] == cond[3:1]\r
- // ITSTATE[4] == 1st Instruction cond[0] \r
- // ITSTATE[3] == 2st Instruction cond[0] \r
- // ITSTATE[2] == 3st Instruction cond[0] \r
+ // ITSTATE[4] == 1st Instruction cond[0]\r
+ // ITSTATE[3] == 2st Instruction cond[0]\r
+ // ITSTATE[2] == 3st Instruction cond[0]\r
// ITSTATE[1] == 4st Instruction cond[0]\r
// ITSTATE[0] == 1 4 instruction IT block. 0 means 0,1,2 or 3 instructions\r
// 1st one in ITSTATE low bits defines the number of instructions\r
} else if ((OpCode & 0xf) == 0x8) {\r
*ItBlock = 1;\r
}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gCondition[(OpCode >> 4) & 0xf]); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gCondition[(OpCode >> 4) & 0xf]);\r
return;\r
}\r
}\r
}\r
\r
- \r
+\r
// Thumb2 are 32-bit instructions\r
*OpCodePtrPtr += 1;\r
Rt = (OpCode32 >> 12) & 0xf;\r
for (Index = 0; Index < sizeof (gOpThumb2)/sizeof (THUMB_INSTRUCTIONS); Index++) {\r
if ((OpCode32 & gOpThumb2[Index].Mask) == gOpThumb2[Index].OpCode) {\r
if (Extended) {\r
- Offset = AsciiSPrint (Buf, Size, "0x%04x %-6a", OpCode32, gOpThumb2[Index].Start); \r
+ Offset = AsciiSPrint (Buf, Size, "0x%04x %-6a", OpCode32, gOpThumb2[Index].Start);\r
} else {\r
- Offset = AsciiSPrint (Buf, Size, " %-6a", gOpThumb2[Index].Start); \r
+ Offset = AsciiSPrint (Buf, Size, " %-6a", gOpThumb2[Index].Start);\r
}\r
switch (gOpThumb2[Index].AddressMode) {\r
case B_T3:\r
Target |= ((OpCode32 & BIT13) == BIT13)? BIT18 : 0; // J1\r
Target |= ((OpCode32 & BIT26) == BIT26)? BIT20 : 0; // S\r
Target = SignExtend32 (Target, BIT20);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target);\r
return;\r
case B_T4:\r
// S:I1:I2:imm10:imm11:0\r
Target |= (!(J1 ^ S) ? BIT23 : 0); // I1\r
Target |= (S ? BIT24 : 0); // S\r
Target = SignExtend32 (Target, BIT24);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PC + 4 + Target);\r
return;\r
\r
case BL_T2:\r
Target |= (!(J1 ^ S) ? BIT24 : 0); // I1\r
Target |= (S ? BIT25 : 0); // S\r
Target = SignExtend32 (Target, BIT25);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PCAlign4 (PC) + Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " 0x%08x", PCAlign4 (PC) + Target);\r
return;\r
\r
case POP_T2:\r
return;\r
\r
case POP_T3:\r
- // <register> \r
+ // <register>\r
AsciiSPrint (&Buf[Offset], Size - Offset, " %a", gReg[(OpCode32 >> 12) & 0xf]);\r
return;\r
\r
\r
case LDM_REG_IMM12_SIGNED:\r
// <rt>, <label>\r
- Target = OpCode32 & 0xfff; \r
+ Target = OpCode32 & 0xfff;\r
if ((OpCode32 & BIT23) == 0) {\r
// U == 0 means subtrack, U == 1 means add\r
Target = -Target;\r
AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL #%d]", (OpCode32 >> 4) & 3);\r
}\r
return;\r
- \r
+\r
case LDM_REG_IMM12:\r
// <rt>, [<rn>, {, #<imm12>]}\r
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]);\r
case LDRD_REG_IMM8_SIGNED:\r
// LDRD <rt>, <rt2>, [<rn>, {, #<imm8>]}{!}\r
P = (OpCode32 & BIT24) == BIT24; // index = P\r
- U = (OpCode32 & BIT23) == BIT23; \r
+ U = (OpCode32 & BIT23) == BIT23;\r
W = (OpCode32 & BIT21) == BIT21;\r
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, [%a", gReg[Rt], gReg[Rt2], gReg[Rn]);\r
if (P) {\r
}\r
return;\r
\r
- case LDRD_REG_IMM8: \r
- // LDRD <rt>, <rt2>, <label> \r
- Target = (OpCode32 & 0xff) << 2; \r
+ case LDRD_REG_IMM8:\r
+ // LDRD <rt>, <rt2>, <label>\r
+ Target = (OpCode32 & 0xff) << 2;\r
if ((OpCode32 & BIT23) == 0) {\r
// U == 0 means subtrack, U == 1 means add\r
Target = -Target;\r
// LDREXD <Rt>, <Rt2>, [<Rn>]\r
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, ,%a, [%a]", gReg[Rt], gReg[Rt2], gReg[Rn]);\r
return;\r
- \r
+\r
case SRS_FORMAT:\r
// SP{!}, #<mode>\r
W = (OpCode32 & BIT21) == BIT21;\r
W = (OpCode32 & BIT21) == BIT21;\r
AsciiSPrint (&Buf[Offset], Size - Offset, " %a%a, #0x%x", gReg[Rn], W?"!":"");\r
return;\r
- \r
+\r
case ADD_IMM12:\r
// ADD{S} <Rd>, <Rn>, #<const> i:imm3:imm8\r
if ((OpCode32 & BIT20) == BIT20) {\r
Buf[Offset - 3] = 'S'; // assume %-6a\r
}\r
Target = (OpCode32 & 0xff) | ((OpCode32 >> 4) & 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #0x%x", gReg[Rd], gReg[Rn], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #0x%x", gReg[Rd], gReg[Rn], Target);\r
return;\r
\r
case ADD_IMM12_1REG:\r
Buf[Offset - 3] = 'S'; // assume %-6a\r
}\r
Target = (OpCode32 & 0xff) | ((OpCode32 >> 4) & 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rd], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rd], Target);\r
return;\r
\r
case THUMB2_IMM16:\r
// MOVW <Rd>, #<const> i:imm3:imm8\r
Target = (OpCode32 & 0xff) | ((OpCode32 >> 4) & 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);\r
Target |= ((OpCode32 >> 4) & 0xf0000);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rd], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rd], Target);\r
return;\r
\r
case ADD_IMM5:\r
Buf[Offset - 3] = 'S'; // assume %-6a\r
}\r
Target = ((OpCode32 >> 6) & 3) | ((OpCode32 >> 10) & 0x1c0);\r
- Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, %a", gReg[Rd], gReg[Rn], gReg[Rm]); \r
+ Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, %a", gReg[Rd], gReg[Rn], gReg[Rm]);\r
if (Target != 0) {\r
- AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL %d", gShiftType[(OpCode >> 5) & 3], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL %d", gShiftType[(OpCode >> 5) & 3], Target);\r
}\r
return;\r
\r
case ADD_IMM5_2REG:\r
// CMP <Rn>, <Rm> {,LSL #<const>} imm3:imm2\r
Target = ((OpCode32 >> 6) & 3) | ((OpCode32 >> 10) & 0x1c0);\r
- Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rn], gReg[Rm]); \r
+ Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a", gReg[Rn], gReg[Rm]);\r
if (Target != 0) {\r
- AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL %d", gShiftType[(OpCode >> 5) & 3], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL %d", gShiftType[(OpCode >> 5) & 3], Target);\r
}\r
\r
\r
Buf[Offset - 3] = 'S'; // assume %-6a\r
}\r
Target = ((OpCode32 >> 6) & 3) | ((OpCode32 >> 10) & 0x1c0);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a #%d", gReg[Rd], gReg[Rm], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a #%d", gReg[Rd], gReg[Rm], Target);\r
return;\r
\r
case ASR_3REG:\r
if ((OpCode32 & BIT20) == BIT20) {\r
Buf[Offset - 3] = 'S'; // assume %-6a\r
}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a %a", gReg[Rd], gReg[Rn], gReg[Rm]); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a %a", gReg[Rd], gReg[Rn], gReg[Rm]);\r
return;\r
\r
case ADR_THUMB2:\r
} else {\r
Target = PCAlign4 (PC) + Target;\r
}\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, 0x%08x", gReg[Rd], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, 0x%08x", gReg[Rd], Target);\r
return;\r
\r
case CMN_THUMB2:\r
// CMN <Rn>, #<const>}\r
Target = (OpCode32 & 0xff) | ((OpCode >> 4) && 0x700) | ((OpCode & BIT26) == BIT26 ? BIT11 : 0);\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rn], Target); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #0x%x", gReg[Rn], Target);\r
return;\r
\r
case BFC_THUMB2:\r
lsbit = ((OpCode32 >> 6) & 3) | ((OpCode >> 10) & 0x1c);\r
if ((Rn == 0xf) & (AsciiStrCmp (gOpThumb2[Index].Start, "BFC") == 0)){\r
// BFC <Rd>, #<lsb>, #<width>\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #%d, #%d", gReg[Rd], lsbit, msbit - lsbit + 1); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, #%d, #%d", gReg[Rd], lsbit, msbit - lsbit + 1);\r
} else if (AsciiStrCmp (gOpThumb2[Index].Start, "BFI") == 0) {\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit - lsbit + 1); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit - lsbit + 1);\r
} else {\r
- AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit + 1); \r
+ AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, #%d, #%d", gReg[Rd], gReg[Rn], lsbit, msbit + 1);\r
}\r
return;\r
\r
if (opc2 != 0) {\r
AsciiSPrint (&Buf[Offset], Size - Offset, ",#%d,", opc2);\r
}\r
- return; \r
+ return;\r
\r
case MRRC_THUMB2:\r
// MRC <coproc>,<opc1>,<Rt>,<Rt2>,<CRm>,<opc2>\r
CRn = (OpCode32 >> 16) & 0xf;\r
CRm = OpCode32 & 0xf;\r
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " p%d,#%d,%a,%a,c%d", coproc, opc1, gReg[Rt], gReg[Rt2], CRm);\r
- return; \r
+ return;\r
\r
case THUMB2_2REGS:\r
// <Rd>, <Rm>\r
// MRS <Rd>, CPSR\r
AsciiSPrint (&Buf[Offset], Size - Offset, " %a, CPSR", gReg[Rd]);\r
return;\r
- \r
+\r
case THUMB2_MSR:\r
// MRS CPSR_<fields>, <Rd>\r
Target = (OpCode32 >> 10) & 3;\r
\r
\r
/**\r
- Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to \r
- point to next instructin. \r
- \r
- We cheat and only decode instructions that access \r
+ Place a dissasembly of of **OpCodePtr into buffer, and update OpCodePtr to\r
+ point to next instructin.\r
+\r
+ We cheat and only decode instructions that access\r
memory. If the instruction is not found we dump the instruction in hex.\r
- \r
- @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble. \r
+\r
+ @param OpCodePtrPtr Pointer to pointer of ARM Thumb instruction to disassemble.\r
@param Thumb TRUE for Thumb(2), FALSE for ARM instruction stream\r
@param Extended TRUE dump hex for instruction too.\r
@param ItBlock Size of IT Block\r
@param Buf Buffer to sprintf disassembly into.\r
- @param Size Size of Buf in bytes. \r
- \r
+ @param Size Size of Buf in bytes.\r
+\r
**/\r
VOID\r
DisassembleInstruction (\r
DisassembleArmInstruction ((UINT32 **)OpCodePtr, Buf, Size, Extended);\r
}\r
}\r
- \r
+\r
Generic ARM implementation of DmaLib.h\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_CPU_ARCH_PROTOCOL *gCpu;\r
UINTN gCacheAlignment = 0;\r
\r
-/** \r
+/**\r
Provides the DMA controller-specific addresses needed to access system memory.\r
- \r
+\r
Operation is relative to the DMA bus master.\r
- \r
+\r
@param Operation Indicates if the bus master is going to read or write to system memory.\r
@param HostAddress The system memory address to map to the DMA controller.\r
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes\r
- that were mapped. \r
+ that were mapped.\r
@param DeviceAddress The resulting map address for the bus master controller to use to\r
- access the hosts HostAddress. \r
+ access the hosts HostAddress.\r
@param Mapping A resulting value to pass to Unmap().\r
- \r
+\r
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r
- @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. \r
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
if (Map == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
*Mapping = Map;\r
\r
if ((((UINTN)HostAddress & (gCacheAlignment - 1)) != 0) ||\r
}\r
\r
\r
-/** \r
+/**\r
Completes the DmaMapBusMasterRead(), DmaMapBusMasterWrite(), or DmaMapBusMasterCommonBuffer()\r
operation and releases any corresponding resources.\r
- \r
+\r
@param Mapping The mapping value returned from DmaMap*().\r
- \r
+\r
@retval EFI_SUCCESS The range was unmapped.\r
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
)\r
{\r
MAP_INFO_INSTANCE *Map;\r
- \r
+\r
if (Mapping == NULL) {\r
ASSERT (FALSE);\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Map = (MAP_INFO_INSTANCE *)Mapping;\r
- \r
+\r
if (Map->DoubleBuffer) {\r
if ((Map->Operation == MapOperationBusMasterWrite) || (Map->Operation == MapOperationBusMasterCommonBuffer)) {\r
CopyMem ((VOID *)(UINTN)Map->HostAddress, (VOID *)(UINTN)Map->DeviceAddress, Map->NumberOfBytes);\r
}\r
- \r
+\r
DmaFreeBuffer (EFI_SIZE_TO_PAGES (Map->NumberOfBytes), (VOID *)(UINTN)Map->DeviceAddress);\r
- \r
+\r
} else {\r
if (Map->Operation == MapOperationBusMasterWrite) {\r
//\r
gCpu->FlushDataCache (gCpu, Map->HostAddress, Map->NumberOfBytes, EfiCpuFlushTypeInvalidate);\r
}\r
}\r
- \r
+\r
FreePool (Map);\r
\r
return EFI_SUCCESS;\r
}\r
\r
-/** \r
+/**\r
Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer.\r
- mapping. \r
- \r
+ mapping.\r
+\r
@param MemoryType The type of memory to allocate, EfiBootServicesData or\r
- EfiRuntimeServicesData. \r
- @param Pages The number of pages to allocate. \r
+ EfiRuntimeServicesData.\r
+ @param Pages The number of pages to allocate.\r
@param HostAddress A pointer to store the base system memory address of the\r
- allocated range. \r
+ allocated range.\r
\r
@retval EFI_SUCCESS The requested memory pages were allocated.\r
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are\r
- MEMORY_WRITE_COMBINE and MEMORY_CACHED. \r
+ MEMORY_WRITE_COMBINE and MEMORY_CACHED.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. \r
- \r
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
}\r
\r
\r
-/** \r
+/**\r
Frees memory that was allocated with DmaAllocateBuffer().\r
- \r
- @param Pages The number of pages to free. \r
- @param HostAddress The base system memory address of the allocated range. \r
- \r
+\r
+ @param Pages The number of pages to free.\r
+ @param HostAddress The base system memory address of the allocated range.\r
+\r
@retval EFI_SUCCESS The requested memory pages were freed.\r
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
was not allocated with DmaAllocateBuffer().\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
{\r
if (HostAddress == NULL) {\r
return EFI_INVALID_PARAMETER;\r
- } \r
- \r
+ }\r
+\r
UncachedFreePages (HostAddress, Pages);\r
return EFI_SUCCESS;\r
}\r
ASSERT_EFI_ERROR(Status);\r
\r
gCacheAlignment = ArmDataCacheLineLength ();\r
- \r
+\r
return Status;\r
}\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
FILE_GUID = F1BD6B36-B705-43aa-8A28-33F58ED85EFB\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = DmaLib \r
+ LIBRARY_CLASS = DmaLib\r
CONSTRUCTOR = ArmDmaLibConstructor\r
\r
[Sources.common]\r
MdePkg/MdePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
ArmPkg/ArmPkg.dec\r
- \r
+\r
\r
[LibraryClasses]\r
DebugLib\r
IoLib\r
BaseMemoryLib\r
ArmLib\r
- \r
- \r
+\r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
\r
[Depex]\r
- gEfiCpuArchProtocolGuid\r
\ No newline at end of file
+ gEfiCpuArchProtocolGuid\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
Arm11Support.S | GCC\r
Arm11Support.asm | RVCT\r
\r
- Arm11Lib.c \r
+ Arm11Lib.c\r
Arm11LibMem.c\r
../Arm9/Arm9CacheInformation.c\r
\r
\r
[LibraryClasses]\r
MemoryAllocationLib\r
- \r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN Index;\r
UINT32 Attributes;\r
UINT32 PhysicalBase = MemoryRegion->PhysicalBase;\r
- \r
+\r
switch (MemoryRegion->Attributes) {\r
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:\r
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK(0);\r
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED(0);\r
break;\r
}\r
- \r
+\r
Entry = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(TranslationTable, MemoryRegion->VirtualBase);\r
Sections = ((( MemoryRegion->Length - 1 ) / TT_DESCRIPTOR_SECTION_SIZE ) + 1 );\r
- \r
+\r
for (Index = 0; Index < Sections; Index++)\r
{\r
*Entry++ = TT_DESCRIPTOR_SECTION_BASE_ADDRESS(PhysicalBase) | Attributes;\r
if (TranslationTableBase != NULL) {\r
*TranslationTableBase = TranslationTable;\r
}\r
- \r
+\r
if (TranslationTableBase != NULL) {\r
*TranslationTableSize = TRANSLATION_TABLE_SIZE;\r
}\r
}\r
\r
ArmSetTTBR0(TranslationTable);\r
- \r
+\r
ArmSetDomainAccessControl(DOMAIN_ACCESS_CONTROL_NONE(15) |\r
DOMAIN_ACCESS_CONTROL_NONE(14) |\r
DOMAIN_ACCESS_CONTROL_NONE(13) |\r
DOMAIN_ACCESS_CONTROL_NONE( 2) |\r
DOMAIN_ACCESS_CONTROL_NONE( 1) |\r
DOMAIN_ACCESS_CONTROL_MANAGER(0));\r
- \r
+\r
ArmEnableInstructionCache();\r
ArmEnableDataCache();\r
ArmEnableMmu();\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
Arm11Support.S | GCC\r
Arm11Support.asm | RVCT\r
\r
- Arm11Lib.c \r
+ Arm11Lib.c\r
Arm11LibMem.c\r
../Arm9/Arm9CacheInformation.c\r
\r
\r
[LibraryClasses]\r
PrePiLib\r
- \r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
Arm11Support.S | GCC\r
Arm11Support.asm | RVCT\r
- \r
+\r
Arm11Lib.c\r
../Arm9/Arm9CacheInformation.c\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
bx lr\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c6, 1 @invalidate single data cache line \r
+ mcr p15, 0, r0, c7, c6, 1 @invalidate single data cache line\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c10, 1 @clean single data cache line \r
+ mcr p15, 0, r0, c7, c10, 1 @clean single data cache line\r
bx lr\r
\r
\r
orr R0,R0,R1 @Set C bit\r
mcr p15,0,r0,c1,c0,0 @Write control register configuration data\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableDataCache):\r
LoadConstantToReg(DC_ON, R1) @ldr R1,=DC_ON\r
mrc p15,0,R0,c1,c0,0 @Read control register configuration data\r
orr R0,R0,R1 @Set I bit\r
mcr p15,0,r0,c1,c0,0 @Write control register configuration data\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableInstructionCache):\r
ldr R1,=IC_ON\r
mrc p15,0,R0,c1,c0,0 @Read control register configuration data\r
\r
ASM_PFX(ArmDataMemoryBarrier):\r
mov R0, #0\r
- mcr P15, #0, R0, C7, C10, #5 \r
+ mcr P15, #0, R0, C7, C10, #5\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDataSyncronizationBarrier):\r
mov R0, #0\r
- mcr P15, #0, R0, C7, C10, #4 \r
+ mcr P15, #0, R0, C7, C10, #4\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInstructionSynchronizationBarrier):\r
mov R0, #0\r
- mcr P15, #0, R0, C7, C5, #4 \r
+ mcr P15, #0, R0, C7, C5, #4\r
bx LR\r
\r
ASM_PFX(ArmSetLowVectors):\r
cmp r0, r1\r
movne r0, #0\r
pop { r1 }\r
- bx lr \r
+ bx lr\r
\r
ASM_PFX(ArmCallWFI):\r
wfi\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
\r
ArmInvalidateDataCacheEntryByMVA\r
- mcr p15, 0, r0, c7, c6, 1 ; invalidate single data cache line \r
+ mcr p15, 0, r0, c7, c6, 1 ; invalidate single data cache line\r
bx lr\r
\r
\r
ArmCleanDataCacheEntryByMVA\r
- mcr p15, 0, r0, c7, c10, 1 ; clean single data cache line \r
+ mcr p15, 0, r0, c7, c10, 1 ; clean single data cache line\r
bx lr\r
\r
\r
ORR R0,R0,R1 ;Set C bit\r
MCR p15,0,r0,c1,c0,0 ;Write control register configuration data\r
BX LR\r
- \r
+\r
ArmDisableDataCache\r
LDR R1,=DC_ON\r
MRC p15,0,R0,c1,c0,0 ;Read control register configuration data\r
ORR R0,R0,R1 ;Set I bit\r
MCR p15,0,r0,c1,c0,0 ;Write control register configuration data\r
BX LR\r
- \r
+\r
ArmDisableInstructionCache\r
LDR R1,=IC_ON\r
MRC p15,0,R0,c1,c0,0 ;Read control register configuration data\r
\r
ASM_PFX(ArmDataMemoryBarrier):\r
mov R0, #0\r
- mcr P15, #0, R0, C7, C10, #5 \r
+ mcr P15, #0, R0, C7, C10, #5\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDataSyncronizationBarrier):\r
mov R0, #0\r
- mcr P15, #0, R0, C7, C10, #4 \r
+ mcr P15, #0, R0, C7, C10, #4\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInstructionSynchronizationBarrier):\r
MOV R0, #0\r
- MCR P15, #0, R0, C7, C5, #4 \r
+ MCR P15, #0, R0, C7, C5, #4\r
bx LR\r
\r
END\r
\r
Arm9Support.S | GCC\r
Arm9Support.asm | RVCT\r
- \r
+\r
Arm9Lib.c\r
Arm9CacheInformation.c\r
\r
\r
[LibraryClasses]\r
MemoryAllocationLib\r
- \r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
\r
Arm9Support.S | GCC\r
Arm9Support.asm | RVCT\r
- \r
+\r
Arm9Lib.c\r
Arm9CacheInformation.c\r
\r
default: return FALSE;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheSize (\r
{\r
switch (DATA_CACHE_SIZE (ArmCacheInfo ()))\r
{\r
- case CACHE_SIZE_4_KB: return 4 * 1024; \r
+ case CACHE_SIZE_4_KB: return 4 * 1024;\r
case CACHE_SIZE_8_KB: return 8 * 1024;\r
- case CACHE_SIZE_16_KB: return 16 * 1024; \r
+ case CACHE_SIZE_16_KB: return 16 * 1024;\r
case CACHE_SIZE_32_KB: return 32 * 1024;\r
case CACHE_SIZE_64_KB: return 64 * 1024;\r
case CACHE_SIZE_128_KB: return 128 * 1024;\r
default: return 0;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheAssociativity (\r
default: return 0;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheLineLength (\r
default: return 0;\r
}\r
}\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmInstructionCachePresent (\r
default: return FALSE;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheSize (\r
{\r
switch (INSTRUCTION_CACHE_SIZE (ArmCacheInfo ()))\r
{\r
- case CACHE_SIZE_4_KB: return 4 * 1024; \r
+ case CACHE_SIZE_4_KB: return 4 * 1024;\r
case CACHE_SIZE_8_KB: return 8 * 1024;\r
- case CACHE_SIZE_16_KB: return 16 * 1024; \r
+ case CACHE_SIZE_16_KB: return 16 * 1024;\r
case CACHE_SIZE_32_KB: return 32 * 1024;\r
case CACHE_SIZE_64_KB: return 64 * 1024;\r
case CACHE_SIZE_128_KB: return 128 * 1024;\r
default: return 0;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheAssociativity (\r
default: return 0;\r
}\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheLineLength (\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2013, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN Index;\r
UINT32 Attributes;\r
UINT32 PhysicalBase = MemoryRegion->PhysicalBase;\r
- \r
+\r
switch (MemoryRegion->Attributes) {\r
case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK:\r
Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK;\r
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED_UNBUFFERED;\r
break;\r
}\r
- \r
+\r
Entry = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(TranslationTable, MemoryRegion->VirtualBase);\r
Sections = MemoryRegion->Length / TT_DESCRIPTOR_SECTION_SIZE;\r
- \r
+\r
// The current code does not support memory region size that is not aligned on TT_DESCRIPTOR_SECTION_SIZE boundary\r
ASSERT (MemoryRegion->Length % TT_DESCRIPTOR_SECTION_SIZE == 0);\r
- \r
+\r
for (Index = 0; Index < Sections; Index++)\r
{\r
*Entry++ = TT_DESCRIPTOR_SECTION_BASE_ADDRESS(PhysicalBase) | Attributes;\r
if (TranslationTableBase != NULL) {\r
*TranslationTableBase = TranslationTable;\r
}\r
- \r
+\r
if (TranslationTableBase != NULL) {\r
*TranslationTableSize = TRANSLATION_TABLE_SIZE;\r
}\r
}\r
\r
ArmSetTTBR0(TranslationTable);\r
- \r
+\r
ArmSetDomainAccessControl(DOMAIN_ACCESS_CONTROL_NONE(15) |\r
DOMAIN_ACCESS_CONTROL_NONE(14) |\r
DOMAIN_ACCESS_CONTROL_NONE(13) |\r
DOMAIN_ACCESS_CONTROL_NONE( 2) |\r
DOMAIN_ACCESS_CONTROL_NONE( 1) |\r
DOMAIN_ACCESS_CONTROL_MANAGER(0));\r
- \r
+\r
ArmEnableInstructionCache();\r
ArmEnableDataCache();\r
ArmEnableMmu();\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
#------------------------------------------------------------------------------\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c6, 1 @ invalidate single data cache line \r
+ mcr p15, 0, r0, c7, c6, 1 @ invalidate single data cache line\r
bx lr\r
\r
ASM_PFX(ArmCleanDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c10, 1 @ clean single data cache line \r
+ mcr p15, 0, r0, c7, c10, 1 @ clean single data cache line\r
bx lr\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryByMVA):\r
orr r0,r0,r1 @Set I bit\r
mcr p15,0,r0,c1,c0,0 @Write control register configuration data\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableInstructionCache):\r
ldr r1,=IC_ON\r
mrc p15,0,r0,c1,c0,0 @Read control register configuration data\r
bic r0,r0,r1 @Clear I bit.\r
mcr p15,0,r0,c1,c0,0 @Write control register configuration data\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInvalidateInstructionCache):\r
mov r0,#0\r
- mcr p15,0,r0,c7,c5,0 @Invalidate entire Instruction cache. \r
+ mcr p15,0,r0,c7,c5,0 @Invalidate entire Instruction cache.\r
@Also flushes the branch target cache.\r
mov r0,#0\r
mcr p15,0,r0,c7,c10,4 @Data write buffer\r
orr R0,R0,R1 @Set C bit\r
mcr p15,0,r0,c1,c0,0 @Write control register configuration data\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableDataCache):\r
ldr R1,=DC_ON\r
mrc p15,0,R0,c1,c0,0 @Read control register configuration data\r
mov R0,#0\r
mcr p15,0,R0,c7,c10,4 @Drain write buffer\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInvalidateDataCache):\r
mov R0,#0\r
mcr p15,0,R0,c7,c6,0 @Invalidate entire data cache\r
mov R0, #0\r
mcr P15, #0, R0, C7, C10, #5 @ check if this is OK?\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDataSyncronizationBarrier):\r
mov R0, #0\r
mcr P15, #0, R0, C7, C10, #4 @ check if this is OK?\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInstructionSynchronizationBarrier):\r
mov R0, #0\r
mcr P15, #0, R0, C7, C5, #4 @ check if this is OK?\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
\r
ArmInvalidateDataCacheEntryByMVA\r
- MCR p15, 0, r0, c7, c6, 1 ; invalidate single data cache line \r
+ MCR p15, 0, r0, c7, c6, 1 ; invalidate single data cache line\r
BX lr\r
\r
\r
ArmCleanDataCacheEntryByMVA\r
- MCR p15, 0, r0, c7, c10, 1 ; clean single data cache line \r
+ MCR p15, 0, r0, c7, c10, 1 ; clean single data cache line\r
BX lr\r
\r
\r
ORR R0,R0,R1 ;Set I bit\r
MCR p15,0,r0,c1,c0,0 ;Write control register configuration data\r
BX LR\r
- \r
+\r
ArmDisableInstructionCache\r
LDR R1,=IC_ON\r
MRC p15,0,R0,c1,c0,0 ;Read control register configuration data\r
ORR R0,R0,R1 ;Set C bit\r
MCR p15,0,r0,c1,c0,0 ;Write control register configuration data\r
BX LR\r
- \r
+\r
ArmDisableDataCache\r
LDR R1,=DC_ON\r
MRC p15,0,R0,c1,c0,0 ;Read control register configuration data\r
MOV R0,#0\r
MCR p15,0,R0,c7,c10,4 ;Drain write buffer\r
BX LR\r
- \r
+\r
ArmCleanInvalidateDataCache\r
MRC p15,0,r15,c7,c14,3\r
BNE ArmCleanInvalidateDataCache\r
mov R0, #0\r
mcr P15, #0, R0, C7, C10, #5 ; Check to see if this is correct\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDataSyncronizationBarrier):\r
mov R0, #0\r
mcr P15, #0, R0, C7, C10, #4 ; Check to see if this is correct\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInstructionSynchronizationBarrier):\r
MOV R0, #0\r
MCR P15, #0, R0, C7, C5, #4 ; Check to see if this is correct\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
cpsid if\r
isb\r
bx LR\r
- \r
-// UINT32 \r
+\r
+// UINT32\r
// ReadCCSIDR (\r
// IN UINT32 CSSELR\r
-// ) \r
+// )\r
ASM_PFX(ReadCCSIDR):\r
mcr p15,2,r0,c0,c0,0 @ Write Cache Size Selection Register (CSSELR)\r
isb\r
mrc p15,1,r0,c0,c0,0 @ Read current CP15 Cache Size ID Register (CCSIDR)\r
bx lr\r
- \r
-// UINT32 \r
+\r
+// UINT32\r
// ReadCLIDR (\r
// IN UINT32 CSSELR\r
-// ) \r
+// )\r
ASM_PFX(ReadCLIDR):\r
mrc p15,1,r0,c0,c0,1 @ Read CP15 Cache Level ID Register\r
bx lr\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
cpsid if\r
isb\r
bx LR\r
- \r
-// UINT32 \r
+\r
+// UINT32\r
// ReadCCSIDR (\r
// IN UINT32 CSSELR\r
-// ) \r
+// )\r
ReadCCSIDR\r
mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR)\r
isb\r
mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR)\r
bx lr\r
- \r
-// UINT32 \r
+\r
+// UINT32\r
// ReadCLIDR (\r
// IN UINT32 CSSELR\r
-// ) \r
+// )\r
ReadCLIDR\r
mrc p15,1,r0,c0,c0,1 ; Read CP15 Cache Level ID Register\r
bx lr\r
/** @file\r
*\r
* Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
#\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2011, ARM Limited. All rights reserved.\r
//\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
UINT32 CLIDR = ReadCLIDR ();\r
- \r
+\r
if ((CLIDR & 0x2) == 0x2) {\r
// Instruction cache exists\r
return TRUE;\r
// Unified cache\r
return TRUE;\r
}\r
- \r
+\r
return FALSE;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheSize (\r
UINT32 Associativity;\r
UINT32 LineSize;\r
UINT32 CCSIDR = ReadCCSIDR (0);\r
- \r
+\r
LineSize = (1 << ((CCSIDR & 0x7) + 2));\r
Associativity = ((CCSIDR >> 3) & 0x3ff) + 1;\r
NumSets = ((CCSIDR >> 13) & 0x7fff) + 1;\r
\r
// LineSize is in words (4 byte chunks)\r
- return NumSets * Associativity * LineSize * 4; \r
+ return NumSets * Associativity * LineSize * 4;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheAssociativity (\r
\r
return ((CCSIDR >> 3) & 0x3ff) + 1;\r
}\r
- \r
+\r
UINTN\r
ArmDataCacheSets (\r
VOID\r
)\r
{\r
UINT32 CCSIDR = ReadCCSIDR (0);\r
- \r
+\r
return ((CCSIDR >> 13) & 0x7fff) + 1;\r
}\r
\r
// * 4 converts to bytes\r
return (1 << (CCSIDR + 2)) * 4;\r
}\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmInstructionCachePresent (\r
)\r
{\r
UINT32 CLIDR = ReadCLIDR ();\r
- \r
+\r
if ((CLIDR & 1) == 1) {\r
// Instruction cache exists\r
return TRUE;\r
// Unified cache\r
return TRUE;\r
}\r
- \r
+\r
return FALSE;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheSize (\r
UINT32 Associativity;\r
UINT32 LineSize;\r
UINT32 CCSIDR = ReadCCSIDR (1);\r
- \r
+\r
LineSize = (1 << ((CCSIDR & 0x7) + 2));\r
Associativity = ((CCSIDR >> 3) & 0x3ff) + 1;\r
NumSets = ((CCSIDR >> 13) & 0x7fff) + 1;\r
\r
// LineSize is in words (4 byte chunks)\r
- return NumSets * Associativity * LineSize * 4; \r
+ return NumSets * Associativity * LineSize * 4;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheAssociativity (\r
return ((CCSIDR >> 3) & 0x3ff) + 1;\r
// return 4;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheSets (\r
)\r
{\r
UINT32 CCSIDR = ReadCCSIDR (1);\r
- \r
+\r
return ((CCSIDR >> 13) & 0x7fff) + 1;\r
}\r
\r
\r
SavedInterruptState = ArmGetInterruptState ();\r
ArmDisableInterrupts ();\r
- \r
+\r
ArmV7AllDataCachesOperation (DataCacheOperation);\r
- \r
+\r
ArmDrainWriteBuffer ();\r
- \r
+\r
if (SavedInterruptState) {\r
ArmEnableInterrupts ();\r
}\r
\r
SavedInterruptState = ArmGetInterruptState ();\r
ArmDisableInterrupts ();\r
- \r
+\r
ArmV7PerformPoUDataCacheOperation (DataCacheOperation);\r
- \r
+\r
ArmDrainWriteBuffer ();\r
- \r
+\r
if (SavedInterruptState) {\r
ArmEnableInterrupts ();\r
}\r
ArmV7AllDataCachesOperation (\r
IN ARM_V7_CACHE_OPERATION DataCacheOperation\r
);\r
- \r
+\r
#endif // __ARM_V7_LIB_H__\r
\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
ArmV7Support.S | GCC\r
ArmV7Support.asm | RVCT\r
- \r
+\r
ArmV7Lib.c\r
ArmV7Mmu.c\r
\r
\r
[LibraryClasses]\r
MemoryAllocationLib\r
- \r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
ArmV7Support.S | GCC\r
ArmV7Support.asm | RVCT\r
- \r
+\r
ArmV7Lib.c\r
ArmV7Mmu.c\r
- \r
+\r
ArmV7ArchTimer.c\r
ArmV7ArchTimerSupport.S | GCC\r
ArmV7ArchTimerSupport.asm | RVCT\r
\r
[LibraryClasses]\r
PrePiLib\r
- \r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
../Common/Arm/ArmLibSupport.S | GCC\r
../Common/Arm/ArmLibSupport.asm | RVCT\r
../Common/ArmLib.c\r
- \r
+\r
ArmV7Support.S | GCC\r
ArmV7Support.asm | RVCT\r
\r
ArmV7Lib.c\r
- \r
+\r
ArmV7ArchTimer.c\r
ArmV7ArchTimerSupport.S | GCC\r
ArmV7ArchTimerSupport.asm | RVCT\r
* File managing the MMU for ARMv7 architecture\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
-#include <Uefi.h> \r
+#include <Uefi.h>\r
#include <Chipset/ArmV7.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
UINT32 Attributes;\r
UINT32 PhysicalBase = MemoryRegion->PhysicalBase;\r
UINT32 RemainLength = MemoryRegion->Length;\r
- \r
+\r
ASSERT(MemoryRegion->Length > 0);\r
\r
switch (MemoryRegion->Attributes) {\r
Attributes = TT_DESCRIPTOR_SECTION_UNCACHED(0);\r
break;\r
}\r
- \r
+\r
// Get the first section entry for this mapping\r
SectionEntry = TRANSLATION_TABLE_ENTRY_FOR_VIRTUAL_ADDRESS(TranslationTable, MemoryRegion->VirtualBase);\r
\r
if (TranslationTableBase != NULL) {\r
*TranslationTableBase = TranslationTable;\r
}\r
- \r
+\r
if (TranslationTableSize != NULL) {\r
*TranslationTableSize = TRANSLATION_TABLE_SECTION_SIZE;\r
}\r
}\r
\r
// Translate the Memory Attributes into Translation Table Register Attributes\r
- if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED) || \r
+ if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED) ||\r
(TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_UNCACHED_UNBUFFERED)) {\r
TTBRAttributes = TTBR_NON_CACHEABLE;\r
- } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK) || \r
+ } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK) ||\r
(TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK)) {\r
TTBRAttributes = TTBR_WRITE_BACK_ALLOC;\r
- } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH) || \r
+ } else if ((TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH) ||\r
(TranslationTableAttribute == ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH)) {\r
TTBRAttributes = TTBR_WRITE_THROUGH_NO_ALLOC;\r
} else {\r
ArmInvalidateInstructionCache ();\r
\r
ArmSetTTBR0 ((VOID *)(UINTN)(((UINTN)TranslationTable & ~TRANSLATION_TABLE_SECTION_ALIGNMENT_MASK) | (TTBRAttributes & 0x7F)));\r
- \r
+\r
ArmSetDomainAccessControl (DOMAIN_ACCESS_CONTROL_NONE(15) |\r
DOMAIN_ACCESS_CONTROL_NONE(14) |\r
DOMAIN_ACCESS_CONTROL_NONE(13) |\r
DOMAIN_ACCESS_CONTROL_NONE( 2) |\r
DOMAIN_ACCESS_CONTROL_NONE( 1) |\r
DOMAIN_ACCESS_CONTROL_MANAGER(0));\r
- \r
+\r
ArmEnableInstructionCache();\r
ArmEnableDataCache();\r
ArmEnableMmu();\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c6, 1 @invalidate single data cache line \r
+ mcr p15, 0, r0, c7, c6, 1 @invalidate single data cache line\r
dsb\r
isb\r
bx lr\r
\r
ASM_PFX(ArmCleanDataCacheEntryByMVA):\r
- mcr p15, 0, r0, c7, c10, 1 @clean single data cache line \r
+ mcr p15, 0, r0, c7, c10, 1 @clean single data cache line\r
dsb\r
isb\r
bx lr\r
\r
\r
ASM_PFX(ArmInvalidateDataCacheEntryBySetWay):\r
- mcr p15, 0, r0, c7, c6, 2 @ Invalidate this line \r
+ mcr p15, 0, r0, c7, c6, 2 @ Invalidate this line\r
dsb\r
isb\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanInvalidateDataCacheEntryBySetWay):\r
- mcr p15, 0, r0, c7, c14, 2 @ Clean and Invalidate this line \r
+ mcr p15, 0, r0, c7, c14, 2 @ Clean and Invalidate this line\r
dsb\r
isb\r
bx lr\r
\r
\r
ASM_PFX(ArmCleanDataCacheEntryBySetWay):\r
- mcr p15, 0, r0, c7, c10, 2 @ Clean this line \r
+ mcr p15, 0, r0, c7, c10, 2 @ Clean this line\r
dsb\r
isb\r
bx lr\r
ASM_PFX(ArmMmuEnabled):\r
mrc p15,0,R0,c1,c0,0\r
and R0,R0,#1\r
- bx LR \r
+ bx LR\r
\r
ASM_PFX(ArmEnableDataCache):\r
ldr R1,=DC_ON\r
dsb\r
isb\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableDataCache):\r
ldr R1,=DC_ON\r
mrc p15,0,R0,c1,c0,0 @Read control register configuration data\r
dsb\r
isb\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDisableInstructionCache):\r
ldr R1,=IC_ON\r
mrc p15,0,R0,c1,c0,0 @Read control register configuration data\r
beq L_Finished\r
mov R10, #0\r
\r
-Loop1: \r
+Loop1:\r
add R2, R10, R10, LSR #1 @ Work out 3xcachelevel\r
mov R12, R6, LSR R2 @ bottom 3 bits are the Cache type for this level\r
and R12, R12, #7 @ get those 3 bits alone\r
cmp R12, #2\r
blt L_Skip @ no cache or only instruction cache at this level\r
mcr p15, 2, R10, c0, c0, 0 @ write the Cache Size selection register (CSSELR) // OR in 1 for Instruction\r
- isb @ isb to sync the change to the CacheSizeID reg \r
+ isb @ isb to sync the change to the CacheSizeID reg\r
mrc p15, 1, R12, c0, c0, 0 @ reads current Cache Size ID register (CCSIDR)\r
and R2, R12, #0x7 @ extract the line length field\r
add R2, R2, #4 @ add 4 for the line length offset (log2 16 bytes)\r
sub R7, R7, #1\r
ands R7, R7, R12, LSR #13 @ R7 is the max number of the index size (right aligned)\r
\r
-Loop2: \r
+Loop2:\r
mov R9, R4 @ R9 working copy of the max way size (right aligned)\r
\r
-Loop3: \r
+Loop3:\r
orr R0, R10, R9, LSL R5 @ factor in the way number and cache number into R11\r
orr R0, R0, R7, LSL R2 @ factor in the index number\r
\r
bge Loop3\r
subs R7, R7, #1 @ decrement the index\r
bge Loop2\r
-L_Skip: \r
+L_Skip:\r
add R10, R10, #2 @ increment the cache number\r
cmp R3, R10\r
bgt Loop1\r
- \r
+\r
L_Finished:\r
dsb\r
ldmfd SP!, {r4-r12, lr}\r
cmp R12, #2\r
blt Skip2 @ no cache or only instruction cache at this level\r
mcr p15, 2, R10, c0, c0, 0 @ write the Cache Size selection register (CSSELR) // OR in 1 for Instruction\r
- isb @ isb to sync the change to the CacheSizeID reg \r
+ isb @ isb to sync the change to the CacheSizeID reg\r
mrc p15, 1, R12, c0, c0, 0 @ reads current Cache Size ID register (CCSIDR)\r
and R2, R12, #0x7 @ extract the line length field\r
add R2, R2, #4 @ add 4 for the line length offset (log2 16 bytes)\r
add R10, R10, #2 @ increment the cache number\r
cmp R3, R10\r
bgt Loop4\r
- \r
+\r
Finished2:\r
dsb\r
ldmfd SP!, {r4-r12, lr}\r
ASM_PFX(ArmDataMemoryBarrier):\r
dmb\r
bx LR\r
- \r
+\r
ASM_PFX(ArmDataSyncronizationBarrier):\r
ASM_PFX(ArmDrainWriteBuffer):\r
dsb\r
bx LR\r
- \r
+\r
ASM_PFX(ArmInstructionSynchronizationBarrier):\r
isb\r
bx LR\r
\r
ASM_PFX(ArmWriteVBar):\r
# Set the Address of the Vector Table in the VBAR register\r
- mcr p15, 0, r0, c12, c0, 0 \r
+ mcr p15, 0, r0, c12, c0, 0\r
# Ensure the SCTLR.V bit is clear\r
mrc p15, 0, r0, c1, c0, 0 @ Read SCTLR into R0 (Read control register configuration data)\r
bic r0, r0, #0x00002000 @ clear V bit\r
ASM_PFX(ArmReadMpidr):\r
mrc p15, 0, r0, c0, c0, 5 @ read MPIDR\r
bx lr\r
- \r
+\r
ASM_PFX(ArmReadTpidrurw):\r
mrc p15, 0, r0, c13, c0, 2 @ read TPIDRURW\r
bx lr\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
// Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
\r
\r
ArmInvalidateDataCacheEntryByMVA\r
- mcr p15, 0, r0, c7, c6, 1 ; invalidate single data cache line \r
+ mcr p15, 0, r0, c7, c6, 1 ; invalidate single data cache line\r
dsb\r
isb\r
bx lr\r
\r
ArmCleanDataCacheEntryByMVA\r
- mcr p15, 0, r0, c7, c10, 1 ; clean single data cache line \r
+ mcr p15, 0, r0, c7, c10, 1 ; clean single data cache line\r
dsb\r
isb\r
bx lr\r
\r
\r
ArmInvalidateDataCacheEntryBySetWay\r
- mcr p15, 0, r0, c7, c6, 2 ; Invalidate this line \r
+ mcr p15, 0, r0, c7, c6, 2 ; Invalidate this line\r
dsb\r
isb\r
bx lr\r
\r
\r
ArmCleanInvalidateDataCacheEntryBySetWay\r
- mcr p15, 0, r0, c7, c14, 2 ; Clean and Invalidate this line \r
+ mcr p15, 0, r0, c7, c14, 2 ; Clean and Invalidate this line\r
dsb\r
isb\r
bx lr\r
\r
\r
ArmCleanDataCacheEntryBySetWay\r
- mcr p15, 0, r0, c7, c10, 2 ; Clean this line \r
+ mcr p15, 0, r0, c7, c10, 2 ; Clean this line\r
dsb\r
isb\r
bx lr\r
dsb\r
isb\r
bx LR\r
- \r
+\r
ArmDisableDataCache\r
ldr R1,=DC_ON ; Specify SCTLR.C bit : (Data) Cache enable bit\r
mrc p15,0,R0,c1,c0,0 ; Read SCTLR into R0 (Read control register configuration data)\r
dsb\r
isb\r
bx LR\r
- \r
+\r
ArmDisableInstructionCache\r
ldr R1,=IC_ON ; Specify SCTLR.I bit : Instruction cache enable bit\r
mrc p15,0,R0,c1,c0,0 ; Read SCTLR into R0 (Read control register configuration data)\r
beq Finished\r
mov R10, #0\r
\r
-Loop1 \r
+Loop1\r
add R2, R10, R10, LSR #1 ; Work out 3xcachelevel\r
mov R12, R6, LSR R2 ; bottom 3 bits are the Cache type for this level\r
and R12, R12, #7 ; get those 3 bits alone\r
cmp R12, #2\r
blt Skip ; no cache or only instruction cache at this level\r
mcr p15, 2, R10, c0, c0, 0 ; write the Cache Size selection register (CSSELR) // OR in 1 for Instruction\r
- isb ; isb to sync the change to the CacheSizeID reg \r
+ isb ; isb to sync the change to the CacheSizeID reg\r
mrc p15, 1, R12, c0, c0, 0 ; reads current Cache Size ID register (CCSIDR)\r
and R2, R12, #&7 ; extract the line length field\r
add R2, R2, #4 ; add 4 for the line length offset (log2 16 bytes)\r
ldr R7, =0x00007FFF\r
ands R7, R7, R12, LSR #13 ; R7 is the max number of the index size (right aligned)\r
\r
-Loop2 \r
+Loop2\r
mov R9, R4 ; R9 working copy of the max way size (right aligned)\r
\r
-Loop3 \r
+Loop3\r
orr R0, R10, R9, LSL R5 ; factor in the way number and cache number into R11\r
orr R0, R0, R7, LSL R2 ; factor in the index number\r
\r
bge Loop3\r
subs R7, R7, #1 ; decrement the index\r
bge Loop2\r
-Skip \r
+Skip\r
add R10, R10, #2 ; increment the cache number\r
cmp R3, R10\r
bgt Loop1\r
- \r
+\r
Finished\r
dsb\r
ldmfd SP!, {r4-r12, lr}\r
beq Finished2\r
mov R10, #0\r
\r
-Loop4 \r
+Loop4\r
add R2, R10, R10, LSR #1 ; Work out 3xcachelevel\r
mov R12, R6, LSR R2 ; bottom 3 bits are the Cache type for this level\r
and R12, R12, #7 ; get those 3 bits alone\r
cmp R12, #2\r
blt Skip2 ; no cache or only instruction cache at this level\r
mcr p15, 2, R10, c0, c0, 0 ; write the Cache Size selection register (CSSELR) // OR in 1 for Instruction\r
- isb ; isb to sync the change to the CacheSizeID reg \r
+ isb ; isb to sync the change to the CacheSizeID reg\r
mrc p15, 1, R12, c0, c0, 0 ; reads current Cache Size ID register (CCSIDR)\r
and R2, R12, #&7 ; extract the line length field\r
add R2, R2, #4 ; add 4 for the line length offset (log2 16 bytes)\r
ldr R7, =0x00007FFF\r
ands R7, R7, R12, LSR #13 ; R7 is the max number of the index size (right aligned)\r
\r
-Loop5 \r
+Loop5\r
mov R9, R4 ; R9 working copy of the max way size (right aligned)\r
\r
-Loop6 \r
+Loop6\r
orr R0, R10, R9, LSL R5 ; factor in the way number and cache number into R11\r
orr R0, R0, R7, LSL R2 ; factor in the index number\r
\r
bge Loop6\r
subs R7, R7, #1 ; decrement the index\r
bge Loop5\r
-Skip2 \r
+Skip2\r
add R10, R10, #2 ; increment the cache number\r
cmp R3, R10\r
bgt Loop4\r
- \r
+\r
Finished2\r
dsb\r
ldmfd SP!, {r4-r12, lr}\r
ArmDataMemoryBarrier\r
dmb\r
bx LR\r
- \r
+\r
ArmDataSyncronizationBarrier\r
ArmDrainWriteBuffer\r
dsb\r
bx LR\r
- \r
+\r
ArmInstructionSynchronizationBarrier\r
isb\r
bx LR\r
\r
ArmWriteVBar\r
// Set the Address of the Vector Table in the VBAR register\r
- mcr p15, 0, r0, c12, c0, 0 \r
+ mcr p15, 0, r0, c12, c0, 0\r
// Ensure the SCTLR.V bit is clear\r
mrc p15, 0, r0, c1, c0, 0 ; Read SCTLR into R0 (Read control register configuration data)\r
bic r0, r0, #0x00002000 ; clear V bit\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
\r
ASM_PFX(ArmReadAuxCr):\r
mrc p15, 0, r0, c1, c0, 1\r
- bx lr \r
+ bx lr\r
\r
ASM_PFX(ArmSetTTBR0):\r
mcr p15,0,r0,c2,c0,0\r
ASM_PFX(ArmUpdateTranslationTableEntry):\r
mcr p15,0,R0,c7,c14,1 @ DCCIMVAC Clean data cache by MVA\r
dsb\r
- mcr p15,0,R1,c8,c7,1 @ TLBIMVA TLB Invalidate MVA \r
+ mcr p15,0,R1,c8,c7,1 @ TLBIMVA TLB Invalidate MVA\r
mcr p15,0,R9,c7,c5,6 @ BPIALL Invalidate Branch predictor array. R9 == NoOp\r
dsb\r
isb\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
// Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
//------------------------------------------------------------------------------\r
\r
#include <AsmMacroIoLib.h>\r
- \r
+\r
INCLUDE AsmMacroIoLib.inc\r
\r
#ifdef ARM_CPU_ARMv6\r
\r
ArmReadAuxCr\r
mrc p15, 0, r0, c1, c0, 1\r
- bx lr \r
+ bx lr\r
\r
ArmSetTTBR0\r
mcr p15,0,r0,c2,c0,0\r
ArmWriteMVBar\r
mcr p15, 0, r0, c12, c0, 1\r
bx lr\r
- \r
+\r
ArmCallWFE\r
wfe\r
bx lr\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
VOID\r
);\r
\r
-UINT32 \r
+UINT32\r
ReadCCSIDR (\r
IN UINT32 CSSELR\r
- ); \r
- \r
+ );\r
+\r
UINT32\r
ReadCLIDR (\r
VOID\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
return FALSE;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheSize (\r
VOID\r
)\r
{\r
- return 0; \r
+ return 0;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheAssociativity (\r
{\r
return 0;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmDataCacheLineLength (\r
{\r
return 0;\r
}\r
- \r
+\r
BOOLEAN\r
EFIAPI\r
ArmInstructionCachePresent (\r
{\r
return FALSE;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheSize (\r
VOID\r
)\r
{\r
- return 0; \r
+ return 0;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheAssociativity (\r
{\r
return 0;\r
}\r
- \r
+\r
UINTN\r
EFIAPI\r
ArmInstructionCacheLineLength (\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2012-2013, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = ArmSmcLib\r
- FILE_GUID = eb3f17d5-a3cc-4eac-8912-84162d0f79da \r
+ FILE_GUID = eb3f17d5-a3cc-4eac-8912-84162d0f79da\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmSmcLib\r
- \r
+\r
[Sources.ARM]\r
Arm/ArmSmc.asm | RVCT\r
Arm/ArmSmc.S | GCC\r
#/** @file\r
-# \r
+#\r
# ArmSmcLib when no SMC support is desired (might be the case for CPU without the\r
# Trustzone support / ARM Security Extension)\r
#\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmSmcLib\r
- \r
+\r
[Sources.ARM]\r
Arm/ArmSmcNull.asm | RVCT\r
Arm/ArmSmcNull.S | GCC\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# CopyMem() worker for ARM\r
#\r
# This file started out as C code that did 64 bit moves if the buffer was\r
# 32-bit aligned, else it does a byte copy. It also does a byte copy for\r
-# any trailing bytes. It was updated to do 32-byte copies using stm/ldm. \r
+# any trailing bytes. It was updated to do 32-byte copies using stm/ldm.\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
/**\r
Copy Length bytes from Source to Destination. Overlap is OK.\r
\r
- This implementation \r
+ This implementation\r
\r
@param Destination Target of copy\r
@param Source Place to copy from\r
mov r10, r0\r
mov r12, r2\r
mov r14, r1\r
- \r
+\r
memcopy_check_overlapped:\r
cmp r11, r1\r
// If (dest < source)\r
cmp r12, r3\r
bcc memcopy_check_optim_default\r
\r
- // If (length == 0) \r
+ // If (length == 0)\r
cmp r12, #0\r
beq memcopy_end\r
- \r
+\r
b memcopy_check_optim_overlap\r
\r
memcopy_check_optim_default:\r
movls r0, #0\r
andhi r0, r3, #1\r
b memcopy_default\r
- \r
+\r
memcopy_check_optim_overlap:\r
// r10 = dest_end, r14 = source_end\r
add r10, r11, r12\r
tst r14, #0xF\r
movne r0, #0\r
b memcopy_overlapped\r
- \r
+\r
memcopy_overlapped_non_optim:\r
// We read 1 byte from the end of the source buffer\r
sub r3, r14, #1\r
sub r12, r12, #1\r
- ldrb r3, [r3, #0] \r
+ ldrb r3, [r3, #0]\r
sub r2, r10, #1\r
cmp r12, #0\r
// We write 1 byte at the end of the dest buffer\r
// Are we in the optimized case ?\r
cmp r0, #0\r
beq memcopy_overlapped_non_optim\r
- \r
+\r
// Optimized Overlapped - Read 32 bytes\r
sub r14, r14, #32\r
sub r12, r12, #32\r
cmp r12, #31\r
ldmia r14, {r2-r9}\r
- \r
+\r
// If length is less than 32 then disable optim\r
movls r0, #0\r
- \r
+\r
cmp r12, #0\r
- \r
- // Optimized Overlapped - Write 32 bytes \r
+\r
+ // Optimized Overlapped - Write 32 bytes\r
sub r10, r10, #32\r
stmia r10, {r2-r9}\r
- \r
+\r
// while (length != 0)\r
bne memcopy_overlapped\r
b memcopy_end\r
- \r
+\r
memcopy_default_non_optim:\r
// Byte copy\r
- ldrb r3, [r14], #1 \r
+ ldrb r3, [r14], #1\r
sub r12, r12, #1\r
strb r3, [r10], #1\r
- \r
+\r
memcopy_default:\r
cmp r12, #0\r
beq memcopy_end\r
- \r
+\r
// r10 = dest, r14 = source\r
memcopy_default_loop:\r
cmp r0, #0\r
beq memcopy_default_non_optim\r
- \r
+\r
// Optimized memcopy - Read 32 Bytes\r
sub r12, r12, #32\r
cmp r12, #31\r
ldmia r14!, {r2-r9}\r
- \r
+\r
// If length is less than 32 then disable optim\r
movls r0, #0\r
- \r
+\r
cmp r12, #0\r
- \r
+\r
// Optimized memcopy - Write 32 Bytes\r
stmia r10!, {r2-r9}\r
\r
// while (length != 0)\r
bne memcopy_default_loop\r
- \r
+\r
memcopy_end:\r
mov r0, r11\r
ldmfd sp!, {r4-r11, pc}\r
- \r
+\r
-;------------------------------------------------------------------------------ \r
+;------------------------------------------------------------------------------\r
;\r
; CopyMem() worker for ARM\r
;\r
/**\r
Copy Length bytes from Source to Destination. Overlap is OK.\r
\r
- This implementation \r
+ This implementation\r
\r
@param Destination Target of copy\r
@param Source Place to copy from\r
mov r10, r0\r
mov r12, r2\r
mov r14, r1\r
- \r
+\r
memcopy_check_overlapped\r
cmp r11, r1\r
// If (dest < source)\r
cmp r12, r3\r
bcc memcopy_check_optim_default\r
\r
- // If (length == 0) \r
+ // If (length == 0)\r
cmp r12, #0\r
beq memcopy_end\r
- \r
+\r
b memcopy_check_optim_overlap\r
\r
memcopy_check_optim_default\r
movls r0, #0\r
andhi r0, r3, #1\r
b memcopy_default\r
- \r
+\r
memcopy_check_optim_overlap\r
// r10 = dest_end, r14 = source_end\r
add r10, r11, r12\r
tst r14, #0xF\r
movne r0, #0\r
b memcopy_overlapped\r
- \r
+\r
memcopy_overlapped_non_optim\r
// We read 1 byte from the end of the source buffer\r
sub r3, r14, #1\r
sub r12, r12, #1\r
- ldrb r3, [r3, #0] \r
+ ldrb r3, [r3, #0]\r
sub r2, r10, #1\r
cmp r12, #0\r
// We write 1 byte at the end of the dest buffer\r
// Are we in the optimized case ?\r
cmp r0, #0\r
beq memcopy_overlapped_non_optim\r
- \r
+\r
// Optimized Overlapped - Read 32 bytes\r
sub r14, r14, #32\r
sub r12, r12, #32\r
cmp r12, #31\r
ldmia r14, {r2-r9}\r
- \r
+\r
// If length is less than 32 then disable optim\r
movls r0, #0\r
- \r
+\r
cmp r12, #0\r
- \r
- // Optimized Overlapped - Write 32 bytes \r
+\r
+ // Optimized Overlapped - Write 32 bytes\r
sub r10, r10, #32\r
stmia r10, {r2-r9}\r
- \r
+\r
// while (length != 0)\r
bne memcopy_overlapped\r
b memcopy_end\r
- \r
+\r
memcopy_default_non_optim\r
// Byte copy\r
- ldrb r3, [r14], #1 \r
+ ldrb r3, [r14], #1\r
sub r12, r12, #1\r
strb r3, [r10], #1\r
- \r
+\r
memcopy_default\r
cmp r12, #0\r
beq memcopy_end\r
- \r
+\r
// r10 = dest, r14 = source\r
memcopy_default_loop\r
cmp r0, #0\r
beq memcopy_default_non_optim\r
- \r
+\r
// Optimized memcopy - Read 32 Bytes\r
sub r12, r12, #32\r
cmp r12, #31\r
ldmia r14!, {r2-r9}\r
- \r
+\r
// If length is less than 32 then disable optim\r
movls r0, #0\r
- \r
+\r
cmp r12, #0\r
- \r
+\r
// Optimized memcopy - Write 32 Bytes\r
stmia r10!, {r2-r9}\r
\r
// while (length != 0)\r
bne memcopy_default_loop\r
- \r
+\r
memcopy_end\r
mov r0, r11\r
ldmfd sp!, {r4-r11, pc}\r
- \r
+\r
END\r
- \r
+\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# SemMem() worker for ARM\r
#\r
# This file started out as C code that did 64 bit moves if the buffer was\r
# 32-bit aligned, else it does a byte copy. It also does a byte copy for\r
-# any trailing bytes. It was updated to do 32-byte at a time. \r
+# any trailing bytes. It was updated to do 32-byte at a time.\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
IN UINT8 Value\r
)\r
**/\r
- \r
+\r
.text\r
.align 2\r
GCC_ASM_EXPORT(InternalMemSetMem)\r
L31:\r
and r4, r2, #0xff\r
orr r4, r4, r4, LSL #8\r
- orr r4, r4, r4, LSL #16 \r
+ orr r4, r4, r4, LSL #16\r
mov r5, r4\r
mov r6, r4\r
- mov r7, r4 \r
- mov r8, r4 \r
- mov r9, r4 \r
- mov r10, r4 \r
- mov r11, r4 \r
+ mov r7, r4\r
+ mov r8, r4\r
+ mov r9, r4\r
+ mov r10, r4\r
+ mov r11, r4\r
b L32\r
L34:\r
cmp lr, #0\r
cmp r1, #0\r
bne L34\r
ldmfd sp!, {r4-r11, pc}\r
- \r
+\r
-;------------------------------------------------------------------------------ \r
+;------------------------------------------------------------------------------\r
;\r
; SetMem() worker for ARM\r
;\r
IN UINT8 Value\r
)\r
**/\r
- \r
+\r
EXPORT InternalMemSetMem\r
- \r
+\r
AREA AsmMemStuff, CODE, READONLY\r
\r
InternalMemSetMem\r
L31\r
and r4, r2, #0xff\r
orr r4, r4, r4, LSL #8\r
- orr r4, r4, r4, LSL #16 \r
+ orr r4, r4, r4, LSL #16\r
mov r5, r4\r
mov r6, r4\r
- mov r7, r4 \r
- mov r8, r4 \r
- mov r9, r4 \r
- mov r10, r4 \r
- mov r11, r4 \r
+ mov r7, r4\r
+ mov r8, r4\r
+ mov r9, r4\r
+ mov r10, r4\r
+ mov r11, r4\r
b L32\r
L34\r
cmp lr, #0\r
cmp r1, #0\r
bne L34\r
ldmfd sp!, {r4-r11, pc}\r
- \r
+\r
END\r
## @file\r
# Instance of Base Memory Library with some ARM ldm/stm assembly.\r
#\r
-# This is a copy of the MdePkg BaseMemoryLib with the CopyMem and \r
-# SetMem worker functions replaced with assembler that uses \r
+# This is a copy of the MdePkg BaseMemoryLib with the CopyMem and\r
+# SetMem worker functions replaced with assembler that uses\r
# ldm/stm.\r
#\r
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
FILE_GUID = 4D466AF3-2380-448D-A337-E4033F29F3F7\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = BaseMemoryLib \r
+ LIBRARY_CLASS = BaseMemoryLib\r
\r
\r
#\r
SetMemWrapper.c\r
CopyMemWrapper.c\r
MemLibGeneric.c\r
- MemLibGuid.c \r
+ MemLibGuid.c\r
MemLibInternals.h\r
\r
[Sources.ARM]\r
If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the\r
value returned is the first mismatched byte in SourceBuffer subtracted from the first\r
mismatched byte in DestinationBuffer.\r
- \r
+\r
If Length > 0 and DestinationBuffer is NULL, then ASSERT().\r
If Length > 0 and SourceBuffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
@return 0 All Length bytes of the two buffers are identical.\r
@retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
mismatched byte in DestinationBuffer.\r
- \r
+\r
**/\r
INTN\r
EFIAPI\r
CopyMem() implementation.\r
\r
The following BaseMemoryLib instances contain the same copy of this file:\r
- \r
+\r
BaseMemoryLib\r
BaseMemoryLibMmx\r
BaseMemoryLibSse2\r
This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns\r
DestinationBuffer. The implementation must be reentrant, and it must handle the case\r
where SourceBuffer overlaps DestinationBuffer.\r
- \r
+\r
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
\r
Implementation of GUID functions.\r
\r
The following BaseMemoryLib instances contain the same copy of this file:\r
- \r
+\r
BaseMemoryLib\r
BaseMemoryLibMmx\r
BaseMemoryLibSse2\r
\r
This function copies the contents of the 128-bit GUID specified by SourceGuid to\r
DestinationGuid, and returns DestinationGuid.\r
- \r
+\r
If DestinationGuid is NULL, then ASSERT().\r
If SourceGuid is NULL, then ASSERT().\r
\r
\r
This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.\r
If there are any bit differences in the two GUIDs, then FALSE is returned.\r
- \r
+\r
If Guid1 is NULL, then ASSERT().\r
If Guid2 is NULL, then ASSERT().\r
\r
GUID value that matches Guid. If a match is found, then a pointer to the matching\r
GUID in the target buffer is returned. If no match is found, then NULL is returned.\r
If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
address to the highest address for a 16-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
If Length is not aligned on a 16-bit boundary, then ASSERT().\r
address to the highest address for a 32-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 32-bit boundary, then ASSERT().\r
address to the highest address for a 64-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
If Length is not aligned on a 64-bit boundary, then ASSERT().\r
address to the highest address for an 8-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
}\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- \r
+\r
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
}\r
\r
/**\r
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+ Scans a target buffer for a UINTN sized value, and returns a pointer to the matching\r
UINTN sized value in the target buffer.\r
\r
This function searches the target buffer specified by Buffer and Length from the lowest\r
address to the highest address for a UINTN sized value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
If Length is not aligned on a UINTN boundary, then ASSERT().\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- \r
+\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Memory to set.\r
BaseMemoryLibOptPei\r
PeiMemoryLib\r
UefiMemoryLib\r
- \r
+\r
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Fills a target buffer with zeros, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# CopyMem() worker for ARM\r
#\r
/**\r
Copy Length bytes from Source to Destination. Overlap is OK.\r
\r
- This implementation \r
+ This implementation\r
\r
@param Destination Target of copy\r
@param Source Place to copy from\r
bne L29\r
sub r3, lr, #1\r
sub ip, ip, #1\r
- ldrb r3, [r3, #0] \r
+ ldrb r3, [r3, #0]\r
sub r2, r9, #1\r
cmp ip, #0\r
sub r9, r9, #1\r
bne L16\r
b L7\r
L11:\r
- ldrb r3, [lr], #1 \r
+ ldrb r3, [lr], #1\r
sub ip, ip, #1\r
strb r3, [r9], #1\r
L26:\r
mov r0, r4\r
ldmfd sp!, {r4, r9, pc}\r
\r
- \r
+\r
-;------------------------------------------------------------------------------ \r
+;------------------------------------------------------------------------------\r
;\r
; CopyMem() worker for ARM\r
;\r
/**\r
Copy Length bytes from Source to Destination. Overlap is OK.\r
\r
- This implementation \r
+ This implementation\r
\r
@param Destination Target of copy\r
@param Source Place to copy from\r
bne L29\r
sub r3, lr, #1\r
sub ip, ip, #1\r
- ldrb r3, [r3, #0] \r
+ ldrb r3, [r3, #0]\r
sub r2, r9, #1\r
cmp ip, #0\r
sub r9, r9, #1\r
bne L16\r
b L7\r
L11\r
- ldrb r3, [lr], #1 \r
+ ldrb r3, [lr], #1\r
sub ip, ip, #1\r
strb r3, [r9], #1\r
L26\r
ldmfd sp!, {r4, r9, pc}\r
\r
END\r
- \r
+\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# SemMem() worker for ARM\r
#\r
IN UINT8 Value\r
)\r
**/\r
- \r
+\r
.text\r
.align 2\r
GCC_ASM_EXPORT(InternalMemSetMem)\r
cmp r1, #0\r
bne L34\r
ldmfd sp!, {pc}\r
- \r
\ No newline at end of file
-;------------------------------------------------------------------------------ \r
+;------------------------------------------------------------------------------\r
;\r
; SetMem() worker for ARM\r
;\r
IN UINT8 Value\r
)\r
**/\r
- \r
+\r
EXPORT InternalMemSetMem\r
- \r
+\r
AREA AsmMemStuff, CODE, READONLY\r
\r
InternalMemSetMem\r
cmp r1, #0\r
bne L34\r
ldmfd sp!, {pc}\r
- \r
+\r
END\r
- \r
\ No newline at end of file
## @file\r
# Instance of Base Memory Library with some ARM vldm/vstm assembly.\r
#\r
-# This is a copy of the MdePkg BaseMemoryLib with the CopyMem and \r
-# SetMem worker functions replaced with assembler that uses \r
+# This is a copy of the MdePkg BaseMemoryLib with the CopyMem and\r
+# SetMem worker functions replaced with assembler that uses\r
# vldm/vstm (part of NEON SIMD, optional in ARMv7-A).\r
#\r
# Note: You need to enable NEON in SEC to use this library\r
FILE_GUID = 09EE1E8D-7A2E-4573-8117-68A18569C1F5\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = BaseMemoryLib \r
+ LIBRARY_CLASS = BaseMemoryLib\r
\r
\r
#\r
SetMemWrapper.c\r
CopyMemWrapper.c\r
MemLibGeneric.c\r
- MemLibGuid.c \r
+ MemLibGuid.c\r
MemLibInternals.h\r
Arm/CopyMem.asm\r
Arm/CopyMem.S\r
If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the\r
value returned is the first mismatched byte in SourceBuffer subtracted from the first\r
mismatched byte in DestinationBuffer.\r
- \r
+\r
If Length > 0 and DestinationBuffer is NULL, then ASSERT().\r
If Length > 0 and SourceBuffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
@return 0 All Length bytes of the two buffers are identical.\r
@retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first\r
mismatched byte in DestinationBuffer.\r
- \r
+\r
**/\r
INTN\r
EFIAPI\r
CopyMem() implementation.\r
\r
The following BaseMemoryLib instances contain the same copy of this file:\r
- \r
+\r
BaseMemoryLib\r
BaseMemoryLibMmx\r
BaseMemoryLibSse2\r
This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns\r
DestinationBuffer. The implementation must be reentrant, and it must handle the case\r
where SourceBuffer overlaps DestinationBuffer.\r
- \r
+\r
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().\r
If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
\r
Implementation of GUID functions.\r
\r
The following BaseMemoryLib instances contain the same copy of this file:\r
- \r
+\r
BaseMemoryLib\r
BaseMemoryLibMmx\r
BaseMemoryLibSse2\r
\r
This function copies the contents of the 128-bit GUID specified by SourceGuid to\r
DestinationGuid, and returns DestinationGuid.\r
- \r
+\r
If DestinationGuid is NULL, then ASSERT().\r
If SourceGuid is NULL, then ASSERT().\r
\r
\r
This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.\r
If there are any bit differences in the two GUIDs, then FALSE is returned.\r
- \r
+\r
If Guid1 is NULL, then ASSERT().\r
If Guid2 is NULL, then ASSERT().\r
\r
GUID value that matches Guid. If a match is found, then a pointer to the matching\r
GUID in the target buffer is returned. If no match is found, then NULL is returned.\r
If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 128-bit boundary, then ASSERT().\r
address to the highest address for a 16-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
If Length is not aligned on a 16-bit boundary, then ASSERT().\r
address to the highest address for a 32-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
If Length is not aligned on a 32-bit boundary, then ASSERT().\r
address to the highest address for a 64-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
If Length is not aligned on a 64-bit boundary, then ASSERT().\r
address to the highest address for an 8-bit value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
}\r
ASSERT (Buffer != NULL);\r
ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
- \r
+\r
return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
}\r
\r
/**\r
- Scans a target buffer for a UINTN sized value, and returns a pointer to the matching \r
+ Scans a target buffer for a UINTN sized value, and returns a pointer to the matching\r
UINTN sized value in the target buffer.\r
\r
This function searches the target buffer specified by Buffer and Length from the lowest\r
address to the highest address for a UINTN sized value that matches Value. If a match is found,\r
then a pointer to the matching byte in the target buffer is returned. If no match is found,\r
then NULL is returned. If Length is 0, then NULL is returned.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Buffer is not aligned on a UINTN boundary, then ASSERT().\r
If Length is not aligned on a UINTN boundary, then ASSERT().\r
Fills a target buffer with a byte value, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with Value, and returns Buffer.\r
- \r
+\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
@param Buffer Memory to set.\r
BaseMemoryLibOptPei\r
PeiMemoryLib\r
UefiMemoryLib\r
- \r
+\r
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Fills a target buffer with zeros, and returns the target buffer.\r
\r
This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
- \r
+\r
If Length > 0 and Buffer is NULL, then ASSERT().\r
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Print (L"ERROR: Did not find initrd image.\n");\r
goto EXIT_FREE_LINUX;\r
}\r
- \r
+\r
// Check if the initrd is a uInitrd\r
if (*(UINT32*)((UINTN)InitrdImageBase) == LINUX_UIMAGE_SIGNATURE) {\r
// Skip the 64-byte image header\r
//\r
// Setup the Linux Kernel Parameters\r
//\r
- \r
+\r
// By setting address=0 we leave the memory allocation to the function\r
Status = PrepareAtagList (CommandLineArguments, InitrdImage, InitrdImageSize, &AtagBase, &AtagSize);\r
if (EFI_ERROR(Status)) {\r
/** @file\r
*\r
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
-# \r
+#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
gArmGlobalVariableGuid\r
\r
[Protocols]\r
- gEfiBdsArchProtocolGuid \r
+ gEfiBdsArchProtocolGuid\r
gEfiDevicePathProtocolGuid\r
gEfiDevicePathFromTextProtocolGuid\r
gEfiSimpleFileSystemProtocolGuid\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__ashldi3)\r
- \r
+\r
ASM_PFX(__ashldi3):\r
cmp r2, #31\r
bls L2\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
Compiler intrinsic to return the number of leading zeros, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__ctzsi2)\r
- \r
+\r
ASM_PFX(__ctzsi2):\r
uxth r3, r0\r
cmp r3, #0\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
EXPORT __aeabi_uidivmod\r
EXPORT __aeabi_idiv\r
EXPORT __aeabi_idivmod\r
- \r
+\r
AREA Math, CODE, READONLY\r
\r
;\r
; What to do about division by zero? For now, just return.\r
__aeabi_idiv0\r
BX r14\r
- \r
+\r
END\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__divdi3)\r
- \r
+\r
ASM_PFX(__divdi3):\r
@ args = 0, pretend = 0, frame = 0\r
@ frame_needed = 1, uses_anonymous_args = 0\r
Compiler intrinsic for 64-bit compare, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__divsi3)\r
- \r
+\r
ASM_PFX(__divsi3):\r
eor r3, r0, r0, asr #31\r
eor r2, r1, r1, asr #31\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
\r
EXPORT __aeabi_lasr\r
- \r
+\r
AREA Math, CODE, READONLY\r
\r
;\r
ASR r0,r1,r3\r
ASR r1,r1,#31\r
BX lr\r
- \r
+\r
END\r
\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
GCC_ASM_EXPORT(__aeabi_ldivmod)\r
\r
//\r
-// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}}, \r
+// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}},\r
// the quotient in {r0, r1}, and the remainder in {r2, r3}.\r
//\r
//__value_in_regs lldiv_t\r
rsbs r2,r2,#0\r
rsc r3,r3,#0\r
L_Test2:\r
- bl ASM_PFX(__aeabi_uldivmod) \r
+ bl ASM_PFX(__aeabi_uldivmod)\r
tst r4,#0x40000000\r
beq L_Test3\r
rsbs r0,r0,#0\r
rsc r3,r3,#0\r
L_Exit:\r
pop {r4,pc}\r
- \r
+\r
\r
\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
EXPORT __aeabi_ldivmod\r
EXTERN __aeabi_uldivmod\r
- \r
+\r
AREA Math, CODE, READONLY\r
\r
;\r
RSC r3,r3,#0\r
L_Exit\r
POP {r4,pc}\r
- \r
+\r
END\r
\r
\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__lshrdi3)\r
- \r
+\r
ASM_PFX(__lshrdi3):\r
cmp r2, #31\r
bls L2\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2011, ARM Limited. All rights reserved.\r
//\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
Compiler intrinsic for 64-bit mod, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
EXPORT __ARM_ll_mullu\r
EXPORT __aeabi_lmul\r
- \r
+\r
AREA Math, CODE, READONLY\r
\r
;\r
mla r1, r2, r1, ip\r
mla r1, r3, lr, r1\r
ldmia sp!, {pc}\r
- \r
+\r
END\r
-#------s------------------------------------------------------------------------ \r
+#------s------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
cmp r2, r0\r
bhi L2\r
b L4\r
- \r
+\r
-///------------------------------------------------------------------------------ \r
+///------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
EXPORT __ARM_switch8\r
\r
AREA ArmSwitch, CODE, READONLY\r
- \r
+\r
__ARM_switch8\r
LDRB r12,[lr,#-1]\r
CMP r3,r12\r
LDRBCS r3,[lr,r12]\r
ADD r12,lr,r3,LSL #1\r
BX r12\r
- \r
+\r
END\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.;\r
#\r
#**/\r
-# \r
+#\r
\r
.text\r
.p2align 2\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.;\r
#\r
#**/\r
-# \r
+#\r
\r
.text\r
.p2align 2\r
\r
GCC_ASM_EXPORT(__switch32)\r
\r
-ASM_PFX(__switch32): \r
+ASM_PFX(__switch32):\r
ldr ip, [lr, #-1]\r
cmp r0, ip\r
add r0, lr, r0, lsl #2\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.;\r
#\r
#**/\r
-# \r
+#\r
\r
.text\r
.p2align 2\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.;\r
#\r
#**/\r
-# \r
+#\r
\r
.text\r
.p2align 2\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__ucmpdi2)\r
- \r
+\r
ASM_PFX(__ucmpdi2):\r
stmfd sp!, {r4, r5, r8, lr}\r
cmp r1, r3\r
Compiler intrinsic for 64-bit compare, ported from LLVM code.\r
\r
Copyright (c) 2008-2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
Compiler intrinsic for 64-bit unisigned div, ported from LLVM code.\r
\r
Copyright (c) 2008-2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__udivmoddi4)\r
- \r
+\r
ASM_PFX(__udivmoddi4):\r
stmfd sp!, {r4, r5, r6, r7, lr}\r
add r7, sp, #12\r
Compiler intrinsic for 64-bit compare, ported from LLVM code.\r
\r
Copyright (c) 2008-2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
udwords q;\r
udwords r;\r
unsigned sr;\r
- \r
+\r
if (b == 0) {\r
// ASSERT (FALSE);\r
return 0;\r
}\r
- \r
+\r
// special cases, X is unknown, K != 0\r
if (n.high == 0)\r
{\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
Compiler intrinsic for 32-bit unsigned div, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
.align 2\r
GCC_ASM_EXPORT(__aeabi_uldivmod)\r
\r
-// \r
+//\r
//UINT64\r
//EFIAPI\r
//__aeabi_uldivmod (\r
-// IN UINT64 Dividend \r
+// IN UINT64 Dividend\r
// IN UINT64 Divisor\r
// )\r
//\r
mov ip, r3\r
mov lr, r2\r
b ASM_PFX(_ll_udiv_ginormous)\r
- \r
+\r
ASM_PFX(_ll_udiv_small):\r
cmp r4, ip, lsl #1\r
mov r3, #0 // 0x0\r
add r1, r1, r3, lsl r6\r
mov r3, #0 // 0x0\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
ASM_PFX(_ll_udiv_big):\r
subs r0, r5, lr\r
mov r3, #0 // 0x0\r
orr r2, r2, r4, ror r6\r
adc r1, r1, #0 // 0x0\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
ASM_PFX(_ll_udiv_ginormous):\r
subs r2, r5, lr\r
mov r1, #0 // 0x0\r
movcc r2, r5\r
movcc r3, r4\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
ASM_PFX(_ll_div0):\r
ldmia sp!, {r4, r5, r6, lr}\r
mov r0, #0 // 0x0\r
mov r1, #0 // 0x0\r
b ASM_PFX(__aeabi_ldiv0)\r
- \r
+\r
ASM_PFX(__aeabi_ldiv0):\r
bx r14\r
\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
\r
AREA Uldivmod, CODE, READONLY\r
\r
-; \r
+;\r
;UINT64\r
;EFIAPI\r
;__aeabi_uldivmod (\r
-; IN UINT64 Dividend \r
+; IN UINT64 Dividend\r
; IN UINT64 Divisor\r
; )\r
;\r
mov ip, r3\r
mov lr, r2\r
b _ll_udiv_ginormous\r
- \r
+\r
_ll_udiv_small\r
cmp r4, ip, lsl #1\r
mov r3, #0 ; 0x0\r
add r1, r1, r3, lsl r6\r
mov r3, #0 ; 0x0\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
_ll_udiv_big\r
subs r0, r5, lr\r
mov r3, #0 ; 0x0\r
orr r2, r2, r4, ror r6\r
adc r1, r1, #0 ; 0x0\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
_ll_udiv_ginormous\r
subs r2, r5, lr\r
mov r1, #0 ; 0x0\r
movcc r2, r5\r
movcc r3, r4\r
ldmia sp!, {r4, r5, r6, pc}\r
- \r
+\r
_ll_div0\r
ldmia sp!, {r4, r5, r6, lr}\r
mov r0, #0 ; 0x0\r
mov r1, #0 ; 0x0\r
b __aeabi_ldiv0\r
- \r
+\r
__aeabi_ldiv0\r
BX r14\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINT32 __umodsi3(UINT32 a, UINT32 b);\r
\r
\r
-UINT64 \r
+UINT64\r
__aeabi_uidivmod(unsigned numerator, unsigned denominator)\r
{\r
UINT64 Return;\r
}\r
\r
unsigned\r
-__aeabi_uidiv (unsigned n, unsigned d) \r
+__aeabi_uidiv (unsigned n, unsigned d)\r
{\r
return __udivsi3 (n, d);\r
}\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__umoddi3)\r
- \r
+\r
ASM_PFX(__umoddi3):\r
stmfd sp!, {r7, lr}\r
add r7, sp, #0\r
Compiler intrinsic for 64-bit unsigned mod, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
.text\r
.align 2\r
GCC_ASM_EXPORT(__umodsi3)\r
- \r
+\r
ASM_PFX(__umodsi3):\r
stmfd sp!, {r4, r5, r7, lr}\r
add r7, sp, #8\r
Compiler intrinsic for 32-bit unsigned mod, ported from LLVM code.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
University of Illinois/NCSA\r
Open Source License\r
- \r
+\r
Copyright (c) 2003-2008 University of Illinois at Urbana-Champaign.\r
All rights reserved.\r
- \r
+\r
Developed by:\r
- \r
+\r
LLVM Team\r
- \r
+\r
University of Illinois at Urbana-Champaign\r
- \r
+\r
http://llvm.org\r
- \r
+\r
Permission is hereby granted, free of charge, to any person obtaining a copy of\r
this software and associated documentation files (the "Software"), to deal with\r
the Software without restriction, including without limitation the rights to\r
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\r
of the Software, and to permit persons to whom the Software is furnished to do\r
so, subject to the following conditions:\r
- \r
+\r
* Redistributions of source code must retain the above copyright notice,\r
this list of conditions and the following disclaimers.\r
- \r
+\r
* Redistributions in binary form must reproduce the above copyright notice,\r
this list of conditions and the following disclaimers in the\r
documentation and/or other materials provided with the distribution.\r
- \r
+\r
* Neither the names of the LLVM Team, University of Illinois at\r
Urbana-Champaign, nor the names of its contributors may be used to\r
endorse or promote products derived from this Software without specific\r
prior written permission.\r
- \r
+\r
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
FILE_GUID = 855274FA-3575-4C20-9709-C031DC5589FA\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = CompilerIntrinsicsLib \r
+ LIBRARY_CLASS = CompilerIntrinsicsLib\r
\r
[Sources.AARCH64]\r
AArch64/memcpy.S\r
Arm/div.asm | RVCT\r
Arm/uldiv.asm | RVCT\r
Arm/ldivmod.asm | RVCT\r
- \r
+\r
\r
#\r
# Move .c to .s to work around LLVM issues\r
\r
Arm/memcpy.S | GCC\r
Arm/memset.S | GCC\r
- \r
+\r
# Arm/modsi3.c | GCC\r
# Arm/moddi3.c | GCC\r
-# Arm/muldi3.c | GCC \r
+# Arm/muldi3.c | GCC\r
Arm/modsi3.S | GCC\r
Arm/moddi3.S | GCC\r
Arm/muldi3.S | GCC\r
- Arm/mullu.S | GCC \r
+ Arm/mullu.S | GCC\r
\r
# Arm/udivsi3.c | GCC\r
# Arm/umodsi3.c | GCC\r
stmfd SP!,{LR} @ Store the link register for the current mode\r
sub SP,SP,#0x20 @ Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} @ Store the register state\r
- \r
+\r
mov R0,#0 @ ExceptionType\r
ldr R1,ASM_PFX(CommonExceptionEntry)\r
bx R1\r
IFAR 0x50\r
\r
LR 0x54 # SVC Link register (we need to restore it)\r
- \r
+\r
LR 0x58 # pushed by srsfd\r
CPSR 0x5c\r
\r
stmfd SP!,{LR} ; Store the link register for the current mode\r
sub SP,SP,#0x20 ; Save space for SP, LR, PC, IFAR - CPSR\r
stmfd SP!,{R0-R12} ; Store the register state\r
- \r
+\r
mov R0,#0 ; ExceptionType\r
ldr R1,CommonExceptionEntry\r
bx R1\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
#\r
\r
[Defines]\r
\r
\r
/**\r
- If the build is done on cygwin the paths are cygpaths. \r
+ If the build is done on cygwin the paths are cygpaths.\r
/cygdrive/c/tmp.txt vs c:\tmp.txt so we need to convert\r
them to work with RVD commands\r
\r
CHAR8 *Ptr;\r
UINTN Index;\r
UINTN Index2;\r
- \r
+\r
Ptr = AsciiStrStr (Name, "/cygdrive/");\r
if (Ptr == NULL) {\r
return Name;\r
}\r
- \r
+\r
for (Index = 9, Index2 = 0; (Index < (Size + 9)) && (Ptr[Index] != '\0'); Index++, Index2++) {\r
Temp[Index2] = Ptr[Index];\r
if (Temp[Index2] == '/') {\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
)\r
{\r
-#if !defined(MDEPKG_NDEBUG) \r
+#if !defined(MDEPKG_NDEBUG)\r
CHAR8 Temp[512];\r
#endif\r
\r
/**\r
Performs additional actions just before a PE/COFF image is unloaded. Any resources\r
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
- \r
+\r
@param ImageContext Pointer to the image context structure that describes the\r
PE/COFF image that is being unloaded.\r
\r
#if !defined(MDEPKG_NDEBUG)\r
CHAR8 Temp[512];\r
#endif\r
- \r
+\r
if (ImageContext->PdbPointer) {\r
#ifdef __CC_ARM\r
// Print out the command for the RVD debugger to load symbols for this image\r
/** @file\r
Debug version of the UncachedMemoryAllocation lib that uses the VirtualUncachedPages\r
protocol, produced by the DXE CPU driver, to produce debuggable uncached memory buffers.\r
- \r
+\r
The DMA rules for EFI contain the concept of a PCI (DMA master) address for memory and\r
a CPU (C code) address for the memory buffer that don't have to be the same. There seem to\r
be common errors out there with folks mixing up the two addresses. This library causes\r
PcdArmUncachedMemoryMask ored into the physical address.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
VOID *\r
UncachedInternalAllocatePages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages\r
);\r
\r
VOID *\r
UncachedInternalAllocateAlignedPages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages,\r
IN UINTN Alignment\r
);\r
- \r
- \r
+\r
+\r
\r
EFI_CPU_ARCH_PROTOCOL *gDebugUncachedCpu;\r
VIRTUAL_UNCACHED_PAGES_PROTOCOL *gVirtualUncachedPages;\r
)\r
{\r
FREE_PAGE_NODE *NewNode;\r
- \r
+\r
NewNode = AllocatePool (sizeof (LIST_ENTRY));\r
if (NewNode == NULL) {\r
ASSERT (FALSE);\r
return;\r
}\r
- \r
+\r
NewNode->Buffer = Buffer;\r
NewNode->Allocation = Allocation;\r
NewNode->Pages = Pages;\r
\r
*Allocation = NULL;\r
*Pages = 0;\r
- \r
+\r
for (Link = mPageList.ForwardLink; Link != &mPageList; Link = Link->ForwardLink) {\r
OldNode = BASE_CR (Link, FREE_PAGE_NODE, Link);\r
if (OldNode->Buffer == Buffer) {\r
*Allocation = OldNode->Allocation;\r
*Pages = OldNode->Pages;\r
- \r
+\r
RemoveEntryList (&OldNode->Link);\r
FreePool (OldNode);\r
return;\r
{\r
UINTN UncachedMemoryMask = (UINTN)PcdGet64 (PcdArmUncachedMemoryMask);\r
UINTN PhysicalAddress;\r
- \r
+\r
PhysicalAddress = (UINTN)VirtualAddress & ~UncachedMemoryMask;\r
- \r
+\r
return (EFI_PHYSICAL_ADDRESS)PhysicalAddress;\r
}\r
\r
{\r
UINTN UncachedMemoryMask = (UINTN)PcdGet64 (PcdArmUncachedMemoryMask);\r
UINTN UncachedAddress;\r
- \r
+\r
UncachedAddress = (UINTN)Address | UncachedMemoryMask;\r
- \r
+\r
return (VOID *)UncachedAddress;\r
}\r
\r
\r
VOID *\r
UncachedInternalAllocatePages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages\r
)\r
{\r
\r
VOID *\r
UncachedInternalAllocateAlignedPages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages,\r
IN UINTN Alignment\r
)\r
// Alignment must be a power of two or zero.\r
//\r
ASSERT ((Alignment & (Alignment - 1)) == 0);\r
- \r
+\r
if (Pages == 0) {\r
return NULL;\r
}\r
// Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.\r
//\r
ASSERT (RealPages > Pages);\r
- \r
+\r
Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
AlignedMemory = (UINTN) Memory;\r
}\r
- \r
+\r
Status = gVirtualUncachedPages->ConvertPages (gVirtualUncachedPages, AlignedMemory, Pages * EFI_PAGE_SIZE, PcdGet64 (PcdArmUncachedMemoryMask), &gAttributes);\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
- \r
+\r
AlignedMemory = (EFI_PHYSICAL_ADDRESS)(UINTN)ConvertToUncachedAddress ((VOID *)(UINTN)AlignedMemory);\r
- \r
+\r
return (VOID *)(UINTN)AlignedMemory;\r
}\r
\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_PHYSICAL_ADDRESS Memory; \r
+ EFI_PHYSICAL_ADDRESS Memory;\r
\r
ASSERT (Pages != 0);\r
- \r
+\r
Memory = ConvertToPhysicalAddress (Buffer);\r
- \r
+\r
Status = gVirtualUncachedPages->RevertPages (gVirtualUncachedPages, Memory, Pages * EFI_PAGE_SIZE, PcdGet64 (PcdArmUncachedMemoryMask), gAttributes);\r
\r
- \r
+\r
Status = gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) Memory, Pages);\r
ASSERT_EFI_ERROR (Status);\r
}\r
)\r
{\r
VOID *AlignedAddress;\r
- \r
+\r
//\r
// Alignment must be a power of two or zero.\r
//\r
if (Alignment < EFI_PAGE_SIZE) {\r
Alignment = EFI_PAGE_SIZE;\r
}\r
- \r
+\r
AlignedAddress = UncachedInternalAllocateAlignedPages (PoolType, EFI_SIZE_TO_PAGES (AllocationSize), Alignment);\r
if (AlignedAddress == NULL) {\r
return NULL;\r
)\r
{\r
VOID *Memory;\r
- \r
+\r
ASSERT (Buffer != NULL);\r
ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));\r
\r
{\r
VOID *Allocation;\r
UINTN Pages;\r
- \r
+\r
RemovePagesFromList (Buffer, &Allocation, &Pages);\r
\r
UncachedFreePages (Allocation, Pages);\r
\r
VOID *\r
UncachedInternalAllocatePool (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN AllocationSize\r
)\r
{\r
\r
VOID *\r
UncachedInternalAllocateZeroPool (\r
- IN EFI_MEMORY_TYPE PoolType, \r
+ IN EFI_MEMORY_TYPE PoolType,\r
IN UINTN AllocationSize\r
- ) \r
+ )\r
{\r
VOID *Memory;\r
\r
\r
VOID *\r
UncachedInternalAllocateCopyPool (\r
- IN EFI_MEMORY_TYPE PoolType, \r
+ IN EFI_MEMORY_TYPE PoolType,\r
IN UINTN AllocationSize,\r
IN CONST VOID *Buffer\r
- ) \r
+ )\r
{\r
VOID *Memory;\r
\r
Memory = CopyMem (Memory, Buffer, AllocationSize);\r
}\r
return Memory;\r
-} \r
+}\r
\r
VOID *\r
EFIAPI\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&gDebugUncachedCpu);\r
ASSERT_EFI_ERROR(Status);\r
\r
#/** @file\r
-# \r
+#\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
\r
[FixedPcd]\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask\r
- \r
- \r
+\r
+\r
[Depex]\r
- gEfiCpuArchProtocolGuid AND gVirtualUncachedPagesProtocolGuid\r
\ No newline at end of file
+ gEfiCpuArchProtocolGuid AND gVirtualUncachedPagesProtocolGuid\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
);\r
\r
/**\r
- Convert the Current Program Status Register (CPSR) to a string. The string is \r
- a defacto standard in the ARM world. \r
- \r
+ Convert the Current Program Status Register (CPSR) to a string. The string is\r
+ a defacto standard in the ARM world.\r
+\r
It is possible to add extra bits by adding them to CpsrChar array.\r
\r
@param Cpsr ARM CPSR register value\r
{ 5, 't' },\r
{ 0, '?' }\r
};\r
- \r
+\r
Str = ReturnStr;\r
\r
for (Index = 0; CpsrChar[Index].BIT != 0; Index++, Str++) {\r
*Str &= ~0x20;\r
}\r
}\r
- \r
+\r
*Str++ = '_';\r
*Str = '\0';\r
- \r
+\r
switch (Cpsr & 0x1f) {\r
case 0x10:\r
ModeStr = "usr";\r
case 0x1f:\r
ModeStr = "sys";\r
break;\r
- \r
+\r
default:\r
ModeStr = "???";\r
break;\r
}\r
- \r
+\r
AsciiStrCat (Str, ModeStr);\r
return;\r
-} \r
+}\r
\r
CHAR8 *\r
FaultStatusToString (\r
\r
/**\r
This is the default action to take on an unexpected exception\r
- \r
+\r
Since this is exception context don't do anything crazy like try to allcoate memory.\r
\r
@param ExceptionType Type of the exception\r
CHAR8 Buffer[80];\r
UINT8 *DisAsm;\r
UINT32 ItBlock;\r
- \r
+\r
CpsrString (SystemContext.SystemContextArm->CPSR, CpsrStr);\r
DEBUG ((EFI_D_ERROR, "%a\n", CpsrStr));\r
- \r
+\r
Pdb = GetImageName (SystemContext.SystemContextArm->PC, &ImageBase, &PeCoffSizeOfHeader);\r
Offset = SystemContext.SystemContextArm->PC - ImageBase;\r
if (Pdb != NULL) {\r
DEBUG ((EFI_D_ERROR, "%a\n", Pdb));\r
\r
//\r
- // A PE/COFF image loads its headers into memory so the headers are \r
+ // A PE/COFF image loads its headers into memory so the headers are\r
// included in the linked addresses. ELF and Mach-O images do not\r
// include the headers so the first byte of the image is usually\r
// text (code). If you look at link maps from ELF or Mach-O images\r
// you need to subtract out the size of the PE/COFF header to get\r
- // get the offset that matches the link map. \r
+ // get the offset that matches the link map.\r
//\r
DEBUG ((EFI_D_ERROR, "loaded at 0x%08x (PE/COFF offset) 0x%x (ELF or Mach-O offset) 0x%x", ImageBase, Offset, Offset - PeCoffSizeOfHeader));\r
- \r
+\r
// If we come from an image it is safe to show the instruction. We know it should not fault\r
DisAsm = (UINT8 *)(UINTN)SystemContext.SystemContextArm->PC;\r
ItBlock = 0;\r
DisassembleInstruction (&DisAsm, (SystemContext.SystemContextArm->CPSR & BIT5) == BIT5, TRUE, &ItBlock, Buffer, sizeof (Buffer));\r
DEBUG ((EFI_D_ERROR, "\n%a", Buffer));\r
- \r
+\r
switch (ExceptionType) {\r
case EXCEPT_ARM_UNDEFINED_INSTRUCTION:\r
case EXCEPT_ARM_SOFTWARE_INTERRUPT:\r
// advance PC past the faulting instruction\r
PcAdjust = (UINTN)DisAsm - SystemContext.SystemContextArm->PC;\r
break;\r
- \r
+\r
default:\r
break;\r
}\r
\r
DEBUG ((EFI_D_ERROR, "\n"));\r
ASSERT (FALSE);\r
- \r
+\r
// Clear the error registers that we have already displayed incase some one wants to keep going\r
SystemContext.SystemContextArm->DFSR = 0;\r
SystemContext.SystemContextArm->IFSR = 0;\r
\r
- // If some one is stepping past the exception handler adjust the PC to point to the next instruction \r
+ // If some one is stepping past the exception handler adjust the PC to point to the next instruction\r
SystemContext.SystemContextArm->PC += PcAdjust;\r
}\r
/** @file\r
PEI Services Table Pointer Library.\r
- \r
+\r
This library is used for PEIM which does executed from flash device directly but\r
executed in memory.\r
\r
#include <Library/DebugLib.h>\r
\r
/**\r
- Caches a pointer PEI Services Table. \r
- \r
- Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer \r
+ Caches a pointer PEI Services Table.\r
+\r
+ Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer\r
in a platform specific manner.\r
- \r
+\r
If PeiServicesTablePointer is NULL, then ASSERT().\r
- \r
+\r
@param PeiServicesTablePointer The address of PeiServices pointer.\r
**/\r
VOID\r
/**\r
Retrieves the cached value of the PEI Services Table pointer.\r
\r
- Returns the cached value of the PEI Services Table pointer in a CPU specific manner \r
- as specified in the CPU binding section of the Platform Initialization Pre-EFI \r
+ Returns the cached value of the PEI Services Table pointer in a CPU specific manner\r
+ as specified in the CPU binding section of the Platform Initialization Pre-EFI\r
Initialization Core Interface Specification.\r
- \r
+\r
If the cached PEI Services Table pointer is NULL, then ASSERT().\r
\r
@return The pointer to PeiServices.\r
[LibraryClasses]\r
ArmLib\r
DebugLib\r
- \r
+\r
[Pcd]\r
- \r
+\r
#include <Library/PrintLib.h>\r
\r
/**\r
- Append string to debugger script file, create file if needed. \r
+ Append string to debugger script file, create file if needed.\r
\r
This library can show up in mulitple places so we need to append the file every time we write to it.\r
For example Sec can use this to load the DXE core, and the DXE core would use this to load all the\r
)\r
{\r
// Working around and issue with the code that is commented out. For now send it to the console.\r
- // You can copy the console into a file and source the file as a script and you get symbols. \r
- // This gets you all the symbols except for SEC. To get SEC symbols you need to copy the \r
+ // You can copy the console into a file and source the file as a script and you get symbols.\r
+ // This gets you all the symbols except for SEC. To get SEC symbols you need to copy the\r
// debug print in the SEC into the debugger manually\r
SemihostWriteString (Buffer);\r
/*\r
\r
\r
/**\r
- If the build is done on cygwin the paths are cygpaths. \r
+ If the build is done on cygwin the paths are cygpaths.\r
/cygdrive/c/tmp.txt vs c:\tmp.txt so we need to convert\r
them to work with RVD commands\r
\r
CHAR8 *Ptr;\r
UINTN Index;\r
UINTN Len;\r
- \r
+\r
Ptr = AsciiStrStr (Name, "/cygdrive/");\r
if (Ptr == NULL) {\r
return Name;\r
}\r
- \r
+\r
Len = AsciiStrLen (Ptr);\r
- \r
+\r
// convert "/cygdrive" to spaces\r
for (Index = 0; Index < 9; Index++) {\r
Ptr[Index] = ' ';\r
// convert /c to c:\r
Ptr[9] = Ptr[10];\r
Ptr[10] = ':';\r
- \r
+\r
// switch path separators\r
for (Index = 11; Index < Len; Index++) {\r
if (Ptr[Index] == '/') {\r
)\r
{\r
CHAR8 Buffer[256];\r
- \r
+\r
#if (__ARMCC_VERSION < 500000)\r
AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));\r
#else\r
AsciiSPrint (Buffer, sizeof(Buffer), "add-symbol-file %a 0x%08x\n", ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContext->SizeOfHeaders));\r
#endif\r
DeCygwinPathIfNeeded (&Buffer[16]);\r
- \r
+\r
WriteStringToFile (Buffer, AsciiStrSize (Buffer));\r
}\r
\r
/**\r
Performs additional actions just before a PE/COFF image is unloaded. Any resources\r
that were allocated by PeCoffLoaderRelocateImageExtraAction() must be freed.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
- \r
+\r
@param ImageContext Pointer to the image context structure that describes the\r
PE/COFF image that is being unloaded.\r
\r
)\r
{\r
CHAR8 Buffer[256];\r
- \r
+\r
AsciiSPrint (Buffer, sizeof(Buffer), "unload symbols_only \"%a\"\n", ImageContext->PdbPointer);\r
DeCygwinPathIfNeeded (Buffer);\r
- \r
+\r
WriteStringToFile (Buffer, AsciiStrSize (Buffer));\r
}\r
\r
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
#include <Library/SemihostLib.h>\r
\r
//\r
-// Define the maximum debug and assert message length that this library supports \r
+// Define the maximum debug and assert message length that this library supports\r
//\r
#define MAX_DEBUG_MESSAGE_LENGTH 0x100\r
\r
\r
Prints a debug message to the debug output device if the specified error level is enabled.\r
\r
- If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
- the message specified by Format and the associated variable argument list to \r
+ If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print\r
+ the message specified by Format and the associated variable argument list to\r
the debug output device.\r
\r
If Format is NULL, then ASSERT().\r
\r
/**\r
\r
- Prints an assert message containing a filename, line number, and description. \r
+ Prints an assert message containing a filename, line number, and description.\r
This may be followed by a breakpoint or a dead loop.\r
\r
- Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
- CpuDeadLoop() is called. If neither of these bits are set, then this function \r
+ Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r
+ to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of\r
+ PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if\r
+ DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then\r
+ CpuDeadLoop() is called. If neither of these bits are set, then this function\r
returns immediately after the message is printed to the debug output device.\r
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while\r
processing another DebugAssert(), then DebugAssert() must return immediately.\r
\r
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
\r
- This function fills Length bytes of Buffer with the value specified by \r
+ This function fills Length bytes of Buffer with the value specified by\r
PcdDebugClearMemoryValue, and returns Buffer.\r
\r
If Buffer is NULL, then ASSERT().\r
\r
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r
+ If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().\r
\r
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
- @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
+ @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.\r
\r
@return Buffer\r
\r
\r
\r
/**\r
- \r
+\r
Returns TRUE if ASSERT() macros are enabled.\r
\r
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of\r
PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
\r
\r
/**\r
- \r
+\r
Returns TRUE if DEBUG()macros are enabled.\r
\r
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of\r
PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
\r
\r
/**\r
- \r
+\r
Returns TRUE if DEBUG_CODE()macros are enabled.\r
\r
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of\r
PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
\r
\r
/**\r
- \r
+\r
Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r
\r
- This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r
+ This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of\r
PcdDebugProperyMask is set. Otherwise FALSE is returned.\r
\r
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
FILE_GUID = 2A8D3FC4-8DB1-4D27-A3F3-780AF03CF848\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = DebugLib|BASE SEC DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = DebugLib|BASE SEC DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
[Sources.common]\r
Serial I/O Port library functions with no library constructor/destructor\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
while (SourceIndex < NumberOfBytes)\r
{\r
CurrentCharacter = Buffer[SourceIndex++];\r
- \r
+\r
switch (CurrentCharacter)\r
{\r
case '\r':\r
DestinationIndex = 0;\r
}\r
}\r
- \r
+\r
if (DestinationIndex > 0)\r
{\r
PrintBuffer[DestinationIndex] = '\0';\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
#\r
\r
/*\r
Semihosting operation request mechanism\r
- \r
+\r
SVC 0x123456 in ARM state (for all architectures)\r
SVC 0xAB in Thumb state (excluding ARMv7-M)\r
BKPT 0xAB for ARMv7-M (Thumb-2 only)\r
- \r
- R0 - operation type \r
+\r
+ R0 - operation type\r
R1 - block containing all other parametes\r
- \r
- lr - must be saved as svc instruction will cause an svc exception and write \r
+\r
+ lr - must be saved as svc instruction will cause an svc exception and write\r
the svc lr register. That happens to be the one we are using, so we must\r
- save it or we will not be able to return. \r
+ save it or we will not be able to return.\r
*/\r
ASM_PFX(GccSemihostCall):\r
- stmfd sp!, {lr} \r
- svc #0x123456 \r
+ stmfd sp!, {lr}\r
+ svc #0x123456\r
ldmfd sp!, {lr}\r
bx lr\r
\r
{\r
Semihost_SYS_WRITE0(String);\r
}\r
- \r
+\r
UINT32\r
SemihostSystem (\r
IN CHAR8 *CommandLine\r
UINTN CommandLength;\r
} SEMIHOST_SYSTEM_BLOCK;\r
\r
-#if defined(__CC_ARM) \r
+#if defined(__CC_ARM)\r
\r
#if defined(__thumb__)\r
#define SWI 0xAB\r
a buffer.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
VOID *\r
UncachedInternalAllocatePages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages\r
);\r
\r
VOID *\r
UncachedInternalAllocateAlignedPages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages,\r
IN UINTN Alignment\r
);\r
- \r
- \r
+\r
+\r
\r
//\r
// Assume all of memory has the same cache attributes, unless we do our magic\r
)\r
{\r
FREE_PAGE_NODE *NewNode;\r
- \r
+\r
NewNode = AllocatePool (sizeof (LIST_ENTRY));\r
if (NewNode == NULL) {\r
ASSERT (FALSE);\r
return;\r
}\r
- \r
+\r
NewNode->Allocation = Allocation;\r
NewNode->Pages = Pages;\r
- \r
+\r
InsertTailList (&mPageList, &NewNode->Link);\r
}\r
\r
FREE_PAGE_NODE *OldNode;\r
\r
*Pages = 0;\r
- \r
+\r
for (Link = mPageList.ForwardLink; Link != &mPageList; Link = Link->ForwardLink) {\r
OldNode = BASE_CR (Link, FREE_PAGE_NODE, Link);\r
if (OldNode->Allocation == Allocation) {\r
*Pages = OldNode->Pages;\r
- \r
+\r
RemoveEntryList (&OldNode->Link);\r
FreePool (OldNode);\r
return;\r
\r
VOID *\r
UncachedInternalAllocatePages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages\r
)\r
{\r
\r
VOID *\r
UncachedInternalAllocateAlignedPages (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN Pages,\r
IN UINTN Alignment\r
)\r
// Alignment must be a power of two or zero.\r
//\r
ASSERT ((Alignment & (Alignment - 1)) == 0);\r
- \r
+\r
if (Pages == 0) {\r
return NULL;\r
}\r
// Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.\r
//\r
ASSERT (RealPages > Pages);\r
- \r
+\r
Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, RealPages, &Memory);\r
if (EFI_ERROR (Status)) {\r
return NULL;\r
}\r
AlignedMemory = (UINTN) Memory;\r
}\r
- \r
+\r
Status = gDS->GetMemorySpaceDescriptor (Memory, &Descriptor);\r
if (!EFI_ERROR (Status)) {\r
// We are making an assumption that all of memory has the same default attributes\r
gAttributes = Descriptor.Attributes;\r
}\r
- \r
+\r
Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), EFI_MEMORY_WC);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
return (VOID *)(UINTN)Memory;\r
}\r
\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_PHYSICAL_ADDRESS Memory; \r
+ EFI_PHYSICAL_ADDRESS Memory;\r
\r
ASSERT (Pages != 0);\r
- \r
+\r
Memory = (EFI_PHYSICAL_ADDRESS) (UINTN) Buffer;\r
Status = gDS->SetMemorySpaceAttributes (Memory, EFI_PAGES_TO_SIZE (Pages), gAttributes);\r
- \r
+\r
Status = gBS->FreePages (Memory, Pages);\r
ASSERT_EFI_ERROR (Status);\r
}\r
)\r
{\r
VOID *AlignedAddress;\r
- \r
+\r
//\r
// Alignment must be a power of two or zero.\r
//\r
if (Alignment < EFI_PAGE_SIZE) {\r
Alignment = EFI_PAGE_SIZE;\r
}\r
- \r
+\r
AlignedAddress = UncachedInternalAllocateAlignedPages (PoolType, EFI_SIZE_TO_PAGES (AllocationSize), Alignment);\r
if (AlignedAddress == NULL) {\r
return NULL;\r
)\r
{\r
VOID *Memory;\r
- \r
+\r
ASSERT (Buffer != NULL);\r
ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));\r
\r
)\r
{\r
UINTN Pages;\r
- \r
+\r
RemovePagesFromList (Allocation, &Pages);\r
\r
UncachedFreePages (Allocation, Pages);\r
\r
VOID *\r
UncachedInternalAllocatePool (\r
- IN EFI_MEMORY_TYPE MemoryType, \r
+ IN EFI_MEMORY_TYPE MemoryType,\r
IN UINTN AllocationSize\r
)\r
{\r
\r
VOID *\r
UncachedInternalAllocateZeroPool (\r
- IN EFI_MEMORY_TYPE PoolType, \r
+ IN EFI_MEMORY_TYPE PoolType,\r
IN UINTN AllocationSize\r
- ) \r
+ )\r
{\r
VOID *Memory;\r
\r
\r
VOID *\r
UncachedInternalAllocateCopyPool (\r
- IN EFI_MEMORY_TYPE PoolType, \r
+ IN EFI_MEMORY_TYPE PoolType,\r
IN UINTN AllocationSize,\r
IN CONST VOID *Buffer\r
- ) \r
+ )\r
{\r
VOID *Memory;\r
\r
Memory = CopyMem (Memory, Buffer, AllocationSize);\r
}\r
return Memory;\r
-} \r
+}\r
\r
VOID *\r
EFIAPI\r
################################################################################\r
[Defines]\r
PLATFORM_NAME = ArmPlatform\r
- PLATFORM_GUID = 4fe82b83-9315-4ff3-8cc0-ab77ca93cb7f \r
+ PLATFORM_GUID = 4fe82b83-9315-4ff3-8cc0-ab77ca93cb7f\r
PLATFORM_VERSION = 0.1\r
DSC_SPECIFICATION = 0x00010005\r
OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)\r
# UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf\r
!endif\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf \r
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
\r
# Assume everything is fixed at build\r
#\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
- \r
+\r
# 1/123 faster than Stm or Vstm version\r
#BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf\r
EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf\r
\r
#\r
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window \r
+ # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window\r
# in the debugger will show load and unload commands for symbols. You can cut and paste this\r
# into the command window to load symbols. We should be able to use a script to do this, but\r
# the version of RVD I have does not support scripts accessing system memory.\r
#PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf\r
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf\r
#PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
- \r
+\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf\r
\r
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf \r
+ SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf\r
\r
# BDS Libraries\r
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf\r
[LibraryClasses.common.SEC]\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.inf\r
\r
- ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf \r
+ ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf\r
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf\r
- \r
+\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf\r
LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
- \r
+\r
#\r
# Control what commands are supported from the UI\r
# Turn these on and off to add features or save size\r
- # \r
+ #\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE\r
\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE\r
- \r
+\r
# Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress\r
gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE\r
- \r
+\r
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE\r
\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Platform"\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmPlatform"\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
#\r
# Optional feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
- # Values are in EFI Pages (4K). DXE Core will make sure that \r
- # at least this much of each type of memory can be allocated \r
+ # Values are in EFI Pages (4K). DXE Core will make sure that\r
+ # at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|20000\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000000000000\r
- \r
+\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0\r
\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf\r
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf \r
- \r
+ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
+\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
- \r
+\r
# Simple TextIn/TextOut for UEFI Terminal\r
EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf\r
- \r
+\r
#\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
#\r
# Application\r
- # \r
+ #\r
EmbeddedPkg/Ebl/Ebl.inf\r
\r
#\r
#\r
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
ArmPlatformPkg/Bds/Bds.inf\r
- \r
+\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
\r
# Simple TextIn/TextOut for UEFI Terminal\r
INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem (Required the Hardware Debugger to be connected)\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
INF FatBinPkg/EnhancedFatDxe/Fat.inf\r
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
+ #\r
+ # UEFI application (Shell Embedded Boot Loader)\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
INF EmbeddedPkg/Ebl/Ebl.inf\r
- \r
+\r
#\r
# Bds\r
#\r
READ_LOCK_STATUS = TRUE\r
\r
INF ArmPlatformPkg/PrePi/PeiUniCore.inf\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
#/** @file\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
[Defines]\r
DEC_SPECIFICATION = 0x00010005\r
PACKAGE_NAME = ArmPlatformPkg\r
- PACKAGE_GUID = 3308e0a0-1d94-11e0-915c-0002a5d5c51b \r
+ PACKAGE_GUID = 3308e0a0-1d94-11e0-915c-0002a5d5c51b\r
PACKAGE_VERSION = 0.1\r
\r
################################################################################\r
[PcdsFeatureFlag.common]\r
# Set this PCD to TRUE to map NORFlash at 0x0. FALSE means the DRAM is mapped at 0x0.\r
gArmPlatformTokenSpaceGuid.PcdNorFlashRemapping|FALSE|BOOLEAN|0x00000012\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdStandalone|TRUE|BOOLEAN|0x00000001\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|FALSE|BOOLEAN|0x00000002\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|FALSE|BOOLEAN|0x00000004\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdCoreCount|1|UINT32|0x00000039\r
gArmPlatformTokenSpaceGuid.PcdClusterCount|1|UINT32|0x00000038\r
- \r
+\r
# Stack for CPU Cores in Secure Mode\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0|UINT32|0x00000005\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x10000|UINT32|0x00000036\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0|UINT32|0x00000009\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x10000|UINT32|0x00000037\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize|0x1000|UINT32|0x0000000A\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 128MB by default)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x08000000|UINT32|0x00000015\r
\r
# = sizeof(UINTN) /* PcdPeiServicePtr or HobListPtr */\r
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize|0x4|UINT32|0x00000016\r
# PeiServicePtr and HobListPtr shares the same location in the PEI Global Variable list\r
- # PeiServicePtr is only valid with PEI Core and HobListPtr only when the PEI Core is skipped. \r
+ # PeiServicePtr is only valid with PEI Core and HobListPtr only when the PEI Core is skipped.\r
gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset|0x0|UINT32|0x00000017\r
gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset|0x0|UINT32|0x00000018\r
\r
\r
## PL061 GPIO\r
gArmPlatformTokenSpaceGuid.PcdPL061GpioBase|0x0|UINT32|0x00000025\r
- \r
+\r
## PL111 Lcd & HdLcd\r
gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x0|UINT32|0x00000026\r
gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x0|UINT32|0x00000027\r
- \r
+\r
## PL180 MCI\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x00000000|UINT32|0x00000028\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x00000000|UINT32|0x00000029\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L""|VOID*|0x0000000D\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootInitrdPath|L""|VOID*|0x0000000E\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L""|VOID*|0x000000F\r
- # PcdDefaultBootType define the type of the binary pointed by PcdDefaultBootDevicePath: \r
+ # PcdDefaultBootType define the type of the binary pointed by PcdDefaultBootDevicePath:\r
# - 0 = an EFI application\r
# - 1 = a Linux kernel with ATAG support\r
# - 2 = a Linux kernel with FDT support\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0|UINT32|0x00000010\r
gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L""|VOID*|0x00000011\r
- \r
+\r
## Timeout value for displaying progressing bar in before boot OS.\r
# According to UEFI 2.0 spec, the default TimeOut should be 0xffff.\r
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|0xffff|UINT16|0x0000001A\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L""|VOID*|0x0000001B\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L""|VOID*|0x0000001C\r
\r
################################################################################\r
[Defines]\r
PLATFORM_NAME = ArmPlatform\r
- PLATFORM_GUID = 4fe82b83-9315-4ff3-8cc0-ab77ca93cb7f \r
+ PLATFORM_GUID = 4fe82b83-9315-4ff3-8cc0-ab77ca93cb7f\r
PLATFORM_VERSION = 0.1\r
DSC_SPECIFICATION = 0x00010005\r
OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME)\r
# UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf\r
!endif\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf \r
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
\r
# Assume everything is fixed at build\r
#\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
- \r
+\r
# 1/123 faster than Stm or Vstm version\r
#BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf\r
EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf\r
\r
#\r
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window \r
+ # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window\r
# in the debugger will show load and unload commands for symbols. You can cut and paste this\r
# into the command window to load symbols. We should be able to use a script to do this, but\r
# the version of RVD I have does not support scripts accessing system memory.\r
#PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf\r
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf\r
#PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
- \r
+\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf\r
\r
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf \r
+ SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf\r
\r
# BDS Libraries\r
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf\r
\r
ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf\r
- \r
+\r
DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf\r
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf\r
\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
- \r
+\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf\r
PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
- \r
+\r
[LibraryClasses.common.PEIM]\r
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
- \r
+\r
#\r
# Control what commands are supported from the UI\r
# Turn these on and off to add features or save size\r
- # \r
+ #\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE\r
\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE\r
- \r
+\r
# Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress\r
gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE\r
- \r
+\r
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE\r
\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Platform"\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmPlatform"\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
#\r
# Optional feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
- # Values are in EFI Pages (4K). DXE Core will make sure that \r
- # at least this much of each type of memory can be allocated \r
+ # Values are in EFI Pages (4K). DXE Core will make sure that\r
+ # at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|20000\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000000000000\r
- \r
+\r
# Stacks for MPCores in Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0\r
# Stacks for MPCores in Monitor Mode\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf\r
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf \r
- \r
+ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
+\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
- \r
+\r
# Simple TextIn/TextOut for UEFI Terminal\r
EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
#\r
# Application\r
- # \r
+ #\r
EmbeddedPkg/Ebl/Ebl.inf\r
\r
#\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
\r
# Simple TextIn/TextOut for UEFI Terminal\r
INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem (Required the Hardware Debugger to be connected)\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
INF FatBinPkg/EnhancedFatDxe/Fat.inf\r
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
+ #\r
+ # UEFI application (Shell Embedded Boot Loader)\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
INF EmbeddedPkg/Ebl/Ebl.inf\r
- \r
+\r
#\r
# Bds\r
#\r
INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA8Lib/ArmCortexA8Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLib.inf\r
- \r
+\r
[LibraryClasses.common.SEC]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf\r
ArmPlatformSecLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSecLib.inf\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
- \r
+\r
# Install Debugger Exception Handlers.\r
gArmTokenSpaceGuid.PcdDebuggerExceptionSupport|TRUE\r
\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM RealView Emulation Board"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmRealViewEb-A8"\r
- \r
+\r
#\r
# NV Storage PCDs. Use base of 0x43F00000 for NOR0\r
#\r
# Stack for CPU Cores in Non Secure Mode\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x48000000\r
\r
- # System Memory (256MB) \r
+ # System Memory (256MB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x70000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x10000000\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 64MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCells\r
#\r
- \r
+\r
## SP804 Timer\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|1000000\r
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 # expressed in 100ns units, 100,000 x 100 ns = 10,000,000 ns = 10 ms\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicInterruptNum|36\r
- gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicBase|0x10011000 \r
+ gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicBase|0x10011000\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerMetronomeBase|0x10011020\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerPerformanceBase|0x10012020\r
- \r
+\r
## PL031 RealTimeClock\r
gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x10017000\r
- \r
+\r
## PL111 Lcd\r
gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x10020000\r
- \r
+\r
#\r
# ARM PL011 - Serial Terminal\r
#\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x10009000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf \r
- \r
+ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
+\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
\r
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
- \r
+\r
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
#\r
# Bds\r
#\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLib.inf\r
- \r
+\r
[LibraryClasses.common.SEC]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf\r
ArmPlatformSecLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbSecLibRTSM/ArmRealViewEbSecLib.inf\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmRealViewEb-A9x2"\r
\r
gArmPlatformTokenSpaceGuid.PcdCoreCount|2\r
- \r
+\r
#\r
# NV Storage PCDs. Use base of 0x43F00000 for NOR0\r
#\r
# Stacks for MPCores in Normal World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x48000000\r
\r
- # System Memory (256MB) \r
+ # System Memory (256MB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x70000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x10000000\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 64MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCells\r
#\r
- \r
+\r
## SP804 Timer\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|1000000\r
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 # expressed in 100ns units, 100,000 x 100 ns = 10,000,000 ns = 10 ms\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicInterruptNum|33\r
- gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicBase|0x10011000 \r
+ gArmPlatformTokenSpaceGuid.PcdSP804TimerPeriodicBase|0x10011000\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerMetronomeBase|0x10011020\r
gArmPlatformTokenSpaceGuid.PcdSP804TimerPerformanceBase|0x10012020\r
- \r
+\r
## PL031 RealTimeClock\r
gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x10017000\r
- \r
+\r
## PL111 Lcd\r
gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x10020000\r
- \r
+\r
#\r
# ARM PL011 - Serial Terminal\r
#\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x10009000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
# ARM L2x0 PCDs\r
#\r
gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x1F002000\r
- \r
+\r
################################################################################\r
#\r
# Components Section - list of all EDK II Modules needed by this Platform\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf \r
- \r
+ EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
+\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
\r
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
- \r
+\r
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf\r
MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
#\r
# Bds\r
#\r
# FLASH layout file for ARM RealView EB.\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
- \r
+\r
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
- \r
+\r
INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
\r
#\r
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
\r
#\r
# Bds\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
- \r
+\r
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
- \r
+\r
INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf\r
\r
#\r
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
\r
#\r
# Bds\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf \r
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
\r
EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf\r
\r
#\r
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window \r
+ # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window\r
# in the debugger will show load and unload commands for symbols. You can cut and paste this\r
# into the command window to load symbols. We should be able to use a script to do this, but\r
# the version of RVD I have does not support scripts accessing system memory.\r
#PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf\r
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf\r
#PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
- \r
+\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf\r
#DebugAgentTimerLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
\r
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf \r
+ SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf\r
\r
GdbSerialLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/GdbSerialLib/GdbSerialLib.inf\r
\r
\r
DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf\r
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf\r
- # Uncomment to turn on GDB stub in SEC. \r
+ # Uncomment to turn on GDB stub in SEC.\r
#DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
- \r
+\r
!ifdef $(EDK2_SKIP_PEICORE)\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE\r
- \r
+\r
# Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress\r
gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE\r
\r
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F\r
\r
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
#\r
# Optional feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
- # Values are in EFI Pages (4K). DXE Core will make sure that \r
- # at least this much of each type of memory can be allocated \r
+ # Values are in EFI Pages (4K). DXE Core will make sure that\r
+ # at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage-RTSM"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1\r
- \r
+\r
# Use the Serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"\r
Include # Root include for the package\r
\r
[Guids.common]\r
- gArmRealViewEbPkgTokenSpaceGuid = { 0x44577A0D, 0x361A, 0x45B2, { 0xb3, 0x3d, 0xbb, 0x9e, 0xe6, 0x0d, 0x5a, 0x4f} } \r
+ gArmRealViewEbPkgTokenSpaceGuid = { 0x44577A0D, 0x361A, 0x45B2, { 0xb3, 0x3d, 0xbb, 0x9e, 0xe6, 0x0d, 0x5a, 0x4f} }\r
\r
[PcdsFixedAtBuild.common]\r
gArmRealViewEbPkgTokenSpaceGuid.PcdGdbUartBase|0|UINT32|0x00000001\r
define /r GetWord(Addr)\r
{\r
unsigned long data;\r
- \r
+\r
if( (Addr & 0x2) == 0 )\r
{\r
data = dword(Addr);\r
$printf "debug type is %x",debugtype$;\r
return;\r
}\r
- \r
+\r
debugrva = dword(imgstart + debugdirentryrva + 0x14);\r
dwarfsig = dword(imgstart + debugrva);\r
if(dwarfsig != 0x66727764)\r
\r
baseofcode = imgstart + dword(filehdrstart + 0x28);\r
baseofdata = imgstart + dword(filehdrstart + 0x2c);\r
- \r
+\r
if( (baseofcode < baseofdata) && (baseofcode != 0) )\r
{\r
elfbase = baseofcode;\r
$printf "debug type is %x",debugtype$;\r
return;\r
}\r
- \r
+\r
debugrva = dword(imgstart + debugdirentryrva + 0x14);\r
debugrva = debugrva - strippedsize;\r
dwarfsig = dword(imgstart + debugrva);\r
$printf "found %x", dwarfsig$;\r
return;\r
}\r
- \r
+\r
if( dwarfsig == 0x66727764 )\r
{\r
elfpath = (char *)(imgstart + debugrva + 0xc);\r
- $printf "looking for elf path at 0x%x", elfpath$; \r
+ $printf "looking for elf path at 0x%x", elfpath$;\r
}\r
- else \r
+ else\r
{\r
elfpath = (char *)(imgstart + debugrva + 0x10);\r
- $printf "looking for elf path at 0x%x", elfpath$; \r
+ $printf "looking for elf path at 0x%x", elfpath$;\r
}\r
\r
// elf base is baseofcode (we hope that for TE images it's not baseofdata)\r
}\r
else if(sectiontype == 0x12) // TE\r
{\r
- ProcessTE(secstart+0x4); \r
+ ProcessTE(secstart+0x4);\r
}\r
}\r
.\r
$fopen 50, 'C:\loadfiles.inc'$;\r
\r
fvlen = dword(fvbase + 0x20);\r
- \r
+\r
// first ffs file is after fv header, use headerlength field\r
//ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) >> 16;\r
ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) / 0x10000;\r
while(ffsoffset < (fvbase+fvlen))\r
{\r
// process ffs file and increment by ffs file size field\r
- ProcessFfsFile(ffsoffset); \r
+ ProcessFfsFile(ffsoffset);\r
ffsfilesize = (dword(ffsoffset + 0x14) & 0x00ffffff);\r
if(ffsfilesize == 0)\r
{\r
break;\r
}\r
ffsoffset = ffsoffset + ffsfilesize;\r
- \r
+\r
\r
// align to next 8 byte boundary\r
if( (ffsoffset & 0x7) != 0 )\r
{\r
ffsoffset = ffsoffset + (0x8 - (ffsoffset & 0x7));\r
}\r
- \r
+\r
} // end fv ffs loop\r
\r
$vclose 50$;\r
unsigned long TopOfRam;\r
{\r
unsigned long offset;\r
- \r
+\r
$printf "FindSystemTable"$;\r
$printf "top of mem is %x",TopOfRam$;\r
- \r
+\r
offset = TopOfRam;\r
- \r
+\r
// align to highest 4MB boundary\r
offset = offset & 0xFFC00000;\r
- \r
+\r
// start at top and look on 4MB boundaries for system table ptr structure\r
while(offset > 0)\r
{\r
//$printf "checking %x",offset$;\r
//$printf "value is %x",dword(offset)$;\r
- \r
+\r
// low signature match\r
if(dword(offset) == 0x20494249)\r
{\r
}\r
}\r
}\r
- \r
+\r
}\r
- \r
+\r
if(offset < 0x400000) break;\r
- offset = offset - 0x400000; \r
+ offset = offset - 0x400000;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
unsigned long dbgptr;\r
unsigned long dbginfo;\r
unsigned long loadedimg;\r
- \r
+\r
$printf "FindDebugInfo"$;\r
- \r
+\r
dbgentries = 0;\r
CfgTableEntries = dword(SystemTable + 0x40);\r
ConfigTable = dword(SystemTable + 0x44);\r
- \r
+\r
$printf "config table is at %x (%d entries)", ConfigTable, CfgTableEntries$;\r
- \r
+\r
// now search for debug info entry with guid 49152E77-1ADA-4764-B7A2-7AFEFED95E8B\r
// 0x49152E77 0x47641ADA 0xFE7AA2B7 0x8B5ED9FE\r
for(i=0; i<CfgTableEntries; i++)\r
}\r
}\r
}\r
- \r
+\r
if(dbgentries == 0)\r
{\r
$printf "no debug entries found"$;\r
return;\r
}\r
- \r
+\r
$printf "debug table at %x (%d entries)", dbgptr, dbgentries$;\r
- \r
+\r
for(i=0; i<dbgentries; i++)\r
{\r
dbginfo = dword(dbgptr + (i*4));\r
{\r
unsigned long maxmem;\r
unsigned long systbl;\r
- \r
+\r
$printf "LoadDxe"$;\r
- \r
+\r
$fopen 50, 'C:\loadfiles.inc'$;\r
- \r
+\r
maxmem = GetMaxMem();\r
systbl = FindSystemTable(maxmem);\r
if(systbl != 0)\r
$printf "found system table at %x",systbl$;\r
FindDebugInfo(systbl);\r
}\r
- \r
+\r
$vclose 50$;\r
}\r
.\r
unsigned long RuntimeDebugInfo;\r
unsigned long DebugInfoOffset;\r
unsigned long imgbase;\r
- \r
+\r
$printf "LoadRuntimeDxe"$;\r
- \r
+\r
$fopen 50, 'C:\loadfiles.inc'$;\r
- \r
+\r
RuntimeDebugInfo = 0x80000010;\r
- \r
+\r
if(RuntimeDebugInfo != 0)\r
{\r
numentries = dword(RuntimeDebugInfo);\r
- \r
+\r
$printf "runtime debug info is at %x (%d entries)", RuntimeDebugInfo, numentries$;\r
- \r
+\r
DebugInfoOffset = RuntimeDebugInfo + 0x4;\r
for(i=0; i<numentries; i++)\r
{\r
DebugInfoOffset = DebugInfoOffset + 0x4;\r
}\r
}\r
- \r
+\r
$vclose 50$;\r
}\r
.\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
unsigned long mem_size;\r
{\r
unsigned char *mem_ptr;\r
- \r
+\r
mem_ptr = mem_start + mem_size;\r
- \r
+\r
do\r
{\r
mem_ptr -= 0x400000; // 4 MB\r
- \r
+\r
if (strncmp(mem_ptr, "IBI SYST", 8) == 0)\r
{\r
return *(unsigned long *)(mem_ptr + 8); // EfiSystemTableBase\r
- } \r
- \r
+ }\r
+\r
} while (mem_ptr > mem_start);\r
- \r
+\r
return 0;\r
}\r
.\r
unsigned char *configuration_table;\r
unsigned long index;\r
unsigned char debug_table_guid[16];\r
- \r
+\r
// Fill in the debug table's guid\r
debug_table_guid[ 0] = 0x77;\r
debug_table_guid[ 1] = 0x2E;\r
debug_table_guid[13] = 0xD9;\r
debug_table_guid[14] = 0x5E;\r
debug_table_guid[15] = 0x8B;\r
- \r
+\r
configuration_table_entries = *(unsigned long *)(system_table + 64);\r
configuration_table = *(unsigned long *)(system_table + 68);\r
- \r
+\r
for (index = 0; index < configuration_table_entries; index++)\r
{\r
if (compare_guid(configuration_table, debug_table_guid) == 0)\r
{\r
return *(unsigned long *)(configuration_table + 16);\r
}\r
- \r
+\r
configuration_table += 20;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
{\r
return 1;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
unsigned char *header;\r
{\r
unsigned long *size;\r
- \r
+\r
size = header + 0x00AC;\r
- \r
+\r
return *size;\r
}\r
.\r
{\r
unsigned long *debugOffset;\r
unsigned char *stringOffset;\r
- \r
+\r
if (valid_pe_header(header))\r
{\r
debugOffset = header + 0x0128;\r
stringOffset = header + *debugOffset + 0x002C;\r
- \r
+\r
return stringOffset;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
define /R write_symbols_file(filename, mem_start, mem_size)\r
unsigned char *filename;\r
unsigned char *mem_start;\r
- unsigned long mem_size; \r
+ unsigned long mem_size;\r
{\r
unsigned char *system_table;\r
unsigned char *debug_info_table_header;\r
unsigned char *debug_filename;\r
unsigned long header_size;\r
int status;\r
- \r
+\r
system_table = find_system_table(mem_start, mem_size);\r
if (system_table == 0)\r
{\r
return;\r
}\r
- \r
+\r
status = fopen(88, filename, "w");\r
- \r
+\r
debug_info_table_header = find_debug_info_table_header(system_table);\r
- \r
+\r
debug_info_table = *(unsigned long *)(debug_info_table_header + 8);\r
debug_info_table_size = *(unsigned long *)(debug_info_table_header + 4);\r
- \r
+\r
for (index = 0; index < (debug_info_table_size * 4); index += 4)\r
{\r
- debug_image_info = *(unsigned long *)(debug_info_table + index); \r
- \r
+ debug_image_info = *(unsigned long *)(debug_info_table + index);\r
+\r
if (debug_image_info == 0)\r
{\r
break;\r
}\r
- \r
+\r
loaded_image_protocol = *(unsigned long *)(debug_image_info + 4);\r
- \r
+\r
image_base = *(unsigned long *)(loaded_image_protocol + 32);\r
- \r
+\r
debug_filename = pe_filename(image_base);\r
header_size = pe_headersize(image_base);\r
- \r
+\r
$fprintf 88, "%s 0x%08x\n", debug_filename, image_base + header_size$;\r
}\r
- \r
- \r
+\r
+\r
fclose(88);\r
}\r
.\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
/*++\r
RealView EB FVB DXE Driver\r
\r
-Copyright (c) 2010, Apple Inc. All rights reserved.<BR> \r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
\r
--*/\r
/**\r
The SetAttributes() function sets configurable firmware volume\r
attributes and returns the new settings of the firmware volume.\r
- \r
+\r
\r
@param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
\r
settings of the firmware volume. Type\r
EFI_FVB_ATTRIBUTES_2 is defined in\r
EFI_FIRMWARE_VOLUME_HEADER.\r
- \r
+\r
@retval EFI_SUCCESS The firmware volume attributes were returned.\r
\r
@retval EFI_INVALID_PARAMETER The attributes requested are in\r
only for memory-mapped firmware volumes.\r
\r
@param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
- \r
+\r
@param Address Pointer to a caller-allocated\r
EFI_PHYSICAL_ADDRESS that, on successful\r
return from GetPhysicalAddress(), contains the\r
base address of the firmware volume.\r
- \r
+\r
@retval EFI_SUCCESS The firmware volume base address was returned.\r
- \r
+\r
@retval EFI_NOT_SUPPORTED The firmware volume is not memory mapped.\r
\r
**/\r
blocks in this range have a size of\r
BlockSize.\r
\r
- \r
+\r
@retval EFI_SUCCESS The firmware volume base address was returned.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER The requested LBA is out of range.\r
\r
**/\r
aware that a read may be partially completed.\r
\r
@param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
- \r
+\r
@param Lba The starting logical block index\r
from which to read.\r
\r
\r
@retval EFI_SUCCESS The firmware volume was read successfully,\r
and contents are in Buffer.\r
- \r
+\r
@retval EFI_BAD_BUFFER_SIZE Read attempted across an LBA\r
boundary. On output, NumBytes\r
contains the total number of bytes\r
returned in Buffer.\r
- \r
+\r
@retval EFI_ACCESS_DENIED The firmware volume is in the\r
ReadDisabled state.\r
- \r
+\r
@retval EFI_DEVICE_ERROR The block device is not\r
functioning correctly and could\r
not be read.\r
unpredictability arises because, for a sticky-write firmware\r
volume, a write may negate a bit in the EFI_FVB_ERASE_POLARITY\r
state but cannot flip it back again. Before calling the\r
- Write() function, it is recommended for the caller to first call \r
+ Write() function, it is recommended for the caller to first call\r
the EraseBlocks() function to erase the specified block to\r
write. A block erase cycle will transition bits from the\r
(NOT)EFI_FVB_ERASE_POLARITY state back to the\r
returns.\r
\r
@param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.\r
- \r
+\r
@param Lba The starting logical block index to write to.\r
- \r
+\r
@param Offset Offset into the block at which to begin writing.\r
- \r
+\r
@param NumBytes The pointer to a UINTN. At entry, *NumBytes\r
contains the total size of the buffer. At\r
exit, *NumBytes contains the total number of\r
bytes actually written.\r
- \r
+\r
@param Buffer The pointer to a caller-allocated buffer that\r
contains the source for the write.\r
- \r
+\r
@retval EFI_SUCCESS The firmware volume was written successfully.\r
- \r
+\r
@retval EFI_BAD_BUFFER_SIZE The write was attempted across an\r
LBA boundary. On output, NumBytes\r
contains the total number of bytes\r
actually written.\r
- \r
+\r
@retval EFI_ACCESS_DENIED The firmware volume is in the\r
WriteDisabled state.\r
- \r
+\r
@retval EFI_DEVICE_ERROR The block device is malfunctioning\r
and could not be written.\r
\r
\r
@retval EFI_SUCCESS The erase request successfully\r
completed.\r
- \r
+\r
@retval EFI_ACCESS_DENIED The firmware volume is in the\r
WriteDisabled state.\r
@retval EFI_DEVICE_ERROR The block device is not functioning\r
partially erased.\r
@retval EFI_INVALID_PARAMETER One or more of the LBAs listed\r
in the variable argument list do\r
- not exist in the firmware volume. \r
+ not exist in the firmware volume.\r
\r
**/\r
EFI_STATUS\r
FvbEraseBlocks,\r
///\r
/// The handle of the parent firmware volume.\r
- /// \r
+ ///\r
NULL\r
};\r
\r
{\r
EFI_STATUS Status;\r
\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&gFvbHandle,\r
&gEfiFirmwareVolumeBlockProtocolGuid, &gFvbProtocol,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
// SetVertAddressEvent ()\r
- \r
+\r
// GCD Map NAND as RT\r
- \r
+\r
return Status;\r
}\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
IoLib\r
\r
[Guids]\r
- \r
+\r
\r
[Protocols]\r
gEfiFirmwareVolumeBlockProtocolGuid\r
* Header defining RealView EB constants (Base addresses, sizes, flags)\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
\r
#define SYS_CFG_RTC VIRTUAL_SYS_CFG(ARM_EB_UNSUPPORTED,1)\r
\r
-#endif \r
+#endif\r
/*++\r
\r
Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>\r
-Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR> \r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
#define EB_GIC5_DIST_BASE 0x10071000\r
\r
// number of interrupts sources supported by each GIC on the EB\r
-#define EB_NUM_GIC_INTERRUPTS 96 \r
+#define EB_NUM_GIC_INTERRUPTS 96\r
\r
// number of 32-bit registers needed to represent those interrupts as a bit\r
// (used for enable set, enable clear, pending set, pending clear, and active regs)\r
if (Source > EB_NUM_GIC_INTERRUPTS) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
- } \r
- \r
+ }\r
+\r
if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
{\r
UINT32 RegOffset;\r
UINTN RegShift;\r
- \r
+\r
if (Source > EB_NUM_GIC_INTERRUPTS) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
// calculate enable register offset and bit position\r
RegOffset = Source / 32;\r
RegShift = Source % 32;\r
\r
// write set-enable register\r
MmioWrite32 (EB_GIC1_DIST_BASE+GIC_ICDISER+(4*RegOffset), 1 << RegShift);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
{\r
UINT32 RegOffset;\r
UINTN RegShift;\r
- \r
+\r
if (Source > EB_NUM_GIC_INTERRUPTS) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
// calculate enable register offset and bit position\r
RegOffset = Source / 32;\r
RegShift = Source % 32;\r
\r
// write set-enable register\r
MmioWrite32 (EB_GIC1_DIST_BASE+GIC_ICDICER+(4*RegOffset), 1 << RegShift);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
{\r
UINT32 RegOffset;\r
UINTN RegShift;\r
- \r
+\r
if (Source > EB_NUM_GIC_INTERRUPTS) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
// calculate enable register offset and bit position\r
RegOffset = Source / 32;\r
RegShift = Source % 32;\r
- \r
+\r
if ((MmioRead32 (EB_GIC1_DIST_BASE+GIC_ICDISER+(4*RegOffset)) & (1<<RegShift)) == 0) {\r
*InterruptState = FALSE;\r
} else {\r
*InterruptState = TRUE;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Signal to the hardware that the End Of Intrrupt state \r
+ Signal to the hardware that the End Of Intrrupt state\r
has been reached.\r
\r
@param This Instance pointer for this protocol\r
if (GicInterrupt >= EB_NUM_GIC_INTERRUPTS) {\r
MmioWrite32 (EB_GIC1_CPU_INTF_BASE+GIC_ICCEIOR, GicInterrupt);\r
}\r
- \r
+\r
InterruptHandler = gRegisteredInterruptHandlers[GicInterrupt];\r
if (InterruptHandler != NULL) {\r
// Call the registered interrupt handler.\r
\r
/**\r
Shutdown our hardware\r
- \r
+\r
DXE Core will disable interrupts and turn off the timer and disable interrupts\r
after all the event handlers have run.\r
\r
)\r
{\r
UINTN i;\r
- \r
+\r
for (i = 0; i < EB_NUM_GIC_INTERRUPTS; i++) {\r
DisableInterruptSource (&gHardwareInterruptProtocol, i);\r
}\r
{\r
EFI_STATUS Status;\r
EFI_CPU_ARCH_PROTOCOL *Cpu;\r
- \r
+\r
//\r
// Get the cpu protocol that this driver requires.\r
//\r
UINT32 RegOffset;\r
UINTN RegShift;\r
\r
- \r
+\r
// Make sure the Interrupt Controller Protocol is not already installed in the system.\r
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);\r
\r
for (i = 0; i < EB_NUM_GIC_INTERRUPTS; i++) {\r
DisableInterruptSource (&gHardwareInterruptProtocol, i);\r
- \r
- // Set Priority \r
+\r
+ // Set Priority\r
RegOffset = i / 4;\r
RegShift = (i % 4) * 8;\r
MmioAndThenOr32 (\r
- EB_GIC1_DIST_BASE+GIC_ICDIPR+(4*RegOffset), \r
- ~(0xff << RegShift), \r
+ EB_GIC1_DIST_BASE+GIC_ICDIPR+(4*RegOffset),\r
+ ~(0xff << RegShift),\r
GIC_DEFAULT_PRIORITY << RegShift\r
);\r
}\r
\r
// set priority mask reg to 0xff to allow all priorities through\r
MmioWrite32 (EB_GIC1_CPU_INTF_BASE + GIC_ICCPMR, 0xff);\r
- \r
+\r
// enable gic cpu interface\r
MmioWrite32 (EB_GIC1_CPU_INTF_BASE + GIC_ICCICR, 0x1);\r
\r
// enable gic distributor\r
MmioWrite32 (EB_GIC1_DIST_BASE + GIC_ICCICR, 0x1);\r
\r
- \r
+\r
ZeroMem (&gRegisteredInterruptHandlers, sizeof (gRegisteredInterruptHandlers));\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&gHardwareInterruptHandle,\r
&gHardwareInterruptProtocolGuid, &gHardwareInterruptProtocol,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
// Set up to be notified when the Cpu protocol is installed.\r
- Status = gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, CpuProtocolInstalledNotification, NULL, &CpuProtocolNotificationEvent); \r
+ Status = gBS->CreateEvent (EVT_NOTIFY_SIGNAL, TPL_CALLBACK, CpuProtocolInstalledNotification, NULL, &CpuProtocolNotificationEvent);\r
ASSERT_EFI_ERROR (Status);\r
\r
Status = gBS->RegisterProtocolNotify (&gEfiCpuArchProtocolGuid, CpuProtocolNotificationEvent, (VOID *)&CpuProtocolNotificationToken);\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
IoLib\r
\r
[Guids]\r
- \r
+\r
\r
[Protocols]\r
gHardwareInterruptProtocolGuid\r
gEfiCpuArchProtocolGuid\r
- \r
+\r
[FixedPcd.common]\r
gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#include <AsmMacroIoLib.h>\r
#include <Library/ArmLib.h>\r
\r
-.text \r
+.text\r
.align 2\r
\r
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
\r
IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
- \r
+\r
AREA ArmRealViewEbHelper, CODE, READONLY\r
\r
//UINTN\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
- Template for ArmEb DebugAgentLib. \r
+ Template for ArmEb DebugAgentLib.\r
\r
- For ARM we reserve FIQ for the Debug Agent Timer. We don't care about \r
- laytency as we only really need the timer to run a few times a second \r
+ For ARM we reserve FIQ for the Debug Agent Timer. We don't care about\r
+ laytency as we only really need the timer to run a few times a second\r
(how fast can some one type a ctrl-c?), but it works much better if\r
the interrupt we are using to break into the debugger is not being\r
- used, and masked, by the system. \r
+ used, and masked, by the system.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/**\r
Setup all the hardware needed for the debug agents timer.\r
\r
- This function is used to set up debug enviroment. \r
+ This function is used to set up debug enviroment.\r
\r
**/\r
VOID\r
{\r
// Map Timer to FIQ\r
}\r
- \r
- \r
+\r
+\r
/**\r
Set the period for the debug agent timer. Zero means disable the timer.\r
\r
@param[in] TimerPeriodMilliseconds Frequency of the debug agent timer.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerSetPeriod (\r
if (TimerPeriodMilliseconds == 0) {\r
// Disable timer and Disable FIQ\r
return;\r
- } \r
+ }\r
\r
// Set timer period and unmask FIQ\r
}\r
- \r
+\r
\r
/**\r
- Perform End Of Interrupt for the debug agent timer. This is called in the \r
- interrupt handler after the interrupt has been processed. \r
+ Perform End Of Interrupt for the debug agent timer. This is called in the\r
+ interrupt handler after the interrupt has been processed.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerEndOfInterrupt (\r
Basic serial IO abstaction for GDB\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
if ((Parity != 0) || (DataBits != 8) || (StopBits != 1)) {\r
// Could add support for different Baud rates....\r
return RETURN_UNSUPPORTED;\r
}\r
- \r
+\r
UINT32 Base = PcdGet32 (PcdGdbUartBase);\r
- \r
+\r
// initialize baud rate generator to 115200 based on EB clock REFCLK24MHZ\r
MmioWrite32 (Base + UARTIBRD, UART_115200_IDIV);\r
MmioWrite32 (Base + UARTFBRD, UART_115200_FDIV);\r
EFIAPI\r
GdbIsCharAvailable (\r
VOID\r
- ) \r
+ )\r
{\r
UINT32 FR = PcdGet32 (PcdGdbUartBase) + UARTFR;\r
\r
{\r
UINT32 FR = PcdGet32 (PcdGdbUartBase) + UARTFR;\r
UINT32 DR = PcdGet32 (PcdGdbUartBase) + UARTDR;\r
- \r
+\r
while ((MmioRead32 (FR) & UART_RX_EMPTY_FLAG_MASK) == 0);\r
return MmioRead8 (DR);\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
\r
[LibraryClasses]\r
DebugLib\r
- IoLib \r
+ IoLib\r
\r
[FixedPcd]\r
gArmRealViewEbPkgTokenSpaceGuid.PcdGdbUartBase\r
#/** @file\r
-# \r
+#\r
# Component description file for NorFlashArmRealViewEbLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = NorFlashPlatformLib\r
- \r
+\r
[Sources.common]\r
NorFlashArmRealViewEb.c\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for ArmRealViewGraphicsDxe module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = PL111LcdPlatformLib\r
- \r
+\r
[Sources.common]\r
PL111LcdArmRealViewEb.c\r
\r
# 1 : 800 x 600 x 24 bpp\r
# 2 : 1024 x 768 x 24 bpp\r
# 3 : 640 x 480 x 16 bpp (565 RGB Mode)\r
- # 4 : 800 x 600 x 16 bpp (565 RGB Mode) \r
+ # 4 : 800 x 600 x 16 bpp (565 RGB Mode)\r
# 5 : 1024 x 768 x 16 bpp (565 RGB Mode)\r
# 6 : 640 x 480 x 15 bpp (555 RGB Mode)\r
- # 7 : 800 x 600 x 15 bpp (555 RGB Mode) \r
+ # 7 : 800 x 600 x 15 bpp (555 RGB Mode)\r
# 8 : 1024 x 768 x 15 bpp (555 RGB Mode)\r
# 9 : 1024 x 768 x 15 bpp (555 RGB Mode) - Linux driver settings\r
# 10 : 640 x 480 x 12 bpp (444 RGB Mode)\r
- # 11 : 800 x 600 x 12 bpp (444 RGB Mode) \r
+ # 11 : 800 x 600 x 12 bpp (444 RGB Mode)\r
# 12 : 1024 x 768 x 12 bpp (444 RGB Mode)\r
#\r
\r
/** @file\r
Template library implementation to support ResetSystem Runtime call.\r
- \r
+\r
Fill in the templates with what ever makes you system reset.\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
ASSERT (FALSE);\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
\r
\r
/**\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
#/** @file\r
-# \r
+#\r
# Component description file for SysConfigArmRealViewEbLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmPlatformSysConfigLib\r
- \r
+\r
[Sources.common]\r
SysConfigArmRealViewEb.c\r
\r
#\r
# Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
[LibraryClasses.common]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/ArmVExpressLib.inf\r
- \r
+\r
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf\r
\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf\r
\r
LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpressLib.inf\r
- \r
- TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf \r
+\r
+ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
\r
[BuildOptions]\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7\r
\r
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7\r
- \r
+\r
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7\r
\r
################################################################################\r
[PcdsFeatureFlag.common]\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE\r
- \r
+\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
- \r
+\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-CTA15-A7"\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000\r
\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
# Stacks for MPCores in Secure World\r
# SRAM (CS1) is only available between 0x14000000 and 0x14001000 on the model\r
# ZBT SRAM is available between 0x2E000000 and 0x2E010000 on the model\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecSecondaryStackSize|0x1000\r
# Share Monitor stacks with Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0\r
- \r
+\r
# System Memory (1GB) - An additional 1GB will be added if UEFI is running on a 2GB Test Chip\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x40000000\r
# A7_2 = 0x102, GicCoreId = 4\r
gArmTokenSpaceGuid.PcdArmPrimaryCore|0x100\r
!endif\r
- \r
+\r
#\r
# SEC Phase Global Variables :\r
- # - 0x00-0x04: Debugger Exception Handler Pointer address \r
+ # - 0x00-0x04: Debugger Exception Handler Pointer address\r
# - 0x04-0x08: Normal Exception Handler Pointer\r
# - 0x0C-0x10: MpSafe Serial Console SpinLock\r
# - 0x10-0x20: KfScb 8 Bakery Locks of 2Bytes each\r
# - 0x20-0x30: CCI 8 Bakery Locks of 2Bytes each\r
# - 0x30-0x48: ARM SMC Events (8 cores * 3 max_event * sizeof(UINT8))\r
gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize|0x48\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
\r
## SP805 Watchdog - Motherboard Watchdog\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x1C0F0000\r
- \r
+\r
## PL011 - Serial Terminal\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1C090000\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
#\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
- \r
- \r
+\r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"Linux from NorFlash"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0xE000000,0xE800000)"\r
!else\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|10000000\r
!endif\r
- \r
+\r
################################################################################\r
#\r
# Components Section - list of all EDK II Modules needed by this Platform\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf \r
+ MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
!ifndef ARM_BIGLITTLE_TC2\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
!endif\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
#\r
# Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
\r
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
- \r
+\r
#\r
# Multiple Console IO support\r
#\r
#\r
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf\r
- \r
+\r
#\r
# Filesystems\r
#\r
!ifndef $(ARM_BIGLITTLE_TC2)\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
!endif\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
\r
# ACPI Support\r
INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf\r
- \r
+\r
#\r
# Networking stack\r
#\r
INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf\r
INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf\r
INF EmbeddedPkg/Drivers/Lan9118Dxe/Lan9118Dxe.inf\r
- \r
+\r
#\r
# UEFI application\r
- # \r
+ #\r
INF ShellBinPkg/UefiShell/UefiShell.inf\r
\r
#\r
READ_LOCK_STATUS = TRUE\r
\r
INF ArmPlatformPkg/PrePi/PeiMPCore.inf\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
################################################################################\r
[Defines]\r
PLATFORM_NAME = ArmVExpressPkg-CTA9x4\r
- PLATFORM_GUID = eb2bd5ff-2379-4a06-9c12-db905cdee9ea \r
+ PLATFORM_GUID = eb2bd5ff-2379-4a06-9c12-db905cdee9ea\r
PLATFORM_VERSION = 0.1\r
DSC_SPECIFICATION = 0x00010005\r
SUPPORTED_ARCHITECTURES = ARM\r
PL341DmcLib|ArmPlatformPkg/Drivers/PL34xDmc/PL341Dmc.inf\r
# ARM PL301 Axi Driver\r
PL301AxiLib|ArmPlatformPkg/Drivers/PL301Axi/PL301Axi.inf\r
- \r
+\r
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf\r
LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf\r
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/ArmVExpressSecLib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/ArmVExpressLibSec.inf\r
\r
- # Uncomment to turn on GDB stub in SEC. \r
+ # Uncomment to turn on GDB stub in SEC.\r
#DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
\r
[BuildOptions]\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4\r
\r
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4\r
- \r
+\r
XCODE:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4\r
\r
################################################################################\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE\r
!endif\r
- \r
+\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
\r
[PcdsFixedAtBuild.common]\r
- gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" \r
+ gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"\r
\r
gArmPlatformTokenSpaceGuid.PcdCoreCount|4\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000\r
\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
# Stacks for MPCores in Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x49E00000\r
# Stacks for MPCores in Monitor Mode\r
# Stacks for MPCores in Normal World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x48000000\r
\r
- # System Memory (1GB) \r
+ # System Memory (1GB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x60000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x40000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x1000F000\r
## SP805 Watchdog - CoreTile Watchdog\r
#gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x100E5000\r
- \r
+\r
## PL011 - Serial Terminal\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x10009000\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
## PL180 MMC/SD card controller\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x10000048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x10005000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"NorFlash"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x46000000,0x46400000)"\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf \r
+ MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
EmbeddedPkg/SerialDxe/SerialDxe.inf\r
- \r
+\r
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
\r
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf\r
# Filesystems\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
!endif\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
!endif\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf\r
- \r
+\r
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf\r
LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf\r
\r
#DebugAgentTimerLib|ArmPlatformPkg/ArmVExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
\r
- TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf \r
+ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf\r
\r
# Virtio Support\r
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
- \r
+\r
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
################################################################################\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE\r
!endif\r
- \r
+\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
- \r
+\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
!endif\r
\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
# Stacks for MPCores in Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x2E009000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x1000\r
- \r
+\r
# Stacks for MPCores in Monitor Mode\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x2E008000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x100\r
- \r
+\r
# Stacks for MPCores in Normal World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x2E000000\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000\r
- \r
- # System Memory (1GB) \r
+\r
+ # System Memory (1GB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x40000000\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 64MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
\r
## SP805 Watchdog - Motherboard Watchdog\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x1C0F0000\r
- \r
+\r
## PL011 - Serial Terminal\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c090000\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
\r
## PL111 Versatile Express Motherboard controller\r
gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x1C1F0000\r
- \r
+\r
## PL180 MMC/SD card controller\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf \r
+ MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
#\r
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf\r
INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf\r
INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf\r
- \r
+\r
#\r
# Multiple Console IO support\r
#\r
# Semi-hosting filesystem\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
- \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
+\r
#\r
# Bds\r
#\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
!endif\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf\r
- \r
+\r
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf\r
LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf\r
\r
#DebugAgentTimerLib|ArmPlatformPkg/ArmVExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
\r
- TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf \r
+ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf\r
\r
# Virtio Support\r
VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
- \r
+\r
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
################################################################################\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE\r
!endif\r
- \r
+\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
- \r
+\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
!endif\r
\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
# Stacks for MPCores in Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x2E009000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x1000\r
- \r
+\r
# Stacks for MPCores in Monitor Mode\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x2E008000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x100\r
- \r
+\r
# Stacks for MPCores in Normal World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x2E000000\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000\r
- \r
- # System Memory (1GB) \r
+\r
+ # System Memory (1GB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x40000000\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 64MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
\r
## SP805 Watchdog - Motherboard Watchdog\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x1C0F0000\r
- \r
+\r
## PL011 - Serial Terminal\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c090000\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
\r
## PL111 Versatile Express Motherboard controller\r
gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x1C1F0000\r
- \r
+\r
## PL180 MMC/SD card controller\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
# ARM Architectural Timer Frequency\r
#\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
- \r
- \r
+\r
+\r
################################################################################\r
#\r
# Components Section - list of all EDK II Modules needed by this Platform\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf \r
+ MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
#\r
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
# Semi-hosting filesystem\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
- \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
+\r
#\r
# Bds\r
#\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
!endif\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLib.inf\r
- \r
+\r
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf\r
NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf\r
LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf\r
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf\r
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf\r
\r
- # Uncomment to turn on GDB stub in SEC. \r
+ # Uncomment to turn on GDB stub in SEC.\r
#DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
- \r
+\r
[BuildOptions]\r
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
- \r
+\r
XCODE:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
\r
################################################################################\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE\r
!endif\r
- \r
+\r
## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.\r
# It could be set FALSE to save size.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
- \r
+\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00010000\r
\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
# Stacks for MPCores in Secure World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x2E009000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x1000\r
- \r
+\r
# Stacks for MPCores in Monitor Mode\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x2E008000\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x100\r
- \r
+\r
# Stacks for MPCores in Normal World\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x2E000000\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000\r
\r
- # System Memory (1GB) \r
+ # System Memory (1GB)\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x40000000\r
- \r
+\r
# Size of the region used by UEFI in permanent memory (Reserved 64MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
\r
## SP805 Watchdog - Motherboard Watchdog\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogBase|0x1C0F0000\r
- \r
+\r
## PL011 - Serial Terminal\r
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x1c090000\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400\r
## PL180 MMC/SD card controller\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
#\r
################################################################################\r
[Components.common]\r
- \r
+\r
#\r
# SEC\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
#\r
# Architectural Protocols\r
#\r
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf \r
+ ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf\r
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf\r
- MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf \r
+ MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf\r
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
#\r
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
################################################################################\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
\r
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
- \r
+\r
#\r
# Multiple Console IO support\r
#\r
# Semi-hosting filesystem\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Versatile Express FileSystem\r
#\r
INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf\r
INF FatBinPkg/EnhancedFatDxe/Fat.inf\r
INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
- \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
+\r
#\r
# Bds\r
#\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
!endif\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
\r
## Trustzone enable (to make the transition from EL3 to EL2 in ArmPlatformPkg/Sec)\r
gArmTokenSpaceGuid.PcdTrustzoneSupport|TRUE\r
- \r
+\r
#\r
# ARM PrimeCell\r
#\r
## PL180 MMC/SD card controller\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000\r
- \r
+\r
#\r
# ARM General Interrupt Controller\r
#\r
# Use the implementation which set the Secure bits\r
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicSecLib.inf\r
}\r
- \r
+\r
#\r
# PEI Phase modules\r
#\r
ArmPkg/Drivers/TimerDxe/TimerDxe.inf\r
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf\r
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf\r
- \r
+\r
#\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# Multimedia Card Interface\r
#\r
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf\r
- \r
+\r
#\r
# Platform Driver\r
#\r
# UEFI application (Shell Embedded Boot Loader)\r
#\r
INF ShellBinPkg/UefiShell/UefiShell.inf\r
- \r
+\r
#\r
# Bds\r
#\r
INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf\r
INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf\r
!endif\r
- \r
+\r
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {\r
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {\r
SECTION FV_IMAGE = FVMAIN\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
# UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf\r
!endif\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf\r
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf\r
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf \r
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
\r
# Assume everything is fixed at build\r
#\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
- \r
+\r
# 1/123 faster than Stm or Vstm version\r
#BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf\r
# ARM SP804 Dual Timer Driver\r
TimerLib|ArmPlatformPkg/Library/SP804TimerLib/SP804TimerLib.inf\r
\r
- # EBL Related Libraries \r
+ # EBL Related Libraries\r
EblCmdLib|ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf\r
EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf\r
EblAddExternalCommandLib|EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf\r
EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf\r
- \r
+\r
#\r
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window \r
+ # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window\r
# in the debugger will show load and unload commands for symbols. You can cut and paste this\r
# into the command window to load symbols. We should be able to use a script to do this, but\r
# the version of RVD I have does not support scripts accessing system memory.\r
#PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf\r
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf\r
#PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
- \r
+\r
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf\r
DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf\r
\r
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf \r
+ SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf\r
\r
# BDS Libraries\r
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf\r
[LibraryClasses.common.SEC]\r
ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf\r
- \r
+\r
DebugAgentLib|ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf\r
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLibBase.inf\r
- \r
+\r
!ifdef $(EDK2_SKIP_PEICORE)\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf\r
- \r
+\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Pei/PeiArmPlatformGlobalVariableLib.inf\r
PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf\r
- \r
+\r
[LibraryClasses.common.PEIM]\r
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
- \r
+\r
#\r
# Control what commands are supported from the UI\r
# Turn these on and off to add features or save size\r
- # \r
+ #\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE\r
\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE\r
- \r
+\r
# Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress\r
gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE\r
- \r
+\r
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE\r
\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"VExpress"\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
#\r
# Optional feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
- # Values are in EFI Pages (4K). DXE Core will make sure that \r
- # at least this much of each type of memory can be allocated \r
+ # Values are in EFI Pages (4K). DXE Core will make sure that\r
+ # at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
#\r
# ARM OS Loader\r
#\r
- # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux: \r
+ # Versatile Express machine type (ARM VERSATILE EXPRESS = 2272) required for ARM Linux:\r
gArmTokenSpaceGuid.PcdArmMachineType|2272\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"Linux from NorFlash"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/MemoryMapped(0x0,0xED000000,0xED400000)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1\r
- \r
+\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(CE660500-824D-11E0-AC72-0002A5D5C51B)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi()"\r
# Arm Versatile Express package.\r
#\r
# Copyright (c) 2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
[Defines]\r
DEC_SPECIFICATION = 0x00010005\r
PACKAGE_NAME = ArmVExpressPkg\r
- PACKAGE_GUID = 9c0aaed4-74c5-4043-b417-a3223814ce76 \r
+ PACKAGE_GUID = 9c0aaed4-74c5-4043-b417-a3223814ce76\r
PACKAGE_VERSION = 0.1\r
\r
################################################################################\r
#/* @file\r
#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
\r
#include <ArmPlatform.h>\r
\r
-.text \r
+.text\r
.align 2\r
\r
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
/** @file\r
*\r
* Copyright (c) 2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
//\r
// Copyright (c) 2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
add r0, r1, r0, LSR #7\r
bx lr\r
\r
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED \r
+ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
//\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#/* @file\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
\r
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask\r
gArmTokenSpaceGuid.PcdArmPrimaryCore\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdCoreCount\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for ArmVExpressSysConfigLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmPlatformSysConfigLib\r
- \r
+\r
[Sources.common]\r
ArmVExpressSysConfig.c\r
\r
/**\r
\r
Copyright (c) 2012, ARM Ltd. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#/** @file\r
-# \r
+#\r
# Component description file for HdLcdArmLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = LcdPlatformLib\r
- \r
+\r
[Sources.common]\r
- \r
+\r
HdLcdArmVExpress.c\r
\r
[Packages]\r
MdePkg/MdePkg.dec\r
ArmPlatformPkg/ArmPlatformPkg.dec\r
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec\r
- \r
+\r
[LibraryClasses]\r
BaseLib\r
ArmPlatformSysConfigLib\r
\r
[Pcd]\r
gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode\r
- gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId\r
\ No newline at end of file
+ gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = NorFlashPlatformLib\r
- \r
+\r
[Sources.common]\r
NorFlashArmVExpress.c\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for ArmVeGraphicsDxe module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = LcdPlatformLib\r
- \r
+\r
[Sources.common]\r
PL111LcdArmVExpress.c\r
\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = ArmVeResetSystemLib\r
- FILE_GUID = 36885202-0854-4373-bfd2-95d229b44d44 \r
+ FILE_GUID = 36885202-0854-4373-bfd2-95d229b44d44\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = EfiResetSystemLib\r
/** @file\r
*\r
* Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
DevicePath = DuplicateDevicePath (OldDevicePath);\r
\r
EndingDevicePath = (FILEPATH_DEVICE_PATH*)GetLastDevicePathNode (DevicePath);\r
- \r
+\r
Print(L"File path of the %s: ", FileName);\r
StrnCpy (BootFilePath, EndingDevicePath->PathName, BOOT_DEVICE_FILEPATH_MAX);\r
Status = EditHIInputStr (BootFilePath, BOOT_DEVICE_FILEPATH_MAX);\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for HDLCD module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
gEfiGraphicsOutputProtocolGuid # Produced\r
gEfiEdidDiscoveredProtocolGuid # Produced\r
gEfiEdidActiveProtocolGuid # Produced\r
- gEfiEdidOverrideProtocolGuid # Produced \r
+ gEfiEdidOverrideProtocolGuid # Produced\r
\r
[FixedPcd]\r
gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase\r
#/** @file\r
-# \r
+#\r
# Component description file for PL111LcdGraphicsOutputDxe module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
#/** @file\r
-# \r
+#\r
# Component description file for NorFlashDxe module\r
-# \r
+#\r
# Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
gEfiDevicePathProtocolGuid\r
gEfiFirmwareVolumeBlockProtocolGuid\r
gEfiDiskIoProtocolGuid\r
- \r
+\r
[Pcd.common]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked\r
\r
[Depex]\r
#\r
# NorFlashDxe must be loaded before VariableRuntimeDxe in case empty flash needs populating with default values\r
- # \r
- BEFORE gVariableRuntimeDxeFileGuid \r
+ #\r
+ BEFORE gVariableRuntimeDxeFileGuid\r
Status = ValidateFvHeader (Instance);\r
}\r
\r
- // Install the Default FVB header if required \r
+ // Install the Default FVB header if required\r
if (EFI_ERROR(Status)) {\r
// There is no valid header, so time to install one.\r
DEBUG((EFI_D_ERROR,"NorFlashFvbInitialize: ERROR - The FVB Header is not valid. Installing a correct one for this volume.\n"));\r
while (Buffer < Final) {\r
// Wait until UART able to accept another char\r
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK));\r
- \r
+\r
MmioWrite8 (UartBase + UARTDR, *Buffer++);\r
}\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for PL011Uart module\r
-# \r
+#\r
# Copyright (c) 2011-2013, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = PL011Uart\r
- FILE_GUID = 4ec8b120-8307-11e0-bc91-0002a5d5c51b \r
+ FILE_GUID = 4ec8b120-8307-11e0-bc91-0002a5d5c51b\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = PL011UartLib\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
gArmPlatformTokenSpaceGuid.PcdPL061GpioBase\r
\r
[Protocols]\r
- gEmbeddedGpioProtocolGuid \r
+ gEmbeddedGpioProtocolGuid\r
\r
[Depex]\r
TRUE\r
This file implement the MMC Host Protocol for the ARM PrimeCell PL180.\r
\r
Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
if ((Status & MCI_STATUS_CMD_ERROR)) {\r
// Clear Status register error flags\r
MmioWrite32 (MCI_CLEAR_STATUS_REG, MCI_STATUS_CMD_ERROR);\r
- \r
+\r
if ((Status & MCI_STATUS_CMD_START_BIT_ERROR)) {\r
DEBUG ((EFI_D_ERROR, "MciSendCommand(CmdIndex:%d) Start bit Error! Response:0x%X Status:0x%x\n", (Cmd & 0x3F), MmioRead32 (MCI_RESPONSE0_REG), Status));\r
RetVal = EFI_NO_RESPONSE;\r
// Read data from the RX FIFO\r
Loop = 0;\r
Finish = MMCI0_BLOCKLEN / 4;\r
- \r
+\r
// Raise the TPL at the highest level to disable Interrupts.\r
Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
\r
\r
//Publish Component Name, BlockIO protocol interfaces\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Handle, \r
+ &Handle,\r
&gEfiMmcHostProtocolGuid, &gMciHost,\r
NULL\r
);\r
Header for the MMC Host Protocol implementation for the ARM PrimeCell PL180.\r
\r
Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
# INF file for the MMC Host Protocol implementation for the ARM PrimeCell PL180.\r
#\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
gEfiCpuArchProtocolGuid\r
gEfiDevicePathProtocolGuid\r
gEfiMmcHostProtocolGuid\r
- \r
+\r
[Pcd]\r
gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress\r
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress\r
- \r
+\r
[Depex]\r
TRUE\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
// Configure the Access Control Register (MI 0)\r
FAxiWriteReg(PL301_QOS_ACCESSCONTROL_MI_0, V2P_CA9_FAXI_MI0_ACCESSCNTRL_VAL);\r
\r
- // MP0 \r
+ // MP0\r
// Set priority for Read\r
FAxiWriteReg(PL301_AR_ARB_MI_0, 0x00000100);\r
FAxiWriteReg(PL301_AR_ARB_MI_0, 0x01000200);\r
FAxiWriteReg(PL301_AR_ARB_MI_0, 0x02000200);\r
FAxiWriteReg(PL301_AR_ARB_MI_0, 0x03000200);\r
FAxiWriteReg(PL301_AR_ARB_MI_0, 0x04000200);\r
- \r
+\r
// Set priority for Write\r
FAxiWriteReg(PL301_AW_ARB_MI_0, 0x00000100);\r
FAxiWriteReg(PL301_AW_ARB_MI_0, 0x01000200);\r
FAxiWriteReg(PL301_AR_ARB_MI_2, 0x02000100);\r
FAxiWriteReg(PL301_AR_ARB_MI_2, 0x03000100);\r
FAxiWriteReg(PL301_AR_ARB_MI_2, 0x04000100);\r
- \r
+\r
// Set priority for Write\r
FAxiWriteReg(PL301_AW_ARB_MI_2, 0x00000100);\r
FAxiWriteReg(PL301_AW_ARB_MI_2, 0x01000200);\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
//\r
// Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#include <AutoGen.h>\r
\r
INCLUDE AsmMacroIoLib.inc\r
- \r
+\r
EXPORT PL35xSmcInitialize\r
EXPORT PL35xSmcSetRefresh\r
\r
PRESERVE8\r
AREA ModuleInitializeSMC, CODE, READONLY\r
- \r
+\r
// IN r1 Smc Base Address\r
// IN r2 Smc Configuration Start Address\r
// IN r3 Smc Configuration End Address\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.<BR>\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
what source means.\r
\r
@param SystemContext Pointer to system register context. Mostly used by debuggers and will\r
- update the system context after the return from the interrupt if \r
+ update the system context after the return from the interrupt if\r
modified. Don't change these values unless you know what you are doing\r
\r
**/\r
EFIAPI\r
TimerInterruptHandler (\r
IN HARDWARE_INTERRUPT_SOURCE Source,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
EFI_TPL OriginalTPL;\r
\r
//\r
- // DXE core uses this callback for the EFI timer tick. The DXE core uses locks \r
+ // DXE core uses this callback for the EFI timer tick. The DXE core uses locks\r
// that raise to TPL_HIGH and then restore back to current level. Thus we need\r
- // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick. \r
+ // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick.\r
//\r
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
\r
}\r
\r
/**\r
- This function registers the handler NotifyFunction so it is called every time \r
- the timer interrupt fires. It also passes the amount of time since the last \r
- handler call to the NotifyFunction. If NotifyFunction is NULL, then the \r
- handler is unregistered. If the handler is registered, then EFI_SUCCESS is \r
- returned. If the CPU does not support registering a timer interrupt handler, \r
- then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler \r
- when a handler is already registered, then EFI_ALREADY_STARTED is returned. \r
- If an attempt is made to unregister a handler when a handler is not registered, \r
- then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to \r
- register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
+ This function registers the handler NotifyFunction so it is called every time\r
+ the timer interrupt fires. It also passes the amount of time since the last\r
+ handler call to the NotifyFunction. If NotifyFunction is NULL, then the\r
+ handler is unregistered. If the handler is registered, then EFI_SUCCESS is\r
+ returned. If the CPU does not support registering a timer interrupt handler,\r
+ then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler\r
+ when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
+ If an attempt is made to unregister a handler when a handler is not registered,\r
+ then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to\r
+ register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR\r
is returned.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
\r
/**\r
\r
- This function adjusts the period of timer interrupts to the value specified \r
- by TimerPeriod. If the timer period is updated, then the selected timer \r
- period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If \r
- the timer hardware is not programmable, then EFI_UNSUPPORTED is returned. \r
- If an error occurs while attempting to update the timer period, then the \r
- timer hardware will be put back in its state prior to this call, and \r
- EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt \r
- is disabled. This is not the same as disabling the CPU's interrupts. \r
- Instead, it must either turn off the timer hardware, or it must adjust the \r
- interrupt controller so that a CPU interrupt is not generated when the timer \r
- interrupt fires. \r
+ This function adjusts the period of timer interrupts to the value specified\r
+ by TimerPeriod. If the timer period is updated, then the selected timer\r
+ period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If\r
+ the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.\r
+ If an error occurs while attempting to update the timer period, then the\r
+ timer hardware will be put back in its state prior to this call, and\r
+ EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt\r
+ is disabled. This is not the same as disabling the CPU's interrupts.\r
+ Instead, it must either turn off the timer hardware, or it must adjust the\r
+ interrupt controller so that a CPU interrupt is not generated when the timer\r
+ interrupt fires.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
@param TimerPeriod The rate to program the timer interrupt in 100 nS units. If\r
{\r
EFI_STATUS Status;\r
UINT64 TimerTicks;\r
- \r
+\r
// always disable the timer\r
MmioAnd32 (SP804_TIMER_PERIODIC_BASE + SP804_TIMER_CONTROL_REG, ~SP804_TIMER_CTRL_ENABLE);\r
\r
// Leave timer disabled from above, and...\r
\r
// Disable timer 0/1 interrupt for a TimerPeriod of 0\r
- Status = gInterrupt->DisableInterruptSource (gInterrupt, gVector); \r
- } else { \r
+ Status = gInterrupt->DisableInterruptSource (gInterrupt, gVector);\r
+ } else {\r
// Convert TimerPeriod into 1MHz clock counts (us units = 100ns units * 10)\r
TimerTicks = DivU64x32 (TimerPeriod, 10);\r
TimerTicks = MultU64x32 (TimerTicks, PcdGet32(PcdSP804TimerFrequencyInMHz));\r
MmioOr32 (SP804_TIMER_PERIODIC_BASE + SP804_TIMER_CONTROL_REG, SP804_TIMER_CTRL_ENABLE);\r
\r
// enable timer 0/1 interrupts\r
- Status = gInterrupt->EnableInterruptSource (gInterrupt, gVector); \r
+ Status = gInterrupt->EnableInterruptSource (gInterrupt, gVector);\r
}\r
\r
// Save the new timer period\r
}\r
\r
/**\r
- This function retrieves the period of timer interrupts in 100 ns units, \r
- returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod \r
- is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is \r
+ This function retrieves the period of timer interrupts in 100 ns units,\r
+ returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod\r
+ is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is\r
returned, then the timer is currently disabled.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
}\r
\r
/**\r
- This function generates a soft timer interrupt. If the platform does not support soft \r
- timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
- If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
- service, then a soft timer interrupt will be generated. If the timer interrupt is \r
- enabled when this service is called, then the registered handler will be invoked. The \r
- registered handler should not be able to distinguish a hardware-generated timer \r
+ This function generates a soft timer interrupt. If the platform does not support soft\r
+ timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.\r
+ If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()\r
+ service, then a soft timer interrupt will be generated. If the timer interrupt is\r
+ enabled when this service is called, then the registered handler will be invoked. The\r
+ registered handler should not be able to distinguish a hardware-generated timer\r
interrupt from a software-generated timer interrupt.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
Interface structure for the Timer Architectural Protocol.\r
\r
@par Protocol Description:\r
- This protocol provides the services to initialize a periodic timer \r
+ This protocol provides the services to initialize a periodic timer\r
interrupt, and to register a handler that is called each time the timer\r
interrupt fires. It may also provide a service to adjust the rate of the\r
- periodic timer interrupt. When a timer interrupt occurs, the handler is \r
- passed the amount of time that has passed since the previous timer \r
+ periodic timer interrupt. When a timer interrupt occurs, the handler is\r
+ passed the amount of time that has passed since the previous timer\r
interrupt.\r
\r
@param RegisterHandler\r
- Registers a handler that will be called each time the \r
- timer interrupt fires. TimerPeriod defines the minimum \r
- time between timer interrupts, so TimerPeriod will also \r
- be the minimum time between calls to the registered \r
+ Registers a handler that will be called each time the\r
+ timer interrupt fires. TimerPeriod defines the minimum\r
+ time between timer interrupts, so TimerPeriod will also\r
+ be the minimum time between calls to the registered\r
handler.\r
\r
@param SetTimerPeriod\r
- Sets the period of the timer interrupt in 100 nS units. \r
- This function is optional, and may return EFI_UNSUPPORTED. \r
- If this function is supported, then the timer period will \r
+ Sets the period of the timer interrupt in 100 nS units.\r
+ This function is optional, and may return EFI_UNSUPPORTED.\r
+ If this function is supported, then the timer period will\r
be rounded up to the nearest supported timer period.\r
\r
\r
Retrieves the period of the timer interrupt in 100 nS units.\r
\r
@param GenerateSoftInterrupt\r
- Generates a soft timer interrupt that simulates the firing of \r
- the timer interrupt. This service can be used to invoke the registered handler if the timer interrupt has been masked for \r
+ Generates a soft timer interrupt that simulates the firing of\r
+ the timer interrupt. This service can be used to invoke the registered handler if the timer interrupt has been masked for\r
a period of time.\r
\r
**/\r
#/** @file\r
-# \r
+#\r
# Component description file for Timer module\r
-# \r
+#\r
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = ArmVeTimerDxe\r
- FILE_GUID = a73d663d-a491-4278-9a69-9521be3379f2 \r
+ FILE_GUID = a73d663d-a491-4278-9a69-9521be3379f2\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
\r
[Guids]\r
\r
[Protocols]\r
- gEfiTimerArchProtocolGuid \r
+ gEfiTimerArchProtocolGuid\r
gHardwareInterruptProtocolGuid\r
\r
[Pcd.common]\r
\r
// Prohibit any rogue access to SP805 registers\r
SP805Lock();\r
- \r
+\r
//\r
// Make sure the Watchdog Timer Architectural Protocol has not been installed in the system yet.\r
// This will avoid conflicts with the universal watchdog\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = SP805WatchdogDxe\r
- FILE_GUID = ebd705fb-fa92-46a7-b32b-7f566d944614 \r
+ FILE_GUID = ebd705fb-fa92-46a7-b32b-7f566d944614\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
\r
gArmPlatformTokenSpaceGuid.PcdSP805WatchdogClockFrequencyInHz\r
\r
[Protocols]\r
- gEfiWatchdogTimerArchProtocolGuid \r
+ gEfiWatchdogTimerArchProtocolGuid\r
\r
[Depex]\r
TRUE\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
extern EFI_GUID gArmGlobalVariableGuid;\r
\r
///\r
-/// Describes all memory ranges used during the HOB producer \r
-/// phase that exist outside the HOB list. This HOB type \r
+/// Describes all memory ranges used during the HOB producer\r
+/// phase that exist outside the HOB list. This HOB type\r
/// describes how memory is used, not the physical attributes of memory.\r
///\r
typedef struct {\r
///\r
EFI_PHYSICAL_ADDRESS GlobalVariableBase;\r
\r
- /// \r
+ ///\r
/// The length in bytes of memory allocated by this HOB.\r
- /// \r
+ ///\r
UINT32 GlobalVariableSize;\r
} ARM_HOB_GLOBAL_VARIABLE;\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/** @file\r
# Timer library implementation\r
-# \r
-# \r
+#\r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = DxeArmPlatformGlobalVariableLib\r
- FILE_GUID = 53fa3cc3-23b7-4ec2-9bfa-30257d7e1135 \r
+ FILE_GUID = 53fa3cc3-23b7-4ec2-9bfa-30257d7e1135\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmPlatformGlobalVariableLib\r
- \r
+\r
CONSTRUCTOR = ArmPlatformGlobalVariableConstructor\r
\r
[Sources.common]\r
#/** @file\r
# ArmPlatformGlobalVariableLib library implementation\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = PrePiArmPlatformGlobalVariableLib\r
- FILE_GUID = 44d59470-e5e6-4811-af00-33bb573a804b \r
+ FILE_GUID = 44d59470-e5e6-4811-af00-33bb573a804b\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = ArmPlatformGlobalVariableLib\r
ASSERT (VariableOffset < PcdGet32 (PcdSecGlobalVariableSize));\r
\r
GlobalVariableBase = PcdGet32 (PcdCPUCoresSecStackBase) + PcdGet32 (PcdCPUCoreSecPrimaryStackSize) - PcdGet32 (PcdSecGlobalVariableSize);\r
- \r
+\r
if (VariableSize == 4) {\r
*(UINT32*)Variable = ReadUnaligned32 ((CONST UINT32*)(GlobalVariableBase + VariableOffset));\r
} else if (VariableSize == 8) {\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
#include <AsmMacroIoLib.h>\r
#include <Library/ArmLib.h>\r
\r
-.text \r
+.text\r
.align 2\r
\r
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)\r
\r
IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCore\r
IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCoreMask\r
- \r
+\r
PRESERVE8\r
AREA ArmPlatformNullHelper, CODE, READONLY\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
#\r
# Copyright (c) 2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
BaseLib\r
DebugLib\r
PcdLib\r
- \r
+\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
IN UINTN Argc,\r
IN CHAR8 **Argv\r
);\r
- \r
+\r
EFI_STATUS\r
EblDumpFdt (\r
IN UINTN Argc,\r
Simple arm disassembler via a library\r
\r
Argv[0] - symboltable\r
- Argv[1] - Optional qoted format string \r
+ Argv[1] - Optional qoted format string\r
Argv[2] - Optional flag\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
UINT32 PeCoffSizeOfHeaders;\r
UINT32 ImageBase;\r
BOOLEAN Elf;\r
- \r
+\r
// Need to add lots of error checking on the passed in string\r
// Default string is for RealView debugger\r
#if (__ARMCC_VERSION < 500000)\r
Format = (Argc > 1) ? Argv[1] : "add-symbol-file %a 0x%x";\r
#endif\r
Elf = (Argc > 2) ? FALSE : TRUE;\r
- \r
+\r
Status = EfiGetSystemConfigurationTable (&gEfiDebugImageInfoTableGuid, (VOID **)&DebugImageTableHeader);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
DebugTable = DebugImageTableHeader->EfiDebugImageInfoTable;\r
if (DebugTable == NULL) {\r
return EFI_SUCCESS;\r
if (Elf) {\r
// ELF and Mach-O images don't include the header so the linked address does not include header\r
ImageBase += PeCoffSizeOfHeaders;\r
- } \r
+ }\r
AsciiPrint (Format, Pdb, ImageBase);\r
AsciiPrint ("\n");\r
} else {\r
}\r
}\r
- } \r
+ }\r
}\r
\r
return EFI_SUCCESS;\r
ARgv[2] - Number of instructions to disassembly (optional)\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
UINT32 Count;\r
CHAR8 Buffer[80];\r
UINT32 ItBlock;\r
- \r
+\r
if (Argc < 2) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Address = AsciiStrHexToUintn (Argv[1]);\r
Count = (Argc > 2) ? (UINT32)AsciiStrHexToUintn (Argv[2]) : 20;\r
\r
- Ptr = (UINT8 *)(UINTN)Address; \r
+ Ptr = (UINT8 *)(UINTN)Address;\r
ItBlock = 0;\r
do {\r
CurrentAddress = Ptr;\r
DisassembleInstruction (&Ptr, TRUE, TRUE, &ItBlock, Buffer, sizeof (Buffer));\r
AsciiPrint ("0x%08x: %a\n", CurrentAddress, Buffer);\r
} while (Count-- > 0);\r
- \r
+\r
\r
return EFI_SUCCESS;\r
}\r
ARgv[2] - Number of instructions to disassembly (optional)\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
AsciiPrint ("%6a %6ld ms\n", Token, Milliseconds);\r
break;\r
}\r
- } \r
+ }\r
}\r
} while (Key != 0);\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
\r
FILE_GUID = 6085e1ca-0d2d-4ba4-9872-c59b36ffd6ad\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
TimerLib\r
BdsLib\r
FdtLib\r
- \r
+\r
[Protocols]\r
gEfiDebugSupportProtocolGuid\r
gEfiLoadedImageProtocolGuid\r
gEfiDevicePathToTextProtocolGuid\r
- \r
+\r
[Guids]\r
gEfiDebugImageInfoTableGuid\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
#/* @file\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
Serial I/O Port library functions with no library constructor/destructor\r
\r
Copyright (c) 2012-2013, ARM Ltd. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#/** @file\r
-# \r
+#\r
# Component description file for PL011SerialPortLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2012 - 2013, ARM Ltd. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#/** @file\r
-# \r
+#\r
# Component description file for PL011SerialPortLib module\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = PL011SerialPortLib\r
- FILE_GUID = 8ecefc8f-a2c4-4091-b80f-20f7aeb0567f \r
+ FILE_GUID = 8ecefc8f-a2c4-4091-b80f-20f7aeb0567f\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = SerialPortLib\r
/** @file\r
PEI Services Table Pointer Library.\r
- \r
+\r
This library is used for PEIM which does executed from flash device directly but\r
executed in memory.\r
\r
#include <Library/PcdLib.h>\r
\r
/**\r
- Caches a pointer PEI Services Table. \r
- \r
- Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer \r
+ Caches a pointer PEI Services Table.\r
+\r
+ Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer\r
in a platform specific manner.\r
- \r
+\r
If PeiServicesTablePointer is NULL, then ASSERT().\r
- \r
+\r
@param PeiServicesTablePointer The address of PeiServices pointer.\r
**/\r
VOID\r
/**\r
Retrieves the cached value of the PEI Services Table pointer.\r
\r
- Returns the cached value of the PEI Services Table pointer in a CPU specific manner \r
- as specified in the CPU binding section of the Platform Initialization Pre-EFI \r
+ Returns the cached value of the PEI Services Table pointer in a CPU specific manner\r
+ as specified in the CPU binding section of the Platform Initialization Pre-EFI\r
Initialization Core Interface Specification.\r
- \r
+\r
If the cached PEI Services Table pointer is NULL, then ASSERT().\r
\r
@return The pointer to PeiServices.\r
}\r
\r
/**\r
- Perform CPU specific actions required to migrate the PEI Services Table \r
+ Perform CPU specific actions required to migrate the PEI Services Table\r
pointer from temporary RAM to permanent RAM.\r
\r
- For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes \r
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes\r
immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
- For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes \r
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes\r
immediately preceding the Interrupt Descriptor Table (IDT) in memory.\r
For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in\r
- a dedicated CPU register. This means that there is no memory storage \r
- associated with storing the PEI Services Table pointer, so no additional \r
+ a dedicated CPU register. This means that there is no memory storage\r
+ associated with storing the PEI Services Table pointer, so no additional\r
migration actions are required for Itanium or ARM CPUs.\r
\r
**/\r
\r
[LibraryClasses]\r
ArmPlatformGlobalVariableLib\r
- \r
+\r
[Pcd]\r
gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Updates the pointer to the HOB list.\r
\r
@param HobList Hob list pointer to store\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
#/** @file\r
#\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
\r
[LibraryClasses]\r
ArmPlatformGlobalVariableLib\r
- \r
+\r
[FixedPcd.common]\r
gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset\r
GetPerformanceCounter (\r
VOID\r
)\r
-{ \r
+{\r
// Free running 64-bit/32-bit counter is needed here.\r
// Don't think we need this to boot, just to do performance profile\r
UINT64 Value;\r
// Timer starts with the reload value\r
*StartValue = 0xFFFFFFFF;\r
}\r
- \r
+\r
if (EndValue != NULL) {\r
// Timer counts down to 0x0\r
*EndValue = (UINT64)0ULL;\r
}\r
- \r
+\r
return PcdGet64 (PcdEmbeddedPerformanceCounterFrequencyInHz);\r
}\r
#/** @file\r
# Timer library implementation\r
-# \r
-# \r
+#\r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
BASE_NAME = SP804TimerLib\r
- FILE_GUID = 09cefa99-0d07-487f-a651-fb44f094b1c7 \r
+ FILE_GUID = 09cefa99-0d07-487f-a651-fb44f094b1c7\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
LIBRARY_CLASS = TimerLib\r
- \r
+\r
CONSTRUCTOR = TimerConstructor\r
\r
[Sources.common]\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
EmbeddedPkg/EmbeddedPkg.dec\r
ArmPkg/ArmPkg.dec\r
ArmPlatformPkg/ArmPlatformPkg.dec\r
- \r
+\r
[LibraryClasses]\r
DebugLib\r
HobLib\r
gArmTokenSpaceGuid.PcdSystemMemoryBase\r
gArmTokenSpaceGuid.PcdSystemMemorySize\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData\r
- \r
+\r
[depex]\r
TRUE\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Info[7].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderCode);\r
Info[8].Type = EfiLoaderData;\r
Info[8].NumberOfPages = PcdGet32 (PcdMemoryTypeEfiLoaderData);\r
- \r
+\r
// Terminator for the list\r
Info[9].Type = EfiMaxMemoryType;\r
Info[9].NumberOfPages = 0;\r
\r
Routine Description:\r
\r
- \r
+\r
\r
Arguments:\r
\r
FileHandle - Handle of the file being invoked.\r
PeiServices - Describes the list of possible PEI Services.\r
- \r
+\r
Returns:\r
\r
Status - EFI_SUCCESS if the boot mode could be set\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
EmbeddedPkg/EmbeddedPkg.dec\r
ArmPkg/ArmPkg.dec\r
ArmPlatformPkg/ArmPlatformPkg.dec\r
- \r
+\r
[LibraryClasses]\r
PeimEntryPoint\r
DebugLib\r
gArmTokenSpaceGuid.PcdSystemMemoryBase\r
gArmTokenSpaceGuid.PcdSystemMemorySize\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData\r
- \r
+\r
[Depex]\r
TRUE\r
#/** @file\r
#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
[FixedPcd]\r
gArmTokenSpaceGuid.PcdFdBaseAddress\r
gArmTokenSpaceGuid.PcdFdSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdFvBaseAddress\r
gArmTokenSpaceGuid.PcdFvSize\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize\r
- \r
+\r
[depex]\r
TRUE\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
IN EFI_PEI_FILE_HANDLE FileHandle,\r
IN CONST EFI_PEI_SERVICES **PeiServices\r
);\r
- \r
+\r
EFI_STATUS\r
EFIAPI\r
PlatformPeim (\r
\r
Routine Description:\r
\r
- \r
+\r
\r
Arguments:\r
\r
FileHandle - Handle of the file being invoked.\r
PeiServices - Describes the list of possible PEI Services.\r
- \r
+\r
Returns:\r
\r
Status - EFI_SUCCESS if the boot mode could be set\r
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));\r
\r
PlatformPeim ();\r
- \r
+\r
Status = PeiServicesLocatePpi (&gArmGlobalVariablePpiGuid, 0, NULL, (VOID**)&ArmGlobalVariablePpi);\r
if (!EFI_ERROR(Status)) {\r
Status = ArmGlobalVariablePpi->GetGlobalVariableMemory (&GlobalVariableBase);\r
#/** @file\r
#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
[FixedPcd]\r
gArmTokenSpaceGuid.PcdFdBaseAddress\r
gArmTokenSpaceGuid.PcdFdSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdFvBaseAddress\r
gArmTokenSpaceGuid.PcdFvSize\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize\r
- \r
+\r
[Depex]\r
TRUE\r
- \r
+\r
* Main file supporting the transition to PEI Core in Normal World for Versatile Express\r
*\r
* Copyright (c) 2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
//\r
// Copyright (c) 2011, ARM Limited. All rights reserved.\r
-// \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
+//\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
//============================================================\r
//Default Exception Handlers\r
//============================================================\r
- \r
- \r
+\r
+\r
ASM_PFX(PeiVectorTable):\r
b _DefaultResetHandler\r
b _DefaultUndefined\r
//\r
// Copyright (c) 2011, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
\r
IMPORT PeiCommonExceptionEntry\r
EXPORT PeiVectorTable\r
- \r
+\r
PRESERVE8\r
AREA PrePeiCoreException, CODE, READONLY, CODEALIGN, ALIGN=5\r
\r
//============================================================\r
//Default Exception Handlers\r
//============================================================\r
- \r
- \r
+\r
+\r
PeiVectorTable\r
b _DefaultResetHandler\r
b _DefaultUndefined\r
cps #0x13 ; Switch to SVC for common stack\r
mov r0, #5\r
blx PeiCommonExceptionEntry\r
- \r
+\r
_DefaultIrq\r
sub r1, LR, #4\r
cps #0x13 ; Switch to SVC for common stack\r
//\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
ldr r3, StartupAddr\r
- \r
+\r
// Jump to PrePeiCore C code\r
// r0 = mp_id\r
// r1 = pei_core_address\r
//\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#include <AutoGen.h>\r
\r
INCLUDE AsmMacroIoLib.inc\r
- \r
+\r
IMPORT CEntryPoint\r
IMPORT ArmPlatformGetCorePosition\r
IMPORT ArmPlatformIsPrimaryCore\r
IMPORT ArmReadMpidr\r
IMPORT ArmPlatformPeiBootAction\r
EXPORT _ModuleEntryPoint\r
- \r
+\r
PRESERVE8\r
AREA PrePeiCoreEntryPoint, CODE, READONLY\r
- \r
+\r
StartupAddr DCD CEntryPoint\r
\r
_ModuleEntryPoint\r
bl ArmReadMpidr\r
// Keep a copy of the MpId register value\r
mov r5, r0\r
- \r
+\r
// Is it the Primary Core ?\r
bl ArmPlatformIsPrimaryCore\r
\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
ldr r3, StartupAddr\r
- \r
+\r
// Jump to PrePeiCore C code\r
// r0 = mp_id\r
// r1 = pei_core_address\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#------------------------------------------------------------------------------\r
- \r
+\r
.text\r
.align 3\r
\r
GCC_ASM_EXPORT(SecSwitchStack)\r
\r
\r
- \r
+\r
#/**\r
# This allows the caller to switch the stack and return\r
#\r
# VOID *StackDelta\r
# )#\r
#\r
-ASM_PFX(SecSwitchStack): \r
+ASM_PFX(SecSwitchStack):\r
mov R1, R13\r
add R1, R0, R1\r
mov R13, R1\r
bx LR\r
- \r
- \r
- \r
+\r
+\r
+\r
-;------------------------------------------------------------------------------ \r
+;------------------------------------------------------------------------------\r
;\r
; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
;\r
;------------------------------------------------------------------------------\r
- \r
+\r
EXPORT SecSwitchStack\r
- \r
+\r
AREA Switch_Stack, CODE, READONLY\r
- \r
+\r
;/**\r
; This allows the caller to switch the stack and return\r
;\r
; VOID *StackDelta\r
; );\r
;\r
-SecSwitchStack \r
+SecSwitchStack\r
MOV R1, SP\r
ADD R1, R0, R1\r
MOV SP, R1\r
// Migrate the temporary memory heap to permanent memory heap.\r
//\r
CopyMem (NewHeap, OldHeap, CopySize >> 1);\r
- \r
+\r
SecSwitchStack ((UINTN)NewStack - (UINTN)OldStack);\r
\r
return EFI_SUCCESS;\r
#/** @file\r
# Pre PeiCore - Hand-off to PEI Core in Normal World\r
-# \r
+#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
#**/\r
\r
[Defines]\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdGicDistributorBase\r
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
gArmTokenSpaceGuid.PcdGicSgiIntId\r
#/** @file\r
# Pre PeiCore - Hand-off to PEI Core in Normal World\r
-# \r
+#\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
#**/\r
\r
[Defines]\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase\r
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdPeiGlobalVariableSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdGicDistributorBase\r
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
#include <Chipset/ArmV7.h>\r
\r
INCLUDE AsmMacroIoLib.inc\r
- \r
+\r
IMPORT CEntryPoint\r
IMPORT ArmPlatformIsPrimaryCore\r
IMPORT ArmReadMpidr\r
IMPORT ArmPlatformPeiBootAction\r
IMPORT ArmPlatformStackSet\r
- \r
+\r
EXPORT _ModuleEntryPoint\r
\r
PRESERVE8\r
AREA PrePiCoreEntryPoint, CODE, READONLY\r
- \r
+\r
StartupAddr DCD CEntryPoint\r
\r
_ModuleEntryPoint\r
Examines a GUIDed section and returns the size of the decoded buffer and the\r
size of an scratch buffer required to actually decode the data in a GUIDed section.\r
\r
- Examines a GUIDed section specified by InputSection. \r
+ Examines a GUIDed section specified by InputSection.\r
If GUID for InputSection does not match the GUID that this handler supports,\r
- then RETURN_UNSUPPORTED is returned. \r
+ then RETURN_UNSUPPORTED is returned.\r
If the required information can not be retrieved from InputSection,\r
then RETURN_INVALID_PARAMETER is returned.\r
If the GUID of InputSection does match the GUID that this handler supports,\r
then the size required to hold the decoded buffer is returned in OututBufferSize,\r
the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field\r
from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.\r
- \r
+\r
If InputSection is NULL, then ASSERT().\r
If OutputBufferSize is NULL, then ASSERT().\r
If ScratchBufferSize is NULL, then ASSERT().\r
\r
/**\r
Decompress a LZAM compressed GUIDed section into a caller allocated output buffer.\r
- \r
- Decodes the GUIDed section specified by InputSection. \r
- If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. \r
+\r
+ Decodes the GUIDed section specified by InputSection.\r
+ If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.\r
If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.\r
If the GUID of InputSection does match the GUID that this handler supports, then InputSection\r
is decoded into the buffer specified by OutputBuffer and the authentication status of this\r
decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the\r
data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise,\r
the decoded data will be placed in caller allocated buffer specified by OutputBuffer.\r
- \r
+\r
If InputSection is NULL, then ASSERT().\r
If OutputBuffer is NULL, then ASSERT().\r
If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().\r
\r
\r
@param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.\r
- @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. \r
+ @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.\r
@param[out] ScratchBuffer A caller allocated buffer that may be required by this function\r
- as a scratch buffer to perform the decode operation. \r
- @param[out] AuthenticationStatus \r
+ as a scratch buffer to perform the decode operation.\r
+ @param[out] AuthenticationStatus\r
A pointer to the authentication status of the decoded output buffer.\r
See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r
section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must\r
OUT VOID *ScratchBuffer, OPTIONAL\r
OUT UINT32 *AuthenticationStatus\r
);\r
- \r
+\r
#endif // __LZMADECOMPRESS_H__\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[Sources.AArch64]\r
AArch64/ArchPrePi.c\r
AArch64/ModuleEntryPoint.S\r
- \r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
gArmGlobalVariableGuid\r
gArmMpCoreInfoGuid\r
\r
-[FeaturePcd] \r
+[FeaturePcd]\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores\r
\r
[FixedPcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
- \r
+\r
gArmTokenSpaceGuid.PcdVFPEnabled\r
\r
gArmTokenSpaceGuid.PcdFdBaseAddress\r
gArmTokenSpaceGuid.PcdSystemMemoryBase\r
gArmTokenSpaceGuid.PcdSystemMemorySize\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdCoreCount\r
gArmTokenSpaceGuid.PcdArmPrimaryCore\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
-# \r
+#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[Sources.AArch64]\r
AArch64/ArchPrePi.c\r
AArch64/ModuleEntryPoint.S\r
- \r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
gArmGlobalVariableGuid\r
gArmMpCoreInfoGuid\r
\r
-[FeaturePcd] \r
+[FeaturePcd]\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob\r
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores\r
\r
[FixedPcd]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
- \r
+\r
gArmTokenSpaceGuid.PcdVFPEnabled\r
\r
gArmTokenSpaceGuid.PcdFdBaseAddress\r
gArmTokenSpaceGuid.PcdSystemMemoryBase\r
gArmTokenSpaceGuid.PcdSystemMemorySize\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize\r
- \r
+\r
gArmPlatformTokenSpaceGuid.PcdCoreCount\r
\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
UINTN StacksSize;\r
\r
// If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)\r
- ASSERT (IS_XIP() || \r
+ ASSERT (IS_XIP() ||\r
((FixedPcdGet32 (PcdFdBaseAddress) >= FixedPcdGet64 (PcdSystemMemoryBase)) &&\r
((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)(FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet64 (PcdSystemMemorySize)))));\r
\r
// Initialize the Debug Agent for Source Level Debugging\r
InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
SaveAndSetDebugTimerInterrupt (TRUE);\r
- \r
+\r
// Declare the PI/UEFI memory region\r
HobList = HobConstructor (\r
(VOID*)UefiMemoryBase,\r
)\r
{\r
UINT64 StartTimeStamp;\r
- \r
+\r
ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));\r
\r
// Initialize the platform specific controllers\r
ArmCallWFE ();\r
}\r
}\r
- \r
+\r
// If not primary Jump to Secondary Main\r
if (ArmPlatformIsPrimaryCore (MpId)) {\r
// Goto primary Main.\r
#\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
import re\r
\r
class BuildReport:\r
PCDs = {}\r
- \r
+\r
def parse_platform_summary(self, file):\r
pass\r
- \r
+\r
def parse_pcd_report(self, report_file):\r
pcd_reg = re.compile(" (\*P|\*F|\*M| ) (\w+)(\ +)\: (.*) \((\w+)\) = (.*)\n")\r
- \r
+\r
for line in report_file.xreadlines():\r
stripped_line = line.strip()\r
if re.match("\<=+\>", stripped_line):\r
m = pcd_reg.match(line)\r
if m:\r
self.PCDs[guid][m.group(2)] = (m.group(6).strip(),m.group(5))\r
- \r
+\r
def parse_firmware_device(self, file):\r
pass\r
- \r
+\r
def parse_module_summary(self, file):\r
#print "Module Summary"\r
pass\r
- \r
+\r
CONST_SECTION_HEADERS = [('Platform Summary', parse_platform_summary),\r
('Platform Configuration Database Report',parse_pcd_report),\r
('Firmware Device (FD)',parse_firmware_device),\r
('Module Summary',parse_module_summary)]\r
- \r
+\r
def __init__(self, filename = 'report.log'):\r
report_file = open(filename, 'r')\r
for line in report_file.xreadlines():\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
from arm_ds.debugger_v1 import Debugger\r
else:\r
region_reg = re.compile("\((.*),(.*)\)")\r
base_reg = re.compile("(.*)")\r
- \r
+\r
for o,a in opts:\r
region_type = None\r
regex = None\r
regex = region_reg\r
else:\r
assert False, "Unhandled option (%s)" % o\r
- \r
+\r
if region_type:\r
m = regex.match(a)\r
if m:\r
raise Exception('cmd_load_symbols', "Expect a base address")\r
else:\r
raise Exception('cmd_load_symbols', "Expect a region format as (base,size)")\r
- \r
+\r
# Debugger object for accessing the debugger\r
debugger = Debugger()\r
\r
\r
try:\r
armplatform_debugger = edk2_debugger.ArmPlatformDebugger(ec, report_file, regions, verbose)\r
- \r
+\r
if load_all:\r
armplatform_debugger.load_all_symbols()\r
else:\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
import os\r
fv = firmware_volume.FirmwareVolume(ec,\r
int(build.PCDs['gArmTokenSpaceGuid']['PcdFvBaseAddress'][0],16),\r
int(build.PCDs['gArmTokenSpaceGuid']['PcdFvSize'][0],16))\r
- \r
+\r
ffs = fv.get_next_ffs()\r
- while ffs != None: \r
+ while ffs != None:\r
print "# %s" % ffs\r
- \r
+\r
section = ffs.get_next_section()\r
while section != None:\r
print "\t%s" % section\r
except Exception:\r
pass\r
section = ffs.get_next_section(section)\r
- \r
+\r
ffs = fv.get_next_ffs(ffs)\r
\r
def dump_system_table(ec, mem_base, mem_size):\r
st = system_table.SystemTable(ec, mem_base, mem_size)\r
- \r
+\r
debug_info_table_base = st.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID)\r
- \r
+\r
debug_info_table = system_table.DebugInfoTable(ec, debug_info_table_base)\r
debug_info_table.dump()\r
\r
def load_symbol_from_file(ec, filename, address, verbose = False):\r
if verbose:\r
print "Add symbols of %s at 0x%x" % (filename, address)\r
- \r
+\r
try:\r
ec.getImageService().addSymbols(filename, address)\r
except:\r
self.sysmembase = sysmembase\r
self.sysmemsize = sysmemsize\r
self.fvs = fvs\r
- \r
+\r
class ArmPlatformDebugger:\r
system_table = None\r
firmware_volumes = {}\r
- \r
+\r
REGION_TYPE_SYSMEM = 1\r
REGION_TYPE_ROM = 2\r
REGION_TYPE_FV = 3\r
- \r
+\r
def __init__(self, ec, report_log, regions, verbose = False):\r
self.ec = ec\r
self.verbose = verbose\r
fvs = []\r
sysmem_base = None\r
sysmem_size = None\r
- \r
+\r
if report_log and os.path.isfile(report_log):\r
try:\r
self.build = build_report.BuildReport(report_log)\r
except IOError:\r
raise IOError(2, 'Report \'%s\' is not valid' % report_log)\r
- \r
+\r
# Generate list of supported Firmware Volumes\r
if self.build.PCDs['gArmTokenSpaceGuid'].has_key('PcdFvSize') and int(self.build.PCDs['gArmTokenSpaceGuid']['PcdFvSize'][0],16) != 0:\r
fvs.append((int(self.build.PCDs['gArmTokenSpaceGuid']['PcdFvBaseAddress'][0],16),int(self.build.PCDs['gArmTokenSpaceGuid']['PcdFvSize'][0],16)))\r
fvs.append((int(self.build.PCDs['gArmTokenSpaceGuid']['PcdSecureFvBaseAddress'][0],16),int(self.build.PCDs['gArmTokenSpaceGuid']['PcdSecureFvSize'][0],16)))\r
if self.build.PCDs['gArmTokenSpaceGuid'].has_key('PcdHypFvSize') and int(self.build.PCDs['gArmTokenSpaceGuid']['PcdHypFvSize'][0],16) != 0:\r
fvs.append((int(self.build.PCDs['gArmTokenSpaceGuid']['PcdHypFvBaseAddress'][0],16),int(self.build.PCDs['gArmTokenSpaceGuid']['PcdHypFvSize'][0],16)))\r
- \r
+\r
sysmem_base = int(self.build.PCDs['gArmTokenSpaceGuid']['PcdSystemMemoryBase'][0],16)\r
sysmem_size = int(self.build.PCDs['gArmTokenSpaceGuid']['PcdSystemMemorySize'][0],16)\r
else:\r
fvs.append((base,0))\r
else:\r
print "Region type '%d' Not Supported" % region[0]\r
- \r
+\r
self.platform = ArmPlatform(sysmem_base, sysmem_size, fvs)\r
- \r
+\r
def in_sysmem(self, addr):\r
return (self.platform.sysmembase is not None) and (self.platform.sysmembase <= addr) and (addr < self.platform.sysmembase + self.platform.sysmemsize)\r
\r
pc = int(self.ec.getRegisterService().getValue('PC')) & 0xFFFFFFFF\r
if self.in_fv(pc):\r
debug_infos = []\r
- \r
+\r
(fv_base, fv_size) = self.get_fv_at(pc)\r
- \r
+\r
if self.firmware_volumes.has_key(fv_base) == False:\r
self.firmware_volumes[fv_base] = firmware_volume.FirmwareVolume(self.ec, fv_base, fv_size)\r
- \r
+\r
stack_frame = self.ec.getTopLevelStackFrame()\r
info = self.firmware_volumes[fv_base].load_symbols_at(int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF, self.verbose)\r
debug_infos.append(info)\r
while stack_frame.next() is not None:\r
stack_frame = stack_frame.next()\r
- \r
+\r
# Stack frame attached to 'PC'\r
pc = int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF\r
- \r
+\r
# Check if the symbols for this stack frame have already been loaded\r
found = False\r
for debug_info in debug_infos:\r
if found == False:\r
info = self.firmware_volumes[fv_base].load_symbols_at(pc)\r
debug_infos.append(info)\r
- \r
+\r
#self.firmware_volumes[fv_base].load_symbols_at(pc)\r
elif self.in_sysmem(pc):\r
debug_infos = []\r
- \r
+\r
if self.system_table is None:\r
# Find the System Table\r
self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize)\r
- \r
+\r
# Find the Debug Info Table\r
debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID)\r
self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base)\r
- \r
+\r
stack_frame = self.ec.getTopLevelStackFrame()\r
info = self.debug_info_table.load_symbols_at(int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF, self.verbose)\r
debug_infos.append(info)\r
while stack_frame.next() is not None:\r
stack_frame = stack_frame.next()\r
- \r
+\r
# Stack frame attached to 'PC'\r
pc = int(stack_frame.getRegisterService().getValue('PC')) & 0xFFFFFFFF\r
- \r
+\r
# Check if the symbols for this stack frame have already been loaded\r
found = False\r
for debug_info in debug_infos:\r
debug_infos.append(info)\r
except:\r
pass\r
- \r
+\r
#self.debug_info_table.load_symbols_at(pc)\r
else:\r
raise Exception('ArmPlatformDebugger', "Not supported region")\r
- \r
+\r
def load_all_symbols(self):\r
# Load all the XIP symbols attached to the Firmware Volume\r
for (fv_base, fv_size) in self.platform.fvs:\r
if self.firmware_volumes.has_key(fv_base) == False:\r
- self.firmware_volumes[fv_base] = firmware_volume.FirmwareVolume(self.ec, fv_base, fv_size) \r
+ self.firmware_volumes[fv_base] = firmware_volume.FirmwareVolume(self.ec, fv_base, fv_size)\r
self.firmware_volumes[fv_base].load_all_symbols(self.verbose)\r
\r
try:\r
if self.system_table is None:\r
# Find the System Table\r
self.system_table = system_table.SystemTable(self.ec, self.platform.sysmembase, self.platform.sysmemsize)\r
- \r
- \r
+\r
+\r
# Find the Debug Info Table\r
debug_info_table_base = self.system_table.get_configuration_table(system_table.DebugInfoTable.CONST_DEBUG_INFO_TABLE_GUID)\r
self.debug_info_table = system_table.DebugInfoTable(self.ec, debug_info_table_base)\r
- \r
+\r
self.debug_info_table.load_all_symbols(self.verbose)\r
except:\r
# Debugger exception could be excepted if DRAM has not been initialized or if we have not started to run from DRAM yet\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
from arm_ds.debugger_v1 import DebugException\r
import string\r
\r
import edk2_debugger\r
- \r
+\r
class EfiFileSection(object):\r
EFI_SECTION_PE32 = 0x10\r
EFI_SECTION_PIC = 0x11\r
EFI_SECTION_TE = 0x12\r
- \r
+\r
EFI_IMAGE_DEBUG_TYPE_CODEVIEW = 0x2\r
- \r
+\r
SIZEOF_EFI_FFS_FILE_HEADER = 0x28\r
\r
def __init__(self, ec, base):\r
self.base = base\r
self.ec = ec\r
- \r
+\r
def __str__(self):\r
return "FileSection(type:0x%X, size:0x%x)" % (self.get_type(), self.get_size())\r
- \r
+\r
def get_base(self):\r
return self.base\r
- \r
+\r
def get_type(self):\r
return struct.unpack("B", self.ec.getMemoryService().read(self.base + 0x3, 1, 8))[0]\r
- \r
+\r
def get_size(self):\r
return (struct.unpack("<I", self.ec.getMemoryService().read(self.base, 4, 32))[0] & 0x00ffffff)\r
\r
class EfiSectionTE:\r
SIZEOF_EFI_TE_IMAGE_HEADER = 0x28\r
EFI_TE_IMAGE_SIGNATURE = ('V','Z')\r
- \r
+\r
def __init__(self, ec, base_te):\r
self.ec = ec\r
self.base_te = int(base_te)\r
te_sig = struct.unpack("cc", self.ec.getMemoryService().read(self.base_te, 2, 32))\r
if te_sig != EfiSectionTE.EFI_TE_IMAGE_SIGNATURE:\r
raise Exception("EfiFileSectionTE","TE Signature incorrect")\r
- \r
+\r
def get_debug_filepath(self):\r
stripped_size = struct.unpack("<H", self.ec.getMemoryService().read(self.base_te + 0x6, 2, 32))[0]\r
stripped_size -= EfiSectionTE.SIZEOF_EFI_TE_IMAGE_HEADER\r
- \r
+\r
debug_dir_entry_rva = self.ec.getMemoryService().readMemory32(self.base_te + 0x20)\r
if debug_dir_entry_rva == 0:\r
raise Exception("EfiFileSectionTE","No debug directory for image")\r
debug_dir_entry_rva -= stripped_size\r
- \r
+\r
debug_type = self.ec.getMemoryService().readMemory32(self.base_te + debug_dir_entry_rva + 0xC)\r
if (debug_type != 0xdf) and (debug_type != EfiFileSection.EFI_IMAGE_DEBUG_TYPE_CODEVIEW):\r
raise Exception("EfiFileSectionTE","Debug type is not dwarf")\r
dwarf_sig = struct.unpack("cccc", self.ec.getMemoryService().read(self.base_te + debug_rva, 4, 32))\r
if (dwarf_sig != 0x66727764) and (dwarf_sig != FirmwareFile.CONST_NB10_SIGNATURE):\r
raise Exception("EfiFileSectionTE","Dwarf debug signature not found")\r
- \r
+\r
if dwarf_sig == 0x66727764:\r
filename = self.base_te + debug_rva + 0xc\r
else:\r
filename = self.base_te + debug_rva + 0x10\r
filename = struct.unpack("200s", self.ec.getMemoryService().read(filename, 200, 32))[0]\r
return filename[0:string.find(filename,'\0')]\r
- \r
+\r
def get_debug_elfbase(self):\r
stripped_size = struct.unpack("<H", self.ec.getMemoryService().read(self.base_te + 0x6, 2, 32))[0]\r
stripped_size -= EfiSectionTE.SIZEOF_EFI_TE_IMAGE_HEADER\r
- \r
+\r
base_of_code = self.ec.getMemoryService().readMemory32(self.base_te + 0xC)\r
- \r
+\r
return self.base_te + base_of_code - stripped_size\r
\r
class EfiSectionPE32:\r
debug_type = self.ec.getMemoryService().readMemory32(self.base_pe32 + debug_dir_entry_rva + 0xC)\r
if (debug_type != 0xdf) and (debug_type != EfiFileSection.EFI_IMAGE_DEBUG_TYPE_CODEVIEW):\r
raise Exception("EfiFileSectionPE32","Debug type is not dwarf")\r
- \r
- \r
+\r
+\r
debug_rva = self.ec.getMemoryService().readMemory32(self.base_pe32 + debug_dir_entry_rva + 0x14)\r
- \r
+\r
dwarf_sig = struct.unpack("cccc", self.ec.getMemoryService().read(str(self.base_pe32 + debug_rva), 4, 32))\r
if (dwarf_sig != 0x66727764) and (dwarf_sig != FirmwareFile.CONST_NB10_SIGNATURE):\r
raise Exception("EfiFileSectionPE32","Dwarf debug signature not found")\r
- \r
+\r
if dwarf_sig == 0x66727764:\r
filename = self.base_pe32 + debug_rva + 0xc\r
else:\r
filename = self.base_pe32 + debug_rva + 0x10\r
filename = struct.unpack("200s", self.ec.getMemoryService().read(str(filename), 200, 32))[0]\r
return filename[0:string.find(filename,'\0')]\r
- \r
+\r
def get_debug_elfbase(self):\r
# Offset from dos hdr to PE file hdr\r
pe_file_header = self.base_pe32 + self.ec.getMemoryService().readMemory32(self.base_pe32 + 0x3C)\r
- \r
+\r
base_of_code = self.base_pe32 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)\r
base_of_data = self.base_pe32 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)\r
- \r
+\r
if (base_of_code < base_of_data) and (base_of_code != 0):\r
return base_of_code\r
else:\r
debug_type = self.ec.getMemoryService().readMemory32(self.base_pe64 + debug_dir_entry_rva + 0xC)\r
if (debug_type != 0xdf) and (debug_type != EfiFileSection.EFI_IMAGE_DEBUG_TYPE_CODEVIEW):\r
raise Exception("EfiFileSectionPE64","Debug type is not dwarf")\r
- \r
- \r
+\r
+\r
debug_rva = self.ec.getMemoryService().readMemory32(self.base_pe64 + debug_dir_entry_rva + 0x14)\r
- \r
+\r
dwarf_sig = struct.unpack("cccc", self.ec.getMemoryService().read(str(self.base_pe64 + debug_rva), 4, 32))\r
if (dwarf_sig != 0x66727764) and (dwarf_sig != FirmwareFile.CONST_NB10_SIGNATURE):\r
raise Exception("EfiFileSectionPE64","Dwarf debug signature not found")\r
- \r
+\r
if dwarf_sig == 0x66727764:\r
filename = self.base_pe64 + debug_rva + 0xc\r
else:\r
filename = self.base_pe64 + debug_rva + 0x10\r
filename = struct.unpack("200s", self.ec.getMemoryService().read(str(filename), 200, 32))[0]\r
return filename[0:string.find(filename,'\0')]\r
- \r
+\r
def get_debug_elfbase(self):\r
# Offset from dos hdr to PE file hdr\r
pe_file_header = self.base_pe64 + self.ec.getMemoryService().readMemory32(self.base_pe64 + 0x3C)\r
- \r
+\r
base_of_code = self.base_pe64 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)\r
base_of_data = self.base_pe64 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)\r
- \r
+\r
if (base_of_code < base_of_data) and (base_of_code != 0):\r
return base_of_code\r
else:\r
return base_of_data\r
- \r
+\r
class FirmwareFile:\r
EFI_FV_FILETYPE_RAW = 0x01\r
EFI_FV_FILETYPE_FREEFORM = 0x02\r
EFI_FV_FILETYPE_APPLICATION = 0x09\r
EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE = 0x0B\r
EFI_FV_FILETYPE_FFS_MIN = 0xF0\r
- \r
+\r
CONST_NB10_SIGNATURE = ('N','B','1','0')\r
- \r
+\r
def __init__(self, fv, base, ec):\r
self.fv = fv\r
self.base = base\r
self.ec = ec\r
- \r
+\r
def __str__(self):\r
return "FFS(state:0x%x, type:0x%X, size:0x%x)" % (self.get_state(), self.get_type(), self.get_size())\r
- \r
+\r
def get_base(self):\r
return self.base\r
- \r
+\r
def get_size(self):\r
size = (self.ec.getMemoryService().readMemory32(self.base + 0x14) & 0x00ffffff)\r
\r
# Occupied size is the size considering the alignment\r
return size + ((0x8 - (size & 0x7)) & 0x7)\r
- \r
+\r
def get_type(self):\r
return self.ec.getMemoryService().readMemory8(self.base + 0x12)\r
- \r
+\r
def get_state(self):\r
state = self.ec.getMemoryService().readMemory8(self.base + 0x17)\r
- \r
+\r
polarity = self.fv.get_polarity()\r
if polarity:\r
state = ~state\r
- \r
+\r
highest_bit = 0x80;\r
while (highest_bit != 0) and ((highest_bit & state) == 0):\r
highest_bit >>= 1\r
- \r
+\r
return highest_bit\r
- \r
+\r
def get_next_section(self, section=None):\r
if section == None:\r
if self.get_type() != FirmwareFile.EFI_FV_FILETYPE_FFS_MIN:\r
return None\r
else:\r
section_base = int(section.get_base() + section.get_size())\r
- \r
+\r
# Align to next 4 byte boundary\r
if (section_base & 0x3) != 0:\r
section_base = section_base + 0x4 - (section_base & 0x3)\r
return EfiFileSection(self.ec, section_base)\r
else:\r
return None\r
- \r
+\r
class FirmwareVolume:\r
CONST_FV_SIGNATURE = ('_','F','V','H')\r
EFI_FVB2_ERASE_POLARITY = 0x800\r
- \r
+\r
DebugInfos = []\r
- \r
+\r
def __init__(self, ec, fv_base, fv_size):\r
self.ec = ec\r
self.fv_base = fv_base\r
self.fv_size = fv_size\r
- \r
+\r
try:\r
signature = struct.unpack("cccc", self.ec.getMemoryService().read(fv_base + 0x28, 4, 32))\r
except DebugException:\r
raise Exception("FirmwareVolume", "Not possible to access the defined firmware volume at [0x%X,0x%X]. Could be the used build report does not correspond to your current debugging context." % (int(fv_base),int(fv_base+fv_size)))\r
if signature != FirmwareVolume.CONST_FV_SIGNATURE:\r
raise Exception("FirmwareVolume", "This is not a valid firmware volume")\r
- \r
+\r
def get_size(self):\r
return self.ec.getMemoryService().readMemory32(self.fv_base + 0x20)\r
- \r
+\r
def get_attributes(self):\r
return self.ec.getMemoryService().readMemory32(self.fv_base + 0x2C)\r
- \r
+\r
def get_polarity(self):\r
attributes = self.get_attributes()\r
if attributes & FirmwareVolume.EFI_FVB2_ERASE_POLARITY:\r
return 1\r
else:\r
return 0\r
- \r
+\r
def get_next_ffs(self, ffs=None):\r
if ffs == None:\r
# Get the offset of the first FFS file from the FV header\r
else:\r
# Goto the next FFS file\r
ffs_base = int(ffs.get_base() + ffs.get_size())\r
- \r
+\r
# Align to next 8 byte boundary\r
if (ffs_base & 0x7) != 0:\r
ffs_base = ffs_base + 0x8 - (ffs_base & 0x7)\r
- \r
+\r
if ffs_base < self.fv_base + self.get_size():\r
return FirmwareFile(self, ffs_base, self.ec)\r
else:\r
return None\r
- \r
- def get_debug_info(self): \r
+\r
+ def get_debug_info(self):\r
self.DebugInfos = []\r
- \r
+\r
ffs = self.get_next_ffs()\r
- while ffs != None: \r
+ while ffs != None:\r
section = ffs.get_next_section()\r
while section != None:\r
type = section.get_type()\r
def load_symbols_at(self, addr, verbose = False):\r
if self.DebugInfos == []:\r
self.get_debug_info()\r
- \r
+\r
for debug_info in self.DebugInfos:\r
if (addr >= debug_info[0]) and (addr < debug_info[0] + debug_info[1]):\r
if debug_info[2] == EfiFileSection.EFI_SECTION_TE:\r
section = EfiSectionPE32(self.ec, debug_info[0] + 0x4)\r
else:\r
raise Exception('FirmwareVolume','Section Type not supported')\r
- \r
+\r
try:\r
edk2_debugger.load_symbol_from_file(self.ec, section.get_debug_filepath(), section.get_debug_elfbase(), verbose)\r
except Exception, (ErrorClass, ErrorMessage):\r
def load_all_symbols(self, verbose = False):\r
if self.DebugInfos == []:\r
self.get_debug_info()\r
- \r
+\r
for debug_info in self.DebugInfos:\r
if debug_info[2] == EfiFileSection.EFI_SECTION_TE:\r
section = EfiSectionTE(self.ec, debug_info[0] + 0x4)\r
section = EfiSectionPE32(self.ec, debug_info[0] + 0x4)\r
else:\r
continue\r
- \r
+\r
try:\r
edk2_debugger.load_symbol_from_file(self.ec, section.get_debug_filepath(), section.get_debug_elfbase(), verbose)\r
except Exception, (ErrorClass, ErrorMessage):\r
#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
from arm_ds.debugger_v1 import DebugException\r
\r
class DebugInfoTable:\r
CONST_DEBUG_INFO_TABLE_GUID = ( 0x49152E77L, 0x47641ADAL, 0xFE7AA2B7L, 0x8B5ED9FEL)\r
- \r
+\r
DebugInfos = []\r
- \r
+\r
def __init__(self, ec, debug_info_table_header_offset):\r
self.ec = ec\r
self.base = debug_info_table_header_offset\r
- \r
+\r
def get_debug_info(self):\r
# Get the information from EFI_DEBUG_IMAGE_INFO_TABLE_HEADER\r
count = self.ec.getMemoryService().readMemory32(self.base + 0x4)\r
debug_info_table_base = self.ec.getMemoryService().readMemory64(self.base + 0x8)\r
else:\r
debug_info_table_base = self.ec.getMemoryService().readMemory32(self.base + 0x8)\r
- \r
+\r
self.DebugInfos = []\r
- \r
+\r
for i in range(0, count):\r
# Get the address of the structure EFI_DEBUG_IMAGE_INFO\r
if edk2_debugger.is_aarch64(self.ec):\r
\r
image_base = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x20)\r
image_size = self.ec.getMemoryService().readMemory32(loaded_image_protocol + 0x28)\r
- \r
+\r
self.DebugInfos.append((image_base,image_size))\r
- \r
+\r
# Return (base, size)\r
def load_symbols_at(self, addr, verbose = False):\r
if self.DebugInfos == []:\r
self.get_debug_info()\r
- \r
+\r
found = False\r
for debug_info in self.DebugInfos:\r
if (addr >= debug_info[0]) and (addr < debug_info[0] + debug_info[1]):\r
section = firmware_volume.EfiSectionPE64(self.ec, debug_info[0])\r
else:\r
section = firmware_volume.EfiSectionPE32(self.ec, debug_info[0])\r
- \r
+\r
try:\r
edk2_debugger.load_symbol_from_file(self.ec, section.get_debug_filepath(), section.get_debug_elfbase(), verbose)\r
except Exception, (ErrorClass, ErrorMessage):\r
def load_all_symbols(self, verbose = False):\r
if self.DebugInfos == []:\r
self.get_debug_info()\r
- \r
+\r
for debug_info in self.DebugInfos:\r
if edk2_debugger.is_aarch64(self.ec):\r
section = firmware_volume.EfiSectionPE64(self.ec, debug_info[0])\r
else:\r
section = firmware_volume.EfiSectionPE32(self.ec, debug_info[0])\r
- \r
+\r
try:\r
edk2_debugger.load_symbol_from_file(self.ec, section.get_debug_filepath(), section.get_debug_elfbase(), verbose)\r
except Exception, (ErrorClass, ErrorMessage):\r
else:\r
section = firmware_volume.EfiSectionPE32(self.ec, base_pe32)\r
print section.get_debug_filepath()\r
- \r
+\r
class SystemTable:\r
CONST_ST_SIGNATURE = ('I','B','I',' ','S','Y','S','T')\r
- \r
+\r
def __init__(self, ec, membase, memsize):\r
self.membase = membase\r
self.memsize = memsize\r
self.ec = ec\r
- \r
+\r
found = False\r
- \r
+\r
# Start from the top of the memory\r
offset = self.membase + self.memsize\r
# Align to highest 4MB boundary\r
offset = offset & ~0x3FFFFF\r
# We should not have a System Table at the top of the System Memory\r
offset = offset - 0x400000\r
- \r
+\r
# Start at top and look on 4MB boundaries for system table ptr structure\r
while offset > self.membase:\r
try:\r
self.system_table_base = self.ec.getMemoryService().readMemory32(offset + 0x8)\r
break\r
offset = offset - 0x400000\r
- \r
+\r
if not found:\r
raise Exception('SystemTable','System Table not found in System Memory [0x%x;0x%X]' % (membase,membase+memsize))\r
- \r
+\r
def get_configuration_table(self, conf_table_guid):\r
if edk2_debugger.is_aarch64(self.ec):\r
# Number of configuration Table entry\r
\r
# Get location of the Configuration Table entries\r
conf_table_offset = self.ec.getMemoryService().readMemory32(self.system_table_base + 0x44)\r
- \r
+\r
for i in range(0, conf_table_entry_count):\r
if edk2_debugger.is_aarch64(self.ec):\r
offset = conf_table_offset + (i * 0x18)\r
return self.ec.getMemoryService().readMemory64(offset + 0x10)\r
else:\r
return self.ec.getMemoryService().readMemory32(offset + 0x10)\r
- \r
+\r
raise Exception('SystemTable','Configuration Table not found')\r
#========================================================================================\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#=======================================================================================\r
\r
#start of the code section\r
-.text \r
+.text\r
.align 3\r
\r
GCC_ASM_EXPORT(return_from_exception)\r
mov sp, r3 @ Set the stack of the Monitor Mode\r
\r
mov lr, r0 @ Use the pass entrypoint as lr\r
- \r
+\r
msr spsr_cxsf, r4 @ Use saved mode for the MOVS jump to the kernel\r
\r
mov r4, r0 @ Swap EntryPoint and MpId registers\r
isb\r
pop { r1 }\r
bx lr @ return (hopefully thumb-safe!)\r
- \r
+\r
ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
//\r
// Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
EXPORT enter_monitor_mode\r
EXPORT copy_cpsr_into_spsr\r
EXPORT set_non_secure_mode\r
- \r
+\r
AREA Helper, CODE, READONLY\r
\r
// r0: Monitor World EntryPoint\r
mov sp, r3 // Set the stack of the Monitor Mode\r
\r
mov lr, r0 // Use the pass entrypoint as lr\r
- \r
+\r
msr spsr_cxsf, r4 // Use saved mode for the MOVS jump to the kernel\r
\r
mov r4, r0 // Swap EntryPoint and MpId registers\r
\r
dead\r
B dead\r
- \r
+\r
END\r
//\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
bl ASM_PFX(ArmReadMpidr)\r
// Keep a copy of the MpId register value\r
mov r9, r0\r
- \r
+\r
// Is it the Primary Core ?\r
bl ASM_PFX(ArmPlatformIsPrimaryCore)\r
cmp r0, #1\r
// Only the primary core initialize the memory (SMC)\r
beq _InitMem\r
- \r
+\r
_WaitInitMem:\r
// If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
// Otherwise we have to wait the Primary Core to finish the initialization\r
bl ASM_PFX(ArmCallWFE)\r
// Now the Init Mem is initialized, we setup the secondary core stacks\r
b _SetupSecondaryCoreStack\r
- \r
+\r
_InitMem:\r
// If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
cmp r10, #ARM_SEC_COLD_BOOT\r
\r
// Initialize Init Boot Memory\r
bl ASM_PFX(ArmPlatformSecBootMemoryInit)\r
- \r
+\r
_SetupPrimaryCoreStack:\r
// Get the top of the primary stacks (and the base of the secondary stacks)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoresSecStackBase), r1)\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
ldr r3, StartupAddr\r
- \r
+\r
// Jump to SEC C code\r
// r0 = mp_id\r
// r1 = Boot Mode\r
mov r0, r9\r
mov r1, r10\r
blx r3\r
- \r
+\r
_NeverReturn:\r
b _NeverReturn\r
//\r
// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#include "SecInternal.h"\r
\r
INCLUDE AsmMacroIoLib.inc\r
- \r
+\r
IMPORT CEntryPoint\r
IMPORT ArmPlatformIsPrimaryCore\r
IMPORT ArmPlatformGetCorePosition\r
\r
PRESERVE8\r
AREA SecEntryPoint, CODE, READONLY\r
- \r
+\r
StartupAddr DCD CEntryPoint\r
\r
_ModuleEntryPoint FUNCTION\r
// Jump to Platform Specific Boot Action function\r
blx ArmPlatformSecBootAction\r
\r
-_IdentifyCpu \r
+_IdentifyCpu\r
// Identify CPU ID\r
bl ArmReadMpidr\r
// Keep a copy of the MpId register value\r
mov r9, r0\r
- \r
+\r
// Is it the Primary Core ?\r
bl ArmPlatformIsPrimaryCore\r
cmp r0, #1\r
// Only the primary core initialize the memory (SMC)\r
beq _InitMem\r
- \r
+\r
_WaitInitMem\r
// If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
// Otherwise we have to wait the Primary Core to finish the initialization\r
bl ArmCallWFE\r
// Now the Init Mem is initialized, we setup the secondary core stacks\r
b _SetupSecondaryCoreStack\r
- \r
+\r
_InitMem\r
// If we are not doing a cold boot in this case we should assume the Initial Memory to be already initialized\r
cmp r10, #ARM_SEC_COLD_BOOT\r
\r
// Initialize Init Boot Memory\r
bl ArmPlatformSecBootMemoryInit\r
- \r
+\r
_SetupPrimaryCoreStack\r
// Get the top of the primary stacks (and the base of the secondary stacks)\r
LoadConstantToReg (FixedPcdGet32(PcdCPUCoresSecStackBase), r1)\r
// Move sec startup address into a data register\r
// Ensure we're jumping to FV version of the code (not boot remapped alias)\r
ldr r3, StartupAddr\r
- \r
+\r
// Jump to SEC C code\r
// r0 = mp_id\r
// r1 = Boot Mode\r
mov r1, r10\r
blx r3\r
ENDFUNC\r
- \r
+\r
_NeverReturn\r
b _NeverReturn\r
END\r
#/** @file\r
# SEC - Reset vector code that jumps to C and starts the PEI phase\r
-# \r
+#\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-# \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
#**/\r
\r
[Defines]\r
Arm/Helper.S | GCC\r
Arm/SecEntryPoint.S | GCC\r
Arm/SecEntryPoint.asm | RVCT\r
- \r
+\r
[Sources.AARCH64]\r
AArch64/Arch.c\r
AArch64/Helper.S\r
ArmGicLib\r
PrintLib\r
SerialPortLib\r
- \r
+\r
[FixedPcd.common]\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
\r
gArmTokenSpaceGuid.PcdTrustzoneSupport\r
gArmTokenSpaceGuid.PcdVFPEnabled\r
- \r
+\r
gArmTokenSpaceGuid.PcdArmScr\r
gArmTokenSpaceGuid.PcdArmNonSecModeTransition\r
- \r
+\r
gArmTokenSpaceGuid.PcdSecureFvBaseAddress\r
gArmTokenSpaceGuid.PcdSecureFvSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdFvBaseAddress\r
\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecSecondaryStackSize\r
gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase\r
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize\r
- \r
+\r
gArmTokenSpaceGuid.PcdGicDistributorBase\r
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase\r
- \r
- gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize \r
+\r
+ gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize\r
\r
[FixedPcd.ARM]\r
gArmTokenSpaceGuid.PcdArmNsacr\r
\r
#/** @file\r
-# \r
+#\r
# Component description file for Bds module\r
-# \r
+#\r
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
UefiDriverEntryPoint\r
\r
[Guids]\r
- \r
+\r
\r
[Protocols]\r
- gEfiBdsArchProtocolGuid \r
- gEfiSimpleTextInProtocolGuid \r
- gEfiSimpleTextOutProtocolGuid \r
- gEfiSerialIoProtocolGuid \r
+ gEfiBdsArchProtocolGuid\r
+ gEfiSimpleTextInProtocolGuid\r
+ gEfiSimpleTextOutProtocolGuid\r
+ gEfiSerialIoProtocolGuid\r
gEfiDevicePathProtocolGuid\r
gEfiSimpleFileSystemProtocolGuid\r
gEfiUsbIoProtocolGuid\r
/** @file\r
- The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements \r
- of the UEFI specification as it is designed to implement an embedded systmes \r
+ The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements\r
+ of the UEFI specification as it is designed to implement an embedded systmes\r
propriatary boot scheme.\r
\r
- This template assume a DXE driver produces a SerialIo protocol not using the EFI \r
+ This template assume a DXE driver produces a SerialIo protocol not using the EFI\r
driver module and it will attempt to connect a console on top of this.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
};\r
\r
\r
- \r
- \r
+\r
+\r
/**\r
- This function uses policy data from the platform to determine what operating \r
- system or system utility should be loaded and invoked. This function call \r
- also optionally make the use of user input to determine the operating system \r
- or system utility to be loaded and invoked. When the DXE Core has dispatched \r
- all the drivers on the dispatch queue, this function is called. This \r
- function will attempt to connect the boot devices required to load and invoke \r
- the selected operating system or system utility. During this process, \r
- additional firmware volumes may be discovered that may contain addition DXE \r
- drivers that can be dispatched by the DXE Core. If a boot device cannot be \r
- fully connected, this function calls the DXE Service Dispatch() to allow the \r
- DXE drivers from any newly discovered firmware volumes to be dispatched. \r
- Then the boot device connection can be attempted again. If the same boot \r
- device connection operation fails twice in a row, then that boot device has \r
+ This function uses policy data from the platform to determine what operating\r
+ system or system utility should be loaded and invoked. This function call\r
+ also optionally make the use of user input to determine the operating system\r
+ or system utility to be loaded and invoked. When the DXE Core has dispatched\r
+ all the drivers on the dispatch queue, this function is called. This\r
+ function will attempt to connect the boot devices required to load and invoke\r
+ the selected operating system or system utility. During this process,\r
+ additional firmware volumes may be discovered that may contain addition DXE\r
+ drivers that can be dispatched by the DXE Core. If a boot device cannot be\r
+ fully connected, this function calls the DXE Service Dispatch() to allow the\r
+ DXE drivers from any newly discovered firmware volumes to be dispatched.\r
+ Then the boot device connection can be attempted again. If the same boot\r
+ device connection operation fails twice in a row, then that boot device has\r
failed, and should be skipped. This function should never return.\r
\r
@param This The EFI_BDS_ARCH_PROTOCOL instance.\r
UINTN Index;\r
EFI_DEVICE_PATH_PROTOCOL *LoadImageDevicePath;\r
EFI_DEVICE_PATH_PROTOCOL *FileSystemDevicePath;\r
- \r
+\r
PERF_END (NULL, "DXE", NULL, 0);\r
PERF_START (NULL, "BDS", NULL, 0);\r
\r
Size = 0x100;\r
gST->FirmwareVendor = AllocateRuntimePool (Size);\r
ASSERT (gST->FirmwareVendor != NULL);\r
- \r
+\r
UnicodeSPrint (gST->FirmwareVendor, Size, L"BeagleBoard EFI %a %a", __DATE__, __TIME__);\r
\r
//\r
// Now we need to setup the EFI System Table with information about the console devices.\r
- // This code is normally in the console spliter driver on platforms that support multiple \r
+ // This code is normally in the console spliter driver on platforms that support multiple\r
// consoles at the same time\r
//\r
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextOutProtocolGuid, NULL, &NoHandles, &Buffer);\r
gST->StandardErrorHandle = Buffer[0];\r
Status = gBS->HandleProtocol (Buffer[0], &gEfiSimpleTextOutProtocolGuid, (VOID **)&gST->ConOut);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
gST->StdErr = gST->ConOut;\r
- \r
+\r
gST->ConOut->OutputString (gST->ConOut, L"BDS: Console Started!!!!\n\r");\r
FreePool (Buffer);\r
- \r
+\r
gConsolePresent = TRUE;\r
- } \r
- \r
+ }\r
+\r
\r
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleTextInProtocolGuid, NULL, &NoHandles, &Buffer);\r
if (!EFI_ERROR (Status)) {\r
gST->ConsoleInHandle = Buffer[0];\r
Status = gBS->HandleProtocol (Buffer[0], &gEfiSimpleTextInProtocolGuid, (VOID **)&gST->ConIn);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
FreePool (Buffer);\r
}\r
\r
//\r
- // We now have EFI Consoles up and running. Print () will work now. DEBUG () and ASSERT () worked \r
+ // We now have EFI Consoles up and running. Print () will work now. DEBUG () and ASSERT () worked\r
// prior to this point as they were configured to use a more primative output scheme.\r
//\r
\r
if (EFI_ERROR (Status)) {\r
break;\r
}\r
- \r
+\r
if (HandleCount == OldHandleCount) {\r
break;\r
}\r
}\r
}\r
}\r
- \r
+\r
//\r
- // Normal UEFI behavior is to process Globally Defined Variables as defined in Chapter 3 \r
+ // Normal UEFI behavior is to process Globally Defined Variables as defined in Chapter 3\r
// (Boot Manager) of the UEFI specification. For this embedded system we don't do this.\r
//\r
\r
}\r
\r
//\r
- // EFI does not define the behaviour if all boot attemps fail and the last one returns. \r
+ // EFI does not define the behaviour if all boot attemps fail and the last one returns.\r
// So we make a policy choice to reset the system since this BDS does not have a UI.\r
//\r
gRT->ResetSystem (EfiResetShutdown, Status, 0, NULL);\r
\r
EFI_STATUS\r
LoadPeCoffSectionFromFv (\r
- IN EFI_HANDLE FvHandle, \r
+ IN EFI_HANDLE FvHandle,\r
IN EFI_GUID *NameGuid\r
);\r
\r
/** @file\r
- The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements \r
- of the UEFI specification as it is designed to implement an embedded systmes \r
+ The entry of the embedded BDS. This BDS does not follow the Boot Manager requirements\r
+ of the UEFI specification as it is designed to implement an embedded systmes\r
propriatary boot scheme.\r
\r
- This template assume a DXE driver produces a SerialIo protocol not using the EFI \r
+ This template assume a DXE driver produces a SerialIo protocol not using the EFI\r
driver module and it will attempt to connect a console on top of this.\r
\r
- \r
+\r
Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINTN UiStringLen;\r
CHAR16 *UiSection;\r
UINT32 Authentication;\r
- \r
- \r
+\r
+\r
UiStringLen = 0;\r
if (UiString != NULL) {\r
DEBUG ((DEBUG_ERROR, "UiString %s\n", UiString));\r
UiStringLen = StrLen (UiString);\r
}\r
- \r
+\r
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiFirmwareVolume2ProtocolGuid, NULL, &NoHandles, &Buffer);\r
if (!EFI_ERROR (Status)) {\r
for (Index = 0; Index < NoHandles; Index++) {\r
Key = AllocatePool (Fv->KeySize);\r
ASSERT (Key != NULL);\r
ZeroMem (Key, Fv->KeySize);\r
- \r
+\r
FileType = EFI_FV_FILETYPE_APPLICATION;\r
- \r
+\r
do {\r
NextStatus = Fv->GetNextFile (Fv, Key, &FileType, NameGuid, &Attributes, &Size);\r
if (!EFI_ERROR (NextStatus)) {\r
FreePool (Key);\r
return Status;\r
}\r
- \r
+\r
UiSection = NULL;\r
Status = Fv->ReadSection (\r
- Fv, \r
- NameGuid, \r
- EFI_SECTION_USER_INTERFACE, \r
+ Fv,\r
+ NameGuid,\r
+ EFI_SECTION_USER_INTERFACE,\r
0,\r
(VOID **)&UiSection,\r
&Size,\r
if (!EFI_ERROR (Status)) {\r
if (StrnCmp (UiString, UiSection, UiStringLen) == 0) {\r
//\r
- // We found a UiString match. \r
+ // We found a UiString match.\r
//\r
*FvHandle = Buffer[Index];\r
FreePool (Key);\r
}\r
}\r
} while (!EFI_ERROR (NextStatus));\r
- \r
+\r
FreePool (Key);\r
}\r
}\r
- \r
+\r
FreePool (Buffer);\r
}\r
\r
IN EFI_HANDLE FvHandle,\r
IN EFI_GUID *NameGuid\r
)\r
-{ \r
+{\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH NewNode;\r
\r
DevicePath = DevicePathFromHandle (FvHandle);\r
\r
EfiInitializeFwVolDevicepathNode (&NewNode, NameGuid);\r
- \r
+\r
return AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&NewNode);\r
}\r
\r
\r
EFI_STATUS\r
LoadPeCoffSectionFromFv (\r
- IN EFI_HANDLE FvHandle, \r
+ IN EFI_HANDLE FvHandle,\r
IN EFI_GUID *NameGuid\r
)\r
{\r
EFI_HANDLE ImageHandle;\r
\r
DevicePath = FvFileDevicePath (FvHandle, NameGuid);\r
- \r
+\r
Status = gBS->LoadImage (TRUE, gImageHandle, DevicePath, NULL, 0, &ImageHandle);\r
if (!EFI_ERROR (Status)) {\r
PERF_END (NULL, "BDS", NULL, 0);\r
Status = gBS->StartImage (ImageHandle, NULL, NULL);\r
}\r
- \r
+\r
return Status;\r
}\r
- \r
+\r
ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA8Lib/ArmCortexA8Lib.inf\r
ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf\r
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf\r
- \r
+\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf\r
\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf\r
\r
EfiResetSystemLib|BeagleBoardPkg/Library/ResetSystemLib/ResetSystemLib.inf\r
- \r
+\r
PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
- \r
+\r
EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf\r
- \r
- \r
+\r
+\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
- \r
+\r
#\r
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window \r
+ # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window\r
# in the debugger will show load and unload commands for symbols. You can cut and paste this\r
# into the command window to load symbols. We should be able to use a script to do this, but\r
# the version of RVD I have does not support scipts accessing system memory.\r
PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf\r
# PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
\r
- \r
+\r
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf\r
DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf\r
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
- \r
+\r
SerialPortLib|Omap35xxPkg/Library/SerialPortLib/SerialPortLib.inf\r
- SerialPortExtLib|EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.inf \r
+ SerialPortExtLib|EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.inf\r
SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf\r
- \r
+\r
RealTimeClockLib|Omap35xxPkg/Library/RealTimeClockLib/RealTimeClockLib.inf\r
\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
- \r
+\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
- \r
+\r
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf\r
\r
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf\r
\r
- TimerLib|Omap35xxPkg/Library/Omap35xxTimerLib/Omap35xxTimerLib.inf \r
+ TimerLib|Omap35xxPkg/Library/Omap35xxTimerLib/Omap35xxTimerLib.inf\r
OmapLib|Omap35xxPkg/Library/OmapLib/OmapLib.inf\r
OmapDmaLib|Omap35xxPkg/Library/OmapDmaLib/OmapDmaLib.inf\r
DebugAgentTimerLib|Omap35xxPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf\r
[LibraryClasses.common.SEC]\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf\r
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.inf\r
- \r
+\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
\r
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
- \r
+\r
HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf\r
PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf\r
MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf\r
PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf\r
PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf\r
MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf\r
- \r
+\r
# 1/123 faster than Stm or Vstm version\r
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
\r
- # Uncomment to turn on GDB stub in SEC. \r
+ # Uncomment to turn on GDB stub in SEC.\r
#DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
\r
[LibraryClasses.common.PEI_CORE]\r
PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf\r
\r
PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf\r
- \r
+\r
\r
[LibraryClasses.common.DXE_DRIVER]\r
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE\r
- \r
+\r
#\r
# Control what commands are supported from the UI\r
# Turn these on and off to add features or save size\r
- # \r
+ #\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE\r
\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE\r
- \r
+\r
# Use the Vector Table location in CpuDxe. We will not copy the Vector Table at PcdCpuVectorBaseAddress\r
gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE\r
gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE\r
\r
\r
[PcdsFixedAtBuild.common]\r
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"Beagle Board"\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"BeagleEdk2"\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000\r
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
#\r
# Optional feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
-# Values are in EFI Pages (4K). DXE Core will make sure that \r
-# at least this much of each type of memory can be allocated \r
+# Values are in EFI Pages (4K). DXE Core will make sure that\r
+# at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
# Beagle board Specific PCDs\r
#\r
gArmTokenSpaceGuid.PcdVFPEnabled|1\r
- \r
+\r
gArmTokenSpaceGuid.PcdSystemMemoryBase|0x80000000\r
gArmTokenSpaceGuid.PcdSystemMemorySize|0x08000000\r
\r
# Size of the region used by UEFI in permanent memory (Reserved 16MB)\r
gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x01000000\r
- \r
+\r
# Size of the region reserved for fixed address allocations (Reserved 32MB)\r
gArmTokenSpaceGuid.PcdArmLinuxKernelMaxOffset|0x02000000\r
\r
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80008000\r
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
#\r
# ARM OS Loader\r
#\r
- # BeagleBoard machine type (OMAP3_BEAGLE = 1546) required for ARM Linux: \r
- gArmTokenSpaceGuid.PcdArmMachineType|1546 \r
+ # BeagleBoard machine type (OMAP3_BEAGLE = 1546) required for ARM Linux:\r
+ gArmTokenSpaceGuid.PcdArmMachineType|1546\r
\r
################################################################################\r
#\r
# SEC\r
#\r
ArmPlatformPkg/PrePi/PeiUniCore.inf\r
- \r
+\r
#\r
# DXE\r
#\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf\r
# NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf\r
- NULL|EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf \r
+ NULL|EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf\r
}\r
\r
ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
- \r
+\r
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf\r
EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
- \r
+\r
MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
- MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf \r
+ MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
EmbeddedPkg/SerialDxe/SerialDxe.inf\r
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf \r
+ MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
#\r
-# This version uses semi-hosting console \r
+# This version uses semi-hosting console\r
# EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf {\r
# <LibraryClasses>\r
# SerialPortLib|ArmPkg/Library/SemiHostingSerialPortLib/SemiHostingSerialPortLib.inf\r
# }\r
- \r
+\r
EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
# Semi-hosting filesystem\r
#\r
ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
- \r
+\r
#\r
# FAT filesystem + GPT/MBR partitioning\r
#\r
#\r
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
Omap35xxPkg/MmcHostDxe/MmcHostDxe.inf\r
- \r
+\r
#\r
# I2C\r
#\r
Omap35xxPkg/SmbusDxe/Smbus.inf\r
- \r
+\r
#\r
# SoC Drivers\r
#\r
Omap35xxPkg/Gpio/Gpio.inf\r
Omap35xxPkg/InterruptDxe/InterruptDxe.inf\r
- Omap35xxPkg/TimerDxe/TimerDxe.inf \r
+ Omap35xxPkg/TimerDxe/TimerDxe.inf\r
Omap35xxPkg/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf\r
\r
#\r
# Power IC\r
#\r
Omap35xxPkg/TPS65950Dxe/TPS65950.inf\r
- \r
+\r
#\r
# Bds\r
#\r
MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf\r
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf\r
- ArmPlatformPkg/Bds/Bds.inf \r
+ ArmPlatformPkg/Bds/Bds.inf\r
\r
#\r
# Example Application\r
- # \r
+ #\r
MdeModulePkg/Application/HelloWorld/HelloWorld.inf\r
\r
READ_LOCK_CAP = TRUE\r
READ_LOCK_STATUS = TRUE\r
\r
- INF MdeModulePkg/Core/Dxe/DxeMain.inf \r
+ INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
\r
#\r
- # PI DXE Drivers producing Architectural Protocols (EFI Services) \r
+ # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
#\r
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf\r
- \r
+\r
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf\r
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf\r
INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf\r
INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf\r
INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf\r
INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf\r
- \r
+\r
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf\r
INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf\r
- INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf \r
+ INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf\r
INF EmbeddedPkg/SerialDxe/SerialDxe.inf\r
- INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf \r
+ INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf\r
\r
INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf\r
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf\r
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf\r
- \r
+\r
!if $(TARGET) == RELEASE\r
#\r
# Semi-hosting filesystem\r
#\r
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf\r
!endif\r
- \r
+\r
#\r
# Nand Flash\r
#\r
#\r
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
INF Omap35xxPkg/MmcHostDxe/MmcHostDxe.inf\r
- \r
+\r
#\r
# I2C\r
#\r
INF Omap35xxPkg/SmbusDxe/Smbus.inf\r
- \r
+\r
#\r
# SoC Drivers\r
#\r
INF Omap35xxPkg/Gpio/Gpio.inf\r
INF Omap35xxPkg/InterruptDxe/InterruptDxe.inf\r
- INF Omap35xxPkg/TimerDxe/TimerDxe.inf \r
+ INF Omap35xxPkg/TimerDxe/TimerDxe.inf\r
INF Omap35xxPkg/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.inf\r
\r
#\r
INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf\r
\r
#\r
- # UEFI application (Shell Embedded Boot Loader) \r
- # \r
- INF ShellBinPkg/UefiShell/UefiShell.inf \r
+ # UEFI application (Shell Embedded Boot Loader)\r
+ #\r
+ INF ShellBinPkg/UefiShell/UefiShell.inf\r
\r
#\r
# Bds\r
\r
\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
#\r
#[Rule.Common.DXE_DRIVER]\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
TE TE $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
\r
[Rule.Common.UEFI_APPLICATION]\r
FILE APPLICATION = $(NAMED_GUID) {\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
}\r
\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
unsigned long mem_size;\r
{\r
unsigned char *mem_ptr;\r
- \r
+\r
mem_ptr = mem_start + mem_size;\r
- \r
+\r
do\r
{\r
mem_ptr -= 0x400000; // 4 MB\r
- \r
+\r
if (strncmp(mem_ptr, "IBI SYST", 8) == 0)\r
{\r
return *(unsigned long *)(mem_ptr + 8); // EfiSystemTableBase\r
- } \r
- \r
+ }\r
+\r
} while (mem_ptr > mem_start);\r
- \r
+\r
return 0;\r
}\r
.\r
unsigned char *configuration_table;\r
unsigned long index;\r
unsigned char debug_table_guid[16];\r
- \r
+\r
// Fill in the debug table's guid\r
debug_table_guid[ 0] = 0x77;\r
debug_table_guid[ 1] = 0x2E;\r
debug_table_guid[13] = 0xD9;\r
debug_table_guid[14] = 0x5E;\r
debug_table_guid[15] = 0x8B;\r
- \r
+\r
configuration_table_entries = *(unsigned long *)(system_table + 64);\r
configuration_table = *(unsigned long *)(system_table + 68);\r
- \r
+\r
for (index = 0; index < configuration_table_entries; index++)\r
{\r
if (compare_guid(configuration_table, debug_table_guid) == 0)\r
{\r
return *(unsigned long *)(configuration_table + 16);\r
}\r
- \r
+\r
configuration_table += 20;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
{\r
return 1;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
unsigned char *header;\r
{\r
unsigned long *size;\r
- \r
+\r
size = header + 0x00AC;\r
- \r
+\r
return *size;\r
}\r
.\r
{\r
unsigned long *debugOffset;\r
unsigned char *stringOffset;\r
- \r
+\r
if (valid_pe_header(header))\r
{\r
debugOffset = header + 0x0128;\r
stringOffset = header + *debugOffset + 0x002C;\r
- \r
+\r
return stringOffset;\r
}\r
- \r
+\r
return 0;\r
}\r
.\r
define /R write_symbols_file(filename, mem_start, mem_size)\r
unsigned char *filename;\r
unsigned char *mem_start;\r
- unsigned long mem_size; \r
+ unsigned long mem_size;\r
{\r
unsigned char *system_table;\r
unsigned char *debug_info_table_header;\r
unsigned char *debug_filename;\r
unsigned long header_size;\r
int status;\r
- \r
+\r
system_table = find_system_table(mem_start, mem_size);\r
if (system_table == 0)\r
{\r
return;\r
}\r
- \r
+\r
status = fopen(88, filename, "w");\r
- \r
+\r
debug_info_table_header = find_debug_info_table_header(system_table);\r
- \r
+\r
debug_info_table = *(unsigned long *)(debug_info_table_header + 8);\r
debug_info_table_size = *(unsigned long *)(debug_info_table_header + 4);\r
- \r
+\r
for (index = 0; index < (debug_info_table_size * 4); index += 4)\r
{\r
- debug_image_info = *(unsigned long *)(debug_info_table + index); \r
- \r
+ debug_image_info = *(unsigned long *)(debug_info_table + index);\r
+\r
if (debug_image_info == 0)\r
{\r
break;\r
}\r
- \r
+\r
loaded_image_protocol = *(unsigned long *)(debug_image_info + 4);\r
- \r
+\r
image_base = *(unsigned long *)(loaded_image_protocol + 32);\r
- \r
+\r
debug_filename = pe_filename(image_base);\r
header_size = pe_headersize(image_base);\r
- \r
+\r
$fprintf 88, "%s 0x%08x\n", debug_filename, image_base + header_size$;\r
}\r
- \r
- \r
+\r
+\r
fclose(88);\r
}\r
.\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
* Header defining the BeagleBoard constants (Base addresses, sizes, flags)\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
REVISION_AB,\r
} BEAGLEBOARD_REVISION;\r
\r
-#endif \r
+#endif\r
/** @file\r
*\r
* Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
OldPinDir = MmioRead32 (GPIO6_BASE + GPIO_OE);\r
MmioWrite32(GPIO6_BASE + GPIO_OE, (OldPinDir | BIT11 | BIT12 | BIT13));\r
Revision = MmioRead32 (GPIO6_BASE + GPIO_DATAIN);\r
- \r
+\r
// Restore I/O settings\r
MmioWrite32 (GPIO6_BASE + GPIO_OE, OldPinDir);\r
- \r
+\r
return (BEAGLEBOARD_REVISION)((Revision >> 11) & 0x7);\r
}\r
\r
#\r
# Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
+#\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#\r
\r
// always the MPIDR of the calling CPU.\r
b ASM_PFX(ArmReadMpidr)\r
\r
-ASM_FUNCTION_REMOVE_IF_UNREFERENCED \r
+ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
//\r
// Copyright (c) 2012-2013, ARM Limited. All rights reserved.\r
-// \r
-// This program and the accompanying materials \r
-// are licensed and made available under the terms and conditions of the BSD License \r
-// which accompanies this distribution. The full text of the license may be found at \r
-// http://opensource.org/licenses/bsd-license.php \r
//\r
-// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+// This program and the accompanying materials\r
+// are licensed and made available under the terms and conditions of the BSD License\r
+// which accompanies this distribution. The full text of the license may be found at\r
+// http://opensource.org/licenses/bsd-license.php\r
+//\r
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
//\r
//\r
\r
#/* @file\r
# Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Add custom commands for BeagleBoard development.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Simple arm disassembler via a library\r
\r
Argv[0] - symboltable\r
- Argv[1] - Optional quoted format string \r
+ Argv[1] - Optional quoted format string\r
Argv[2] - Optional flag\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
UINT32 PeCoffSizeOfHeaders;\r
UINT32 ImageBase;\r
BOOLEAN Elf;\r
- \r
+\r
// Need to add lots of error checking on the passed in string\r
// Default string is for RealView debugger or gdb depending on toolchain used.\r
if (Argc > 1) {\r
// Assume gdb\r
Format = "add-symbol-file %a 0x%x";\r
#else\r
- // Default to RVCT \r
+ // Default to RVCT\r
Format = "load /a /ni /np %a &0x%x";\r
#endif\r
}\r
Elf = (Argc > 2) ? FALSE : TRUE;\r
- \r
+\r
Status = EfiGetSystemConfigurationTable (&gEfiDebugImageInfoTableGuid, (VOID **)&DebugImageTableHeader);\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
DebugTable = DebugImageTableHeader->EfiDebugImageInfoTable;\r
if (DebugTable == NULL) {\r
return EFI_SUCCESS;\r
if (Elf) {\r
// ELF and Mach-O images don't include the header so the linked address does not include header\r
ImageBase += PeCoffSizeOfHeaders;\r
- } \r
+ }\r
AsciiPrint (Format, Pdb, ImageBase);\r
AsciiPrint ("\n");\r
} else {\r
}\r
}\r
- } \r
+ }\r
}\r
\r
return EFI_SUCCESS;\r
ARgv[2] - Number of instructions to disassembly (optional)\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
UINT32 Count;\r
CHAR8 Buffer[80];\r
UINT32 ItBlock;\r
- \r
+\r
if (Argc < 2) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Address = AsciiStrHexToUintn (Argv[1]);\r
Count = (Argc > 2) ? (UINT32)AsciiStrHexToUintn (Argv[2]) : 20;\r
\r
- Ptr = (UINT8 *)(UINTN)Address; \r
+ Ptr = (UINT8 *)(UINTN)Address;\r
ItBlock = 0;\r
do {\r
CurrentAddress = Ptr;\r
DisassembleInstruction (&Ptr, TRUE, TRUE, &ItBlock, Buffer, sizeof (Buffer));\r
AsciiPrint ("0x%08x: %a\n", CurrentAddress, Buffer);\r
} while (Count-- > 0);\r
- \r
+\r
\r
return EFI_SUCCESS;\r
}\r
ARgv[2] - Number of instructions to disassembly (optional)\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
AsciiPrint ("%6a %6ld ms\n", Token, Milliseconds);\r
break;\r
}\r
- } \r
+ }\r
}\r
} while (Key != 0);\r
\r
FILE_GUID = ea62bdc3-1063-425f-8851-98cb47f213a8\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
ArmDisassemblerLib\r
PerformanceLib\r
TimerLib\r
- \r
+\r
[Protocols]\r
gEfiDebugSupportProtocolGuid\r
gEfiLoadedImageProtocolGuid\r
- \r
+\r
[Guids]\r
gEfiDebugImageInfoTableGuid\r
Basic serial IO abstaction for GDB\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
return RETURN_SUCCESS;\r
EFIAPI\r
GdbIsCharAvailable (\r
VOID\r
- ) \r
+ )\r
{\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 RBR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_RBR_REG;\r
CHAR8 Char;\r
- \r
+\r
while ((MmioRead8(LSR) & UART_LSR_RX_FIFO_E_MASK) == UART_LSR_RX_FIFO_E_EMPTY);\r
Char = MmioRead8(RBR);\r
\r
{\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 THR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_THR_REG;\r
- \r
+\r
while ((MmioRead8(LSR) & UART_LSR_TX_FIFO_E_MASK) == UART_LSR_TX_FIFO_E_NOT_EMPTY);\r
MmioWrite8(THR, Char);\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[LibraryClasses]\r
DebugLib\r
IoLib\r
- OmapLib \r
+ OmapLib\r
\r
[FixedPcd]\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxConsoleUart\r
/** @file\r
Do a generic Cold Reset for OMAP3550 and BeagleBoard specific Warm reset\r
- \r
+\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;\r
MemoryMap = AllocatePages (Pages);\r
- \r
+\r
//\r
// Get System MemoryMap\r
//\r
ASSERT (FALSE);\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
\r
\r
/**\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
[Pcd.common]\r
gArmTokenSpaceGuid.PcdCpuResetAddress\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress\r
- \r
+\r
[LibraryClasses]\r
DebugLib\r
ArmLib\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
#\r
mrc p15, 0, r0, c1, c0, 1 // read Auxiliary Control Register\r
bic r0, r0, #0x00000002 // disable L2 cache\r
mcr p15, 0, r0, c1, c0, 1 // store Auxiliary Control Register\r
- \r
+\r
//Enable Strict alignment checking & Instruction cache\r
mrc p15, 0, r0, c1, c0, 0\r
bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */\r
mcr p15, 0, r0, c1, c0, 2\r
mov r0, #0x40000000 // Set EN bit in FPEXC\r
mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly\r
- \r
- \r
+\r
+\r
// Set CPU vectors to start of DRAM\r
LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base\r
mcr p15, 0, r0, c12, c0, 0\r
adds r2, r2, #4\r
cmp r2, #32\r
bne FillVectors\r
- \r
+\r
/* before we call C code, lets setup the stack pointer in internal RAM */\r
stack_pointer_setup:\r
\r
//\r
- // Set stack based on PCD values. Need to do it this way to make C code work \r
- // when it runs from FLASH. \r
- // \r
+ // Set stack based on PCD values. Need to do it this way to make C code work\r
+ // when it runs from FLASH.\r
+ //\r
LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) /* stack base arg2 */\r
LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) /* stack size arg3 */\r
add r4, r2, r3\r
ShouldNeverGetHere:\r
/* _CEntryPoint should never return */\r
b ShouldNeverGetHere\r
- \r
+\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
//\r
#include <Library/PcdLib.h>\r
#include <AutoGen.h>\r
INCLUDE AsmMacroIoLib.inc\r
- \r
+\r
IMPORT CEntryPoint\r
EXPORT _ModuleEntryPoint\r
- \r
+\r
PRESERVE8\r
AREA ModuleEntryPoint, CODE, READONLY\r
- \r
+\r
\r
_ModuleEntryPoint\r
- \r
+\r
//Disable L2 cache\r
mrc p15, 0, r0, c1, c0, 1 // read Auxiliary Control Register\r
bic r0, r0, #0x00000002 // disable L2 cache\r
mcr p15, 0, r0, c1, c0, 1 // store Auxiliary Control Register\r
- \r
+\r
//Enable Strict alignment checking & Instruction cache\r
mrc p15, 0, r0, c1, c0, 0\r
bic r0, r0, #0x00002300 /* clear bits 13, 9:8 (--V- --RS) */\r
orr r0, r0, #0x00000002 /* set bit 1 (A) Align */\r
orr r0, r0, #0x00001000 /* set bit 12 (I) enable I-Cache */\r
mcr p15, 0, r0, c1, c0, 0\r
- \r
+\r
// Enable NEON register in case folks want to use them for optimizations (CopyMem)\r
mrc p15, 0, r0, c1, c0, 2\r
orr r0, r0, #0x00f00000 // Enable VPF access (V* instructions)\r
mcr p15, 0, r0, c1, c0, 2\r
mov r0, #0x40000000 // Set EN bit in FPEXC\r
msr FPEXC,r0\r
- \r
+\r
// Set CPU vectors to start of DRAM\r
LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base\r
mcr p15, 0, r0, c12, c0, 0\r
adds r2, r2, #4\r
cmp r2, #32\r
bne FillVectors\r
- \r
+\r
/* before we call C code, lets setup the stack pointer in internal RAM */\r
stack_pointer_setup\r
\r
//\r
- // Set stack based on PCD values. Need to do it this way to make C code work \r
- // when it runs from FLASH. \r
- // \r
- LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) // stack base arg2 \r
- LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) // stack size arg3 \r
+ // Set stack based on PCD values. Need to do it this way to make C code work\r
+ // when it runs from FLASH.\r
+ //\r
+ LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) // stack base arg2\r
+ LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) // stack size arg3\r
add r4, r2, r3\r
\r
//Enter SVC mode and set up SVC stack pointer\r
mov r13,r4\r
\r
// Call C entry point\r
- LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1 \r
+ LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1\r
LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) // memory start arg0\r
- blx CEntryPoint // Assume C code is thumb \r
+ blx CEntryPoint // Assume C code is thumb\r
\r
ShouldNeverGetHere\r
/* _CEntryPoint should never return */\r
b ShouldNeverGetHere\r
- \r
+\r
END\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
MemoryTable[1].VirtualBase = SOC_REGISTERS_L3_PHYSICAL_BASE;\r
MemoryTable[1].Length = SOC_REGISTERS_L3_PHYSICAL_LENGTH;\r
MemoryTable[1].Attributes = SOC_REGISTERS_L3_ATTRIBUTES;\r
- \r
+\r
// SOC Registers. L4 interconnects\r
MemoryTable[2].PhysicalBase = SOC_REGISTERS_L4_PHYSICAL_BASE;\r
MemoryTable[2].VirtualBase = SOC_REGISTERS_L4_PHYSICAL_BASE;\r
MemoryTable[3].VirtualBase = 0;\r
MemoryTable[3].Length = 0;\r
MemoryTable[3].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0;\r
- \r
+\r
ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize);\r
- \r
+\r
BuildMemoryAllocationHob((EFI_PHYSICAL_ADDRESS)(UINTN)TranslationTableBase, TranslationTableSize, EfiBootServicesData);\r
}\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Examines a GUIDed section and returns the size of the decoded buffer and the\r
size of an scratch buffer required to actually decode the data in a GUIDed section.\r
\r
- Examines a GUIDed section specified by InputSection. \r
+ Examines a GUIDed section specified by InputSection.\r
If GUID for InputSection does not match the GUID that this handler supports,\r
- then RETURN_UNSUPPORTED is returned. \r
+ then RETURN_UNSUPPORTED is returned.\r
If the required information can not be retrieved from InputSection,\r
then RETURN_INVALID_PARAMETER is returned.\r
If the GUID of InputSection does match the GUID that this handler supports,\r
then the size required to hold the decoded buffer is returned in OututBufferSize,\r
the size of an optional scratch buffer is returned in ScratchSize, and the Attributes field\r
from EFI_GUID_DEFINED_SECTION header of InputSection is returned in SectionAttribute.\r
- \r
+\r
If InputSection is NULL, then ASSERT().\r
If OutputBufferSize is NULL, then ASSERT().\r
If ScratchBufferSize is NULL, then ASSERT().\r
\r
/**\r
Decompress a LZAM compressed GUIDed section into a caller allocated output buffer.\r
- \r
- Decodes the GUIDed section specified by InputSection. \r
- If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned. \r
+\r
+ Decodes the GUIDed section specified by InputSection.\r
+ If GUID for InputSection does not match the GUID that this handler supports, then RETURN_UNSUPPORTED is returned.\r
If the data in InputSection can not be decoded, then RETURN_INVALID_PARAMETER is returned.\r
If the GUID of InputSection does match the GUID that this handler supports, then InputSection\r
is decoded into the buffer specified by OutputBuffer and the authentication status of this\r
decode operation is returned in AuthenticationStatus. If the decoded buffer is identical to the\r
data in InputSection, then OutputBuffer is set to point at the data in InputSection. Otherwise,\r
the decoded data will be placed in caller allocated buffer specified by OutputBuffer.\r
- \r
+\r
If InputSection is NULL, then ASSERT().\r
If OutputBuffer is NULL, then ASSERT().\r
If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT().\r
\r
\r
@param[in] InputSection A pointer to a GUIDed section of an FFS formatted file.\r
- @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation. \r
+ @param[out] OutputBuffer A pointer to a buffer that contains the result of a decode operation.\r
@param[out] ScratchBuffer A caller allocated buffer that may be required by this function\r
- as a scratch buffer to perform the decode operation. \r
- @param[out] AuthenticationStatus \r
+ as a scratch buffer to perform the decode operation.\r
+ @param[out] AuthenticationStatus\r
A pointer to the authentication status of the decoded output buffer.\r
See the definition of authentication status in the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI\r
section of the PI Specification. EFI_AUTH_STATUS_PLATFORM_OVERRIDE must\r
OUT VOID *ScratchBuffer, OPTIONAL\r
OUT UINT32 *AuthenticationStatus\r
);\r
- \r
+\r
#endif // __LZMADECOMPRESS_H__\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
C Entry point for the SEC. First C code after the reset vector.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
MmioWrite32 (UartBaseAddress + UART_MCR_REG, UART_MCR_RTS_FORCE_ACTIVE | UART_MCR_DTR_FORCE_ACTIVE);\r
\r
// Clear & enable fifos\r
- MmioWrite32 (UartBaseAddress + UART_FCR_REG, UART_FCR_TX_FIFO_CLEAR | UART_FCR_RX_FIFO_CLEAR | UART_FCR_FIFO_ENABLE); \r
+ MmioWrite32 (UartBaseAddress + UART_FCR_REG, UART_FCR_TX_FIFO_CLEAR | UART_FCR_RX_FIFO_CLEAR | UART_FCR_FIFO_ENABLE);\r
\r
- // Restore MODE_SELECT \r
+ // Restore MODE_SELECT\r
MmioWrite32 (UartBaseAddress + UART_MDR1_REG, UART_MDR1_MODE_SELECT_UART_16X);\r
}\r
\r
\r
// Start talking\r
UartInit ();\r
- \r
+\r
InitializeDebugAgent (DEBUG_AGENT_INIT_PREMEM_SEC, NULL, NULL);\r
SaveAndSetDebugTimerInterrupt (TRUE);\r
\r
\r
// Load the DXE Core and transfer control to it\r
LoadDxeCoreFromFv (NULL, 0);\r
- \r
+\r
// DXE Core should always load and never return\r
ASSERT (FALSE);\r
}\r
\r
#/** @file\r
# SEC - Reset vector code that jumps to C and loads DXE core\r
-# \r
+#\r
# Copyright (c) 2008, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
Cache.c\r
PadConfiguration.c\r
Clock.c\r
- \r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
MemoryAllocationLib\r
PrePiHobListPointerLib\r
\r
-[FeaturePcd] \r
+[FeaturePcd]\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable\r
\r
[FixedPcd]\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackBase\r
gEmbeddedTokenSpaceGuid.PcdMemoryBase\r
gEmbeddedTokenSpaceGuid.PcdMemorySize\r
- \r
+\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxConsoleUart\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxFreeTimer\r
- \r
+\r
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress\r
\r
The data structures in this code come from:\r
OMAP35x Applications Processor Technical Reference Manual chapter 25\r
OMAP34xx Multimedia Device Technical Reference Manual chapter 26.4.8.\r
- \r
- You should use the OMAP35x manual when possible. Some things, like SectionKey, \r
+\r
+ You should use the OMAP35x manual when possible. Some things, like SectionKey,\r
are not defined in the OMAP35x manual and you have to use the OMAP34xx manual\r
- to find the data. \r
+ to find the data.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
unsigned char Version;\r
unsigned short Reserved;\r
unsigned int Flags;\r
- unsigned int PRM_CLKSRC_CTRL; \r
- unsigned int PRM_CLKSEL; \r
+ unsigned int PRM_CLKSRC_CTRL;\r
+ unsigned int PRM_CLKSEL;\r
unsigned int CM_CLKSEL1_EMU;\r
unsigned int CM_CLKSEL_CORE;\r
unsigned int CM_CLKSEL_WKUP;\r
unsigned int CM_CLKEN_PLL_DPLL3;\r
- unsigned int CM_AUTOIDLE_PLL_DPLL3; \r
- unsigned int CM_CLKSEL1_PLL; \r
+ unsigned int CM_AUTOIDLE_PLL_DPLL3;\r
+ unsigned int CM_CLKSEL1_PLL;\r
unsigned int CM_CLKEN_PLL_DPLL4;\r
unsigned int CM_AUTOIDLE_PLL_DPLL4;\r
unsigned int CM_CLKSEL2_PLL;\r
- unsigned int CM_CLKSEL3_PLL; \r
- unsigned int CM_CLKEN_PLL_MPU; \r
- unsigned int CM_AUTOIDLE_PLL_MPU; \r
- unsigned int CM_CLKSEL1_PLL_MPU; \r
- unsigned int CM_CLKSEL2_PLL_MPU; \r
+ unsigned int CM_CLKSEL3_PLL;\r
+ unsigned int CM_CLKEN_PLL_MPU;\r
+ unsigned int CM_AUTOIDLE_PLL_MPU;\r
+ unsigned int CM_CLKSEL1_PLL_MPU;\r
+ unsigned int CM_CLKSEL2_PLL_MPU;\r
unsigned int CM_CLKSTCTRL_MPU;\r
} CHSETTINGS_DATA;\r
\r
)\r
{\r
unsigned int Value;\r
- \r
+\r
CHSETTINGSData->SectionKey = 0xC0C0C0C1;\r
CHSETTINGSData->Valid = 0x1;\r
CHSETTINGSData->Version = 0x1;\r
)\r
{\r
unsigned int Value;\r
- \r
+\r
CHRAMData->SectionKey = 0xC0C0C0C2;\r
CHRAMData->Valid = 0x1;\r
- \r
+\r
fscanf(DataFile, "SDRC_SYSCONFIG_LSB=0x%04x\n", &Value);\r
CHRAMData->SDRC_SYSCONFIG_LSB = Value;\r
fscanf(DataFile, "SDRC_CS_CFG_LSB=0x%04x\n", &Value);\r
CHRAMData->Flags = 0x0003;\r
}\r
\r
-static \r
-void \r
+static\r
+void\r
PrepareConfigurationHeader (\r
void\r
)\r
CHRAM_DATA CHRAMData;\r
unsigned int ConfigurationHdrOffset = 0;\r
FILE *DataFile;\r
- \r
+\r
// Open data file\r
DataFile = fopen(gDataFile, "rb");\r
if (DataFile == NULL) {\r
fprintf(stderr, "Can't open data file %s.\n", gDataFile);\r
exit(1);\r
}\r
- \r
+\r
//Initialize configuration header.\r
memset(gConfigurationHeader, 0x00, sizeof(gConfigurationHeader));\r
\r
memset(&CHRAMData, 0x00, sizeof(CHRAM_DATA));\r
PopulateCHRAMData(DataFile, &CHRAMData);\r
memcpy(gConfigurationHeader + Toc.Start, &CHRAMData, Toc.Size);\r
- \r
+\r
//Adjust ConfigurationHdrOffset to point to next TOC\r
ConfigurationHdrOffset += sizeof(TOC_DATA);\r
\r
//Closing TOC item\r
memset(gConfigurationHeader + ConfigurationHdrOffset, 0xFF, CLOSING_TOC_ITEM_SIZE);\r
ConfigurationHdrOffset += CLOSING_TOC_ITEM_SIZE;\r
- \r
+\r
// Close data file\r
fclose(DataFile);\r
}\r
\r
-static \r
+static\r
void\r
ConstructImage (\r
void\r
if (InputFile == NULL) {\r
fprintf(stderr, "Can't open input file.\n");\r
exit(0);\r
- } \r
+ }\r
\r
// Get the size of the input image.\r
fstat(fileno(InputFile), &FileStat);\r
InputImageFileSize = FileStat.st_size;\r
- \r
+\r
OutputFile = fopen(gOutputImageFile, "wb");\r
if (OutputFile == NULL) {\r
fprintf(stderr, "Can't open output file %s.\n", gOutputImageFile);\r
exit(0);\r
}\r
\r
- // Write Configuration header \r
+ // Write Configuration header\r
fwrite(gConfigurationHeader, 1, sizeof(gConfigurationHeader), OutputFile);\r
\r
// Write image header (Input image size, execution address)\r
}\r
\r
\r
-int \r
+int\r
main (\r
- int argc, \r
+ int argc,\r
char** argv\r
)\r
{\r
char Ch;\r
unsigned char *ptr;\r
int i;\r
- int TwoArg; \r
+ int TwoArg;\r
\r
if (argc == 1) {\r
PrintUsage ();\r
case 'E': /* Image execution address */\r
gImageExecutionAddress = strtoul (TwoArg ? argv[i+1] : &argv[i][2], (char **)&ptr, 16);\r
break;\r
- \r
+\r
case 'I': /* Input image file */\r
gInputImageFile = TwoArg ? argv[i+1] : &argv[i][2];\r
break;\r
case 'O': /* Output image file */\r
gOutputImageFile = TwoArg ? argv[i+1] : &argv[i][2];\r
break;\r
- \r
+\r
case 'D': /* Data file */\r
gDataFile = TwoArg ? argv[i+1] : &argv[i][2];\r
break;\r
}\r
}\r
\r
- \r
+\r
//Prepare configuration header\r
PrepareConfigurationHeader ();\r
\r
//\r
-// Quick hack to work around not having sed, or any other reasonable \r
+// Quick hack to work around not having sed, or any other reasonable\r
// way to edit a file from a script on Windows......\r
//\r
// Copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
-// \r
+//\r
// This program and the accompanying materials\r
// are licensed and made available under the terms and conditions of the BSD License\r
// which accompanies this distribution. The full text of the license may be found at\r
// argv[1] - Old File\r
// argv[2] - New File\r
// argv[3+n] - Match String\r
-// argv[4+n] - Replace string \r
+// argv[4+n] - Replace string\r
int\r
main (int argc, char **argv)\r
{\r
// into a buffer that is as big as the maximum search key size.\r
// Then we can search the keys for a match. If no match\r
// copy the old file character to the new file. If it is a match\r
- // then copy the replacement string into the output file. \r
- // This code assumes the file system is smart and caches the \r
- // file in a buffer. So all the reads don't really hit the disk. \r
+ // then copy the replacement string into the output file.\r
+ // This code assumes the file system is smart and caches the\r
+ // file in a buffer. So all the reads don't really hit the disk.\r
InFilePos = 0;\r
while (InFilePos < (InFileSize - MinLenKey)) {\r
fseek (In, InFilePos, SEEK_SET);\r
if (!Found) {\r
fputc (Key[0], Out);\r
}\r
- \r
+\r
InFilePos++;\r
}\r
\r
while ((c = fgetc (In)) != EOF) {\r
fputc (c, Out);\r
}\r
- \r
+\r
fclose (In);\r
fclose (Out);\r
free (Key);\r
Argv[0] - "%CommandName%"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
\r
@param chr one Ascii character\r
\r
- @return The uppercase value of Ascii character \r
+ @return The uppercase value of Ascii character\r
\r
**/\r
STATIC\r
FirstString is identical to SecondString, then 0 is returned. Otherwise, the\r
value returned is the first mismatched Unicode character in SecondString\r
subtracted from the first mismatched Unicode character in FirstString.\r
- \r
- @param FirstString Pointer to a Null-terminated ASCII string. \r
+\r
+ @param FirstString Pointer to a Null-terminated ASCII string.\r
@param SecondString Pointer to a Null-terminated ASCII string.\r
@param Length Max length to compare.\r
- \r
+\r
@retval 0 FirstString is identical to SecondString using case insensitive\r
comparisons.\r
@retval !=0 FirstString is not identical to SecondString using case\r
SecondString++;\r
Length--;\r
}\r
- \r
+\r
return AsciiToUpper (*FirstString) - AsciiToUpper (*SecondString);\r
}\r
\r
\r
\r
/**\r
- Add a command to the mCmdTable. If there is no free space in the command \r
- table ASSERT. The mCmdTable is maintained in alphabetical order and the \r
+ Add a command to the mCmdTable. If there is no free space in the command\r
+ table ASSERT. The mCmdTable is maintained in alphabetical order and the\r
new entry is inserted into its sorted position.\r
\r
@param Entry Command Entry to add to the CmdTable\r
if (AsciiStriCmp (mCmdTable[Count - 1]->Name, Entry->Name) <= 0) {\r
break;\r
}\r
- \r
+\r
mCmdTable[Count] = mCmdTable[Count - 1];\r
}\r
mCmdTable[Count] = (EBL_COMMAND_TABLE *)Entry;\r
\r
\r
/**\r
- Add an set of commands to the command table. Most commonly used on static \r
+ Add an set of commands to the command table. Most commonly used on static\r
array of commands.\r
\r
@param EntryArray Pointer to array of command entries\r
\r
\r
/**\r
- Return the best matching command for the passed in command name. The match \r
+ Return the best matching command for the passed in command name. The match\r
does not have to be exact, it just needs to be unique. This enables commands\r
to be shortened to the smallest set of starting characters that is unique.\r
\r
if (Str != NULL) {\r
// If the command includes a trailing . command extension skip it for the match.\r
// Example: hexdump.4\r
- Length = (UINTN)(Str - CommandName); \r
+ Length = (UINTN)(Str - CommandName);\r
}\r
- \r
+\r
for (Index = 0, BestMatchCount = 0, Match = NULL; Index < mCmdTableNextFreeIndex; Index++) {\r
if (AsciiStriCmp (mCmdTable[Index]->Name, CommandName) == 0) {\r
// match a command exactly\r
)\r
{\r
UINTN Count;\r
- \r
+\r
if (Str == NULL) {\r
return 0;\r
}\r
- \r
+\r
for (Count = 0; *Str != '\0'; Str++) {\r
if (Str[Count] == '\n') {\r
Count++;\r
}\r
}\r
- \r
+\r
return Count;\r
}\r
\r
\r
/**\r
- List out help information on all the commands or print extended information \r
+ List out help information on all the commands or print extended information\r
about a specific passed in command.\r
\r
Argv[0] - "help"\r
Argv[1] - Command to display help about\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
}\r
}\r
} else if (Argv[1] != NULL) {\r
- // Print specific help \r
+ // Print specific help\r
for (Index = 0, CurrentRow = 0; Index < mCmdTableNextFreeIndex; Index++) {\r
if (AsciiStriCmp (Argv[1], mCmdTable[Index]->Name) == 0) {\r
Ptr = (mCmdTable[Index]->Help == NULL) ? mCmdTable[Index]->HelpSummary : mCmdTable[Index]->Help;\r
Argv[0] - "exit"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_ABORTED\r
UINT32 DescriptorVersion;\r
UINTN Pages;\r
\r
- if (Argc > 1) { \r
+ if (Argc > 1) {\r
if (AsciiStriCmp (Argv[1], "efi") != 0) {\r
return EFI_ABORTED;\r
}\r
} else if (Argc == 1) {\r
return EFI_ABORTED;\r
}\r
- \r
+\r
MemoryMap = NULL;\r
MemoryMapSize = 0;\r
do {\r
\r
Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;\r
MemoryMap = AllocatePages (Pages);\r
- \r
+\r
//\r
// Get System MemoryMap\r
//\r
// At this point it is very dangerous to do things EFI as most of EFI is now gone.\r
// This command is useful if you are working with a debugger as it will shutdown\r
// DMA and other things that could break a soft resets.\r
- // \r
+ //\r
CpuDeadLoop ();\r
- \r
+\r
// Should never get here, but makes the compiler happy\r
return EFI_ABORTED;\r
}\r
\r
/**\r
Update the screen by decrementing the timeout value.\r
- This AsciiPrint has to match the AsciiPrint in \r
- EblPauseCmd. \r
+ This AsciiPrint has to match the AsciiPrint in\r
+ EblPauseCmd.\r
\r
@param ElaspedTime Current timeout value remaining\r
\r
Argv[1] - timeout value is decimal seconds\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS Timeout expired with no input\r
Argv[0] - "break"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
Argv[1] - warm or shutdown reset type\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
case 's':\r
ResetType = EfiResetShutdown;\r
}\r
- } \r
+ }\r
\r
gRT->ResetSystem (ResetType, EFI_SUCCESS, 0, NULL);\r
return EFI_SUCCESS;\r
Argv[1] - on or off\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
)\r
{\r
if (Argc <= 1) {\r
- // toggle setting \r
+ // toggle setting\r
gPageBreak = (gPageBreak) ? FALSE : TRUE;\r
} else {\r
// use argv to set the value\r
}\r
if (Bytes >= 2) {\r
Result = (Result << 8) + *Address++;\r
- } \r
+ }\r
if (Bytes >= 3) {\r
Result = (Result << 8) + *Address++;\r
}\r
AsciiPrint ("%08x: ", Offset);\r
for (Line = 0; (Line < 0x10) && (Address < EndAddress);) {\r
Bytes = EndAddress - Address;\r
- \r
+\r
switch (Width) {\r
case 4:\r
if (Bytes >= 4) {\r
Blanks[Spaces] = '\0';\r
\r
AsciiPrint(Blanks);\r
- \r
+\r
Blanks[Spaces] = ' ';\r
}\r
\r
if (Length % Width != 0) {\r
AsciiPrint ("%08x\n", Offset);\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
\r
/**\r
See if command contains .# where # is a number. Return # as the Width\r
- or 1 as the default Width for commands. \r
- \r
+ or 1 as the default Width for commands.\r
+\r
Example hexdump.4 returns a width of 4.\r
\r
@param Argv Argv[0] is the command name\r
{\r
CHAR8 *Str;\r
UINTN Width;\r
- \r
+\r
//Hexdump.2 HexDump.4 mean use a different width\r
Str = AsciiStrStr (Argv, ".");\r
if (Str != NULL) {\r
Toggle page break global. This turns on and off prompting to Quit or hit any\r
key to continue when a command is about to scroll the screen with its output\r
\r
- Argv[0] - "hexdump"[.#] # is optional 1,2, or 4 for width \r
- Argv[1] - Device or File to dump. \r
+ Argv[0] - "hexdump"[.#] # is optional 1,2, or 4 for width\r
+ Argv[1] - Device or File to dump.\r
Argv[2] - Optional offset to start dumping\r
Argv[3] - Optional number of bytes to dump\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
if ((Argc < 2) || (Argc > 4)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Width = WidthFromCommandName (Argv[0], 1);\r
if ((Width != 1) && (Width != 2) && (Width != 4)) {\r
return EFI_INVALID_PARAMETER;\r
// Make sure size includes the part of the file we have skipped\r
Size += Offset;\r
}\r
- } \r
+ }\r
\r
Status = EfiSeek (File, Offset, EfiSeekStart);\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
- \r
+\r
for (; Offset + HEXDUMP_CHUNK <= Size; Offset += Chunk) {\r
Chunk = HEXDUMP_CHUNK;\r
Status = EfiRead (File, Location, &Chunk);\r
goto Exit;\r
}\r
}\r
- \r
+\r
// Any left over?\r
if (Offset < Size) {\r
Chunk = Size - Offset;\r
{\r
\r
EblAddCommands (mCmdTemplate, sizeof (mCmdTemplate)/sizeof (EBL_COMMAND_TABLE));\r
- \r
+\r
gBS->InstallProtocolInterface (\r
&gExternalCmdHandle,\r
&gEfiEblAddCommandProtocolGuid,\r
\r
/**\r
Perform a dir on a device. The device must support Simple File System Protocol\r
- or the FV protocol. \r
+ or the FV protocol.\r
\r
Argv[0] - "dir"\r
- Argv[1] - Device Name:path. Path is optional \r
+ Argv[1] - Device Name:path. Path is optional\r
Argv[2] - Optional filename to match on. A leading * means match substring\r
Argv[3] - Optional FV file type\r
\r
dir fs1:\efi ; perform a dir on fs1: device in the efi directory\r
- dir fs1:\efi *.efi; perform a dir on fs1: device in the efi directory but \r
+ dir fs1:\efi *.efi; perform a dir on fs1: device in the efi directory but\r
only print out files that contain the string *.efi\r
- dir fv1:\ ; perform a dir on fv1: device in the efi directory \r
+ dir fv1:\ ; perform a dir on fv1: device in the efi directory\r
NOTE: fv devices do not contain subdirs\r
dir fv1:\ * PEIM ; will match all files of type PEIM\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
EFI_OPEN_FILE *File;\r
EFI_FILE_INFO *DirInfo;\r
UINTN ReadSize;\r
- UINTN CurrentRow; \r
+ UINTN CurrentRow;\r
CHAR16 *MatchSubString;\r
EFI_STATUS GetNextFileStatus;\r
UINTN Key;\r
do {\r
Type = SearchType;\r
GetNextFileStatus = Fv->GetNextFile (\r
- Fv, \r
+ Fv,\r
&Key,\r
- &Type, \r
- &NameGuid, \r
- &Attributes, \r
+ &Type,\r
+ &NameGuid,\r
+ &Attributes,\r
&Size\r
);\r
if (!EFI_ERROR (GetNextFileStatus)) {\r
Size = 0;\r
Status = Fv->ReadFile (\r
Fv,\r
- &NameGuid, \r
+ &NameGuid,\r
Section,\r
&Size,\r
&Type,\r
&AuthenticationStatus\r
);\r
if (!((Status == EFI_BUFFER_TOO_SMALL) || !EFI_ERROR (Status))) {\r
- // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid \r
+ // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid\r
Size = 0;\r
}\r
- \r
+\r
TypeStr = (Type <= EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) ? gFvFileType[Type] : "UNKNOWN";\r
\r
// read the UI seciton to do a name match.\r
}\r
}\r
} while (!EFI_ERROR (GetNextFileStatus));\r
- \r
+\r
if (SearchType == EFI_FV_FILETYPE_ALL) {\r
AsciiPrint ("%,20d bytes in files %,d bytes free\n", TotalSize, File->FvSize - File->FvHeaderSize - TotalSize);\r
}\r
- \r
- \r
+\r
+\r
} else if ((File->Type == EfiOpenFileSystem) || (File->Type == EfiOpenBlockIo)) {\r
// Simple File System DIR\r
\r
if (UnicodeFileName[0] == '*') {\r
MatchSubString = &UnicodeFileName[1];\r
}\r
- } \r
+ }\r
\r
File->FsFileHandle->SetPosition (File->FsFileHandle, 0);\r
for (CurrentRow = 0;;) {\r
if (DirInfo == NULL) {\r
goto Done;\r
}\r
- \r
+\r
// Read the data\r
Status = File->FsFileHandle->Read (File->FsFileHandle, &ReadSize, DirInfo);\r
if ((EFI_ERROR (Status)) || (ReadSize == 0)) {\r
} else {\r
break;\r
}\r
- \r
+\r
if (MatchSubString != NULL) {\r
if (StrStr (&DirInfo->FileName[0], MatchSubString) == NULL) {\r
// does not match *name argument, so skip\r
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
break;\r
}\r
- \r
+\r
FreePool (DirInfo);\r
}\r
\r
Change the Current Working Directory\r
\r
Argv[0] - "cd"\r
- Argv[1] - Device Name:path. Path is optional \r
+ Argv[1] - Device Name:path. Path is optional\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
{\r
if (Argc <= 1) {\r
return EFI_SUCCESS;\r
- } \r
- \r
+ }\r
+\r
return EfiSetCwd (Argv[1]);\r
}\r
\r
EblInitializeDirCmd (\r
VOID\r
)\r
-{ \r
+{\r
if (FeaturePcdGet (PcdEmbeddedDirCmd)) {\r
EblAddCommands (mCmdDirTemplate, sizeof (mCmdDirTemplate)/sizeof (EBL_COMMAND_TABLE));\r
}\r
#define __EBL_H__\r
\r
#include <PiDxe.h>\r
-#include <Protocol/BlockIo.h> \r
-#include <Protocol/SimpleFileSystem.h> \r
-#include <Protocol/FirmwareVolume2.h> \r
-#include <Protocol/LoadFile.h> \r
-#include <Protocol/FirmwareVolumeBlock.h> \r
-#include <Protocol/PxeBaseCode.h> \r
-#include <Protocol/LoadedImage.h> \r
+#include <Protocol/BlockIo.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/FirmwareVolume2.h>\r
+#include <Protocol/LoadFile.h>\r
+#include <Protocol/FirmwareVolumeBlock.h>\r
+#include <Protocol/PxeBaseCode.h>\r
+#include <Protocol/LoadedImage.h>\r
#include <Protocol/EblAddCommand.h>\r
#include <Protocol/PciIo.h>\r
#include <Protocol/DevicePath.h>\r
#include <Library/DevicePathLib.h>\r
#include <Library/PrintLib.h>\r
#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiLib.h> \r
+#include <Library/UefiLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/DebugLib.h>\r
IN UINTN Width,\r
IN UINTN Offset\r
);\r
- \r
+\r
UINTN\r
WidthFromCommandName (\r
IN CHAR8 *Argv,\r
Ebl.h\r
Network.c\r
Variable.c\r
- \r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
IntelFrameworkPkg/IntelFrameworkPkg.dec\r
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
- \r
+\r
[LibraryClasses]\r
- DebugLib \r
- UefiLib \r
- UefiApplicationEntryPoint \r
- UefiBootServicesTableLib \r
- UefiRuntimeServicesTableLib \r
- BaseMemoryLib \r
- MemoryAllocationLib \r
- DevicePathLib \r
- IoLib \r
- PrintLib \r
- PcdLib \r
- EfiFileLib \r
+ DebugLib\r
+ UefiLib\r
+ UefiApplicationEntryPoint\r
+ UefiBootServicesTableLib\r
+ UefiRuntimeServicesTableLib\r
+ BaseMemoryLib\r
+ MemoryAllocationLib\r
+ DevicePathLib\r
+ IoLib\r
+ PrintLib\r
+ PcdLib\r
+ EfiFileLib\r
HobLib\r
- BaseLib \r
+ BaseLib\r
EblCmdLib\r
EblNetworkLib\r
\r
[LibraryClasses.ARM]\r
SemihostLib\r
- \r
-[Protocols.common] \r
- gEfiFirmwareVolume2ProtocolGuid \r
- gEfiFirmwareVolumeBlockProtocolGuid \r
- gEfiBlockIoProtocolGuid \r
+\r
+[Protocols.common]\r
+ gEfiFirmwareVolume2ProtocolGuid\r
+ gEfiFirmwareVolumeBlockProtocolGuid\r
+ gEfiBlockIoProtocolGuid\r
gEfiSimpleFileSystemProtocolGuid\r
- gEfiLoadFileProtocolGuid \r
- gEfiLoadedImageProtocolGuid \r
- gEfiPxeBaseCodeProtocolGuid \r
+ gEfiLoadFileProtocolGuid\r
+ gEfiLoadedImageProtocolGuid\r
+ gEfiPxeBaseCodeProtocolGuid\r
gEfiEblAddCommandProtocolGuid\r
gEfiDiskIoProtocolGuid\r
gEfiPciIoProtocolGuid\r
\r
if (File->DevicePath != NULL) {\r
// Try to print out the MAC address\r
- for (DevicePathNode = File->DevicePath; \r
- !IsDevicePathEnd (DevicePathNode); \r
+ for (DevicePathNode = File->DevicePath;\r
+ !IsDevicePathEnd (DevicePathNode);\r
DevicePathNode = NextDevicePathNode (DevicePathNode)) {\r
- \r
+\r
if ((DevicePathType (DevicePathNode) == MESSAGING_DEVICE_PATH) && (DevicePathSubType (DevicePathNode) == MSG_MAC_ADDR_DP)) {\r
MacAddr = (MAC_ADDR_DEVICE_PATH *)DevicePathNode;\r
- \r
+\r
HwAddressSize = sizeof (EFI_MAC_ADDRESS);\r
if (MacAddr->IfType == 0x01 || MacAddr->IfType == 0x00) {\r
HwAddressSize = 6;\r
}\r
- \r
+\r
AsciiPrint ("MAC ");\r
for (Index = 0; Index < HwAddressSize; Index++) {\r
AsciiPrint ("%02x", MacAddr->MacAddress.Addr[Index] & 0xff);\r
}\r
- } \r
+ }\r
}\r
}\r
\r
\r
\r
/**\r
- Dump information about devices in the system. \r
+ Dump information about devices in the system.\r
\r
fv: PI Firmware Volume\r
fs: EFI Simple File System\r
Argv[0] - "device"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
}\r
}\r
}\r
- \r
+\r
Max = EfiGetDeviceCounts (EfiOpenLoadFile);\r
if (Max != 0) {\r
AsciiPrint ("LoadFile Devices: (usually network)\n");\r
\r
\r
/**\r
- Start an EFI image (PE32+ with EFI defined entry point). \r
+ Start an EFI image (PE32+ with EFI defined entry point).\r
\r
Argv[0] - "start"\r
Argv[1] - device name and path\r
start LoadFile0: ; load an FV via a PXE boot\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
\r
File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0);\r
if (File == NULL) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
DevicePath = File->DevicePath;\r
\r
FreePool (Buffer);\r
}\r
- \r
+\r
EfiClose (File);\r
\r
if (!EFI_ERROR (Status)) {\r
// We don't pass Argv[0] to the EFI Application (it's name) just the args\r
Status = gBS->HandleProtocol (ImageHandle, &gEfiLoadedImageProtocolGuid, (VOID **)&ImageInfo);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
ImageInfo->LoadOptionsSize = (UINT32)AsciiStrSize (Argv[2]);\r
ImageInfo->LoadOptions = AllocatePool (ImageInfo->LoadOptionsSize);\r
AsciiStrCpy (ImageInfo->LoadOptions, Argv[2]);\r
/**\r
Load a Firmware Volume (FV) into memory from a device. This causes drivers in\r
the FV to be dispatched if the dependencies of the drivers are met.\r
- \r
+\r
Argv[0] - "loadfv"\r
Argv[1] - device name and path\r
\r
loadfv LoadFile0: ; load an FV via a PXE boot\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
\r
File = EfiOpen (Argv[1], EFI_FILE_MODE_READ, 0);\r
if (File == NULL) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
if (File->Type == EfiOpenMemoryBuffer) {\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
Status = gDS->ProcessFirmwareVolume (FvStart, FvSize, &FvHandle);\r
if (EFI_ERROR (Status)) {\r
FreePool (FvStart);\r
- } \r
+ }\r
}\r
return Status;\r
}\r
\r
\r
/**\r
- Perform an EFI connect to connect devices that follow the EFI driver model. \r
+ Perform an EFI connect to connect devices that follow the EFI driver model.\r
If it is a PI system also call the dispatcher in case a new FV was made\r
available by one of the connect EFI drivers (this is not a common case).\r
- \r
+\r
Argv[0] - "connect"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
for (Index = 0; Index < HandleCount; Index++) {\r
gBS->DisconnectController (HandleBuffer[Index], NULL, NULL);\r
}\r
- \r
+\r
//\r
// Given we disconnect our console we should go and do a connect now\r
//\r
\r
/**\r
Dump out the EFI memory map\r
- \r
+\r
Argv[0] - "memmap"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
ZeroMem (PageCount, sizeof (PageCount));\r
\r
AsciiPrint ("EFI Memory Map\n");\r
- \r
+\r
// First call is to figure out how big the buffer needs to be\r
MemMapSize = 0;\r
MemMap = NULL;\r
MemMap = NEXT_MEMORY_DESCRIPTOR (MemMap, DescriptorSize);\r
}\r
}\r
- \r
+\r
for (Index = 0, TotalMemory = 0; Index < EfiMaxMemoryType; Index++) {\r
if (PageCount[Index] != 0) {\r
AsciiPrint ("\n %a %,7ld Pages (%,14ld)", gMemMapType[Index], PageCount[Index], LShiftU64 (PageCount[Index], 12));\r
/**\r
Load a file into memory and optionally jump to it. A load address can be\r
specified or automatically allocated. A quoted command line can optionally\r
- be passed into the image. \r
+ be passed into the image.\r
\r
Argv[0] - "go"\r
Argv[1] - Device Name:path for the file to load\r
Argv[2] - Address to load to or '*' if the load address will be allocated\r
Argv[3] - Optional Entry point to the image. Image will be called if present\r
- Argv[4] - "" string that will be passed as Argc & Argv to EntryPoint. Needs \r
+ Argv[4] - "" string that will be passed as Argc & Argv to EntryPoint. Needs\r
to include the command name\r
\r
- go fv1:\EblCmdX 0x10000 0x10010 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX \r
- from FV1 to location 0x10000 and call the entry point at 0x10010 passing \r
+ go fv1:\EblCmdX 0x10000 0x10010 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX\r
+ from FV1 to location 0x10000 and call the entry point at 0x10010 passing\r
in "EblCmdX Arg2 Arg3 Arg4" as the arguments.\r
\r
- go fv0:\EblCmdX * 0x10 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX from FS0 \r
+ go fv0:\EblCmdX * 0x10 "EblCmdX Arg2 Arg3 Arg4"; - load EblCmdX from FS0\r
to location allocated by this command and call the entry point at offset 0x10\r
passing in "EblCmdX Arg2 Arg3 Arg4" as the arguments.\r
\r
go fv1:\EblCmdX 0x10000; Load EblCmdX to address 0x10000 and return\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
EBL_COMMMAND EntryPoint;\r
UINTN EntryPointArgc;\r
CHAR8 *EntryPointArgv[MAX_ARGS];\r
- \r
+\r
\r
if (Argc <= 2) {\r
// device name and laod address are required\r
if (Argv[2][0] == '*') {\r
// * Means allocate the buffer\r
Status = EfiReadAllocatePool (File, &Address, &Size);\r
- \r
+\r
// EntryPoint is relative to the start of the image\r
EntryPoint = (EBL_COMMMAND)((UINTN)EntryPoint + (UINTN)Address);\r
\r
EntryPointArgc = 1;\r
EntryPointArgv[0] = File->FileName;\r
}\r
- \r
+\r
Status = EntryPoint (EntryPointArgc, EntryPointArgv);\r
}\r
}\r
if (Argc < 3) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
DestFileName = Argv[2];\r
FileNameLen = AsciiStrLen (DestFileName);\r
\r
AsciiPrint("Source file open error.\n");\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
Destination = EfiOpen(DestFileName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0);\r
if (Destination == NULL) {\r
AsciiPrint("Destination file open error.\n");\r
if (Buffer == NULL) {\r
goto Exit;\r
}\r
- \r
+\r
Size = EfiTell(Source, NULL);\r
\r
for (Offset = 0; Offset + FILE_COPY_CHUNK <= Size; Offset += Chunk) {\r
Chunk = FILE_COPY_CHUNK;\r
- \r
+\r
Status = EfiRead(Source, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Read file error %r\n", Status);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Write file error %r\n", Status);\r
goto Exit;\r
- } \r
+ }\r
}\r
- \r
+\r
// Any left over?\r
if (Offset < Size) {\r
Chunk = Size - Offset;\r
- \r
+\r
Status = EfiRead(Source, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Read file error %r\n", Status);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Write file error %r\n", Status);\r
goto Exit;\r
- } \r
+ }\r
}\r
\r
\r
FreePool (DestFileName);\r
}\r
}\r
- \r
+\r
if (Buffer != NULL) {\r
FreePool(Buffer);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
UINTN Size2;\r
UINTN Offset;\r
UINTN Chunk = FILE_COPY_CHUNK;\r
- \r
+\r
if (Argc != 3) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
File1 = EfiOpen(Argv[1], EFI_FILE_MODE_READ, 0);\r
if (File1 == NULL) {\r
AsciiPrint("File 1 open error.\n");\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
File2 = EfiOpen(Argv[2], EFI_FILE_MODE_READ, 0);\r
if (File2 == NULL) {\r
AsciiPrint("File 2 open error.\n");\r
if (Buffer1 == NULL) {\r
goto Exit;\r
}\r
- \r
+\r
Buffer2 = AllocatePool(FILE_COPY_CHUNK);\r
if (Buffer2 == NULL) {\r
goto Exit;\r
- } \r
+ }\r
\r
for (Offset = 0; Offset + FILE_COPY_CHUNK <= Size1; Offset += Chunk) {\r
Chunk = FILE_COPY_CHUNK;\r
- \r
+\r
Status = EfiRead(File1, Buffer1, &Chunk);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("File 1 read error\n");\r
AsciiPrint("File 2 read error\n");\r
goto Exit;\r
}\r
- \r
+\r
if (CompareMem(Buffer1, Buffer2, Chunk) != 0) {\r
AsciiPrint("Files differ.\n");\r
goto Exit;\r
};\r
}\r
- \r
+\r
// Any left over?\r
if (Offset < Size1) {\r
Chunk = Size1 - Offset;\r
- \r
+\r
Status = EfiRead(File1, Buffer1, &Chunk);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("File 1 read error\n");\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("File 2 read error\n");\r
goto Exit;\r
- } \r
+ }\r
}\r
- \r
+\r
if (CompareMem(Buffer1, Buffer2, Chunk) != 0) {\r
AsciiPrint("Files differ.\n");\r
} else {\r
AsciiPrint("File 1 close error %r\n", Status);\r
}\r
}\r
- \r
+\r
if (File2 != NULL) {\r
Status = EfiClose(File2);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("File 2 close error %r\n", Status);\r
}\r
}\r
- \r
+\r
if (Buffer1 != NULL) {\r
FreePool(Buffer1);\r
}\r
- \r
+\r
if (Buffer2 != NULL) {\r
FreePool(Buffer2);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
},\r
{\r
"go",\r
- " dev:path loadaddress entrypoint args; load to given address and jump in", \r
+ " dev:path loadaddress entrypoint args; load to given address and jump in",\r
NULL,\r
EblGoCmd\r
},\r
{\r
"loadfv",\r
- " devname; Load PI FV from device", \r
+ " devname; Load PI FV from device",\r
NULL,\r
EblLoadFvCmd\r
},\r
{\r
"start",\r
- " path; EFI Boot Device:filepath. fs1:\\EFI\\BOOT.EFI", \r
+ " path; EFI Boot Device:filepath. fs1:\\EFI\\BOOT.EFI",\r
NULL,\r
EblStartCmd\r
},\r
{\r
"memmap",\r
- "; dump EFI memory map", \r
+ "; dump EFI memory map",\r
NULL,\r
EblMemMapCmd\r
},\r
**/\r
\r
#include "Ebl.h"\r
-// BugBug: Autogen does not allow this to be included currently \r
+// BugBug: Autogen does not allow this to be included currently\r
//#include <EdkModulePkg/Include/EdkDxe.h>\r
\r
GLOBAL_REMOVE_IF_UNREFERENCED char *mHobResourceType[] = {\r
Argv[0] - "hob"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
CurrentRow = 0;\r
for (Hob.Raw = GetHobList (); !END_OF_HOB_LIST(Hob); Hob.Raw = GET_NEXT_HOB(Hob)) {\r
if (Hob.Header->HobType == EFI_HOB_TYPE_HANDOFF) {\r
- AsciiPrint ("PHIT HOB Ver %x Boot Mode %02x Top %lx Bottom %lx\n", \r
- Hob.HandoffInformationTable->Version, \r
- Hob.HandoffInformationTable->BootMode, \r
+ AsciiPrint ("PHIT HOB Ver %x Boot Mode %02x Top %lx Bottom %lx\n",\r
+ Hob.HandoffInformationTable->Version,\r
+ Hob.HandoffInformationTable->BootMode,\r
Hob.HandoffInformationTable->EfiMemoryTop,\r
Hob.HandoffInformationTable->EfiMemoryBottom\r
);\r
return EFI_SUCCESS;\r
}\r
\r
- AsciiPrint (" Free Top %lx Free Bottom %lx End Of HOB %lx\n", \r
+ AsciiPrint (" Free Top %lx Free Bottom %lx End Of HOB %lx\n",\r
Hob.HandoffInformationTable->EfiFreeMemoryTop,\r
Hob.HandoffInformationTable->EfiFreeMemoryBottom,\r
Hob.HandoffInformationTable->EfiEndOfHobList\r
} else if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION) {\r
// mod(%) on array index is just to prevent buffer overrun\r
AsciiPrint ("Mem Alloc HOB %a %g %08lx:%lx\n",\r
- (Hob.MemoryAllocation->AllocDescriptor.MemoryType < EfiMaxMemoryType) ? gMemMapType[Hob.MemoryAllocation->AllocDescriptor.MemoryType] : "ILLEGAL TYPE", \r
- &Hob.MemoryAllocation->AllocDescriptor.Name, \r
- Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress, \r
+ (Hob.MemoryAllocation->AllocDescriptor.MemoryType < EfiMaxMemoryType) ? gMemMapType[Hob.MemoryAllocation->AllocDescriptor.MemoryType] : "ILLEGAL TYPE",\r
+ &Hob.MemoryAllocation->AllocDescriptor.Name,\r
+ Hob.MemoryAllocation->AllocDescriptor.MemoryBaseAddress,\r
Hob.MemoryAllocation->AllocDescriptor.MemoryLength\r
);\r
if (CompareGuid (&gEfiHobMemoryAllocModuleGuid, &Hob.MemoryAllocation->AllocDescriptor.Name)) {\r
} else if (Hob.Header->HobType == EFI_HOB_TYPE_RESOURCE_DESCRIPTOR) {\r
AsciiPrint ("Resource HOB %a %g %08lx:%lx\n Attributes: %08x\n",\r
(Hob.ResourceDescriptor->ResourceType < EFI_RESOURCE_MAX_MEMORY_TYPE) ? mHobResourceType[Hob.ResourceDescriptor->ResourceType] : mHobResourceType[EFI_RESOURCE_MAX_MEMORY_TYPE],\r
- &Hob.ResourceDescriptor->Owner, \r
- Hob.ResourceDescriptor->PhysicalStart, \r
- Hob.ResourceDescriptor->ResourceLength, \r
+ &Hob.ResourceDescriptor->Owner,\r
+ Hob.ResourceDescriptor->PhysicalStart,\r
+ Hob.ResourceDescriptor->ResourceLength,\r
Hob.ResourceDescriptor->ResourceAttribute\r
);\r
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
return EFI_SUCCESS;\r
}\r
- AsciiPrint (" %a 0x%08x\n", \r
- (EfiMemoryTypeInformation->Type < EfiMaxMemoryType) ? gMemMapType[EfiMemoryTypeInformation->Type] : "END ", \r
+ AsciiPrint (" %a 0x%08x\n",\r
+ (EfiMemoryTypeInformation->Type < EfiMaxMemoryType) ? gMemMapType[EfiMemoryTypeInformation->Type] : "END ",\r
EfiMemoryTypeInformation->NumberOfPages\r
);\r
}\r
}\r
} else if (Hob.Header->HobType == EFI_HOB_TYPE_FV) {\r
- AsciiPrint ("FV HOB %08lx:%08lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->Length); \r
+ AsciiPrint ("FV HOB %08lx:%08lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->Length);\r
} else if (Hob.Header->HobType == EFI_HOB_TYPE_CPU) {\r
- AsciiPrint ("CPU HOB: Mem %x IO %x\n", Hob.Cpu->SizeOfMemorySpace, Hob.Cpu->SizeOfIoSpace); \r
+ AsciiPrint ("CPU HOB: Mem %x IO %x\n", Hob.Cpu->SizeOfMemorySpace, Hob.Cpu->SizeOfIoSpace);\r
} else if (Hob.Header->HobType == EFI_HOB_TYPE_MEMORY_POOL) {\r
AsciiPrint ("Mem Pool HOB:\n");\r
/* Not in PI\r
\r
if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
break;\r
- } \r
+ }\r
}\r
\r
return EFI_SUCCESS;\r
\r
Module Name: HwDebug.c\r
\r
- Commands useful for debugging hardware. \r
+ Commands useful for debugging hardware.\r
\r
**/\r
\r
md 0x123445678 ; Dump 0x20 1 byte quantities starting at 0x123445678\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
OutputData (Address, Length, Width, (UINTN)Address);\r
\r
Address += Length;\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
mf 0x123445678 ; Start at 0x123445678 and write 00 (4 byte) to the next 1 byte\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
MmioWrite8 (Address, (UINT8)Data);\r
}\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
Argv[3] - func\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
CHAR8 *Str;\r
UINTN ThisBus;\r
\r
- \r
+\r
BusArg = (Argc > 1) ? AsciiStrDecimalToUintn (Argv[1]) : 0;\r
DevArg = (Argc > 2) ? AsciiStrDecimalToUintn (Argv[2]) : 0;\r
FuncArg = (Argc > 3) ? AsciiStrDecimalToUintn (Argv[3]) : 0;\r
\r
Header = &PciHeader;\r
- \r
+\r
Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiPciIoProtocolGuid, NULL, &HandleCount, &HandleBuffer);\r
if (EFI_ERROR (Status)) {\r
AsciiPrint ("No PCI devices found in the system\n");\r
Status = Pci->Pci.Read (Pci, EfiPciIoWidthUint32, 0, sizeof (PciHeader)/sizeof (UINT32), &PciHeader);\r
if (!EFI_ERROR (Status)) {\r
Hdr = &PciHeader.Bridge.Hdr;\r
- \r
+\r
if (Hdr->ClassCode[2] < sizeof (gPciDevClass)/sizeof (VOID *)) {\r
Str = gPciDevClass[Hdr->ClassCode[2]];\r
if (Hdr->ClassCode[2] == PCI_CLASS_SERIAL) {\r
AsciiPrint (" 0x%04x 0x%04x %a 0x%02x", Hdr->VendorId, Hdr->DeviceId, Str, Hdr->ClassCode[1]);\r
}\r
if (Seg != 0) {\r
- // Only print Segment if it is non zero. If you only have one PCI segment it is \r
+ // Only print Segment if it is non zero. If you only have one PCI segment it is\r
// redundent to print it out\r
AsciiPrint (" Seg:%d", Seg);\r
}\r
if (!EFI_ERROR (Status)) {\r
Pci->GetLocation (Pci, &Seg, &Bus, &Dev, &Func);\r
if ((Bus == BusArg) && (Dev == DevArg) && (Func == FuncArg)) {\r
- // Only print Segment if it is non zero. If you only have one PCI segment it is \r
+ // Only print Segment if it is non zero. If you only have one PCI segment it is\r
// redundant to print it out\r
if (Seg != 0) {\r
AsciiPrint ("Seg:%d ", Seg);\r
}\r
AsciiPrint ("Bus:%d Dev:%d Func:%d ", Bus, Dev, Func);\r
- \r
+\r
Status = Pci->Pci.Read (Pci, EfiPciIoWidthUint32, 0, sizeof (PciHeader)/sizeof (UINT32), Header);\r
if (!EFI_ERROR (Status)) {\r
Hdr = &PciHeader.Bridge.Hdr;\r
if (IS_PCI_BRIDGE (&PciHeader.Bridge)) {\r
Bridge = &PciHeader.Bridge.Bridge;\r
AsciiPrint (\r
- "PCI Bridge. Bus Primary %d Secondary %d Subordinate %d\n", \r
+ "PCI Bridge. Bus Primary %d Secondary %d Subordinate %d\n",\r
Bridge->PrimaryBus, Bridge->SecondaryBus, Bridge->SubordinateBus\r
);\r
AsciiPrint (" Bar 0: 0x%08x Bar 1: 0x%08x\n", Bridge->Bar[0], Bridge->Bar[1]);\r
}\r
}\r
}\r
- \r
+\r
AsciiPrint ("\n");\r
break;\r
}\r
}\r
}\r
}\r
- \r
+\r
FreePool (HandleBuffer);\r
return EFI_SUCCESS;\r
}\r
ior 0x3f8 ;Do a 8-bit IO Read from 0x3f8\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
iow 0x3f8 af ;Do an 8-bit IO write of af to 0x3f8\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
Port = AsciiStrHexToUintn (Argv[1]);\r
Data = AsciiStrHexToUintn (Argv[2]);\r
Width = WidthFromCommandName (Argv[0], 1);\r
- \r
+\r
if (Width == 1) {\r
IoWrite8 (Port, (UINT8)Data);\r
} else if (Width == 2) {\r
// Global to turn on/off breaking commands with prompts before they scroll the screen\r
BOOLEAN gPageBreak = TRUE;\r
\r
-VOID \r
+VOID\r
RingBufferIncrement (\r
IN INTN *Value\r
)\r
{\r
*Value = *Value + 1;\r
- \r
+\r
if (*Value >= MAX_CMD_HISTORY) {\r
*Value = 0;\r
}\r
)\r
{\r
*Value = *Value - 1;\r
- \r
+\r
if (*Value < 0) {\r
*Value = MAX_CMD_HISTORY - 1;\r
}\r
}\r
\r
/**\r
- Save this command in the circular history buffer. Older commands are \r
+ Save this command in the circular history buffer. Older commands are\r
overwritten with newer commands.\r
\r
@param Cmd Command line to archive the history of.\r
{\r
// Don't bother adding empty commands to the list\r
if (AsciiStrLen(Cmd) != 0) {\r
- \r
+\r
// First entry\r
if (mCmdHistoryStart == -1) {\r
mCmdHistoryStart = 0;\r
} else {\r
// Record the new command at the next index\r
RingBufferIncrement(&mCmdHistoryStart);\r
- \r
+\r
// If the next index runs into the end index, shuffle end back by one\r
if (mCmdHistoryStart == mCmdHistoryEnd) {\r
RingBufferIncrement(&mCmdHistoryEnd);\r
}\r
}\r
- \r
+\r
// Copy the new command line into the ring buffer\r
AsciiStrnCpy(&mCmdHistory[mCmdHistoryStart][0], Cmd, MAX_CMD_LINE);\r
}\r
- \r
+\r
// Reset the command history for the next up arrow press\r
- mCmdHistoryCurrent = mCmdHistoryStart; \r
+ mCmdHistoryCurrent = mCmdHistoryStart;\r
}\r
\r
\r
)\r
{\r
CHAR8 *HistoricalCommand = NULL;\r
- \r
+\r
// No history yet?\r
if (mCmdHistoryCurrent == -1) {\r
HistoricalCommand = mCmdBlank;\r
goto Exit;\r
}\r
- \r
+\r
if (Direction == SCAN_UP) {\r
HistoricalCommand = &mCmdHistory[mCmdHistoryCurrent][0];\r
- \r
+\r
// if we just echoed the last command, hang out there, don't wrap around\r
if (mCmdHistoryCurrent == mCmdHistoryEnd) {\r
goto Exit;\r
}\r
- \r
+\r
// otherwise, back up by one\r
RingBufferDecrement(&mCmdHistoryCurrent);\r
- \r
+\r
} else if (Direction == SCAN_DOWN) {\r
- \r
+\r
// if we last echoed the start command, put a blank prompt out\r
if (mCmdHistoryCurrent == mCmdHistoryStart) {\r
HistoricalCommand = mCmdBlank;\r
goto Exit;\r
}\r
- \r
+\r
// otherwise increment the current pointer and return that command\r
RingBufferIncrement(&mCmdHistoryCurrent);\r
RingBufferIncrement(&mCmdHistoryCurrent);\r
- \r
+\r
HistoricalCommand = &mCmdHistory[mCmdHistoryCurrent][0];\r
RingBufferDecrement(&mCmdHistoryCurrent);\r
}\r
\r
-Exit: \r
+Exit:\r
return HistoricalCommand;\r
}\r
\r
} else if (*Char != ' ') {\r
Argv[Arg++] = Char;\r
LookingForArg = FALSE;\r
- } \r
+ }\r
} else {\r
// Looking for the terminator of an Argv[] entry\r
if (!InQuote && (*Char == ' ')) {\r
*Char = '\0';\r
InQuote = FALSE;\r
}\r
- } \r
+ }\r
}\r
\r
*Argc = Arg;\r
\r
@param Key EFI Key information returned\r
@param TimeoutInSec Number of seconds to wait to timeout\r
- @param CallBack Callback called every second during the timeout wait \r
+ @param CallBack Callback called every second during the timeout wait\r
\r
@return EFI_SUCCESS Key was returned\r
@return EFI_TIMEOUT If the TimoutInSec expired\r
if (WaitCount == 2) {\r
gBS->CloseEvent (WaitList[1]);\r
}\r
- return EFI_SUCCESS; \r
+ return EFI_SUCCESS;\r
}\r
break;\r
\r
case 1:\r
- // Periodic 1 sec timer signaled \r
+ // Periodic 1 sec timer signaled\r
TimeoutInSec--;\r
if (CallBack != NULL) {\r
- // Call the users callback function if registered \r
+ // Call the users callback function if registered\r
CallBack (TimeoutInSec);\r
}\r
if (TimeoutInSec == 0) {\r
default:\r
ASSERT (FALSE);\r
}\r
- } \r
+ }\r
}\r
\r
\r
If the use hits Q to quit return TRUE else for any other key return FALSE.\r
PrefixNewline is used to figure out if a newline is needed before the prompt\r
string. This depends on the last print done before calling this function.\r
- CurrentRow is updated by one on a call or set back to zero if a prompt is \r
+ CurrentRow is updated by one on a call or set back to zero if a prompt is\r
needed.\r
\r
@param CurrentRow Used to figure out if its the end of the page and updated\r
\r
\r
/**\r
- Set the text color of the EFI Console. If a zero is passed in reset to \r
+ Set the text color of the EFI Console. If a zero is passed in reset to\r
default text/background color.\r
\r
@param Attribute For text and background color\r
/**\r
Collect the keyboard input for a cmd line. Carriage Return, New Line, or ESC\r
terminates the command line. You can edit the command line via left arrow,\r
- delete and backspace and they all back up and erase the command line. \r
+ delete and backspace and they all back up and erase the command line.\r
No edit of command line is possible without deletion at this time!\r
- The up arrow and down arrow fill Cmd with information from the history \r
+ The up arrow and down arrow fill Cmd with information from the history\r
buffer.\r
\r
- @param Cmd Command line to return \r
+ @param Cmd Command line to return\r
@param CmdMaxSize Maximum size of Cmd\r
\r
@return The Status of EblGetCharKey()\r
\r
/**\r
Send null requests to all removable media block IO devices so the a media add/remove/change\r
- can be detected in real before we execute a command. \r
+ can be detected in real before we execute a command.\r
\r
- This is mainly due to the fact that the FAT driver does not do this today so you can get stale \r
+ This is mainly due to the fact that the FAT driver does not do this today so you can get stale\r
dir commands after an SD Card has been removed.\r
**/\r
VOID\r
commands returns an error.\r
\r
@param CmdLine Command Line to process.\r
- @param MaxCmdLineSize MaxSize of the Command line \r
+ @param MaxCmdLineSize MaxSize of the Command line\r
\r
@return EFI status of the Command\r
\r
}\r
} else {\r
AsciiPrint ("The command '%a' is not supported.\n", Argv[0]);\r
- } \r
- } \r
+ }\r
+ }\r
}\r
\r
return Status;\r
}\r
- \r
+\r
\r
\r
/**\r
- Embedded Boot Loader (EBL) - A simple EFI command line application for embedded \r
+ Embedded Boot Loader (EBL) - A simple EFI command line application for embedded\r
devices. PcdEmbeddedAutomaticBootCommand is a complied in command line that\r
gets executed automatically. The ; separator allows multiple commands\r
for each command line.\r
EdkBootLoaderEntry (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
CHAR8 CmdLine[MAX_CMD_LINE];\r
EblInitializeExternalCmd ();\r
EblInitializeNetworkCmd();\r
EblInitializeVariableCmds ();\r
- \r
+\r
if (gST->ConOut == NULL) {\r
DEBUG((EFI_D_ERROR,"Error: No Console Output\n"));\r
return EFI_NOT_READY;\r
gST->ConOut->QueryMode (gST->ConOut, gST->ConOut->Mode->Mode, &gScreenColumns, &gScreenRows);\r
\r
EblPrintStartupBanner ();\r
- \r
+\r
// Parse command line and handle commands separated by ;\r
// The loop prints the prompt gets user input and saves history\r
- \r
+\r
// Look for a variable with a default command line, otherwise use the Pcd\r
ZeroMem(&VendorGuid, sizeof(EFI_GUID));\r
\r
Status = gRT->GetVariable(CommandLineVariableName, &VendorGuid, NULL, &CommandLineVariableSize, CommandLineVariable);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
CommandLineVariable = AllocatePool(CommandLineVariableSize);\r
- \r
+\r
Status = gRT->GetVariable(CommandLineVariableName, &VendorGuid, NULL, &CommandLineVariableSize, CommandLineVariable);\r
if (!EFI_ERROR(Status)) {\r
UnicodeStrToAsciiStr(CommandLineVariable, CmdLine);\r
}\r
- \r
+\r
FreePool(CommandLineVariable);\r
}\r
- \r
+\r
if (EFI_ERROR(Status)) {\r
AsciiStrCpy (CmdLine, (CHAR8 *)PcdGetPtr (PcdEmbeddedAutomaticBootCommand));\r
}\r
- \r
+\r
for (;;) {\r
Status = ProcessCmdLine (CmdLine, MAX_CMD_LINE);\r
if (Status == EFI_ABORTED) {\r
Address->v4.Addr[2] = (UINT8)AsciiStrDecimalToUintn (String);\r
String = AsciiStrStr(String, ".") + 1;\r
Address->v4.Addr[3] = (UINT8)AsciiStrDecimalToUintn (String);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
EFI_STATUS Status = EFI_INVALID_PARAMETER;\r
EFI_MAC_ADDRESS Mac;\r
EFI_IP_ADDRESS Ip;\r
- \r
- if (Argc == 1) { \r
+\r
+ if (Argc == 1) {\r
// Get current IP/MAC\r
- \r
+\r
// Get current MAC address\r
Status = EblGetCurrentMacAddress (&Mac);\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
- \r
+\r
AsciiPrint ("MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", Mac.Addr[0], Mac.Addr[1], Mac.Addr[2], Mac.Addr[3], Mac.Addr[4], Mac.Addr[5]);\r
- \r
+\r
// Get current IP address\r
Status = EblGetCurrentIpAddress (&Ip);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("IP Address is not configured.\n");\r
Status = EFI_SUCCESS;\r
goto Exit;\r
- } \r
+ }\r
\r
AsciiPrint("IP Address: %d.%d.%d.%d\n", Ip.v4.Addr[0], Ip.v4.Addr[1],Ip.v4.Addr[2], Ip.v4.Addr[3]);\r
- \r
+\r
} else if ((Argv[1][0] == 'r') && (Argc == 2)) {\r
// Get new address via dhcp\r
Status = EblPerformDHCP (TRUE);\r
if (EFI_ERROR (Status)) {\r
goto Exit;\r
}\r
- \r
+\r
Status = EblSetStationIp (&Ip, NULL);\r
}\r
- \r
+\r
Exit:\r
return Status;\r
}\r
\r
/**\r
Execute the passed in file like a series of commands. The ; can be used on\r
- a single line to indicate multiple commands per line. The Ascii text file \r
- can contain any number of lines. The following line termination forms are \r
+ a single line to indicate multiple commands per line. The Ascii text file\r
+ can contain any number of lines. The following line termination forms are\r
supported:\r
LF : Unix, Mac OS X*, BeOS\r
CR+LF: MS-DOS*, Microsoft Windows*\r
CR : Commodore, Apple II, and really Mac OS\r
- LF+CR: for simplicity and completeness \r
+ LF+CR: for simplicity and completeness\r
\r
Argv[0] - "script"\r
Argv[1] - Device Name:path for the file to load\r
script fv1:\script.txt\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
CHAR8 *Ptr;\r
CHAR8 *ScanPtr;\r
UINTN CmdLineSize;\r
- \r
- \r
+\r
+\r
\r
if (Argc < 2) {\r
// file name required\r
CmdLineSize++;\r
break;\r
}\r
- \r
+\r
}\r
\r
Status = ProcessCmdLine (Ptr, CmdLineSize);\r
}\r
- \r
+\r
FreePool (Address);\r
}\r
- \r
+\r
EfiClose (File);\r
return Status;\r
}\r
GLOBAL_REMOVE_IF_UNREFERENCED const EBL_COMMAND_TABLE mScriptTemplate[] = {\r
{\r
"script",\r
- " device:path; load an ascii file and execute it like commands", \r
+ " device:path; load an ascii file and execute it like commands",\r
NULL,\r
EblScriptCmd\r
}\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
AsciiPrint("Variable name is missing.\n");\r
return Status;\r
}\r
- \r
+\r
// Check if it is a valid variable setting\r
AsciiValue = AsciiStrStr (AsciiVariableSetting,"=");\r
if (AsciiValue == NULL) {\r
/** @file\r
- Glue code that contains the EFI entry point and converts it to an EBL \r
+ Glue code that contains the EFI entry point and converts it to an EBL\r
ASCII Argc, Argv sytle entry point\r
\r
\r
} else if (*Char != ' ') {\r
Argv[Arg++] = Char;\r
LookingForArg = FALSE;\r
- } \r
+ }\r
} else {\r
// Looking for the terminator of an Argv[] entry\r
if ((InQuote && (*Char == '"')) || (!InQuote && (*Char == ' '))) {\r
\r
return;\r
}\r
- \r
+\r
\r
\r
\r
/**\r
- Embedded Boot Loader (EBL) - A simple EFI command line application for embedded \r
+ Embedded Boot Loader (EBL) - A simple EFI command line application for embedded\r
devices. PcdEmbeddedAutomaticBootCommand is a complied in command line that\r
gets executed automatically. The ; separator allows multiple commands\r
for each command line.\r
EdkExternCmdEntry (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
EFI_LOADED_IMAGE_PROTOCOL *ImageInfo;\r
if (EFI_ERROR (Status)) {\r
Argc = 0;\r
} else {\r
- // Looks like valid commands were passed in. \r
+ // Looks like valid commands were passed in.\r
ParseArguments (ImageInfo->LoadOptions, ImageInfo->LoadOptionsSize, &Argc, Argv);\r
}\r
- \r
+\r
return EblMain (Argc, Argv);\r
}\r
\r
/** @file\r
- Example of an external EBL command. It's loaded via EBL start command. \r
+ Example of an external EBL command. It's loaded via EBL start command.\r
Argc and Argv are passed in via "" of the EBL command line.\r
\r
Start fs0:\EdkExternCmd.efi "Argv[0] Argv[1] 2"\r
\r
- will launch this command with \r
+ will launch this command with\r
Argv[0] = "Argv[0]"\r
Argv[1] = "Argv[2]"\r
Argv[2] = "3"\r
Entry point with Argc, Argv. Put your code here.\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
for (Index = 0; Index < Argc; Index++) {\r
AsciiPrint ("Argv[%d] = %a\n", Index, Argv[Index]);\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
if (Count == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
*Count = gCurrentMonotonicCount++;\r
return EFI_SUCCESS;\r
}\r
if (HighCount == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
gCurrentMonotonicCount += 0x0000000100000000ULL;\r
- \r
+\r
*HighCount = (UINT32)RShiftU64 (gCurrentMonotonicCount, 32) & 0xFFFFFFFF;\r
\r
return EFI_SUCCESS;\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE|BOOLEAN|0x00000006\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPciDebugCmd|FALSE|BOOLEAN|0x00000041\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedProbeRemovable|TRUE|BOOLEAN|0x00000052\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|FALSE|BOOLEAN|0x0000001b\r
gEmbeddedTokenSpaceGuid.PcdCacheEnable|FALSE|BOOLEAN|0x00000042\r
gEmbeddedTokenSpaceGuid.PcdGdbSerial|FALSE|BOOLEAN|0x00000053\r
gEmbeddedTokenSpaceGuid.PcdPrePiHobBase|131072|UINT32|0x00000040\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0|UINT32|0x0000000b\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|131072|UINT32|0x0000000c\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x0|UINT32|0x0000004e\r
gEmbeddedTokenSpaceGuid.PcdMemorySize|0x0|UINT32|0x0000004f\r
\r
gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|0x0|UINT32|0x00000043\r
gEmbeddedTokenSpaceGuid.PcdFlashFvMainOffset|0x0|UINT32|0x00000044\r
gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize|0x0|UINT32|0x00000045\r
- \r
+\r
# Used to help reduce fragmentation in the EFI memory map\r
# EFI Pages (4K) are the units used\r
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0|UINT32|0x00000012\r
gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress|0x38e00000|UINT32|0x0000001f\r
\r
gEmbeddedTokenSpaceGuid.PcdMetronomeTickPeriod|100|UINT32|0x00000020\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress|0xffff0000|UINT32|0x00000030\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize|0x0000000|UINT32|0x00000031\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|0x0000000|UINT64|0x00000032\r
# DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf\r
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf\r
\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf\r
- \r
+\r
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf\r
- \r
+\r
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
- \r
+\r
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf\r
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf\r
PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf\r
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
- \r
+\r
SerialPortLib|EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.inf\r
SerialPortExtLib|EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.inf\r
RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf\r
# Need to change this for IPF\r
#\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
- \r
+\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
# Networking Requirements\r
NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf\r
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf\r
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf \r
+ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf\r
\r
[LibraryClasses.common.DXE_DRIVER]\r
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
[LibraryClasses.common.UEFI_DRIVER]\r
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
- \r
+\r
[LibraryClasses.common.SEC]\r
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf\r
\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|FALSE\r
gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|FALSE\r
gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|FALSE\r
- \r
+\r
#\r
# Control what commands are supported from the UI\r
# Turn these on and off to add features or save size\r
- # \r
+ #\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedIoEnable|FALSE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPciDebugCmd|TRUE\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|FALSE\r
\r
\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|L""\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiHobBase|0\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0\r
#\r
# Optinal feature to help prevent EFI memory map fragments\r
# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob\r
-# Values are in EFI Pages (4K). DXE Core will make sure that \r
-# at least this much of each type of memory can be allocated \r
+# Values are in EFI Pages (4K). DXE Core will make sure that\r
+# at least this much of each type of memory can be allocated\r
# from a single memory range. This way you only end up with\r
# maximum of two fragements for each type in the memory map\r
# (the memory used, and the free memory that was prereserved\r
#\r
################################################################################\r
[Components.common]\r
- EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf \r
+ EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf\r
EmbeddedPkg/Library/EblCmdLibNull/EblCmdLibNull.inf\r
EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf\r
- EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.inf \r
- EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.inf \r
+ EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.inf\r
+ EmbeddedPkg/Library/GdbSerialLib/GdbSerialLib.inf\r
EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf\r
EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.inf\r
-# This is Ebl FDF file \r
+# This is Ebl FDF file\r
#\r
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
#\r
#\r
################################################################################\r
INF EmbeddedPkg/Ebl/Ebl.inf\r
- \r
+\r
################################################################################\r
-# \r
+#\r
# Rules are use with the [FV] section's module INF type to define\r
# how an FFS file is created for a given INF file. The following Rule are the default\r
# rules for the different module type. User can add the customized rules to define the\r
# content of the FFS file.\r
-# \r
+#\r
################################################################################\r
- \r
- \r
+\r
+\r
############################################################################\r
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # \r
+# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #\r
############################################################################\r
-# \r
+#\r
#[Rule.Common.DXE_DRIVER]\r
# FILE DRIVER = $(NAMED_GUID) {\r
# DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex\r
[Rule.Common.PEI_CORE]\r
FILE PEI_CORE = $(NAMED_GUID) {\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING ="$(MODULE_NAME)" Optional \r
+ UI STRING ="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM]\r
FILE PEIM = $(NAMED_GUID) {\r
PEI_DEPEX PEI_DEPEX Optional $(MODULE_NAME).depex\r
PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi\r
- UI STRING="$(MODULE_NAME)" Optional \r
+ UI STRING="$(MODULE_NAME)" Optional\r
}\r
\r
[Rule.Common.PEIM.TIANOCOMPRESSED]\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
{ EXCEPT_ARM_SOFTWARE_INTERRUPT, GDB_SIGTRAP }\r
-// { EXCEPT_ARM_UNDEFINED_INSTRUCTION, GDB_SIGTRAP }, \r
-// { EXCEPT_ARM_PREFETCH_ABORT, GDB_SIGTRAP }, \r
-// { EXCEPT_ARM_DATA_ABORT, GDB_SIGEMT }, \r
-// { EXCEPT_ARM_RESERVED, GDB_SIGILL } \r
+// { EXCEPT_ARM_UNDEFINED_INSTRUCTION, GDB_SIGTRAP },\r
+// { EXCEPT_ARM_PREFETCH_ABORT, GDB_SIGTRAP },\r
+// { EXCEPT_ARM_DATA_ABORT, GDB_SIGEMT },\r
+// { EXCEPT_ARM_RESERVED, GDB_SIGILL }\r
};\r
\r
// Shut up some annoying RVCT warnings\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
/**\r
Return the number of entries in the gRegisters[]\r
- \r
- @retval UINTN, the number of entries (registers) in the gRegisters[] array. \r
+\r
+ @retval UINTN, the number of entries (registers) in the gRegisters[] array.\r
**/\r
UINTN\r
MaxRegisterCount (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
\r
- @retval TRUE if Isa is supported \r
+ @retval TRUE if Isa is supported\r
\r
**/\r
BOOLEAN\r
/**\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the ARM member\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
- **/ \r
+ **/\r
UINTN *\r
FindPointerToRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
{\r
UINTN RegSize;\r
CHAR8 Char;\r
- \r
+\r
if (gRegisterOffsets[RegNumber] > 0xF00) {\r
AsciiSPrint (OutBufPtr, 9, "00000000");\r
OutBufPtr += 8;\r
Char = Char - 'A' + 'a';\r
}\r
*OutBufPtr++ = Char;\r
- \r
+\r
Char = mHexToStr[(UINT8)((*FindPointerToRegister (SystemContext, RegNumber) >> RegSize) & 0xf)];\r
if ((Char >= 'A') && (Char <= 'F')) {\r
Char = Char - 'A' + 'a';\r
}\r
*OutBufPtr++ = Char;\r
- \r
+\r
RegSize = RegSize + 8;\r
}\r
return OutBufPtr;\r
\r
\r
/**\r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
**/\r
UINTN RegNumber;\r
CHAR8 OutBuffer[9]; // 1 reg=8 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
- \r
+\r
if (RegNumber >= MaxRegisterCount ()) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
- \r
+\r
OutBufPtr = OutBuffer;\r
OutBufPtr = BasicReadRegister (SystemContext, RegNumber, OutBufPtr);\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket (OutBuffer);\r
}\r
\r
\r
/**\r
- Reads the general registers into an output buffer and sends it as a packet \r
+ Reads the general registers into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
CHAR8 *OutBuffer;\r
CHAR8 *OutBufPtr;\r
UINTN RegisterCount = MaxRegisterCount ();\r
- \r
+\r
// It is not safe to allocate pool here....\r
OutBuffer = AllocatePool ((RegisterCount * 8) + 1); // 8 bytes per register in string format plus a null to terminate\r
OutBufPtr = OutBuffer;\r
for (Index = 0; Index < RegisterCount; Index++) {\r
OutBufPtr = BasicReadRegister (SystemContext, Index, OutBufPtr);\r
}\r
- \r
+\r
*OutBufPtr = '\0';\r
SendPacket (OutBuffer);\r
FreePool (OutBuffer);\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT32 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
if (gRegisterOffsets[RegNumber] > 0xF00) {\r
return InBufPtr + 8;\r
}\r
RegSize = 0;\r
while (RegSize < 32) {\r
TempValue = HexCharToInt (*InBufPtr++);\r
- \r
+\r
if ((INTN)TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
+\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt (*InBufPtr++);\r
- \r
+\r
if ((INTN)TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister (SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
- \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
+\r
// check if this is a valid Register Number\r
if (RegNumber >= MaxRegisterCount ()) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
UINTN RegisterCount = MaxRegisterCount ();\r
\r
MinLength = (RegisterCount * 8) + 1; // 'G' plus the registers in ASCII format\r
- \r
+\r
if (AsciiStrLen (InBuffer) < MinLength) {\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
- \r
+\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for (i = 0; i < RegisterCount; i++) {\r
InBufPtr = BasicWriteRegister (SystemContext, i, InBufPtr);\r
}\r
- \r
+\r
SendSuccess ();\r
}\r
\r
\r
LIST_ENTRY BreakpointList;\r
\r
-/** \r
+/**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
return;\r
}\r
mSingleStepActive = TRUE;\r
- \r
+\r
mSingleStepPC = SystemContext.SystemContextArm->PC;\r
\r
mSingleStepDataSize = sizeof (UINT32);\r
- mSingleStepData = (*(UINT32 *)mSingleStepPC); \r
+ mSingleStepData = (*(UINT32 *)mSingleStepPC);\r
*(UINT32 *)mSingleStepPC = GDB_ARM_BKPT;\r
if (*(UINT32 *)mSingleStepPC != GDB_ARM_BKPT) {\r
// For some reason our breakpoint did not take\r
//DEBUG((EFI_D_ERROR, "AddSingleStep at 0x%08x (was: 0x%08x is:0x%08x)\n", SystemContext.SystemContextArm->PC, mSingleStepData, *(UINT32 *)mSingleStepPC));\r
}\r
\r
- \r
-/** \r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
if (!mSingleStepActive) {\r
return;\r
}\r
- \r
+\r
if (mSingleStepDataSize == sizeof (UINT16)) {\r
*(UINT16 *)mSingleStepPC = (UINT16)mSingleStepData;\r
} else {\r
\r
\r
/**\r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextArm->PC = AsciiStrHexToUintn (&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
Breakpoint->Signature = ARM_SOFTWARE_BREAKPOINT_SIGNATURE;\r
Breakpoint->Address = Address;\r
Breakpoint->Instruction = *(UINT32 *)Address;\r
- \r
+\r
// Add it to the list\r
InsertTailList (&BreakpointList, &Breakpoint->Link);\r
\r
switch (Type) {\r
case 0: //Software breakpoint\r
break;\r
- \r
+\r
default:\r
SendError (GDB_EINVALIDBRKPOINTTYPE);\r
return;\r
\r
BOOLEAN\r
ValidateException (\r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
UINT32 ExceptionAddress;\r
UINT32 Instruction;\r
- \r
+\r
// Is it a debugger SWI?\r
ExceptionAddress = SystemContext.SystemContextArm->PC -= 4;\r
Instruction = *(UINT32 *)ExceptionAddress;\r
/** @file\r
UEFI driver that implements a GDB stub\r
- \r
+\r
Note: Any code in the path of the Serial IO output can not call DEBUG as will\r
will blow out the stack. Serial IO calls DEBUG, debug calls Serail IO, ...\r
- \r
+\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
CHAR8 gInBuffer[MAX_BUF_SIZE];\r
CHAR8 gOutBuffer[MAX_BUF_SIZE];\r
\r
-// Assume gdb does a "qXfer:libraries:read::offset,length" when it connects so we can default \r
+// Assume gdb does a "qXfer:libraries:read::offset,length" when it connects so we can default\r
// this value to FALSE. Since gdb can reconnect its self a global default is not good enough\r
BOOLEAN gSymbolTableUpdate = FALSE;\r
EFI_EVENT gEvent;\r
\r
/**\r
The user Entry Point for Application. The user code starts with this function\r
- as the real entry point for the image goes into a library that calls this \r
+ as the real entry point for the image goes into a library that calls this\r
function.\r
\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image. \r
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
@param[in] SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The entry point is executed successfully.\r
@retval other Some error occurs when executing this entry point.\r
\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status; \r
+ EFI_STATUS Status;\r
EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport;\r
UINTN HandleCount;\r
EFI_HANDLE *Handles;\r
\r
return Status;\r
}\r
- \r
+\r
DebugSupport = NULL;\r
IsaSupported = FALSE;\r
do {\r
}\r
} while (HandleCount > 0);\r
FreePool (Handles);\r
- \r
+\r
if (!IsaSupported) {\r
DEBUG ((EFI_D_ERROR, "Debug Support Protocol does not support our ISA\n"));\r
\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
Status = DebugSupport->GetMaximumProcessorIndex (DebugSupport, &gMaxProcessorIndex);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
DEBUG ((EFI_D_INFO, "Debug Support Protocol ISA %x\n", DebugSupport->Isa));\r
DEBUG ((EFI_D_INFO, "Debug Support Protocol Processor Index %d\n", gMaxProcessorIndex));\r
- \r
+\r
// Call processor-specific init routine\r
InitializeProcessor ();\r
\r
Status = DebugSupport->RegisterPeriodicCallback (DebugSupport, Processor, GdbPeriodicCallBack);\r
ASSERT_EFI_ERROR (Status);\r
}\r
- \r
+\r
//\r
// This even fires every time an image is added. This allows the stub to know when gdb needs\r
- // to update the symbol table. \r
+ // to update the symbol table.\r
//\r
Status = gBS->CreateEvent (\r
EVT_NOTIFY_SIGNAL,\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- \r
+\r
if (PcdGetBool (PcdGdbSerial)) {\r
GdbInitializeSerialConsole ();\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
{\r
CHAR8 c1;\r
CHAR8 c2;\r
- \r
+\r
while (Length-- > 0) {\r
c1 = (CHAR8)HexCharToInt (*NewData++);\r
c2 = (CHAR8)HexCharToInt (*NewData++);\r
\r
if ((c1 < 0) || (c2 < 0)) {\r
Print ((CHAR16 *)L"Bad message from write to memory..\n");\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return;\r
}\r
*Address++ = (UINT8)((c1 << 4) + c2);\r
\r
OutBufPtr = OutBuffer;\r
while (Length > 0) {\r
- \r
+\r
Char = mHexToStr[*Address >> 4];\r
if ((Char >= 'A') && (Char <= 'F')) {\r
Char = Char - 'A' + 'a';\r
\r
/**\r
Send a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
- If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up \r
+\r
+ If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up\r
in an infinit loop. This is so if you unplug the debugger code just keeps running\r
\r
- @param PacketData Payload data for the packet \r
+ @param PacketData Payload data for the packet\r
+\r
\r
- \r
@retval Number of bytes of packet data sent.\r
\r
**/\r
CHAR8 *Ptr;\r
CHAR8 TestChar;\r
UINTN Count;\r
- \r
+\r
Timeout = PcdGet32 (PcdGdbMaxPacketRetryCount);\r
\r
Count = 0;\r
// Only try a finite number of times so we don't get stuck in the loop\r
return Count;\r
}\r
- \r
+\r
// Packet prefix\r
GdbPutChar ('$');\r
- \r
+\r
for (CheckSum = 0, Count =0 ; *Ptr != '\0'; Ptr++, Count++) {\r
GdbPutChar (*Ptr);\r
CheckSum = CheckSum + *Ptr;\r
}\r
- \r
- // Packet terminating character and checksum \r
+\r
+ // Packet terminating character and checksum\r
GdbPutChar ('#');\r
GdbPutChar (mHexToStr[CheckSum >> 4]);\r
GdbPutChar (mHexToStr[CheckSum & 0x0F]);\r
- \r
+\r
TestChar = GdbGetChar ();\r
} while (TestChar != '+');\r
- \r
+\r
return Count;\r
}\r
\r
/**\r
Receive a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
+\r
If host re-starts sending a packet without ending the previous packet, only the last valid packet is proccessed.\r
(In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)\r
- \r
+\r
If an ack '+' is not sent resend the packet\r
\r
- @param PacketData Payload data for the packet \r
+ @param PacketData Payload data for the packet\r
\r
@retval Number of bytes of packet data received.\r
\r
CHAR8 Char;\r
CHAR8 SumString[3];\r
CHAR8 TestChar;\r
- \r
+\r
ZeroMem (PacketData, PacketDataSize);\r
- \r
+\r
for (;;) {\r
// wait for the start of a packet\r
TestChar = GdbGetChar ();\r
while (TestChar != '$') {\r
TestChar = GdbGetChar ();\r
};\r
- \r
+\r
retry:\r
for (Index = 0, CheckSum = 0; Index < (PacketDataSize - 1); Index++) {\r
Char = GdbGetChar ();\r
continue;\r
}\r
\r
- SumString[0] = GdbGetChar (); \r
+ SumString[0] = GdbGetChar ();\r
SumString[1] = GdbGetChar ();\r
SumString[2] = '\0';\r
- \r
+\r
if (AsciiStrHexToUintn (SumString) == CheckSum) {\r
// Ack: Success\r
GdbPutChar ('+');\r
- \r
+\r
// Null terminate the callers string\r
PacketData[Index] = '\0';\r
return Index;\r
GdbPutChar ('-');\r
}\r
}\r
- \r
+\r
//return 0;\r
}\r
\r
\r
/**\r
- Empties the given buffer \r
+ Empties the given buffer\r
@param Buf pointer to the first element in buffer to be emptied\r
**/\r
VOID\r
-EmptyBuffer ( \r
+EmptyBuffer (\r
IN CHAR8 *Buf\r
)\r
-{ \r
+{\r
*Buf = '\0';\r
}\r
\r
\r
/**\r
Converts an 8-bit Hex Char into a INTN.\r
- \r
+\r
@param Char the hex character to be converted into UINTN\r
@retval a INTN, from 0 to 15, that corressponds to Char\r
-1 if Char is not a hex character\r
} else if ((Char >= '0') && (Char <= '9')) {\r
return Char - '0';\r
} else { // if not a hex value, return a negative value\r
- return -1; \r
+ return -1;\r
}\r
}\r
\r
Send an error with the given error number after converting to hex.\r
The error number is put into the buffer in hex. '255' is the biggest errno we can send.\r
ex: 162 will be sent as A2.\r
- \r
+\r
@param errno the error number that will be sent\r
**/\r
VOID\r
//\r
gError[1] = mHexToStr [ErrorNum >> 4];\r
gError[2] = mHexToStr [ErrorNum & 0x0f];\r
- \r
+\r
SendPacket (gError); // send buffer\r
}\r
\r
EFIAPI\r
SendSuccess (\r
VOID\r
- ) \r
+ )\r
{\r
SendPacket ("OK"); // send buffer\r
}\r
/**\r
Send empty packet to specify that particular command/functionality is not supported.\r
**/\r
-VOID \r
-EFIAPI \r
+VOID\r
+EFIAPI\r
SendNotSupported (\r
- VOID \r
- ) \r
+ VOID\r
+ )\r
{\r
SendPacket ("");\r
}\r
\r
/**\r
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
//\r
// replace _, or previous value, with Exception type\r
//\r
- *TSignalPtr++ = mHexToStr [GdbExceptionType >> 4]; \r
+ *TSignalPtr++ = mHexToStr [GdbExceptionType >> 4];\r
*TSignalPtr++ = mHexToStr [GdbExceptionType & 0x0f];\r
- \r
+\r
if (GdbExceptionType == GDB_SIGTRAP) {\r
if (gSymbolTableUpdate) {\r
//\r
\r
//\r
// possible n:r pairs\r
- // \r
+ //\r
\r
//Retrieve the breakpoint number\r
BreakpointDetected = GetBreakpointDetected (SystemContext);\r
\r
//Figure out if the exception is happend due to watch, rwatch or awatch.\r
- BreakType = GetBreakpointType (SystemContext, BreakpointDetected); \r
+ BreakType = GetBreakpointType (SystemContext, BreakpointDetected);\r
\r
//INFO: rwatch is not supported due to the way IA32 debug registers work\r
if ((BreakType == DataWrite) || (BreakType == DataRead) || (BreakType == DataReadWrite)) {\r
- \r
+\r
//Construct n:r pair\r
DataAddress = GetBreakpointDataAddress (SystemContext, BreakpointDetected);\r
\r
}\r
\r
*TSignalPtr++ = ':';\r
- \r
+\r
//Set up series of bytes in big-endian byte order. "awatch" won't work with little-endian byte order.\r
RegSize = REG_SIZE;\r
while (RegSize > 0) {\r
\r
*TSignalPtr = '\0';\r
\r
- SendPacket (TSignalBuffer); \r
+ SendPacket (TSignalBuffer);\r
}\r
\r
\r
/**\r
Translates the EFI mapping to GDB mapping\r
- \r
+\r
@param EFIExceptionType EFI Exception that is being processed\r
@retval UINTN that corresponds to EFIExceptionType's GDB exception type number\r
**/\r
UINT8\r
-ConvertEFItoGDBtype ( \r
+ConvertEFItoGDBtype (\r
IN EFI_EXCEPTION_TYPE EFIExceptionType\r
)\r
-{ \r
+{\r
UINTN Index;\r
- \r
+\r
for (Index = 0; Index < MaxEfiException () ; Index++) {\r
if (gExceptionType[Index].Exception == EFIExceptionType) {\r
return gExceptionType[Index].SignalNo;\r
\r
\r
/** "m addr,length"\r
- Find the Length of the area to read and the start addres. Finally, pass them to \r
- another function, TransferFromMemToOutBufAndSend, that will read from that memory space and \r
+ Find the Length of the area to read and the start addres. Finally, pass them to\r
+ another function, TransferFromMemToOutBufAndSend, that will read from that memory space and\r
send it as a packet.\r
**/\r
\r
CHAR8 AddressBuffer[MAX_ADDR_SIZE]; // the buffer that will hold the address in hex chars\r
CHAR8 *AddrBufPtr; // pointer to the address buffer\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
+\r
AddrBufPtr = AddressBuffer;\r
InBufPtr = &PacketData[1];\r
while (*InBufPtr != ',') {\r
*AddrBufPtr++ = *InBufPtr++;\r
}\r
*AddrBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ',' in the buffer\r
- \r
+\r
/* Error checking */\r
if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {\r
Print((CHAR16 *)L"Address is too long\n");\r
- SendError (GDB_EBADMEMADDRBUFSIZE); \r
+ SendError (GDB_EBADMEMADDRBUFSIZE);\r
return;\r
}\r
- \r
+\r
// 2 = 'm' + ','\r
if (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - 2 >= MAX_LENGTH_SIZE) {\r
Print((CHAR16 *)L"Length is too long\n");\r
- SendError (GDB_EBADMEMLENGTH); \r
+ SendError (GDB_EBADMEMLENGTH);\r
return;\r
}\r
- \r
+\r
Address = AsciiStrHexToUintn (AddressBuffer);\r
Length = AsciiStrHexToUintn (InBufPtr);\r
- \r
+\r
TransferFromMemToOutBufAndSend (Length, (unsigned char *)Address);\r
}\r
\r
\r
/** "M addr,length :XX..."\r
- Find the Length of the area in bytes to write and the start addres. Finally, pass them to \r
+ Find the Length of the area in bytes to write and the start addres. Finally, pass them to\r
another function, TransferFromInBufToMem, that will write to that memory space the info in\r
the input buffer.\r
**/\r
CHAR8 *AddrBufPtr; // pointer to the Address buffer\r
CHAR8 *LengthBufPtr; // pointer to the Length buffer\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
+\r
AddrBufPtr = AddressBuffer;\r
LengthBufPtr = LengthBuffer;\r
InBufPtr = &PacketData[1];\r
- \r
+\r
while (*InBufPtr != ',') {\r
*AddrBufPtr++ = *InBufPtr++;\r
}\r
*AddrBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ',' in the buffer\r
- \r
+\r
while (*InBufPtr != ':') {\r
*LengthBufPtr++ = *InBufPtr++;\r
}\r
*LengthBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ':' in the buffer\r
- \r
+\r
Address = AsciiStrHexToUintn (AddressBuffer);\r
Length = AsciiStrHexToUintn (LengthBuffer);\r
- \r
+\r
/* Error checking */\r
- \r
+\r
//Check if Address is not too long.\r
if (AsciiStrLen (AddressBuffer) >= MAX_ADDR_SIZE) {\r
Print ((CHAR16 *)L"Address too long..\n");\r
- SendError (GDB_EBADMEMADDRBUFSIZE); \r
+ SendError (GDB_EBADMEMADDRBUFSIZE);\r
return;\r
}\r
- \r
+\r
//Check if message length is not too long\r
if (AsciiStrLen (LengthBuffer) >= MAX_LENGTH_SIZE) {\r
Print ((CHAR16 *)L"Length too long..\n");\r
- SendError (GDB_EBADMEMLENGBUFSIZE); \r
+ SendError (GDB_EBADMEMLENGBUFSIZE);\r
return;\r
}\r
- \r
+\r
// Check if Message is not too long/short.\r
// 3 = 'M' + ',' + ':'\r
MessageLength = (AsciiStrLen (PacketData) - AsciiStrLen (AddressBuffer) - AsciiStrLen (LengthBuffer) - 3);\r
if (MessageLength != (2*Length)) {\r
//Message too long/short. New data is not the right size.\r
- SendError (GDB_EBADMEMDATASIZE); \r
+ SendError (GDB_EBADMEMDATASIZE);\r
return;\r
}\r
TransferFromInBufToMem (Length, (unsigned char *)Address, InBufPtr);\r
*OutBufPtr++ = Type;\r
Count = 1;\r
\r
- // Binary data encoding \r
+ // Binary data encoding\r
OutBufPtr = gOutBuffer;\r
while (*Str != '\0') {\r
Char = *Str++;\r
\r
*OutBufPtr = '\0' ; // the end of the buffer\r
SendPacket (gOutBuffer);\r
- \r
+\r
return Count;\r
}\r
\r
\r
/**\r
- Note: This should be a library function. In the Apple case you have to add \r
- the size of the PE/COFF header into the starting address to make things work \r
+ Note: This should be a library function. In the Apple case you have to add\r
+ the size of the PE/COFF header into the starting address to make things work\r
right as there is no way to pad the Mach-O for the size of the PE/COFF header.\r
- \r
- \r
+\r
+\r
Returns a pointer to the PDB file name for a PE/COFF image that has been\r
loaded into system memory with the PE/COFF Loader Library functions.\r
\r
\r
@return The PDB file name for the PE/COFF image specified by Pe32Data or NULL\r
if it cannot be retrieved. DebugBase is only valid if PDB file name is\r
- valid. \r
+ valid.\r
\r
**/\r
VOID *\r
TEImageAdjust);\r
}\r
SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;\r
- \r
+\r
// __APPLE__ check this math...\r
*DebugBase = ((CHAR8 *)Pe32Data) - TEImageAdjust;\r
} else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {\r
- \r
+\r
*DebugBase = Pe32Data;\r
- \r
- \r
+\r
+\r
//\r
// NOTE: We use Machine field to identify PE32/PE32+, instead of Magic.\r
// It is due to backward-compatibility, for some system might\r
}\r
\r
\r
-/** \r
+/**\r
Process "qXfer:object:read:annex:offset,length" request.\r
- \r
- Returns an XML document that contains loaded libraries. In our case it is \r
+\r
+ Returns an XML document that contains loaded libraries. In our case it is\r
information in the EFI Debug Image Table converted into an XML document.\r
- \r
- GDB will call with an arbitrary length (it can't know the real length and \r
- will reply with chunks of XML that are easy for us to deal with. Gdb will \r
+\r
+ GDB will call with an arbitrary length (it can't know the real length and\r
+ will reply with chunks of XML that are easy for us to deal with. Gdb will\r
keep calling until we say we are done. XML doc looks like:\r
- \r
+\r
<library-list>\r
<library name="/a/a/c/d.dSYM"><segment address="0x10000000"/></library>\r
<library name="/a/m/e/e.pdb"><segment address="0x20000000"/></library>\r
<library name="/a/l/f/f.dll"><segment address="0x30000000"/></library>\r
</library-list>\r
- \r
+\r
Since we can not allocate memory in interrupt context this module has\r
assumptions about how it will get called:\r
1) Length will generally be max remote packet size (big enough)\r
2) First Offset of an XML document read needs to be 0\r
3) This code will return back small chunks of the XML document on every read.\r
Each subsequent call will ask for the next available part of the document.\r
- \r
+\r
Note: The only variable size element in the XML is:\r
- " <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is \r
+ " <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is\r
based on the file path and name of the symbol file. If the symbol file name\r
is bigger than the max gdb remote packet size we could update this code\r
to respond back in chunks.\r
\r
@param Offset offset into special data area\r
- @param Length number of bytes to read starting at Offset \r
- \r
+ @param Length number of bytes to read starting at Offset\r
+\r
**/\r
VOID\r
QxferLibrary (\r
if (Offset != gPacketqXferLibraryOffset) {\r
SendError (GDB_EINVALIDARG);\r
Print (L"\nqXferLibrary (%d, %d) != %d\n", Offset, Length, gPacketqXferLibraryOffset);\r
- \r
- // Force a retry from the beginning \r
+\r
+ // Force a retry from the beginning\r
gPacketqXferLibraryOffset = 0;\r
\r
return;\r
\r
if (Offset == 0) {\r
gPacketqXferLibraryOffset += gXferObjectReadResponse ('m', "<library-list>\n");\r
- \r
+\r
// The owner of the table may have had to ralloc it so grab a fresh copy every time\r
- // we assume qXferLibrary will get called over and over again until the entire XML table is \r
+ // we assume qXferLibrary will get called over and over again until the entire XML table is\r
// returned in a tight loop. Since we are in the debugger the table should not get updated\r
gDebugTable = gDebugImageTableHeader->EfiDebugImageInfoTable;\r
gEfiDebugImageTableEntry = 0;\r
return;\r
}\r
- \r
+\r
if (gDebugTable != NULL) {\r
for (; gEfiDebugImageTableEntry < gDebugImageTableHeader->TableSize; gEfiDebugImageTableEntry++, gDebugTable++) {\r
if (gDebugTable->NormalImage != NULL) {\r
- if ((gDebugTable->NormalImage->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) && \r
+ if ((gDebugTable->NormalImage->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) &&\r
(gDebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {\r
Pdb = PeCoffLoaderGetDebuggerInfo (\r
- gDebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase, \r
+ gDebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase,\r
&LoadAddress\r
);\r
if (Pdb != NULL) {\r
Size = AsciiSPrint (\r
- gXferLibraryBuffer, \r
- sizeof (gXferLibraryBuffer), \r
- " <library name=\"%a\"><segment address=\"0x%p\"/></library>\n", \r
+ gXferLibraryBuffer,\r
+ sizeof (gXferLibraryBuffer),\r
+ " <library name=\"%a\"><segment address=\"0x%p\"/></library>\n",\r
Pdb,\r
LoadAddress\r
);\r
if ((Size != 0) && (Size != (sizeof (gXferLibraryBuffer) - 1))) {\r
gPacketqXferLibraryOffset += gXferObjectReadResponse ('m', gXferLibraryBuffer);\r
- \r
+\r
// Update loop variables so we are in the right place when we get back\r
gEfiDebugImageTableEntry++;\r
gDebugTable++;\r
return;\r
} else {\r
- // We could handle <library> entires larger than sizeof (gXferLibraryBuffer) here if \r
+ // We could handle <library> entires larger than sizeof (gXferLibraryBuffer) here if\r
// needed by breaking up into N packets\r
// "<library name=\"%s\r
// the rest of the string (as many packets as required\r
//\r
// But right now we just skip any entry that is too big\r
}\r
- } \r
+ }\r
}\r
- } \r
+ }\r
}\r
}\r
- \r
- \r
+\r
+\r
gXferObjectReadResponse ('l', "</library-list>\n");\r
gPacketqXferLibraryOffset = 0;\r
return;\r
/**\r
Exception Hanldler for GDB. It will be called for all exceptions\r
registered via the gExceptionType[] array.\r
- \r
+\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-GdbExceptionHandler ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbExceptionHandler (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
UINT8 GdbExceptionType;\r
CHAR8 *Ptr;\r
- \r
- \r
+\r
+\r
if (ValidateException (ExceptionType, SystemContext) == FALSE) {\r
return;\r
}\r
\r
RemoveSingleStep (SystemContext);\r
- \r
+\r
GdbExceptionType = ConvertEFItoGDBtype (ExceptionType);\r
GdbSendTSignal (SystemContext, GdbExceptionType);\r
- \r
+\r
for( ; ; ) {\r
ReceivePacket (gInBuffer, MAX_BUF_SIZE);\r
- \r
+\r
switch (gInBuffer[0]) {\r
case '?':\r
GdbSendTSignal (SystemContext, GdbExceptionType);\r
break;\r
- \r
+\r
case 'c':\r
- ContinueAtAddress (SystemContext, gInBuffer); \r
+ ContinueAtAddress (SystemContext, gInBuffer);\r
return;\r
\r
case 'g':\r
ReadGeneralRegisters (SystemContext);\r
break;\r
- \r
+\r
case 'G':\r
WriteGeneralRegisters (SystemContext, gInBuffer);\r
break;\r
- \r
+\r
case 'H':\r
- //Return "OK" packet since we don't have more than one thread. \r
+ //Return "OK" packet since we don't have more than one thread.\r
SendSuccess ();\r
break;\r
- \r
+\r
case 'm':\r
ReadFromMemory (gInBuffer);\r
break;\r
//\r
// Still debugging this code. Not used in Darwin\r
//\r
- case 'q': \r
+ case 'q':\r
// General Query Packets\r
if (AsciiStrnCmp (gInBuffer, "qSupported", 10) == 0) {\r
// return what we currently support, we don't parse what gdb suports\r
// ‘qXfer:libraries:read::offset,length\r
// gInBuffer[22] is offset string, ++Ptr is length string’\r
for (Ptr = &gInBuffer[22]; *Ptr != ','; Ptr++);\r
- \r
+\r
// Not sure if multi-radix support is required. Currently only support decimal\r
QxferLibrary (AsciiStrHexToUintn (&gInBuffer[22]), AsciiStrHexToUintn (++Ptr));\r
} if (AsciiStrnCmp (gInBuffer, "qOffsets", 10) == 0) {\r
break;\r
\r
case 's':\r
- SingleStep (SystemContext, gInBuffer); \r
+ SingleStep (SystemContext, gInBuffer);\r
return;\r
- \r
+\r
case 'z':\r
RemoveBreakPoint (SystemContext, gInBuffer);\r
break;\r
- \r
+\r
case 'Z':\r
InsertBreakPoint (SystemContext, gInBuffer);\r
break;\r
- \r
- default: \r
+\r
+ default:\r
//Send empty packet\r
SendNotSupported ();\r
break;\r
\r
\r
/**\r
- Periodic callback for GDB. This function is used to catch a ctrl-c or other \r
+ Periodic callback for GDB. This function is used to catch a ctrl-c or other\r
break in type command from GDB.\r
- \r
- @param SystemContext Register content at time of the call \r
+\r
+ @param SystemContext Register content at time of the call\r
**/\r
VOID\r
EFIAPI\r
-GdbPeriodicCallBack ( \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbPeriodicCallBack (\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
//\r
- // gCtrlCBreakFlag may have been set from a previous F response package \r
- // and we set the global as we need to process it at a point where we \r
+ // gCtrlCBreakFlag may have been set from a previous F response package\r
+ // and we set the global as we need to process it at a point where we\r
// can update the system context. If we are in the middle of processing\r
// a F Packet it is not safe to read the GDB serial stream so we need\r
// to skip it on this check\r
//\r
if (!gCtrlCBreakFlag && !gProcessingFPacket) {\r
//\r
- // Ctrl-C was not pending so grab any pending characters and see if they \r
- // are a Ctrl-c (0x03). If so set the Ctrl-C global. \r
+ // Ctrl-C was not pending so grab any pending characters and see if they\r
+ // are a Ctrl-c (0x03). If so set the Ctrl-C global.\r
//\r
while (TRUE) {\r
if (!GdbIsCharAvailable ()) {\r
//\r
break;\r
}\r
- \r
+\r
if (GdbGetChar () == 0x03) {\r
gCtrlCBreakFlag = TRUE;\r
//\r
}\r
}\r
}\r
- \r
+\r
if (gCtrlCBreakFlag) {\r
//\r
// Update the context to force a single step trap when we exit the GDB\r
\r
[Sources.ARM]\r
Arm/Processor.c\r
- \r
+\r
[Sources.IA32]\r
Ia32/Processor.c\r
- \r
+\r
[Sources.X64]\r
X64/Processor.c\r
- \r
- \r
+\r
+\r
[Packages]\r
MdePkg/MdePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
- \r
+\r
[LibraryClasses]\r
- BaseLib \r
- DebugLib \r
- UefiLib \r
- UefiDriverEntryPoint \r
- UefiBootServicesTableLib \r
- UefiRuntimeServicesTableLib \r
- BaseMemoryLib \r
- MemoryAllocationLib \r
- DevicePathLib \r
- PcdLib \r
+ BaseLib\r
+ DebugLib\r
+ UefiLib\r
+ UefiDriverEntryPoint\r
+ UefiBootServicesTableLib\r
+ UefiRuntimeServicesTableLib\r
+ BaseMemoryLib\r
+ MemoryAllocationLib\r
+ DevicePathLib\r
+ PcdLib\r
GdbSerialLib\r
PrintLib\r
CacheMaintenanceLib\r
\r
\r
-[Protocols] \r
- gEfiDebugSupportProtocolGuid \r
- gEfiDebugPortProtocolGuid \r
- gEfiSerialIoProtocolGuid \r
- \r
+[Protocols]\r
+ gEfiDebugSupportProtocolGuid\r
+ gEfiDebugPortProtocolGuid\r
+ gEfiSerialIoProtocolGuid\r
+\r
[Guids]\r
gEfiDebugImageInfoTableGuid\r
\r
extern CONST CHAR8 mHexToStr[];\r
\r
// maximum size of input and output buffers\r
-// This value came from the show remote command of the gdb we tested against \r
+// This value came from the show remote command of the gdb we tested against\r
#define MAX_BUF_SIZE 2000\r
\r
// maximum size of address buffer\r
//\r
// GDB Signal definitions - generic names for interrupts\r
//\r
-#define GDB_SIGILL 4 // Illegal instruction \r
+#define GDB_SIGILL 4 // Illegal instruction\r
#define GDB_SIGTRAP 5 // Trace Trap (Breakpoint and SingleStep)\r
#define GDB_SIGEMT 7 // Emulator Trap\r
#define GDB_SIGFPE 8 // Floating point exception\r
// Includes all general GDB Unix like error values\r
//\r
#define GDB_EBADMEMADDRBUFSIZE 11 // the buffer that stores memory Address to be read from/written to is not the right size\r
-#define GDB_EBADMEMLENGBUFSIZE 12 // the buffer that stores Length is not the right size \r
+#define GDB_EBADMEMLENGBUFSIZE 12 // the buffer that stores Length is not the right size\r
#define GDB_EBADMEMLENGTH 13 // Length, the given number of bytes to read or write, is not the right size\r
-#define GDB_EBADMEMDATA 14 // one of the bytes or nibbles of the memory is leess than 0 \r
+#define GDB_EBADMEMDATA 14 // one of the bytes or nibbles of the memory is leess than 0\r
#define GDB_EBADMEMDATASIZE 15 // the memory data, 'XX..', is too short or too long\r
#define GDB_EBADBUFSIZE 21 // the buffer created is not the correct size\r
#define GDB_EINVALIDARG 31 // argument is invalid\r
//\r
//Define Register size for different architectures\r
//\r
-#if defined (MDE_CPU_IA32) \r
+#if defined (MDE_CPU_IA32)\r
#define REG_SIZE 32\r
#elif defined (MDE_CPU_X64)\r
#define REG_SIZE 64\r
UINT32 B1:1; // Breakpoint condition detected\r
UINT32 B2:1; // Breakpoint condition detected\r
UINT32 B3:1; // Breakpoint condition detected\r
- UINT32 Reserved_1:9; // Reserved \r
+ UINT32 Reserved_1:9; // Reserved\r
UINT32 BD:1; // Debug register access detected\r
UINT32 BS:1; // Single step\r
UINT32 BT:1; // Task switch\r
\r
//\r
// Set TRUE if F Reply package signals a ctrl-c. We can not process the Ctrl-c\r
-// here we need to wait for the periodic callback to do this. \r
+// here we need to wait for the periodic callback to do this.\r
//\r
extern BOOLEAN gCtrlCBreakFlag;\r
\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
/**\r
Return the number of entries in the gRegisters[]\r
- \r
- @retval UINTN, the number of entries (registers) in the gRegisters[] array. \r
+\r
+ @retval UINTN, the number of entries (registers) in the gRegisters[] array.\r
**/\r
UINTN\r
MaxRegisterCount (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
- \r
+\r
@retval TRUE if Isa is supported,\r
FALSE otherwise.\r
**/\r
\r
/**\r
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
\r
/**\r
Translates the EFI mapping to GDB mapping\r
- \r
+\r
@param EFIExceptionType EFI Exception that is being processed\r
@retval UINTN that corresponds to EFIExceptionType's GDB exception type number\r
**/\r
UINT8\r
-ConvertEFItoGDBtype ( \r
+ConvertEFItoGDBtype (\r
IN EFI_EXCEPTION_TYPE EFIExceptionType\r
);\r
\r
\r
/**\r
- Empties the given buffer \r
+ Empties the given buffer\r
@param *Buf pointer to the first element in buffer to be emptied\r
**/\r
VOID\r
-EmptyBuffer ( \r
+EmptyBuffer (\r
IN CHAR8 *Buf\r
);\r
\r
\r
/**\r
Converts an 8-bit Hex Char into a INTN.\r
- \r
+\r
@param Char - the hex character to be converted into UINTN\r
@retval a INTN, from 0 to 15, that corressponds to Char\r
-1 if Char is not a hex character\r
Send an error with the given error number after converting to hex.\r
The error number is put into the buffer in hex. '255' is the biggest errno we can send.\r
ex: 162 will be sent as A2.\r
- \r
+\r
@param errno the error number that will be sent\r
**/\r
VOID\r
VOID\r
);\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer This is the input buffer received from gdb server\r
**/\r
);\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
\r
/** ‘m addr,length ’\r
- Find the Length of the area to read and the start addres. Finally, pass them to \r
- another function, TransferFromMemToOutBufAndSend, that will read from that memory space and \r
+ Find the Length of the area to read and the start addres. Finally, pass them to\r
+ another function, TransferFromMemToOutBufAndSend, that will read from that memory space and\r
send it as a packet.\r
- \r
+\r
@param *PacketData Pointer to Payload data for the packet\r
**/\r
VOID\r
\r
\r
/** ‘M addr,length :XX...’\r
- Find the Length of the area in bytes to write and the start addres. Finally, pass them to \r
+ Find the Length of the area in bytes to write and the start addres. Finally, pass them to\r
another function, TransferFromInBufToMem, that will write to that memory space the info in\r
the input buffer.\r
- \r
+\r
@param PacketData Pointer to Payload data for the packet\r
**/\r
VOID\r
);\r
\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
@param *PacketData Pointer to PacketData\r
**/\r
\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param PacketData Pointer to Payload data for the packet\r
**/\r
IN CHAR8 *PacketData\r
);\r
\r
-/** \r
+/**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
AddSingleStep (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
- \r
-/** \r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
RemoveSingleStep (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
- \r
- \r
+\r
+\r
/**\r
‘Z1, [addr], [length]’\r
‘Z2, [addr], [length]’\r
/**\r
Exception Hanldler for GDB. It will be called for all exceptions\r
registered via the gExceptionType[] array.\r
- \r
+\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
- \r
+ @param SystemContext Register content at time of the exception\r
+\r
**/\r
VOID\r
EFIAPI\r
-GdbExceptionHandler ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbExceptionHandler (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
/**\r
- Periodic callback for GDB. This function is used to catch a ctrl-c or other \r
+ Periodic callback for GDB. This function is used to catch a ctrl-c or other\r
break in type command from GDB.\r
- \r
+\r
@param SystemContext Register content at time of the call\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
-GdbPeriodicCallBack ( \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbPeriodicCallBack (\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
/**\r
Make two serail consoles: 1) StdIn and StdOut via GDB. 2) StdErr via GDB.\r
- \r
+\r
These console show up on the remote system running GDB\r
\r
**/\r
\r
/**\r
Send a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
- If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up \r
+\r
+ If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up\r
in an infinit loop. This is so if you unplug the debugger code just keeps running\r
\r
- @param PacketData Payload data for the packet \r
- \r
+ @param PacketData Payload data for the packet\r
+\r
@retval Number of bytes of packet data sent.\r
\r
**/\r
SendPacket (\r
IN CHAR8 *PacketData\r
);\r
- \r
+\r
\r
/**\r
Receive a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
+\r
If host re-starts sending a packet without ending the previous packet, only the last valid packet is proccessed.\r
(In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)\r
- \r
+\r
If an ack '+' is not sent resend the packet\r
- \r
- @param PacketData Payload data for the packet \r
- \r
+\r
+ @param PacketData Payload data for the packet\r
+\r
@retval Number of bytes of packet data received.\r
\r
**/\r
OUT CHAR8 *PacketData,\r
IN UINTN PacketDataSize\r
);\r
- \r
+\r
\r
/**\r
- Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates \r
+ Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates\r
the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that were read\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes read.\r
OUT VOID *Buffer,\r
IN UINTN Count\r
);\r
- \r
+\r
\r
/**\r
- Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates \r
- nothing was written. On error -1 is returned. \r
+ Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates\r
+ nothing was written. On error -1 is returned.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that are to be written\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes written.\r
IN UINTN Count\r
);\r
\r
-UINTN * \r
+UINTN *\r
FindPointerToRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
);\r
\r
-CHAR8 * \r
+CHAR8 *\r
BasicReadRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
IN UINTN RegNumber,\r
IN CHAR8 *InBufPtr\r
);\r
\r
-VOID \r
+VOID\r
PrintReg (\r
EFI_SYSTEM_CONTEXT SystemContext\r
);\r
UINTN\r
GetBreakpointDataAddress (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN BreakpointNumber \r
+ IN UINTN BreakpointNumber\r
);\r
\r
UINTN\r
BREAK_TYPE\r
GetBreakpointType (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN BreakpointNumber \r
+ IN UINTN BreakpointNumber\r
);\r
\r
UINTN\r
\r
BOOLEAN\r
ValidateException (\r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
#endif\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// {EFI mapping, GDB mapping}\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
- { EXCEPT_IA32_DIVIDE_ERROR, GDB_SIGFPE }, \r
+ { EXCEPT_IA32_DIVIDE_ERROR, GDB_SIGFPE },\r
{ EXCEPT_IA32_DEBUG, GDB_SIGTRAP },\r
{ EXCEPT_IA32_NMI, GDB_SIGEMT },\r
{ EXCEPT_IA32_BREAKPOINT, GDB_SIGTRAP },\r
\r
\r
//Debug only..\r
-VOID \r
+VOID\r
PrintReg (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
}\r
\r
//Debug only..\r
-VOID \r
+VOID\r
PrintDRreg (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
/**\r
Return the number of entries in the gRegisters[]\r
- \r
- @retval UINTN, the number of entries (registers) in the gRegisters[] array. \r
+\r
+ @retval UINTN, the number of entries (registers) in the gRegisters[] array.\r
**/\r
UINTN\r
MaxRegisterCount (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
- \r
+\r
@retval TRUE if Isa is supported,\r
FALSE otherwise.\r
**/\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the IA32 member\r
\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
**/\r
UINTN *\r
FindPointerToRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
)\r
{\r
UINTN RegSize;\r
- \r
+\r
RegSize = 0;\r
while (RegSize < REG_SIZE) {\r
*OutBufPtr++ = mHexToStr[((*FindPointerToRegister (SystemContext, RegNumber) >> (RegSize+4)) & 0xf)];\r
}\r
\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
UINTN RegNumber;\r
CHAR8 OutBuffer[9]; // 1 reg=8 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
}\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
\r
OutBufPtr = OutBuffer;\r
- for (i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 16 registers to read \r
+ for (i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 16 registers to read\r
OutBufPtr = BasicReadRegister (SystemContext, i, OutBufPtr);\r
}\r
\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT32 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
NewValue = 0;\r
RegSize = 0;\r
while (RegSize < REG_SIZE) {\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister (SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
UINTN i;\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
\r
- // check to see if the buffer is the right size which is \r
- // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129 \r
+ // check to see if the buffer is the right size which is\r
+ // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129\r
if (AsciiStrLen(InBuffer) != 129) { // 16 regs, 8 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for (i=0; i < MaxRegisterCount(); i++) { // there are only 16 registers to write\r
}\r
\r
\r
-/** \r
+/**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
SystemContext.SystemContextIa32->Eflags |= TF_BIT; //Setting the TF bit.\r
}\r
\r
- \r
-/** \r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
\r
\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextIa32->Eip = AsciiStrHexToUintn (&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextIa32->Eip = AsciiStrHexToUintn (&PacketData[1]);\r
}\r
- \r
+\r
AddSingleStep (SystemContext);\r
}\r
\r
\r
@param SystemContext Register content at time of the exception\r
\r
- @retval {1-4} Currently detected breakpoint value \r
+ @retval {1-4} Currently detected breakpoint value\r
@retval 0 No breakpoint detected.\r
- \r
+\r
**/\r
UINTN\r
GetBreakpointDetected (\r
} else if (Dr6.Bits.B3 == 1) {\r
BreakpointNumber = 4;\r
} else {\r
- BreakpointNumber = 0; //No breakpoint detected \r
+ BreakpointNumber = 0; //No breakpoint detected\r
}\r
\r
return BreakpointNumber;\r
/**\r
Returns Breakpoint type (InstructionExecution, DataWrite, DataRead or DataReadWrite)\r
based on the Breakpoint number\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
- \r
+\r
@retval BREAK_TYPE Breakpoint type value read from register DR7 RWn field\r
For unknown value, it returns NotSupported.\r
- \r
+\r
**/\r
BREAK_TYPE\r
GetBreakpointType (\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
if (BreakpointNumber == 1) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW0; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW0;\r
} else if (BreakpointNumber == 2) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW1; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW1;\r
} else if (BreakpointNumber == 3) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW2; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW2;\r
} else if (BreakpointNumber == 4) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW3; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW3;\r
}\r
\r
return Type;\r
}\r
\r
\r
-/** \r
+/**\r
Parses Length and returns the length which DR7 LENn field accepts.\r
- For example: If we receive 1-Byte length then we should return 0. \r
+ For example: If we receive 1-Byte length then we should return 0.\r
Zero gets written to DR7 LENn field.\r
\r
@param Length Breakpoint length in Bytes (1 byte, 2 byte, 4 byte)\r
IN UINTN Length\r
)\r
{\r
- if (Length == 1) { //1-Byte length \r
+ if (Length == 1) { //1-Byte length\r
return 0;\r
} else if (Length == 2) { //2-Byte length\r
return 1;\r
\r
\r
/**\r
- Finds the next free debug register. If all the registers are occupied then \r
- EFI_OUT_OF_RESOURCES is returned. \r
+ Finds the next free debug register. If all the registers are occupied then\r
+ EFI_OUT_OF_RESOURCES is returned.\r
\r
@param SystemContext Register content at time of the exception\r
@param Register Register value (0 - 3 for the first free debug register)\r
/**\r
Enables the debug register. Writes Address value to appropriate DR0-3 register.\r
Sets LENn, Gn, RWn bits in DR7 register.\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
- @param Register Register value (0 - 3) \r
+ @param Register Register value (0 - 3)\r
@param Address Breakpoint address value\r
- @param Type Breakpoint type (Instruction, Data write, Data read \r
+ @param Type Breakpoint type (Instruction, Data write, Data read\r
or write etc.)\r
\r
@retval EFI_STATUS Appropriate status value.\r
//Convert length data\r
Length = ConvertLengthData (Length);\r
\r
- //For Instruction execution, length should be 0 \r
+ //For Instruction execution, length should be 0\r
//(Ref. Intel reference manual 18.2.4)\r
if ((Type == 0) && (Length != 0)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- //Update Dr7 with appropriate Gn, RWn and LENn bits \r
+ //Update Dr7 with appropriate Gn, RWn and LENn bits\r
SystemContext.SystemContextIa32->Dr7 = Dr7.UintN;\r
\r
return EFI_SUCCESS;\r
@param SystemContext Register content at time of the exception\r
@param Address Breakpoint address value\r
@param Length Breakpoint length value\r
- @param Type Breakpoint type (Instruction, Data write, \r
+ @param Type Breakpoint type (Instruction, Data write,\r
Data read or write etc.)\r
@param Register Register value to be returned\r
\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
- if ((Dr7.Bits.G0 == 1) && \r
+ if ((Dr7.Bits.G0 == 1) &&\r
(Dr7.Bits.LEN0 == Length) &&\r
- (Dr7.Bits.RW0 == Type) && \r
+ (Dr7.Bits.RW0 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr0)) {\r
*Register = 0;\r
- } else if ((Dr7.Bits.G1 == 1) && \r
+ } else if ((Dr7.Bits.G1 == 1) &&\r
(Dr7.Bits.LEN1 == Length) &&\r
- (Dr7.Bits.RW1 == Type) && \r
+ (Dr7.Bits.RW1 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr1)) {\r
*Register = 1;\r
- } else if ((Dr7.Bits.G2 == 1) && \r
+ } else if ((Dr7.Bits.G2 == 1) &&\r
(Dr7.Bits.LEN2 == Length) &&\r
- (Dr7.Bits.RW2 == Type) && \r
+ (Dr7.Bits.RW2 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr2)) {\r
*Register = 2;\r
- } else if ((Dr7.Bits.G3 == 1) && \r
+ } else if ((Dr7.Bits.G3 == 1) &&\r
(Dr7.Bits.LEN3 == Length) &&\r
- (Dr7.Bits.RW3 == Type) && \r
+ (Dr7.Bits.RW3 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr3)) {\r
*Register = 3;\r
} else {\r
EFI_STATUS\r
DisableDebugRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN Register \r
+ IN UINTN Register\r
)\r
{\r
IA32_DR7 Dr7;\r
UINTN Address = 0;\r
- \r
+\r
//Read DR7 register so appropriate Gn, RWn and LENn bits can be turned off.\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
}\r
\r
switch (Type) {\r
- \r
+\r
case 0: //Software breakpoint\r
BreakType = SoftwareBreakpoint;\r
break;\r
- \r
+\r
case 1: //Hardware breakpoint\r
BreakType = InstructionExecution;\r
break;\r
- \r
+\r
case 2: //Write watchpoint\r
BreakType = DataWrite;\r
break;\r
\r
BOOLEAN\r
ValidateException (\r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
return TRUE;\r
/** @file\r
- Serial IO Abstraction for GDB stub. This allows an EFI consoles that shows up on the system \r
+ Serial IO Abstraction for GDB stub. This allows an EFI consoles that shows up on the system\r
running GDB. One consle for error information and another console for user input/output.\r
- \r
- Basic packet format is $packet-data#checksum. So every comand has 4 bytes of overhead: $, \r
- #, 0, 0. The 0 and 0 are the ascii characters for the checksum. \r
- \r
+\r
+ Basic packet format is $packet-data#checksum. So every comand has 4 bytes of overhead: $,\r
+ #, 0, 0. The 0 and 0 are the ascii characters for the checksum.\r
+\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
//\r
// Set TRUE if F Reply package signals a ctrl-c. We can not process the Ctrl-c\r
-// here we need to wait for the periodic callback to do this. \r
+// here we need to wait for the periodic callback to do this.\r
//\r
BOOLEAN gCtrlCBreakFlag = FALSE;\r
\r
BOOLEAN gProcessingFPacket = FALSE;\r
\r
/**\r
- Process a control-C break message. \r
- \r
- Currently a place holder, remove the ASSERT when it gets implemented. \r
+ Process a control-C break message.\r
+\r
+ Currently a place holder, remove the ASSERT when it gets implemented.\r
\r
@param ErrNo Error infomration from the F reply packet or other source\r
\r
@param Packet Packet to parse like an F reply packet\r
@param ErrNo Buffer to hold Count bytes that were read\r
\r
- @retval -1 Error, not a valid F reply packet \r
- @retval other Return the return code from the F reply packet \r
+ @retval -1 Error, not a valid F reply packet\r
+ @retval other Return the return code from the F reply packet\r
\r
**/\r
INTN\r
GdbParseFReplyPacket (\r
IN CHAR8 *Packet,\r
- OUT UINTN *ErrNo \r
+ OUT UINTN *ErrNo\r
)\r
{\r
INTN RetCode;\r
- \r
+\r
if (Packet[0] != 'F') {\r
// A valid responce would be an F packet\r
return -1;\r
}\r
- \r
+\r
RetCode = AsciiStrHexToUintn (&Packet[1]);\r
- \r
- // Find 1st comma \r
- for (;*Packet != '\0' && *Packet != ','; Packet++); \r
+\r
+ // Find 1st comma\r
+ for (;*Packet != '\0' && *Packet != ','; Packet++);\r
if (*Packet == '\0') {\r
*ErrNo = 0;\r
return RetCode;\r
}\r
- \r
+\r
*ErrNo = AsciiStrHexToUintn (++Packet);\r
\r
- // Find 2nd comma \r
- for (;*Packet != '\0' && *Packet != ','; Packet++); \r
+ // Find 2nd comma\r
+ for (;*Packet != '\0' && *Packet != ','; Packet++);\r
if (*Packet == '\0') {\r
return RetCode;\r
}\r
- \r
+\r
if (*(++Packet) == 'C') {\r
- GdbCtrlCBreakMessage (*ErrNo); \r
+ GdbCtrlCBreakMessage (*ErrNo);\r
}\r
- \r
+\r
return RetCode;\r
}\r
\r
\r
/**\r
- Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates \r
+ Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates\r
the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that were read\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes read.\r
INTN RetCode;\r
UINTN ErrNo;\r
BOOLEAN ReceiveDone = FALSE;\r
- \r
+\r
// Send:\r
// "Fread,XX,YYYYYYYY,XX\r
//\r
// XX - FileDescriptor in ASCII\r
- // YYYYYYYY - Buffer address in ASCII \r
+ // YYYYYYYY - Buffer address in ASCII\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fread,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
- \r
+\r
gProcessingFPacket = TRUE;\r
SendPacket (Packet);\r
Print ((CHAR16 *)L"Packet sent..\n");\r
\r
RetCode = GdbParseFReplyPacket (Packet, &ErrNo);\r
Print ((CHAR16 *)L"RetCode: %x..ErrNo: %x..\n", RetCode, ErrNo);\r
- \r
+\r
if (ErrNo > 0) {\r
//Send error to the host if there is any.\r
SendError ((UINT8)ErrNo);\r
}\r
- \r
+\r
gProcessingFPacket = FALSE;\r
\r
return RetCode;\r
-} \r
- \r
+}\r
+\r
\r
/**\r
- Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates \r
- nothing was written. On error -1 is returned. \r
+ Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates\r
+ nothing was written. On error -1 is returned.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that are to be written\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes written.\r
// #Fwrite,XX,YYYYYYYY,XX$SS\r
//\r
// XX - FileDescriptor in ASCII\r
- // YYYYYYYY - Buffer address in ASCII \r
+ // YYYYYYYY - Buffer address in ASCII\r
// XX - Count in ASCII\r
// SS - check sum\r
//\r
Size = AsciiSPrint (Packet, sizeof (Packet), "Fwrite,%x,%x,%x", FileDescriptor, Buffer, Count);\r
// Packet array is too small if you got this ASSERT\r
ASSERT (Size < sizeof (Packet));\r
- \r
+\r
SendPacket (Packet);\r
Print ((CHAR16 *)L"Packet sent..\n");\r
\r
// Process GDB commands\r
switch (Packet[0]) {\r
//Read memory command.\r
- //m addr,length. \r
+ //m addr,length.\r
case 'm':\r
ReadFromMemory (Packet);\r
break;\r
//Fretcode, errno, Ctrl-C flag\r
//retcode - Count read\r
case 'F':\r
- //Once target receives F reply packet that means the previous \r
+ //Once target receives F reply packet that means the previous\r
//transactions are finished.\r
ReceiveDone = TRUE;\r
break;\r
- \r
+\r
//Send empty buffer\r
- default : \r
+ default :\r
SendNotSupported();\r
break;\r
}\r
if (ErrNo > 0) {\r
SendError((UINT8)ErrNo);\r
}\r
- \r
+\r
return RetCode;\r
}\r
\r
Reset the serial device.\r
\r
@param This Protocol instance pointer.\r
- \r
+\r
@retval EFI_SUCCESS The device was reset.\r
@retval EFI_DEVICE_ERROR The serial device could not be reset.\r
\r
\r
\r
/**\r
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
data buts, and stop bits on a serial device.\r
\r
@param This Protocol instance pointer.\r
\r
@param This Protocol instance pointer.\r
@param Control A pointer to return the current Control signals from the serial device.\r
- \r
+\r
@retval EFI_SUCCESS The control bits were read from the serial device.\r
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
\r
UINTN Return;\r
\r
SerialDev = GDB_SERIAL_DEV_FROM_THIS (This);\r
- \r
+\r
Return = GdbWrite (SerialDev->OutFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
if (Return != *BufferSize) {\r
*BufferSize = Return;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
UINTN Return;\r
\r
SerialDev = GDB_SERIAL_DEV_FROM_THIS (This);\r
- \r
+\r
Return = GdbRead (SerialDev->InFileDescriptor, Buffer, *BufferSize);\r
if (Return == (UINTN)-1) {\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
if (Return != *BufferSize) {\r
*BufferSize = Return;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
\r
-// \r
+//\r
// Template used to initailize the GDB Serial IO protocols\r
//\r
GDB_SERIAL_DEV gdbSerialDevTemplate = {\r
GDB_SERIAL_DEV_SIGNATURE,\r
NULL,\r
- \r
+\r
{ // SerialIo\r
SERIAL_IO_INTERFACE_REVISION,\r
GdbSerialReset,\r
\r
/**\r
Make two serial consoles: 1) StdIn and StdOut via GDB. 2) StdErr via GDB.\r
- \r
+\r
These console show up on the remote system running GDB\r
\r
**/\r
// Use the template to make a copy of the Serial Console private data structure.\r
StdOutSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdOutSerialDev != NULL);\r
- \r
+\r
// Fixup pointer after the copy\r
StdOutSerialDev->SerialIo.Mode = &StdOutSerialDev->SerialMode;\r
- \r
+\r
StdErrSerialDev = AllocateCopyPool (sizeof (GDB_SERIAL_DEV), &gdbSerialDevTemplate);\r
ASSERT (StdErrSerialDev != NULL);\r
\r
// Fixup pointer and modify stuff that is different for StdError\r
- StdErrSerialDev->SerialIo.Mode = &StdErrSerialDev->SerialMode; \r
+ StdErrSerialDev->SerialIo.Mode = &StdErrSerialDev->SerialMode;\r
StdErrSerialDev->DevicePath.Index = 1;\r
StdErrSerialDev->OutFileDescriptor = GDB_STDERR;\r
- \r
+\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &StdOutSerialDev->Handle, \r
+ &StdOutSerialDev->Handle,\r
&gEfiSerialIoProtocolGuid, &StdOutSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdOutSerialDev->DevicePath,\r
NULL\r
\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &StdErrSerialDev->Handle, \r
+ &StdErrSerialDev->Handle,\r
&gEfiSerialIoProtocolGuid, &StdErrSerialDev->SerialIo,\r
&gEfiDevicePathProtocolGuid, &StdErrSerialDev->DevicePath,\r
NULL\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Array of exception types that need to be hooked by the debugger\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
- { EXCEPT_X64_DIVIDE_ERROR, GDB_SIGFPE }, \r
+ { EXCEPT_X64_DIVIDE_ERROR, GDB_SIGFPE },\r
{ EXCEPT_X64_DEBUG, GDB_SIGTRAP },\r
{ EXCEPT_X64_NMI, GDB_SIGEMT },\r
{ EXCEPT_X64_BREAKPOINT, GDB_SIGTRAP },\r
\r
\r
// The offsets of registers SystemContextX64.\r
-// The fields in the array are in the gdb ordering. \r
+// The fields in the array are in the gdb ordering.\r
// HAVE TO DOUBLE-CHECK THE ORDER of the 24 regs\r
//\r
UINTN gRegisterOffsets[] = {\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
/**\r
Return the number of entries in the gRegisters[]\r
- \r
- @retval UINTN, the number of entries (registers) in the gRegisters[] array. \r
+\r
+ @retval UINTN, the number of entries (registers) in the gRegisters[] array.\r
**/\r
UINTN\r
MaxRegisterCount (\r
return sizeof (gRegisterOffsets)/sizeof (UINTN);\r
}\r
\r
- \r
+\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
\r
@retval TRUE if Isa is supported\r
/**\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the X64 member\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
**/\r
UINTN *\r
FindPointerToRegister(\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
)\r
{\r
UINTN RegSize;\r
- \r
+\r
RegSize = 0;\r
while (RegSize < 64) {\r
*OutBufPtr++ = mHexToStr[((*FindPointerToRegister(SystemContext, RegNumber) >> (RegSize+4)) & 0xf)];\r
}\r
\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
**/\r
UINTN RegNumber;\r
CHAR8 OutBuffer[17]; // 1 reg=16 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
- \r
+\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
- \r
+\r
OutBufPtr = OutBuffer;\r
OutBufPtr = BasicReadRegister(SystemContext, RegNumber, OutBufPtr);\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket (OutBuffer);\r
}\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
UINTN i;\r
CHAR8 OutBuffer[385]; // 24 regs, 16 hex chars each, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
OutBufPtr = OutBuffer;\r
- for(i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 24 registers to read \r
+ for(i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 24 registers to read\r
OutBufPtr = BasicReadRegister(SystemContext, i, OutBufPtr);\r
}\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket (OutBuffer);\r
}\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT64 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
NewValue = 0;\r
RegSize = 0;\r
while (RegSize < 64) {\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
+\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister(SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
{\r
UINTN i;\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
- // check to see if the buffer is the right size which is \r
- // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 385 \r
+\r
+ // check to see if the buffer is the right size which is\r
+ // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 385\r
if (AsciiStrLen(InBuffer) != 385) { // 24 regs, 16 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
- \r
+\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for(i=0; i < MaxRegisterCount(); i++) { // there are only 16 registers to write\r
InBufPtr = BasicWriteRegister(SystemContext, i, InBufPtr);\r
}\r
- \r
+\r
SendSuccess();\r
}\r
\r
\r
- /** \r
+ /**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
SystemContext.SystemContextX64->Rflags |= TF_BIT; //Setting the TF bit.\r
}\r
\r
- \r
- \r
-/** \r
+\r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
\r
\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextX64->Rip = AsciiStrHexToUintn(&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextX64->Rip = AsciiStrHexToUintn (&PacketData[1]);\r
}\r
- \r
+\r
AddSingleStep (SystemContext);\r
}\r
\r
\r
/**\r
- Returns breakpoint data address from DR0-DR3 based on the input breakpoint \r
+ Returns breakpoint data address from DR0-DR3 based on the input breakpoint\r
number\r
\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
\r
- @retval Address Data address from DR0-DR3 based on the \r
+ @retval Address Data address from DR0-DR3 based on the\r
breakpoint number.\r
\r
**/\r
}\r
\r
/**\r
- Returns currently detected breakpoint value based on the register \r
+ Returns currently detected breakpoint value based on the register\r
DR6 B0-B3 field.\r
If no breakpoint is detected then it returns 0.\r
\r
}\r
\r
/**\r
- Returns Breakpoint type (InstructionExecution, DataWrite, DataRead \r
+ Returns Breakpoint type (InstructionExecution, DataWrite, DataRead\r
or DataReadWrite) based on the Breakpoint number\r
\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
\r
- @retval BREAK_TYPE Breakpoint type value read from register DR7 RWn \r
+ @retval BREAK_TYPE Breakpoint type value read from register DR7 RWn\r
field. For unknown value, it returns NotSupported.\r
\r
**/\r
}\r
\r
\r
-/** \r
+/**\r
Parses Length and returns the length which DR7 LENn field accepts.\r
- For example: If we receive 1-Byte length then we should return 0. \r
+ For example: If we receive 1-Byte length then we should return 0.\r
Zero gets written to DR7 LENn field.\r
\r
@param Length Breakpoint length in Bytes (1 byte, 2 byte, 4 byte)\r
IN UINTN Length\r
)\r
{\r
- if (Length == 1) { //1-Byte length \r
+ if (Length == 1) { //1-Byte length\r
return 0;\r
} else if (Length == 2) { //2-Byte length\r
return 1;\r
@param SystemContext Register content at time of the exception\r
@param Register Register value (0 - 3)\r
@param Address Breakpoint address value\r
- @param Type Breakpoint type (Instruction, Data write, \r
+ @param Type Breakpoint type (Instruction, Data write,\r
Data read or write etc.)\r
\r
@retval EFI_STATUS Appropriate status value.\r
//Convert length data\r
Length = ConvertLengthData (Length);\r
\r
- //For Instruction execution, length should be 0 \r
+ //For Instruction execution, length should be 0\r
//(Ref. Intel reference manual 18.2.4)\r
if ((Type == 0) && (Length != 0)) {\r
return EFI_INVALID_PARAMETER;\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
}\r
\r
\r
-/** \r
- Returns register number 0 - 3 for the maching debug register. \r
- This function compares incoming Address, Type, Length and \r
+/**\r
+ Returns register number 0 - 3 for the maching debug register.\r
+ This function compares incoming Address, Type, Length and\r
if there is a match then it returns the appropriate register number.\r
In case of mismatch, function returns EFI_NOT_FOUND message.\r
\r
@param SystemContext Register content at time of the exception\r
- @param Address Breakpoint address value \r
+ @param Address Breakpoint address value\r
@param Length Breakpoint length value\r
@param Type Breakpoint type (Instruction, Data write, Data read\r
or write etc.)\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
- if ((Dr7.Bits.G0 == 1) && \r
+ if ((Dr7.Bits.G0 == 1) &&\r
(Dr7.Bits.LEN0 == Length) &&\r
- (Dr7.Bits.RW0 == Type) && \r
+ (Dr7.Bits.RW0 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr0)) {\r
*Register = 0;\r
- } else if ((Dr7.Bits.G1 == 1) && \r
+ } else if ((Dr7.Bits.G1 == 1) &&\r
(Dr7.Bits.LEN1 == Length) &&\r
- (Dr7.Bits.RW1 == Type) && \r
+ (Dr7.Bits.RW1 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr1)) {\r
*Register = 1;\r
- } else if ((Dr7.Bits.G2 == 1) && \r
+ } else if ((Dr7.Bits.G2 == 1) &&\r
(Dr7.Bits.LEN2 == Length) &&\r
- (Dr7.Bits.RW2 == Type) && \r
+ (Dr7.Bits.RW2 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr2)) {\r
*Register = 2;\r
- } else if ((Dr7.Bits.G3 == 1) && \r
+ } else if ((Dr7.Bits.G3 == 1) &&\r
(Dr7.Bits.LEN3 == Length) &&\r
- (Dr7.Bits.RW3 == Type) && \r
+ (Dr7.Bits.RW3 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr3)) {\r
*Register = 3;\r
} else {\r
}\r
\r
switch (Type) {\r
- \r
+\r
case 0: //Software breakpoint\r
BreakType = SoftwareBreakpoint;\r
break;\r
- \r
+\r
case 1: //Hardware breakpoint\r
BreakType = InstructionExecution;\r
break;\r
- \r
+\r
case 2: //Write watchpoint\r
BreakType = DataWrite;\r
break;\r
\r
BOOLEAN\r
ValidateException (\r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
return TRUE;\r
} EXTRACT_SECTION_DATA;\r
\r
typedef struct {\r
- EFI_HOB_GUID_TYPE Hob; \r
+ EFI_HOB_GUID_TYPE Hob;\r
EXTRACT_SECTION_DATA Data;\r
} EXTRACT_SECTION_HOB;\r
\r
/** @file\r
- Platform specific Debug Agent abstraction for timer used by the agent. \r
+ Platform specific Debug Agent abstraction for timer used by the agent.\r
\r
The timer is used by the debugger to break into a running program.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
DebugAgentTimerIntialize (\r
VOID\r
);\r
- \r
+\r
\r
/**\r
Set the period for the debug agent timer. Zero means disable the timer.\r
\r
@param[in] TimerPeriodMilliseconds Frequency of the debug agent timer.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerSetPeriod (\r
IN UINT32 TimerPeriodMilliseconds\r
);\r
- \r
+\r
\r
/**\r
- Perform End Of Interrupt for the debug agent timer. This is called in the \r
- interrupt handler after the interrupt has been processed. \r
+ Perform End Of Interrupt for the debug agent timer. This is called in the\r
+ interrupt handler after the interrupt has been processed.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerEndOfInterrupt (\r
VOID\r
);\r
- \r
+\r
#endif\r
\r
\r
- \r
\ No newline at end of file
/** @file\r
DMA abstraction library APIs. Based on UEFI PCI IO protocol DMA abstractions.\r
- At some point these functions will probably end up in a non PCI protocol \r
+ At some point these functions will probably end up in a non PCI protocol\r
for embedded systems.\r
\r
DMA Bus Master Read Operation:\r
- Call DmaMap() for MapOperationBusMasterRead. \r
- Program the DMA Bus Master with the DeviceAddress returned by DmaMap(). \r
- Start the DMA Bus Master. \r
- Wait for DMA Bus Master to complete the read operation. \r
+ Call DmaMap() for MapOperationBusMasterRead.\r
+ Program the DMA Bus Master with the DeviceAddress returned by DmaMap().\r
+ Start the DMA Bus Master.\r
+ Wait for DMA Bus Master to complete the read operation.\r
Call DmaUnmap().\r
\r
DMA Bus Master Write Operation:\r
Call DmaUnmap().\r
\r
DMA Bus Master Common Buffer Operation:\r
- Call DmaAllocateBuffer() to allocate a common buffer. \r
- Call DmaMap() for MapOperationBusMasterCommonBuffer. \r
- Program the DMA Bus Master with the DeviceAddress returned by DmaMap(). \r
- The common buffer can now be accessed equally by the processor and the DMA bus master. \r
- Call DmaUnmap(). \r
+ Call DmaAllocateBuffer() to allocate a common buffer.\r
+ Call DmaMap() for MapOperationBusMasterCommonBuffer.\r
+ Program the DMA Bus Master with the DeviceAddress returned by DmaMap().\r
+ The common buffer can now be accessed equally by the processor and the DMA bus master.\r
+ Call DmaUnmap().\r
Call DmaFreeBuffer().\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
\r
\r
\r
-/** \r
+/**\r
Provides the DMA controller-specific addresses needed to access system memory.\r
- \r
+\r
Operation is relative to the DMA bus master.\r
- \r
+\r
@param Operation Indicates if the bus master is going to read or write to system memory.\r
@param HostAddress The system memory address to map to the DMA controller.\r
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes\r
- that were mapped. \r
+ that were mapped.\r
@param DeviceAddress The resulting map address for the bus master controller to use to\r
- access the hosts HostAddress. \r
+ access the hosts HostAddress.\r
@param Mapping A resulting value to pass to DmaUnmap().\r
- \r
+\r
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r
- @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. \r
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
\r
\r
\r
-/** \r
+/**\r
Completes the DmaMapBusMasterRead, DmaMapBusMasterWrite, or DmaMapBusMasterCommonBuffer\r
operation and releases any corresponding resources.\r
- \r
+\r
@param Mapping The mapping value returned from DmaMap().\r
- \r
+\r
@retval EFI_SUCCESS The range was unmapped.\r
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
\r
-/** \r
+/**\r
Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer.\r
- mapping. \r
- \r
+ mapping.\r
+\r
@param MemoryType The type of memory to allocate, EfiBootServicesData or\r
- EfiRuntimeServicesData. \r
- @param Pages The number of pages to allocate. \r
+ EfiRuntimeServicesData.\r
+ @param Pages The number of pages to allocate.\r
@param HostAddress A pointer to store the base system memory address of the\r
- allocated range. \r
+ allocated range.\r
\r
@retval EFI_SUCCESS The requested memory pages were allocated.\r
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are\r
- MEMORY_WRITE_COMBINE and MEMORY_CACHED. \r
+ MEMORY_WRITE_COMBINE and MEMORY_CACHED.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. \r
- \r
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
\r
-/** \r
+/**\r
Frees memory that was allocated with DmaAllocateBuffer().\r
- \r
- @param Pages The number of pages to free. \r
- @param HostAddress The base system memory address of the allocated range. \r
- \r
+\r
+ @param Pages The number of pages to free.\r
+ @param HostAddress The base system memory address of the allocated range.\r
+\r
@retval EFI_SUCCESS The requested memory pages were freed.\r
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
was not allocated with DmaAllocateBuffer().\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
\r
-#endif \r
+#endif\r
\r
\r
@param TimeoutInSec Number of seconds to wait to timeout\r
\r
- @param CallBack Callback called every second during the timeout wait \r
+ @param CallBack Callback called every second during the timeout wait\r
\r
\r
\r
\r
string. This depends on the last print done before calling this function.\r
\r
- CurrentRow is updated by one on a call or set back to zero if a prompt is \r
+ CurrentRow is updated by one on a call or set back to zero if a prompt is\r
\r
needed.\r
\r
\r
\r
//\r
-// LIbrary constructor called directly from Ebl Code. \r
+// LIbrary constructor called directly from Ebl Code.\r
// This module calls EblAddCommand () or EblAddCommands () to register new commands\r
//\r
VOID\r
IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL\r
IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL\r
);\r
- \r
+\r
EFI_STATUS\r
EFIAPI\r
EblMtftp (\r
IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL,\r
IN BOOLEAN DontUseBuffer\r
);\r
- \r
+\r
#endif\r
\r
/** @file\r
- Library functions that perform file IO. Memory buffer, file system, and \r
- fimrware volume operations are supproted. \r
+ Library functions that perform file IO. Memory buffer, file system, and\r
+ fimrware volume operations are supproted.\r
\r
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
current mounted device concept of current working directory concept implement\r
by this library.\r
\r
- Device names are case insensative and only check the leading characters for \r
+ Device names are case insensative and only check the leading characters for\r
unique matches. Thus the following are all the same:\r
LoadFile0:\r
l0:\r
fs3: - EFI Simple File System device 3\r
Fv2: - EFI Firmware VOlume device 2\r
1.2.3.4:name - TFTP IP and file name\r
- \r
+\r
**/\r
\r
#ifndef __EFI_FILE_LIB_H__\r
\r
#define MAX_PATHNAME 0x200\r
\r
-/// Type of the file that has been opened \r
+/// Type of the file that has been opened\r
typedef enum {\r
EfiOpenLoadFile,\r
EfiOpenMemoryBuffer,\r
\r
/// Public information about the open file\r
typedef struct {\r
- UINTN Version; // Common information \r
+ UINTN Version; // Common information\r
EFI_OPEN_FILE_TYPE Type;\r
EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
EFI_STATUS LastError;\r
- EFI_HANDLE EfiHandle; \r
+ EFI_HANDLE EfiHandle;\r
CHAR8 *DeviceName;\r
CHAR8 *FileName;\r
\r
UINT64 MaxPosition;\r
\r
UINTN BaseOffset; // Base offset for hexdump command\r
- \r
+\r
UINTN Size; // Valid for all types other than l#:\r
UINT8 *Buffer; // Information valid for A#:\r
\r
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#: \r
- EFI_GUID FvNameGuid; \r
- EFI_SECTION_TYPE FvSectionType; \r
- EFI_FV_FILETYPE FvType; \r
- EFI_FV_FILE_ATTRIBUTES FvAttributes; \r
+ EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#:\r
+ EFI_GUID FvNameGuid;\r
+ EFI_SECTION_TYPE FvSectionType;\r
+ EFI_FV_FILETYPE FvType;\r
+ EFI_FV_FILE_ATTRIBUTES FvAttributes;\r
\r
- EFI_PHYSICAL_ADDRESS FvStart; \r
- UINTN FvSize; \r
+ EFI_PHYSICAL_ADDRESS FvStart;\r
+ UINTN FvSize;\r
UINTN FvHeaderSize;\r
\r
EFI_FILE *FsFileHandle; // Information valid for Fs#:\r
UINTN DiskOffset; // Information valid for B#:\r
\r
EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#:\r
- \r
+\r
EFI_IP_ADDRESS ServerIp; // Information valid for t:\r
BOOLEAN IsDirty;\r
BOOLEAN IsBufferValid;\r
- \r
+\r
} EFI_OPEN_FILE;\r
\r
\r
\r
\r
/**\r
- Open a device named by PathName. The PathName includes a device name and \r
+ Open a device named by PathName. The PathName includes a device name and\r
path separated by a :. See file header for more details on the PathName\r
syntax. There is no checking to prevent a file from being opened more than\r
- one type. \r
+ one type.\r
\r
SectionType is only used to open an FV. Each file in an FV contains multiple\r
sections and only the SectionType section is opened.\r
\r
For any file that is opened with EfiOpen() must be closed with EfiClose().\r
\r
- @param PathName Path to parse to open \r
+ @param PathName Path to parse to open\r
@param OpenMode Same as EFI_FILE.Open()\r
@param SectionType Section in FV to open.\r
\r
\r
\r
/**\r
- Return the size of the file represented by Stream. Also return the current \r
+ Return the size of the file represented by Stream. Also return the current\r
Seek position. Opening a file will enable a valid file size to be returned.\r
- LoadFile is an exception as a load file size is set to zero. \r
+ LoadFile is an exception as a load file size is set to zero.\r
\r
@param Stream Open File Handle\r
\r
\r
/**\r
Seek to the Offset location in the file. LoadFile and FV device types do\r
- not support EfiSeek(). It is not possible to grow the file size using \r
+ not support EfiSeek(). It is not possible to grow the file size using\r
EfiSeek().\r
- \r
+\r
SeekType defines how use Offset to calculate the new file position:\r
EfiSeekStart : Position = Offset\r
EfiSeekCurrent: Position is Offset bytes from the current position\r
EfiSeekEnd : Only supported if Offset is zero to seek to end of file.\r
\r
@param Stream Open File Handle\r
- @param Offset Offset to seek too. \r
+ @param Offset Offset to seek too.\r
@param SeekType Type of seek to perform\r
\r
\r
\r
/**\r
Read BufferSize bytes from the current location in the file. For load file\r
- and FV case you must read the entire file. \r
+ and FV case you must read the entire file.\r
\r
@param Stream Open File Handle\r
- @param Buffer Caller allocated buffer. \r
+ @param Buffer Caller allocated buffer.\r
@param BufferSize Size of buffer in bytes.\r
\r
\r
\r
/**\r
Read the entire file into a buffer. This routine allocates the buffer and\r
- returns it to the user full of the read data. \r
+ returns it to the user full of the read data.\r
\r
This is very useful for load file where it's hard to know how big the buffer\r
must be.\r
\r
@param Stream Open File Handle\r
- @param Buffer Pointer to buffer to return. \r
+ @param Buffer Pointer to buffer to return.\r
@param BufferSize Pointer to Size of buffer return..\r
\r
\r
\r
\r
/**\r
- Write data back to the file. \r
+ Write data back to the file.\r
\r
@param Stream Open File Handle\r
- @param Buffer Pointer to buffer to return. \r
+ @param Buffer Pointer to buffer to return.\r
@param BufferSize Pointer to Size of buffer return..\r
\r
\r
EfiGetDeviceCounts (\r
IN EFI_OPEN_FILE_TYPE Type\r
);\r
- \r
+\r
\r
/**\r
Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
the path does not contain a device name, The CWD is prepended to the path.\r
- \r
+\r
@param Cwd Current Working Directory to set\r
\r
\r
EFI_STATUS\r
EfiSetCwd (\r
IN CHAR8 *Cwd\r
- ); \r
+ );\r
\r
/**\r
Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
the path does not contain a device name, The CWD is prepended to the path.\r
- \r
- @param Cwd Current Working Directory \r
+\r
+ @param Cwd Current Working Directory\r
\r
\r
@return NULL No CWD set\r
@return 'other' malloc'ed buffer contains CWD.\r
- \r
+\r
**/\r
CHAR8 *\r
EfiGetCwd (\r
VOID\r
- ); \r
+ );\r
\r
#endif\r
IN UINTN DataSize,\r
IN CHAR16 *ResetData OPTIONAL\r
);\r
- \r
+\r
\r
\r
/**\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
\r
\r
/**\r
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
data buts, and stop bits on a serial device. This call is optional as the serial\r
port will be set up with defaults base on PCD values.\r
\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
- ); \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
+ );\r
\r
\r
/**\r
\r
@return TRUE - Character availible\r
@return FALSE - Character not availible\r
- \r
+\r
**/\r
BOOLEAN\r
EFIAPI\r
Get a character from GDB. This function must be able to run in interrupt context.\r
\r
@return A character from GDB\r
- \r
+\r
**/\r
CHAR8\r
EFIAPI\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Updates the pointer to the HOB list.\r
\r
@param HobList Hob list pointer to store\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
\r
/**\r
Find a file in the volume by name\r
- \r
+\r
@param FileName A pointer to the name of the file to\r
find within the firmware volume.\r
\r
information.\r
\r
@retval EFI_SUCCESS File information returned.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
- \r
+\r
**/\r
EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
FfsGetFileInfo (\r
IN CONST EFI_PEI_FILE_HANDLE FileHandle,\r
OUT EFI_FV_FILE_INFO *FileInfo\r
information.\r
\r
@retval EFI_SUCCESS File information returned.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
\r
**/\r
@param FileType File handle of a Fv type file.\r
@param Volumehandle On succes Volume Handle of the match\r
@param FileHandle On success File Handle of the match\r
- \r
+\r
@retval EFI_NOT_FOUND FV image can't be found.\r
@retval EFI_SUCCESS Successfully found FileType\r
\r
\r
\r
/**\r
- This service enables PEIMs to ascertain the present value of the boot mode. \r
+ This service enables PEIMs to ascertain the present value of the boot mode.\r
\r
\r
- @retval BootMode \r
+ @retval BootMode\r
\r
**/\r
EFI_BOOT_MODE\r
\r
\r
/**\r
- This service enables PEIMs to update the boot mode variable. \r
+ This service enables PEIMs to update the boot mode variable.\r
\r
@param BootMode The value of the boot mode to set.\r
\r
VOID *\r
EFIAPI\r
GetHobList (\r
- VOID \r
+ VOID\r
);\r
\r
\r
Updates the pointer to the HOB list.\r
\r
@param HobList Hob list pointer to store\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
/**\r
Returns the next instance of a HOB type from the starting HOB.\r
\r
- This function searches the first instance of a HOB type from the starting HOB pointer. \r
+ This function searches the first instance of a HOB type from the starting HOB pointer.\r
If there does not exist such HOB type from the starting HOB pointer, it will return NULL.\r
In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r
unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r
/**\r
Returns the first instance of a HOB type among the whole HOB list.\r
\r
- This function searches the first instance of a HOB type among the whole HOB list. \r
- If there does not exist such HOB type in the HOB list, it will return NULL. \r
+ This function searches the first instance of a HOB type among the whole HOB list.\r
+ If there does not exist such HOB type in the HOB list, it will return NULL.\r
\r
@param Type The HOB type to return.\r
\r
);\r
\r
/**\r
- This function searches the first instance of a HOB from the starting HOB pointer. \r
- Such HOB should satisfy two conditions: \r
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. \r
- If there does not exist such HOB from the starting HOB pointer, it will return NULL. \r
+ This function searches the first instance of a HOB from the starting HOB pointer.\r
+ Such HOB should satisfy two conditions:\r
+ its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r
+ If there does not exist such HOB from the starting HOB pointer, it will return NULL.\r
Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r
to extract the data section and its size info respectively.\r
In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r
);\r
\r
/**\r
- This function searches the first instance of a HOB among the whole HOB list. \r
+ This function searches the first instance of a HOB among the whole HOB list.\r
Such HOB should satisfy two conditions:\r
its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r
If there does not exist such HOB from the starting HOB pointer, it will return NULL.\r
/**\r
Builds a GUID HOB with a certain data length.\r
\r
- This function builds a customized HOB tagged with a GUID for identification \r
- and returns the start address of GUID HOB data so that caller can fill the customized data. \r
+ This function builds a customized HOB tagged with a GUID for identification\r
+ and returns the start address of GUID HOB data so that caller can fill the customized data.\r
The HOB Header and Name field is already stripped.\r
It can only be invoked during PEI phase;\r
for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
);\r
\r
/**\r
- Builds a Firmware Volume HOB and a resrouce descriptor hob \r
+ Builds a Firmware Volume HOB and a resrouce descriptor hob\r
\r
This function builds a Firmware Volume HOB.\r
It can only be invoked during PEI phase;\r
**/\r
VOID\r
EFIAPI\r
-BuildFvHobs ( \r
+BuildFvHobs (\r
IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r
IN UINT64 NumberOfBytes,\r
IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute OPTIONAL\r
- ); \r
+ );\r
\r
\r
/**\r
@param Length The size of the Firmware Volume in bytes.\r
@param FvName The name of the Firmware Volume.\r
@param FileName The name of the file.\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
@return A pointer to the allocated buffer or NULL if allocation fails.\r
\r
**/\r
-VOID * \r
+VOID *\r
EFIAPI\r
AllocatePages (\r
IN UINTN Pages\r
);\r
- \r
+\r
/**\r
Allocates a buffer of type EfiBootServicesData.\r
\r
AllocatePool (\r
IN UINTN AllocationSize\r
);\r
- \r
- \r
+\r
+\r
/**\r
Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.\r
\r
/** @file\r
Implement EFI RealTimeClock runtime services via Lib.\r
- \r
+\r
Currently this driver does not support runtime virtual calling.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
/** @file\r
\r
Copyright (c) 2012, ARM Ltd. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
/** @file\r
Protocol is used to help implement DebugSupport.RegisterPeriodicCallback() functionality.\r
- This enables the DXE timer driver to support the periodic callback function so the \r
+ This enables the DXE timer driver to support the periodic callback function so the\r
DebugSupport driver does not need to contain platform specific information about how a timer\r
works.\r
\r
\r
extern EFI_GUID gEfiDebugSupportPeriodicCallbackProtocolGuid;\r
\r
-#endif \r
+#endif\r
\r
/**\r
Add a single command table entry.\r
- \r
+\r
@param EntryArray Pointer EBL_COMMAND_TABLE of the command that is being added\r
\r
**/\r
);\r
\r
\r
-typedef \r
+typedef\r
VOID\r
(EFIAPI *EBL_GET_CHAR_CALL_BACK) (\r
IN UINTN ElapsedTime\r
\r
@param Key EFI Key information returned\r
@param TimeoutInSec Number of seconds to wait to timeout\r
- @param CallBack Callback called every second during the timeout wait \r
+ @param CallBack Callback called every second during the timeout wait\r
\r
@return EFI_SUCCESS Key was returned\r
@return EFI_TIMEOUT If the TimoutInSec expired\r
\r
**/\r
-typedef \r
+typedef\r
EFI_STATUS\r
(EFIAPI *EBL_GET_CHAR_KEY) (\r
IN OUT EFI_INPUT_KEY *Key,\r
If the use hits Q to quit return TRUE else for any other key return FALSE.\r
PrefixNewline is used to figure out if a newline is needed before the prompt\r
string. This depends on the last print done before calling this function.\r
- CurrentRow is updated by one on a call or set back to zero if a prompt is \r
+ CurrentRow is updated by one on a call or set back to zero if a prompt is\r
needed.\r
\r
@param CurrentRow Used to figure out if its the end of the page and updated\r
/** @file\r
Deal with devices that just exist in memory space.\r
- \r
+\r
To follow the EFI driver model you need a root handle to start with. An\r
- EFI driver will have a driver binding protocol (Supported, Start, Stop) \r
- that is used to layer on top of a handle via a gBS->ConnectController. \r
+ EFI driver will have a driver binding protocol (Supported, Start, Stop)\r
+ that is used to layer on top of a handle via a gBS->ConnectController.\r
The first handle has to just be in the system to make that work. For\r
- PCI it is a PCI Root Bridge IO protocol that provides the root. \r
- \r
- On an embedded system with MMIO device we need a handle to just \r
- show up. That handle will have this protocol and a device path \r
- protocol on it. \r
- \r
+ PCI it is a PCI Root Bridge IO protocol that provides the root.\r
+\r
+ On an embedded system with MMIO device we need a handle to just\r
+ show up. That handle will have this protocol and a device path\r
+ protocol on it.\r
+\r
For an ethernet device the device path must contain a MAC address device path\r
node.\r
\r
Offset - starting register number\r
Length - number of bytes to read\r
Buffer - destination buffer\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - registers read successfully\r
Offset - starting register number\r
Length - number of bytes to write\r
Buffer - source buffer\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - registers written successfully\r
This - pointer to protocol\r
Gpio - which pin to read\r
Value - state of the pin\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - GPIO state returned in Value\r
This - pointer to protocol\r
Gpio - which pin to modify\r
Mode - mode to set\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - GPIO set as requested\r
This - pointer to protocol\r
Gpio - which pin\r
Mode - pointer to output mode value\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - mode value retrieved\r
This - pointer to protocol\r
Gpio - which pin\r
Direction - pull-up, pull-down, or none\r
- \r
+\r
Returns:\r
\r
EFI_SUCCESS - pin was set\r
\r
extern EFI_GUID gEmbeddedGpioProtocolGuid;\r
\r
-#endif \r
+#endif\r
/** @file\r
Abstraction for hardware based interrupt routine\r
- \r
+\r
On non IA-32 systems it is common to have a single hardware interrupt vector\r
and a 2nd layer of software that routes the interrupt handlers based on the\r
- interrupt source. This protocol enables this routing. The driver implementing \r
- this protocol is responsible for clearing the pending interrupt in the \r
- interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible \r
+ interrupt source. This protocol enables this routing. The driver implementing\r
+ this protocol is responsible for clearing the pending interrupt in the\r
+ interrupt routing hardware. The HARDWARE_INTERRUPT_HANDLER is responsible\r
for clearing interrupt sources from individual devices.\r
\r
\r
@param Source Source of the interrupt. Hardware routing off a specific platform defines\r
what source means.\r
@param SystemContext Pointer to system register context. Mostly used by debuggers and will\r
- update the system context after the return from the interrupt if \r
+ update the system context after the return from the interrupt if\r
modified. Don't change these values unless you know what you are doing\r
\r
**/\r
VOID\r
(EFIAPI *HARDWARE_INTERRUPT_HANDLER) (\r
IN HARDWARE_INTERRUPT_SOURCE Source,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
(EFIAPI *HARDWARE_INTERRUPT_INTERRUPT_STATE) (\r
IN EFI_HARDWARE_INTERRUPT_PROTOCOL *This,\r
IN HARDWARE_INTERRUPT_SOURCE Source,\r
- IN BOOLEAN *InterruptState \r
+ IN BOOLEAN *InterruptState\r
);\r
\r
/**\r
- Signal to the hardware that the End Of Intrrupt state \r
+ Signal to the hardware that the End Of Intrrupt state\r
has been reached.\r
\r
@param This Instance pointer for this protocol\r
Definition of the MMC Host Protocol\r
\r
Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
\r
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
/**\r
Retrieves information about a PE/COFF image.\r
\r
- Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize, \r
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and \r
- DebugDirectoryEntryRva fields of the ImageContext structure. \r
- If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. \r
- If the PE/COFF image accessed through the ImageRead service in the ImageContext \r
- structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED. \r
- If any errors occur while computing the fields of ImageContext, \r
- then the error status is returned in the ImageError field of ImageContext. \r
+ Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize,\r
+ DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and\r
+ DebugDirectoryEntryRva fields of the ImageContext structure.\r
+ If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.\r
+ If the PE/COFF image accessed through the ImageRead service in the ImageContext\r
+ structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED.\r
+ If any errors occur while computing the fields of ImageContext,\r
+ then the error status is returned in the ImageError field of ImageContext.\r
If the image is a TE image, then SectionAlignment is set to 0.\r
- The ImageRead and Handle fields of ImageContext structure must be valid prior \r
+ The ImageRead and Handle fields of ImageContext structure must be valid prior\r
to invoking this service.\r
\r
@param ImageContext Pointer to the image context structure that describes the PE/COFF\r
ImageContext as the relocation base address. Otherwise, use the DestinationAddress field\r
of ImageContext as the relocation base address. The caller must allocate the relocation\r
fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.\r
- \r
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, \r
- ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, \r
- DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of \r
+\r
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress,\r
+ ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders,\r
+ DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of\r
the ImageContext structure must be valid prior to invoking this service.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate\r
the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.\r
The EntryPoint, FixupDataSize, CodeView, PdbPointer and HiiResourceData fields of ImageContext are computed.\r
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize, \r
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva \r
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize,\r
+ DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva\r
fields of the ImageContext structure must be valid prior to invoking this service.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
\r
/**\r
Reads contents of a PE/COFF image from a buffer in system memory.\r
- \r
- This is the default implementation of a PE_COFF_LOADER_READ_FILE function \r
- that assumes FileHandle pointer to the beginning of a PE/COFF image. \r
- This function reads contents of the PE/COFF image that starts at the system memory \r
- address specified by FileHandle. The read operation copies ReadSize bytes from the \r
- PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer. \r
+\r
+ This is the default implementation of a PE_COFF_LOADER_READ_FILE function\r
+ that assumes FileHandle pointer to the beginning of a PE/COFF image.\r
+ This function reads contents of the PE/COFF image that starts at the system memory\r
+ address specified by FileHandle. The read operation copies ReadSize bytes from the\r
+ PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer.\r
The size of the buffer actually read is returned in ReadSize.\r
- \r
+\r
If FileHandle is NULL, then ASSERT().\r
If ReadSize is NULL, then ASSERT().\r
If Buffer is NULL, then ASSERT().\r
\r
@param FileHandle Pointer to base of the input stream\r
@param FileOffset Offset into the PE/COFF image to begin the read operation.\r
- @param ReadSize On input, the size in bytes of the requested read operation. \r
+ @param ReadSize On input, the size in bytes of the requested read operation.\r
On output, the number of bytes actually read.\r
@param Buffer Output buffer that contains the data read from the PE/COFF image.\r
\r
- @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into \r
+ @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into\r
the buffer.\r
**/\r
typedef\r
\r
/**\r
Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI\r
- runtime. \r
- \r
- This function reapplies relocation fixups to the PE/COFF image specified by ImageBase \r
- and ImageSize so the image will execute correctly when the PE/COFF image is mapped \r
- to the address specified by VirtualImageBase. RelocationData must be identical \r
- to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure \r
+ runtime.\r
+\r
+ This function reapplies relocation fixups to the PE/COFF image specified by ImageBase\r
+ and ImageSize so the image will execute correctly when the PE/COFF image is mapped\r
+ to the address specified by VirtualImageBase. RelocationData must be identical\r
+ to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure\r
after this PE/COFF image was relocated with PeCoffLoaderRelocateImage().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
cache(s) in hardware, then the caller is responsible for performing cache maintenance operations\r
prior to transferring control to a PE/COFF image that is loaded using this library.\r
\r
- @param ImageBase Base address of a PE/COFF image that has been loaded \r
+ @param ImageBase Base address of a PE/COFF image that has been loaded\r
and relocated into system memory.\r
@param VirtImageBase The request virtual address that the PE/COFF image is to\r
be fixed up for.\r
@param ImageSize The size, in bytes, of the PE/COFF image.\r
- @param RelocationData A pointer to the relocation data that was collected when the PE/COFF \r
+ @param RelocationData A pointer to the relocation data that was collected when the PE/COFF\r
image was relocated using PeCoffLoaderRelocateImage().\r
- \r
+\r
**/\r
typedef\r
VOID\r
\r
/**\r
Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
- Releases any environment specific resources that were allocated when the image \r
- specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
- \r
+ Releases any environment specific resources that were allocated when the image\r
+ specified by ImageContext was loaded using PeCoffLoaderLoadImage().\r
+\r
For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
- For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+ For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,\r
this function can simply return RETURN_SUCCESS.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
- \r
+\r
@param ImageContext Pointer to the image context structure that describes the PE/COFF\r
image to be unloaded.\r
\r
/** @file\r
*\r
* Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
program with the debugger.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
}\r
- \r
- \r
+\r
+\r
/**\r
Set the period for the debug agent timer. Zero means disable the timer.\r
\r
@param[in] TimerPeriodMilliseconds Frequency of the debug agent timer.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerSetPeriod (\r
)\r
{\r
}\r
- \r
+\r
\r
/**\r
- Perform End Of Interrupt for the debug agent timer. This is called in the \r
- interrupt handler after the interrupt has been processed. \r
+ Perform End Of Interrupt for the debug agent timer. This is called in the\r
+ interrupt handler after the interrupt has been processed.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerEndOfInterrupt (\r
)\r
{\r
}\r
- \r
- \r
\ No newline at end of file
+\r
/** @file\r
- PE/COFF Loader Library implementation that wraps a protocol passed up from \r
+ PE/COFF Loader Library implementation that wraps a protocol passed up from\r
SEC/PEI via a HOB. This is done to save space.\r
\r
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
/**\r
Retrieves information about a PE/COFF image.\r
\r
- Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize, \r
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and \r
- DebugDirectoryEntryRva fields of the ImageContext structure. \r
- If ImageContext is NULL, then return RETURN_INVALID_PARAMETER. \r
- If the PE/COFF image accessed through the ImageRead service in the ImageContext \r
- structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED. \r
- If any errors occur while computing the fields of ImageContext, \r
- then the error status is returned in the ImageError field of ImageContext. \r
+ Computes the PeCoffHeaderOffset, IsTeImage, ImageType, ImageAddress, ImageSize,\r
+ DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and\r
+ DebugDirectoryEntryRva fields of the ImageContext structure.\r
+ If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.\r
+ If the PE/COFF image accessed through the ImageRead service in the ImageContext\r
+ structure is not a supported PE/COFF image type, then return RETURN_UNSUPPORTED.\r
+ If any errors occur while computing the fields of ImageContext,\r
+ then the error status is returned in the ImageError field of ImageContext.\r
If the image is a TE image, then SectionAlignment is set to 0.\r
- The ImageRead and Handle fields of ImageContext structure must be valid prior \r
+ The ImageRead and Handle fields of ImageContext structure must be valid prior\r
to invoking this service.\r
\r
@param ImageContext Pointer to the image context structure that describes the PE/COFF\r
ImageContext as the relocation base address. Otherwise, use the DestinationAddress field\r
of ImageContext as the relocation base address. The caller must allocate the relocation\r
fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.\r
- \r
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, \r
- ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, \r
- DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of \r
+\r
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress,\r
+ ImageSize, DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders,\r
+ DebugDirectoryEntryRva, EntryPoint, FixupDataSize, CodeView, PdbPointer, and FixupData of\r
the ImageContext structure must be valid prior to invoking this service.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate\r
the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.\r
The EntryPoint, FixupDataSize, CodeView, PdbPointer and HiiResourceData fields of ImageContext are computed.\r
- The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize, \r
- DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva \r
+ The ImageRead, Handle, PeCoffHeaderOffset, IsTeImage, Machine, ImageType, ImageAddress, ImageSize,\r
+ DestinationAddress, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva\r
fields of the ImageContext structure must be valid prior to invoking this service.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
\r
/**\r
Reads contents of a PE/COFF image from a buffer in system memory.\r
- \r
- This is the default implementation of a PE_COFF_LOADER_READ_FILE function \r
- that assumes FileHandle pointer to the beginning of a PE/COFF image. \r
- This function reads contents of the PE/COFF image that starts at the system memory \r
- address specified by FileHandle. The read operation copies ReadSize bytes from the \r
- PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer. \r
+\r
+ This is the default implementation of a PE_COFF_LOADER_READ_FILE function\r
+ that assumes FileHandle pointer to the beginning of a PE/COFF image.\r
+ This function reads contents of the PE/COFF image that starts at the system memory\r
+ address specified by FileHandle. The read operation copies ReadSize bytes from the\r
+ PE/COFF image starting at byte offset FileOffset into the buffer specified by Buffer.\r
The size of the buffer actually read is returned in ReadSize.\r
- \r
+\r
If FileHandle is NULL, then ASSERT().\r
If ReadSize is NULL, then ASSERT().\r
If Buffer is NULL, then ASSERT().\r
\r
@param FileHandle Pointer to base of the input stream\r
@param FileOffset Offset into the PE/COFF image to begin the read operation.\r
- @param ReadSize On input, the size in bytes of the requested read operation. \r
+ @param ReadSize On input, the size in bytes of the requested read operation.\r
On output, the number of bytes actually read.\r
@param Buffer Output buffer that contains the data read from the PE/COFF image.\r
\r
- @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into \r
+ @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into\r
the buffer.\r
**/\r
RETURN_STATUS\r
ReadSize,\r
Buffer\r
);\r
- \r
+\r
}\r
\r
\r
\r
/**\r
Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI\r
- runtime. \r
- \r
- This function reapplies relocation fixups to the PE/COFF image specified by ImageBase \r
- and ImageSize so the image will execute correctly when the PE/COFF image is mapped \r
- to the address specified by VirtualImageBase. RelocationData must be identical \r
- to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure \r
+ runtime.\r
+\r
+ This function reapplies relocation fixups to the PE/COFF image specified by ImageBase\r
+ and ImageSize so the image will execute correctly when the PE/COFF image is mapped\r
+ to the address specified by VirtualImageBase. RelocationData must be identical\r
+ to the FiuxupData buffer from the PE_COFF_LOADER_IMAGE_CONTEXT structure\r
after this PE/COFF image was relocated with PeCoffLoaderRelocateImage().\r
\r
Note that if the platform does not maintain coherency between the instruction cache(s) and the data\r
cache(s) in hardware, then the caller is responsible for performing cache maintenance operations\r
prior to transferring control to a PE/COFF image that is loaded using this library.\r
\r
- @param ImageBase Base address of a PE/COFF image that has been loaded \r
+ @param ImageBase Base address of a PE/COFF image that has been loaded\r
and relocated into system memory.\r
@param VirtImageBase The request virtual address that the PE/COFF image is to\r
be fixed up for.\r
@param ImageSize The size, in bytes, of the PE/COFF image.\r
- @param RelocationData A pointer to the relocation data that was collected when the PE/COFF \r
+ @param RelocationData A pointer to the relocation data that was collected when the PE/COFF\r
image was relocated using PeCoffLoaderRelocateImage().\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
\r
/**\r
Unloads a loaded PE/COFF image from memory and releases its taken resource.\r
- Releases any environment specific resources that were allocated when the image \r
- specified by ImageContext was loaded using PeCoffLoaderLoadImage(). \r
- \r
+ Releases any environment specific resources that were allocated when the image\r
+ specified by ImageContext was loaded using PeCoffLoaderLoadImage().\r
+\r
For NT32 emulator, the PE/COFF image loaded by system needs to release.\r
- For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded, \r
+ For real platform, the PE/COFF image loaded by Core doesn't needs to be unloaded,\r
this function can simply return RETURN_SUCCESS.\r
- \r
+\r
If ImageContext is NULL, then ASSERT().\r
- \r
+\r
@param ImageContext Pointer to the image context structure that describes the PE/COFF\r
image to be unloaded.\r
\r
if (Hob == NULL) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
gPeCoffLoader = Hob->Interface;\r
return EFI_SUCCESS;\r
}\r
#/** @file\r
-# PE/COFF Loader Library implementation that wraps a protocol passed up from \r
+# PE/COFF Loader Library implementation that wraps a protocol passed up from\r
# SEC/PEI via a HOB. This is done to save space.\r
#\r
# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
FILE_GUID = 671C6FD7-99FB-4EE3-B640-4B1D463BC3B5\r
MODULE_TYPE = DXE_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = PeCoffLib \r
+ LIBRARY_CLASS = PeCoffLib\r
CONSTRUCTOR = DxeHobPeCoffLibConstructor\r
\r
\r
\r
@param Key EFI Key information returned\r
@param TimeoutInSec Number of seconds to wait to timeout\r
- @param CallBack Callback called every second during the timeout wait \r
+ @param CallBack Callback called every second during the timeout wait\r
\r
@return EFI_SUCCESS Key was returned\r
@return EFI_TIMEOUT If the TimoutInSec expired\r
If the use hits Q to quit return TRUE else for any other key return FALSE.\r
PrefixNewline is used to figure out if a newline is needed before the prompt\r
string. This depends on the last print done before calling this function.\r
- CurrentRow is updated by one on a call or set back to zero if a prompt is \r
+ CurrentRow is updated by one on a call or set back to zero if a prompt is\r
needed.\r
\r
@param CurrentRow Used to figure out if its the end of the page and updated\r
\r
/**\r
The user Entry Point for the driver. The user code starts with this function\r
- as the real entry point for the image goes into a library that calls this \r
+ as the real entry point for the image goes into a library that calls this\r
function.\r
\r
- @param[in] ImageHandle The firmware allocated handle for the EFI image. \r
+ @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
@param[in] SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The entry point is executed successfully.\r
@retval other Some error occurs when executing this entry point.\r
\r
\r
mAddExternalCmdLibTemplate = EntryArray;\r
mAddExternalCmdLibTemplateSize = ArrayCount;\r
- \r
+\r
EfiCreateProtocolNotifyEvent (\r
&gEfiEblAddCommandProtocolGuid,\r
TPL_CALLBACK,\r
NULL,\r
&mEblCommandRegistration\r
);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
FILE_GUID = 9195D970-C6F7-484E-8013-5B03C89C3B81\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EblAddExternalCommandLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EblAddExternalCommandLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
UefiBootServicesTableLib\r
UefiLib\r
EblAddExternalCommandLib\r
- \r
+\r
[Protocols]\r
gEfiEblAddCommandProtocolGuid\r
- \r
+\r
[Guids]\r
- \r
\ No newline at end of file
FILE_GUID = 3513C4E2-06D6-4921-9C2B-E938777BA79E\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EfiCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EfiCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
EmbeddedPkg/EmbeddedPkg.dec\r
\r
[LibraryClasses]\r
- \r
+\r
[Protocols]\r
- \r
+\r
[Guids]\r
- \r
\ No newline at end of file
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
EFI_STATUS Status;\r
EFI_PXE_BASE_CODE_PROTOCOL *Pxe;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiPxeBaseCodeProtocolGuid, NULL, (VOID **)&Pxe);\r
if (EFI_ERROR(Status)) {\r
return Status;\r
{\r
EFI_STATUS Status;\r
VOID *NullPtr;\r
- \r
+\r
Status = gBS->HandleProtocol (Handle, &gEfiPxeBaseCodeProtocolGuid, &NullPtr);\r
if (!EFI_ERROR (Status)) {\r
return "EFI PXE Network Boot";\r
}\r
- \r
- return ""; \r
+\r
+ return "";\r
}\r
\r
EFI_STATUS\r
{\r
EFI_STATUS Status;\r
EFI_PXE_BASE_CODE_PROTOCOL *Pxe;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiPxeBaseCodeProtocolGuid, NULL, (VOID **)&Pxe);\r
if (EFI_ERROR(Status)) {\r
return Status;\r
{\r
EFI_STATUS Status;\r
EFI_PXE_BASE_CODE_PROTOCOL *Pxe;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiPxeBaseCodeProtocolGuid, NULL, (VOID **)&Pxe);\r
if (EFI_ERROR(Status)) {\r
return Status;\r
if (EFI_ERROR(Status) && (Status != EFI_ALREADY_STARTED)) {\r
return Status;\r
}\r
- \r
+\r
Status = Pxe->SetStationIp (Pxe, NewStationIp, NewSubnetMask);\r
return Status;\r
}\r
\r
- \r
+\r
EFI_STATUS\r
EFIAPI\r
EblMtftp (\r
{\r
EFI_STATUS Status;\r
EFI_PXE_BASE_CODE_PROTOCOL *Pxe;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiPxeBaseCodeProtocolGuid, NULL, (VOID **)&Pxe);\r
if (EFI_ERROR(Status)) {\r
return Status;\r
}\r
- \r
+\r
Status = Pxe->Mtftp (\r
Pxe,\r
Operation,\r
);\r
return Status;\r
}\r
- \r
+\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
gEfiPxeBaseCodeProtocolGuid\r
\r
[Depex]\r
- TRUE\r
\ No newline at end of file
+ TRUE\r
**/\r
\r
#include <PiDxe.h>\r
-#include <Protocol/BlockIo.h> \r
-#include <Protocol/DiskIo.h> \r
-#include <Protocol/SimpleFileSystem.h> \r
-#include <Protocol/FirmwareVolume2.h> \r
+#include <Protocol/BlockIo.h>\r
+#include <Protocol/DiskIo.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/FirmwareVolume2.h>\r
#include <Protocol/LoadFile.h>\r
-#include <Protocol/FirmwareVolumeBlock.h> \r
+#include <Protocol/FirmwareVolumeBlock.h>\r
#include <Guid/FileInfo.h>\r
#include <Library/BaseLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
#include <Library/DevicePathLib.h>\r
#include <Library/PrintLib.h>\r
#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiLib.h> \r
+#include <Library/UefiLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
#include <Library/DebugLib.h>\r
/**\r
PathName is in the form <device name>:<path> for example fs1:\ or ROOT:\.\r
Return TRUE if the <devce name> prefix of PathName matches a file system\r
-Volume Name. MatchIndex is the array index in mFsInfo[] of the match, \r
+Volume Name. MatchIndex is the array index in mFsInfo[] of the match,\r
and it can be used with mFs[] to find the handle that needs to be opened\r
\r
@param PathName PathName to check\r
\r
EFI_STATUS\r
ConvertIpStringToEfiIp (\r
- IN CHAR8 *PathName, \r
+ IN CHAR8 *PathName,\r
OUT EFI_IP_ADDRESS *ServerIp\r
)\r
{\r
\r
\r
/**\r
-Internal work function to extract a device number from a string skipping \r
+Internal work function to extract a device number from a string skipping\r
text. Easy way to extract numbers from strings like blk7:.\r
\r
@param Str String to extract device number form\r
UINTN Index;\r
\r
\r
- // Find the first digit \r
+ // Find the first digit\r
Max = AsciiStrLen (Str);\r
for (Index = 0; !((*Str >= '0') && (*Str <= '9')) && (Index < Max); Index++) {\r
Str++;\r
do {\r
File->FvType = EFI_FV_FILETYPE_ALL;\r
GetNextFileStatus = File->Fv->GetNextFile (\r
- File->Fv, \r
+ File->Fv,\r
&Key,\r
- &File->FvType, \r
- &File->FvNameGuid, \r
- &File->FvAttributes, \r
+ &File->FvType,\r
+ &File->FvNameGuid,\r
+ &File->FvAttributes,\r
&File->Size\r
);\r
if (!EFI_ERROR (GetNextFileStatus)) {\r
\r
\r
/**\r
-Open a device named by PathName. The PathName includes a device name and \r
+Open a device named by PathName. The PathName includes a device name and\r
path separated by a :. See file header for more details on the PathName\r
syntax. There is no checking to prevent a file from being opened more than\r
-one type. \r
+one type.\r
\r
SectionType is only used to open an FV. Each file in an FV contains multiple\r
sections and only the SectionType section is opened.\r
\r
For any file that is opened with EfiOpen() must be closed with EfiClose().\r
\r
-@param PathName Path to parse to open \r
+@param PathName Path to parse to open\r
@param OpenMode Same as EFI_FILE.Open()\r
@param SectionType Section in FV to open.\r
\r
}\r
\r
if ((PathName[0] == '/') || (PathName[0] == '\\')) {\r
- // PathName starts in / so this means we go to the root of the device in the CWD. \r
+ // PathName starts in / so this means we go to the root of the device in the CWD.\r
CwdPlusPathName[0] = '\0';\r
for (FileStart = 0; gCwd[FileStart] != '\0'; FileStart++) {\r
CwdPlusPathName[FileStart] = gCwd[FileStart];\r
return File;\r
}\r
\r
- DevNumber = EblConvertDevStringToNumber ((CHAR8 *)PathName); \r
+ DevNumber = EblConvertDevStringToNumber ((CHAR8 *)PathName);\r
}\r
\r
File->DeviceName = AllocatePool (StrLen);\r
if (File->FileName[0] == '\0') {\r
// if it is just a file name use / as root\r
File->FileName = "\\";\r
- } \r
+ }\r
\r
//\r
// Use best match algorithm on the dev names so we only need to look at the\r
- // first few charters to match the full device name. Short name forms are \r
+ // first few charters to match the full device name. Short name forms are\r
// legal from the caller.\r
//\r
Status = EFI_SUCCESS;\r
File->EfiHandle = mFs[DevNumber];\r
Status = EblFileDevicePath (File, &PathName[FileStart], OpenMode);\r
\r
- } else if (PathName[1] == 'v' || PathName[1] == 'V') { \r
+ } else if (PathName[1] == 'v' || PathName[1] == 'V') {\r
if (DevNumber >= mFvCount) {\r
goto ErrorExit;\r
}\r
for (Index = FileStart; PathName[Index] != '\0'; Index++) {\r
if (PathName[Index] == ':') {\r
// Support fv0:\DxeCore:0x10\r
- // This means open the PE32 Section of the file \r
+ // This means open the PE32 Section of the file\r
ModifiedSectionType = (EFI_SECTION_TYPE)AsciiStrHexToUintn (&PathName[Index + 1]);\r
PathName[Index] = '\0';\r
}\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Write file error %r\n", Status);\r
goto Exit;\r
- } \r
+ }\r
}\r
\r
// Any left over?\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("Write file error\n");\r
goto Exit;\r
- } \r
+ }\r
}\r
\r
Exit:\r
DevStr = "loadfile%d:";\r
break;\r
case EfiOpenFirmwareVolume:\r
- DevStr = "fv%d:"; \r
+ DevStr = "fv%d:";\r
break;\r
case EfiOpenFileSystem:\r
- DevStr = "fs%d:"; \r
+ DevStr = "fs%d:";\r
break;\r
case EfiOpenBlockIo:\r
- DevStr = "blk%d:"; \r
+ DevStr = "blk%d:";\r
break;\r
case EfiOpenMemoryBuffer:\r
- DevStr = "a%d:"; \r
+ DevStr = "a%d:";\r
break;\r
default:\r
return NULL;\r
\r
TftpBufferSize = File->Size;\r
Status = EblMtftp (\r
- EFI_PXE_BASE_CODE_TFTP_WRITE_FILE, \r
- File->Buffer, \r
- TRUE, \r
- &TftpBufferSize, \r
- NULL, \r
- &File->ServerIp, \r
- (UINT8 *)File->FileName, \r
- NULL, \r
+ EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r
+ File->Buffer,\r
+ TRUE,\r
+ &TftpBufferSize,\r
+ NULL,\r
+ &File->ServerIp,\r
+ (UINT8 *)File->FileName,\r
+ NULL,\r
FALSE\r
);\r
if (EFI_ERROR(Status)) {\r
}\r
}\r
\r
- if ((File->Type == EfiOpenLoadFile) || \r
+ if ((File->Type == EfiOpenLoadFile) ||\r
((File->Type == EfiOpenTftp) && (File->IsBufferValid == TRUE)) ||\r
((File->Type == EfiOpenFirmwareVolume) && (File->IsBufferValid == TRUE))) {\r
EblFreePool(File->Buffer);\r
\r
\r
/**\r
-Return the size of the file represented by Stream. Also return the current \r
+Return the size of the file represented by Stream. Also return the current\r
Seek position. Opening a file will enable a valid file size to be returned.\r
-LoadFile is an exception as a load file size is set to zero. \r
+LoadFile is an exception as a load file size is set to zero.\r
\r
@param Stream Open File Handle\r
\r
\r
/**\r
Seek to the Offset location in the file. LoadFile and FV device types do\r
-not support EfiSeek(). It is not possible to grow the file size using \r
+not support EfiSeek(). It is not possible to grow the file size using\r
EfiSeek().\r
\r
SeekType defines how use Offset to calculate the new file position:\r
EfiSeekEnd : Only supported if Offset is zero to seek to end of file.\r
\r
@param Stream Open File Handle\r
-@param Offset Offset to seek too. \r
+@param Offset Offset to seek too.\r
@param SeekType Type of seek to perform\r
\r
\r
TftpBufferSize = File->Size;\r
\r
Status = EblMtftp (\r
- EFI_PXE_BASE_CODE_TFTP_READ_FILE, \r
- File->Buffer, \r
- FALSE, \r
- &TftpBufferSize, \r
- NULL, \r
- &File->ServerIp, \r
- (UINT8 *)File->FileName, \r
- NULL, \r
+ EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r
+ File->Buffer,\r
+ FALSE,\r
+ &TftpBufferSize,\r
+ NULL,\r
+ &File->ServerIp,\r
+ (UINT8 *)File->FileName,\r
+ NULL,\r
FALSE);\r
if (EFI_ERROR(Status)) {\r
AsciiPrint("TFTP error during APPLE_NSP_TFTP_READ_FILE: %r\n", Status);\r
\r
/**\r
Read BufferSize bytes from the current location in the file. For load file,\r
-FV, and TFTP case you must read the entire file. \r
+FV, and TFTP case you must read the entire file.\r
\r
@param Stream Open File Handle\r
-@param Buffer Caller allocated buffer. \r
+@param Buffer Caller allocated buffer.\r
@param BufferSize Size of buffer in bytes.\r
\r
\r
\r
case EfiOpenFirmwareVolume:\r
if (CompareGuid (&File->FvNameGuid, &gZeroGuid)) {\r
- // This is the entire FV device, so treat like a memory buffer \r
+ // This is the entire FV device, so treat like a memory buffer\r
CopyMem (Buffer, (VOID *)(UINTN)(File->FvStart + File->CurrentPosition), *BufferSize);\r
File->CurrentPosition += *BufferSize;\r
Status = EFI_SUCCESS;\r
\r
/**\r
Read the entire file into a buffer. This routine allocates the buffer and\r
-returns it to the user full of the read data. \r
+returns it to the user full of the read data.\r
\r
This is very useful for load file where it's hard to know how big the buffer\r
must be.\r
\r
@param Stream Open File Handle\r
-@param Buffer Pointer to buffer to return. \r
+@param Buffer Pointer to buffer to return.\r
@param BufferSize Pointer to Size of buffer return..\r
\r
\r
\r
\r
/**\r
-Write data back to the file. For TFTP case you must write the entire file. \r
+Write data back to the file. For TFTP case you must write the entire file.\r
\r
@param Stream Open File Handle\r
-@param Buffer Pointer to buffer to return. \r
+@param Buffer Pointer to buffer to return.\r
@param BufferSize Pointer to Size of buffer return..\r
\r
\r
{\r
EFI_STATUS Status;\r
EFI_FV_WRITE_FILE_DATA FileData;\r
- EFI_DISK_IO_PROTOCOL *DiskIo; \r
+ EFI_DISK_IO_PROTOCOL *DiskIo;\r
\r
if (!FileHandleValid (File)) {\r
return EFI_INVALID_PARAMETER;\r
\r
\r
/**\r
-Given Cwd expand Path to remove .. and replace them with real \r
+Given Cwd expand Path to remove .. and replace them with real\r
directory names.\r
\r
@param Cwd Current Working Directory\r
if (Work == NULL) {\r
// Remaining part of Path contains no more ..\r
break;\r
- } \r
+ }\r
\r
- // append path prior to .. \r
+ // append path prior to ..\r
AsciiStrnCat (NewPath, Start, Work - Start);\r
StrLen = AsciiStrLen (NewPath);\r
for (i = StrLen; i >= 0; i--) {\r
}\r
\r
Start = Work + 3;\r
- } \r
+ }\r
\r
// Handle the path that remains after the ..\r
AsciiStrnCat (NewPath, Start, End - Start);\r
EFI_STATUS\r
EfiSetCwd (\r
IN CHAR8 *Cwd\r
- ) \r
+ )\r
{\r
EFI_OPEN_FILE *File;\r
UINTN Len;\r
Path = Cwd;\r
if (AsciiStrStr (Cwd, "..") != NULL) {\r
if (gCwd == NULL) {\r
- // no parent \r
+ // no parent\r
return EFI_SUCCESS;\r
}\r
\r
Set the Current Working Directory (CWD). If a call is made to EfiOpen () and\r
the path does not contain a device name, The CWD is prepended to the path.\r
The CWD buffer is only valid until a new call is made to EfiSetCwd(). After\r
-a call to EfiSetCwd() it is not legal to use the pointer returned by \r
+a call to EfiSetCwd() it is not legal to use the pointer returned by\r
this function.\r
\r
-@param Cwd Current Working Directory \r
+@param Cwd Current Working Directory\r
\r
\r
@return "" No CWD set\r
FILE_GUID = d8c640db-73ba-48f5-a7ed-8e93c6012491\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EfiFileLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EfiFileLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
DevicePathLib\r
PrintLib\r
BaseMemoryLib\r
- UefiLib \r
+ UefiLib\r
UefiBootServicesTableLib\r
UefiRuntimeServicesTableLib\r
DebugLib\r
EblNetworkLib\r
- \r
+\r
[Protocols]\r
gEfiBlockIoProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiDiskIoProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiLoadFileProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
- \r
+\r
[Guids]\r
gEfiFileInfoGuid\r
gEfiFileSystemInfoGuid\r
#/* @file\r
# Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#*/\r
\r
-#------------------------------------------------------------------------------ \r
+#------------------------------------------------------------------------------\r
#\r
# Use ARMv6 instruction to operate on a single stack\r
#\r
This is the stack constructed by the exception handler (low address to high address)\r
# R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM\r
Reg Offset\r
- === ====== \r
+ === ======\r
R0 0x00 # stmfd SP!,{R0-R12}\r
R1 0x04\r
R2 0x08\r
DFAR 0x48\r
IFSR 0x4c\r
IFAR 0x50\r
- \r
+\r
LR 0x54 # SVC Link register (we need to restore it)\r
- \r
- LR 0x58 # pushed by srsfd \r
- CPSR 0x5c \r
+\r
+ LR 0x58 # pushed by srsfd\r
+ CPSR 0x5c\r
\r
*/\r
- \r
+\r
\r
GCC_ASM_EXPORT(ExceptionHandlersStart)\r
GCC_ASM_EXPORT(ExceptionHandlersEnd)\r
ASM_PFX(ExceptionHandlersEnd):\r
\r
//\r
-// This code runs from CpuDxe driver loaded address. It is patched into \r
+// This code runs from CpuDxe driver loaded address. It is patched into\r
// CommonExceptionEntry.\r
//\r
ASM_PFX(AsmCommonExceptionEntry):\r
mrc p15, 0, R1, c6, c0, 2 @ Read IFAR\r
- str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 @ Read IFSR\r
str R1, [SP, #0x4c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 @ Read DFAR\r
str R1, [SP, #0x48] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 @ Read DFSR\r
str R1, [SP, #0x44] @ Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] @ srsdb saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] @ Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
\r
add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R3, R1, #0x1f @ Check CPSR to see if User or System Mode\r
cmp R3, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1df))\r
- cmpne R3, #0x10 @ \r
+ cmpne R3, #0x10 @\r
stmeqed R2, {lr}^ @ save unbanked lr\r
- @ else \r
+ @ else\r
stmneed R2, {lr} @ save SVC lr\r
\r
\r
- ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd \r
+ ldr R5, [SP, #0x58] @ PC is the LR pushed by srsfd\r
@ Check to see if we have to adjust for Thumb entry\r
sub r4, r0, #1 @ if (ExceptionType == 1 || ExceptionType ==2)) {\r
- cmp r4, #1 @ // UND & SVC have differnt LR adjust for Thumb \r
+ cmp r4, #1 @ // UND & SVC have differnt LR adjust for Thumb\r
bhi NoAdjustNeeded\r
- \r
- tst r1, #0x20 @ if ((CPSR & T)) == T) { // Thumb Mode on entry \r
+\r
+ tst r1, #0x20 @ if ((CPSR & T)) == T) { // Thumb Mode on entry\r
addne R5, R5, #2 @ PC += 2@\r
- str R5,[SP,#0x58] @ Update LR value pused by srsfd \r
- \r
+ str R5,[SP,#0x58] @ Update LR value pused by srsfd\r
+\r
NoAdjustNeeded:\r
\r
str R5, [SP, #0x3c] @ Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
- sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack \r
+\r
+ sub R1, SP, #0x60 @ We pused 0x60 bytes on the stack\r
str R1, [SP, #0x34] @ Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- @ R0 is ExceptionType \r
- mov R1,SP @ R1 is SystemContext \r
\r
-/* \r
+ @ R0 is ExceptionType\r
+ mov R1,SP @ R1 is SystemContext\r
+\r
+/*\r
VOID\r
EFIAPI\r
GdbExceptionHandler (\r
IN OUT EFI_SYSTEM_CONTEXT SystemContext R1\r
)\r
\r
-*/ \r
+*/\r
blx ASM_PFX(GdbExceptionHandler) @ Call exception handler\r
- \r
+\r
ldr R1,[SP,#0x3c] @ EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R1,[SP,#0x58] @ Store it back to srsfd stack slot so it can be restored \r
+ str R1,[SP,#0x58] @ Store it back to srsfd stack slot so it can be restored\r
\r
ldr R1,[SP,#0x40] @ EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R1,[SP,#0x5c] @ Store it back to srsfd stack slot so it can be restored \r
- \r
+ str R1,[SP,#0x5c] @ Store it back to srsfd stack slot so it can be restored\r
+\r
add R3, SP, #0x54 @ Make R3 point to SVC LR saved on entry\r
add R2, SP, #0x38 @ Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R1, R1, #0x1f @ Check to see if User or System Mode\r
cmp R1, #0x1f @ if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R1, #0x10 @ \r
+ cmpne R1, #0x10 @\r
ldmeqed R2, {lr}^ @ restore unbanked lr\r
@ else\r
ldmneed R3, {lr} @ restore SVC lr, via ldmfd SP!, {LR}\r
- \r
+\r
ldmfd SP!,{R0-R12} @ Restore general purpose registers\r
@ Exception handler can not change SP\r
- \r
+\r
add SP,SP,#0x20 @ Clear out the remaining stack space\r
ldmfd SP!,{LR} @ restore the link register for this context\r
rfefd SP! @ return from exception via srsfd stack slot\r
- \r
+\r
-//------------------------------------------------------------------------------ \r
+//------------------------------------------------------------------------------\r
//\r
// Use ARMv6 instruction to operate on a single stack\r
//\r
This is the stack constructed by the exception handler (low address to high address)\r
# R0 - IFAR is EFI_SYSTEM_CONTEXT for ARM\r
Reg Offset\r
- === ====== \r
+ === ======\r
R0 0x00 # stmfd SP!,{R0-R12}\r
R1 0x04\r
R2 0x08\r
DFAR 0x48\r
IFSR 0x4c\r
IFAR 0x50\r
- \r
+\r
LR 0x54 # SVC Link register (we need to restore it)\r
- \r
- LR 0x58 # pushed by srsfd \r
- CPSR 0x5c \r
+\r
+ LR 0x58 # pushed by srsfd\r
+ CPSR 0x5c\r
\r
*/\r
- \r
- \r
+\r
+\r
EXPORT ExceptionHandlersStart\r
EXPORT ExceptionHandlersEnd\r
EXPORT CommonExceptionEntry\r
\r
PRESERVE8\r
AREA DxeExceptionHandlers, CODE, READONLY\r
- \r
+\r
//\r
// This code gets copied to the ARM vector table\r
// ExceptionHandlersStart - ExceptionHandlersEnd gets copied\r
stmfd SP!,{R0-R12} ; Store the register state\r
\r
mov R0,#1 ; ExceptionType\r
- ldr R1,CommonExceptionEntry; \r
+ ldr R1,CommonExceptionEntry;\r
bx R1\r
\r
SoftwareInterruptEntry\r
ExceptionHandlersEnd\r
\r
//\r
-// This code runs from CpuDxe driver loaded address. It is patched into \r
+// This code runs from CpuDxe driver loaded address. It is patched into\r
// CommonExceptionEntry.\r
//\r
AsmCommonExceptionEntry\r
mrc p15, 0, R1, c6, c0, 2 ; Read IFAR\r
- str R1, [SP, #0x50] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR \r
- \r
+ str R1, [SP, #0x50] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFAR\r
+\r
mrc p15, 0, R1, c5, c0, 1 ; Read IFSR\r
str R1, [SP, #0x4c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.IFSR\r
- \r
+\r
mrc p15, 0, R1, c6, c0, 0 ; Read DFAR\r
str R1, [SP, #0x48] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFAR\r
- \r
+\r
mrc p15, 0, R1, c5, c0, 0 ; Read DFSR\r
str R1, [SP, #0x44] ; Store it in EFI_SYSTEM_CONTEXT_ARM.DFSR\r
- \r
- ldr R1, [SP, #0x5c] ; srsfd saved pre-exception CPSR on the stack \r
+\r
+ ldr R1, [SP, #0x5c] ; srsfd saved pre-exception CPSR on the stack\r
str R1, [SP, #0x40] ; Store it in EFI_SYSTEM_CONTEXT_ARM.CPSR\r
\r
add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R3, R1, #0x1f ; Check CPSR to see if User or System Mode\r
cmp R3, #0x1f ; if ((CPSR == 0x10) || (CPSR == 0x1df))\r
- cmpne R3, #0x10 ; \r
+ cmpne R3, #0x10 ;\r
stmeqed R2, {lr}^ ; save unbanked lr\r
- ; else \r
+ ; else\r
stmneed R2, {lr} ; save SVC lr\r
\r
\r
- ldr R5, [SP, #0x58] ; PC is the LR pushed by srsfd \r
+ ldr R5, [SP, #0x58] ; PC is the LR pushed by srsfd\r
; Check to see if we have to adjust for Thumb entry\r
sub r4, r0, #1 ; if (ExceptionType == 1 || ExceptionType ==2)) {\r
- cmp r4, #1 ; // UND & SVC have differnt LR adjust for Thumb \r
+ cmp r4, #1 ; // UND & SVC have differnt LR adjust for Thumb\r
bhi NoAdjustNeeded\r
- \r
- tst r1, #0x20 ; if ((CPSR & T)) == T) { // Thumb Mode on entry \r
+\r
+ tst r1, #0x20 ; if ((CPSR & T)) == T) { // Thumb Mode on entry\r
addne R5, R5, #2 ; PC += 2;\r
- str R5,[SP,#0x58] ; Update LR value pused by srsfd \r
- \r
+ str R5,[SP,#0x58] ; Update LR value pused by srsfd\r
+\r
NoAdjustNeeded\r
\r
str R5, [SP, #0x3c] ; Store it in EFI_SYSTEM_CONTEXT_ARM.PC\r
- \r
- sub R1, SP, #0x60 ; We pused 0x60 bytes on the stack \r
+\r
+ sub R1, SP, #0x60 ; We pused 0x60 bytes on the stack\r
str R1, [SP, #0x34] ; Store it in EFI_SYSTEM_CONTEXT_ARM.SP\r
- \r
- ; R0 is ExceptionType \r
- mov R1,SP ; R1 is SystemContext \r
\r
-/* \r
+ ; R0 is ExceptionType\r
+ mov R1,SP ; R1 is SystemContext\r
+\r
+/*\r
VOID\r
EFIAPI\r
GdbExceptionHandler (\r
\r
*/\r
blx GdbExceptionHandler ; Call exception handler\r
- \r
+\r
ldr R1,[SP,#0x3c] ; EFI_SYSTEM_CONTEXT_ARM.PC\r
- str R1,[SP,#0x58] ; Store it back to srsfd stack slot so it can be restored \r
+ str R1,[SP,#0x58] ; Store it back to srsfd stack slot so it can be restored\r
\r
ldr R1,[SP,#0x40] ; EFI_SYSTEM_CONTEXT_ARM.CPSR\r
- str R1,[SP,#0x5c] ; Store it back to srsfd stack slot so it can be restored \r
- \r
+ str R1,[SP,#0x5c] ; Store it back to srsfd stack slot so it can be restored\r
+\r
add R3, SP, #0x54 ; Make R3 point to SVC LR saved on entry\r
add R2, SP, #0x38 ; Make R2 point to EFI_SYSTEM_CONTEXT_ARM.LR\r
and R1, R1, #0x1f ; Check to see if User or System Mode\r
cmp R1, #0x1f ; if ((CPSR == 0x10) || (CPSR == 0x1f))\r
- cmpne R1, #0x10 ; \r
+ cmpne R1, #0x10 ;\r
ldmeqed R2, {lr}^ ; restore unbanked lr\r
; else\r
ldmneed R3, {lr} ; restore SVC lr, via ldmfd SP!, {LR}\r
- \r
+\r
ldmfd SP!,{R0-R12} ; Restore general purpose registers\r
; Exception handler can not change SP\r
- \r
+\r
add SP,SP,#0x20 ; Clear out the remaining stack space\r
ldmfd SP!,{LR} ; restore the link register for this context\r
rfefd SP! ; return from exception via srsfd stack slot\r
- \r
+\r
END\r
\r
\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
{ EXCEPT_ARM_SOFTWARE_INTERRUPT, GDB_SIGTRAP },\r
- { EXCEPT_ARM_UNDEFINED_INSTRUCTION, GDB_SIGTRAP }, \r
- { EXCEPT_ARM_PREFETCH_ABORT, GDB_SIGTRAP }, \r
+ { EXCEPT_ARM_UNDEFINED_INSTRUCTION, GDB_SIGTRAP },\r
+ { EXCEPT_ARM_PREFETCH_ABORT, GDB_SIGTRAP },\r
{ EXCEPT_ARM_DATA_ABORT, GDB_SIGTRAP }, // GDB_SIGEMT\r
{ EXCEPT_ARM_RESERVED, GDB_SIGTRAP }, // GDB_SIGILL\r
{ EXCEPT_ARM_FIQ, GDB_SIGINT } // Used for ctrl-c\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
\r
- @retval TRUE if Isa is supported \r
+ @retval TRUE if Isa is supported\r
\r
**/\r
BOOLEAN\r
/**\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the ARM member\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
- **/ \r
+ **/\r
UINTN *\r
FindPointerToRegister(\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
{\r
UINTN RegSize;\r
CHAR8 Char;\r
- \r
+\r
if (gRegisterOffsets[RegNumber] > 0xF00) {\r
AsciiSPrint(OutBufPtr, 9, "00000000");\r
OutBufPtr += 8;\r
Char = Char - 'A' + 'a';\r
}\r
*OutBufPtr++ = Char;\r
- \r
+\r
Char = mHexToStr[(UINT8)((*FindPointerToRegister(SystemContext, RegNumber) >> RegSize) & 0xf)];\r
if ((Char >= 'A') && (Char <= 'F')) {\r
Char = Char - 'A' + 'a';\r
}\r
*OutBufPtr++ = Char;\r
- \r
+\r
RegSize = RegSize + 8;\r
}\r
return OutBufPtr;\r
\r
\r
/**\r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
**/\r
UINTN RegNumber;\r
CHAR8 OutBuffer[9]; // 1 reg=8 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
- \r
+\r
if (RegNumber >= (sizeof (gRegisterOffsets)/sizeof (UINTN))) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
- \r
+\r
OutBufPtr = OutBuffer;\r
OutBufPtr = BasicReadRegister (SystemContext, RegNumber, OutBufPtr);\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket(OutBuffer);\r
}\r
\r
\r
/**\r
- Reads the general registers into an output buffer and sends it as a packet \r
+ Reads the general registers into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
// a UINT32 takes 8 ascii characters\r
CHAR8 OutBuffer[(sizeof (gRegisterOffsets) * 2) + 1];\r
CHAR8 *OutBufPtr;\r
- \r
+\r
// It is not safe to allocate pool here....\r
OutBufPtr = OutBuffer;\r
for (Index = 0; Index < (sizeof (gRegisterOffsets)/sizeof (UINTN)); Index++) {\r
OutBufPtr = BasicReadRegister (SystemContext, Index, OutBufPtr);\r
}\r
- \r
+\r
*OutBufPtr = '\0';\r
SendPacket(OutBuffer);\r
}\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT32 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
if (gRegisterOffsets[RegNumber] > 0xF00) {\r
return InBufPtr + 8;\r
}\r
RegSize = 0;\r
while (RegSize < 32) {\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if ((INTN)TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
+\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if ((INTN)TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister(SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
- \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
+\r
// check if this is a valid Register Number\r
if (RegNumber >= (sizeof (gRegisterOffsets)/sizeof (UINTN))) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
UINTN RegisterCount = (sizeof (gRegisterOffsets)/sizeof (UINTN));\r
\r
MinLength = (RegisterCount * 8) + 1; // 'G' plus the registers in ASCII format\r
- \r
+\r
if (AsciiStrLen(InBuffer) < MinLength) {\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
- \r
+\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for(i = 0; i < RegisterCount; i++) {\r
InBufPtr = BasicWriteRegister (SystemContext, i, InBufPtr);\r
}\r
- \r
+\r
SendSuccess ();\r
}\r
\r
\r
\r
/**\r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextArm->PC = AsciiStrHexToUintn(&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
\r
\r
/**\r
- Send the T signal with the given exception type (in gdb order) and possibly \r
+ Send the T signal with the given exception type (in gdb order) and possibly\r
with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
\r
/**\r
FIQ state is only changed by FIQ exception. We don't want to take FIQ\r
- ticks in the GDB stub. The stub disables FIQ on entry, but this is the \r
+ ticks in the GDB stub. The stub disables FIQ on entry, but this is the\r
third instruction that executes in the execption handler. Thus we have\r
a crack we need to test for.\r
\r
@param PC PC of execption\r
\r
- @return TRUE We are in the GDB stub exception preamble \r
+ @return TRUE We are in the GDB stub exception preamble\r
@return FALSE We are not in GDB stub code\r
**/\r
BOOLEAN\r
/**\r
Check to see if this exception is related to ctrl-c handling.\r
\r
- In this scheme we dedicate FIQ to the ctrl-c handler so it is \r
- independent of the rest of the system. \r
- \r
- SaveAndSetDebugTimerInterrupt () can be used to \r
+ In this scheme we dedicate FIQ to the ctrl-c handler so it is\r
+ independent of the rest of the system.\r
+\r
+ SaveAndSetDebugTimerInterrupt () can be used to\r
\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
\r
@return TRUE This was a ctrl-c check that did not find a ctrl-c\r
@return FALSE This was not a ctrl-c check or some one hit ctrl-c\r
**/\r
BOOLEAN\r
-ProcessorControlC ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ProcessorControlC (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
CHAR8 Char;\r
Return = TRUE;\r
break;\r
}\r
- \r
+\r
Char = GdbGetChar ();\r
if (Char == 0x03) {\r
//\r
IN VOID *Context, OPTIONAL\r
IN DEBUG_AGENT_CONTINUE Function OPTIONAL\r
)\r
-{ \r
+{\r
UINTN Offset;\r
UINTN Length;\r
BOOLEAN IrqEnabled;\r
VectorBase = (UINT32 *)(UINTN)PcdGet32 (PcdCpuVectorBaseAddress);\r
\r
\r
- // Copy our assembly code into the page that contains the exception vectors. \r
+ // Copy our assembly code into the page that contains the exception vectors.\r
CopyMem ((VOID *)VectorBase, (VOID *)ExceptionHandlersStart, Length);\r
\r
//\r
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexToStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};\r
\r
\r
-// add-symbol-file c:/work/edk2/Build/BeagleBoard/DEBUG_ARMGCC/ARM/BeagleBoardPkg/Sec/Sec/DEBUG/BeagleBoardSec.dll 0x80008360 \r
+// add-symbol-file c:/work/edk2/Build/BeagleBoard/DEBUG_ARMGCC/ARM/BeagleBoardPkg/Sec/Sec/DEBUG/BeagleBoardSec.dll 0x80008360\r
CHAR8 *qXferHack = "<library name=\"c:/work/edk2/Build/BeagleBoard/DEBUG_ARMGCC/ARM/BeagleBoardPkg/Sec/Sec/DEBUG/BeagleBoardSec.dll\"><segment address=\"0x80008360\"/></library>";\r
\r
UINTN\r
*OutBufPtr++ = Type;\r
Count = 1;\r
\r
- // Binary data encoding \r
+ // Binary data encoding\r
OutBufPtr = gOutBuffer;\r
while (*Str != '\0') {\r
Char = *Str++;\r
\r
*OutBufPtr = '\0' ; // the end of the buffer\r
SendPacket (gOutBuffer);\r
- \r
+\r
return Count;\r
}\r
\r
-/** \r
+/**\r
Process "qXfer:object:read:annex:offset,length" request.\r
- \r
- Returns an XML document that contains loaded libraries. In our case it is \r
+\r
+ Returns an XML document that contains loaded libraries. In our case it is\r
infomration in the EFI Debug Inmage Table converted into an XML document.\r
- \r
- GDB will call with an arbitrary length (it can't know the real length and \r
- will reply with chunks of XML that are easy for us to deal with. Gdb will \r
+\r
+ GDB will call with an arbitrary length (it can't know the real length and\r
+ will reply with chunks of XML that are easy for us to deal with. Gdb will\r
keep calling until we say we are done. XML doc looks like:\r
- \r
+\r
<library-list>\r
<library name="/a/a/c/d.dSYM"><segment address="0x10000000"/></library>\r
<library name="/a/m/e/e.pdb"><segment address="0x20000000"/></library>\r
<library name="/a/l/f/f.dll"><segment address="0x30000000"/></library>\r
</library-list>\r
- \r
- Since we can not allocate memory in interupt context this module has \r
+\r
+ Since we can not allocate memory in interupt context this module has\r
assumptions about how it will get called:\r
1) Length will generally be max remote packet size (big enough)\r
2) First Offset of an XML document read needs to be 0\r
3) This code will return back small chunks of the XML document on every read.\r
Each subseqent call will ask for the next availble part of the document.\r
- \r
+\r
Note: The only variable size element in the XML is:\r
- " <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is \r
+ " <library name=\"%s\"><segment address=\"%p\"/></library>\n" and it is\r
based on the file path and name of the symbol file. If the symbol file name\r
is bigger than the max gdb remote packet size we could update this code\r
to respond back in chunks.\r
\r
@param Offset offset into special data area\r
- @param Length number of bytes to read starting at Offset \r
- \r
+ @param Length number of bytes to read starting at Offset\r
+\r
**/\r
VOID\r
QxferLibrary (\r
{\r
CHAR8 c1;\r
CHAR8 c2;\r
- \r
+\r
while (Length-- > 0) {\r
c1 = (CHAR8)HexCharToInt (*NewData++);\r
c2 = (CHAR8)HexCharToInt (*NewData++);\r
\r
if ((c1 < 0) || (c2 < 0)) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return;\r
}\r
*Address++ = (UINT8)((c1 << 4) + c2);\r
\r
OutBufPtr = OutBuffer;\r
while (Length > 0) {\r
- \r
+\r
Char = mHexToStr[*Address >> 4];\r
if ((Char >= 'A') && (Char <= 'F')) {\r
Char = Char - 'A' + 'a';\r
\r
/**\r
Send a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
- If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up \r
+\r
+ If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up\r
in an infinit loop. This is so if you unplug the debugger code just keeps running\r
\r
- @param PacketData Payload data for the packet \r
+ @param PacketData Payload data for the packet\r
+\r
\r
- \r
@retval Number of bytes of packet data sent.\r
\r
**/\r
CHAR8 *Ptr;\r
CHAR8 TestChar;\r
UINTN Count;\r
- \r
+\r
Timeout = PcdGet32 (PcdGdbMaxPacketRetryCount);\r
\r
Count = 0;\r
// Only try a finite number of times so we don't get stuck in the loop\r
return Count;\r
}\r
- \r
+\r
// Packet prefix\r
GdbPutChar ('$');\r
- \r
+\r
for (CheckSum = 0, Count =0 ; *Ptr != '\0'; Ptr++, Count++) {\r
GdbPutChar (*Ptr);\r
CheckSum = CheckSum + *Ptr;\r
}\r
- \r
- // Packet terminating character and checksum \r
+\r
+ // Packet terminating character and checksum\r
GdbPutChar ('#');\r
GdbPutChar (mHexToStr[CheckSum >> 4]);\r
GdbPutChar (mHexToStr[CheckSum & 0x0F]);\r
- \r
+\r
TestChar = GdbGetChar ();\r
} while (TestChar != '+');\r
- \r
+\r
return Count;\r
}\r
\r
/**\r
Receive a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
+\r
If host re-starts sending a packet without ending the previous packet, only the last valid packet is proccessed.\r
(In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)\r
- \r
+\r
If an ack '+' is not sent resend the packet\r
\r
- @param PacketData Payload data for the packet \r
+ @param PacketData Payload data for the packet\r
\r
@retval Number of bytes of packet data received.\r
\r
CHAR8 Char;\r
CHAR8 SumString[3];\r
CHAR8 TestChar;\r
- \r
+\r
ZeroMem (PacketData, PacketDataSize);\r
- \r
+\r
for (;;) {\r
// wait for the start of a packet\r
TestChar = GdbGetChar ();\r
while (TestChar != '$') {\r
TestChar = GdbGetChar ();\r
};\r
- \r
+\r
retry:\r
for (Index = 0, CheckSum = 0; Index < (PacketDataSize - 1); Index++) {\r
Char = GdbGetChar ();\r
continue;\r
}\r
\r
- SumString[0] = GdbGetChar (); \r
+ SumString[0] = GdbGetChar ();\r
SumString[1] = GdbGetChar ();\r
SumString[2] = '\0';\r
- \r
+\r
if (AsciiStrHexToUintn (SumString) == CheckSum) {\r
// Ack: Success\r
GdbPutChar ('+');\r
- \r
+\r
// Null terminate the callers string\r
PacketData[Index] = '\0';\r
return Index;\r
GdbPutChar ('-');\r
}\r
}\r
- \r
+\r
//return 0;\r
}\r
\r
\r
/**\r
- Empties the given buffer \r
+ Empties the given buffer\r
@param Buf pointer to the first element in buffer to be emptied\r
**/\r
VOID\r
-EmptyBuffer ( \r
+EmptyBuffer (\r
IN CHAR8 *Buf\r
)\r
-{ \r
+{\r
*Buf = '\0';\r
}\r
\r
\r
/**\r
Converts an 8-bit Hex Char into a INTN.\r
- \r
+\r
@param Char the hex character to be converted into UINTN\r
@retval a INTN, from 0 to 15, that corressponds to Char\r
-1 if Char is not a hex character\r
} else if ((Char >= '0') && (Char <= '9')) {\r
return Char - '0';\r
} else { // if not a hex value, return a negative value\r
- return -1; \r
+ return -1;\r
}\r
}\r
\r
Send an error with the given error number after converting to hex.\r
The error number is put into the buffer in hex. '255' is the biggest errno we can send.\r
ex: 162 will be sent as A2.\r
- \r
+\r
@param errno the error number that will be sent\r
**/\r
VOID\r
//\r
gError[1] = mHexToStr [ErrorNum >> 4];\r
gError[2] = mHexToStr [ErrorNum & 0x0f];\r
- \r
+\r
SendPacket (gError); // send buffer\r
}\r
\r
EFIAPI\r
SendSuccess (\r
VOID\r
- ) \r
+ )\r
{\r
SendPacket ("OK"); // send buffer\r
}\r
/**\r
Send empty packet to specify that particular command/functionality is not supported.\r
**/\r
-VOID \r
-EFIAPI \r
+VOID\r
+EFIAPI\r
SendNotSupported (\r
- VOID \r
- ) \r
-{ \r
+ VOID\r
+ )\r
+{\r
SendPacket ("");\r
}\r
\r
\r
/**\r
Translates the EFI mapping to GDB mapping\r
- \r
+\r
@param EFIExceptionType EFI Exception that is being processed\r
@retval UINTN that corresponds to EFIExceptionType's GDB exception type number\r
**/\r
UINT8\r
-ConvertEFItoGDBtype ( \r
+ConvertEFItoGDBtype (\r
IN EFI_EXCEPTION_TYPE EFIExceptionType\r
)\r
-{ \r
+{\r
UINTN i;\r
- \r
+\r
for (i=0; i < MaxEfiException() ; i++) {\r
if (gExceptionType[i].Exception == EFIExceptionType) {\r
return gExceptionType[i].SignalNo;\r
\r
\r
/** "m addr,length"\r
- Find the Length of the area to read and the start addres. Finally, pass them to \r
- another function, TransferFromMemToOutBufAndSend, that will read from that memory space and \r
+ Find the Length of the area to read and the start addres. Finally, pass them to\r
+ another function, TransferFromMemToOutBufAndSend, that will read from that memory space and\r
send it as a packet.\r
**/\r
\r
CHAR8 AddressBuffer[MAX_ADDR_SIZE]; // the buffer that will hold the address in hex chars\r
CHAR8 *AddrBufPtr; // pointer to the address buffer\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
+\r
AddrBufPtr = AddressBuffer;\r
InBufPtr = &PacketData[1];\r
while (*InBufPtr != ',') {\r
*AddrBufPtr++ = *InBufPtr++;\r
}\r
*AddrBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ',' in the buffer\r
- \r
+\r
/* Error checking */\r
if (AsciiStrLen(AddressBuffer) >= MAX_ADDR_SIZE) {\r
- SendError (GDB_EBADMEMADDRBUFSIZE); \r
+ SendError (GDB_EBADMEMADDRBUFSIZE);\r
return;\r
}\r
- \r
+\r
// 2 = 'm' + ','\r
if (AsciiStrLen(PacketData) - AsciiStrLen(AddressBuffer) - 2 >= MAX_LENGTH_SIZE) {\r
- SendError (GDB_EBADMEMLENGTH); \r
+ SendError (GDB_EBADMEMLENGTH);\r
return;\r
}\r
- \r
+\r
Address = AsciiStrHexToUintn (AddressBuffer);\r
Length = AsciiStrHexToUintn (InBufPtr);\r
- \r
+\r
TransferFromMemToOutBufAndSend (Length, (unsigned char *)Address);\r
}\r
\r
\r
/** "M addr,length :XX..."\r
- Find the Length of the area in bytes to write and the start addres. Finally, pass them to \r
+ Find the Length of the area in bytes to write and the start addres. Finally, pass them to\r
another function, TransferFromInBufToMem, that will write to that memory space the info in\r
the input buffer.\r
**/\r
CHAR8 *AddrBufPtr; // pointer to the Address buffer\r
CHAR8 *LengthBufPtr; // pointer to the Length buffer\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
+\r
AddrBufPtr = AddressBuffer;\r
LengthBufPtr = LengthBuffer;\r
InBufPtr = &PacketData[1];\r
- \r
+\r
while (*InBufPtr != ',') {\r
*AddrBufPtr++ = *InBufPtr++;\r
}\r
*AddrBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ',' in the buffer\r
- \r
+\r
while (*InBufPtr != ':') {\r
*LengthBufPtr++ = *InBufPtr++;\r
}\r
*LengthBufPtr = '\0';\r
- \r
+\r
InBufPtr++; // this skips ':' in the buffer\r
- \r
+\r
Address = AsciiStrHexToUintn (AddressBuffer);\r
Length = AsciiStrHexToUintn (LengthBuffer);\r
- \r
+\r
/* Error checking */\r
- \r
+\r
//Check if Address is not too long.\r
if (AsciiStrLen(AddressBuffer) >= MAX_ADDR_SIZE) {\r
- SendError (GDB_EBADMEMADDRBUFSIZE); \r
+ SendError (GDB_EBADMEMADDRBUFSIZE);\r
return;\r
}\r
- \r
+\r
//Check if message length is not too long\r
if (AsciiStrLen(LengthBuffer) >= MAX_LENGTH_SIZE) {\r
- SendError (GDB_EBADMEMLENGBUFSIZE); \r
+ SendError (GDB_EBADMEMLENGBUFSIZE);\r
return;\r
}\r
- \r
+\r
// Check if Message is not too long/short.\r
// 3 = 'M' + ',' + ':'\r
MessageLength = (AsciiStrLen(PacketData) - AsciiStrLen(AddressBuffer) - AsciiStrLen(LengthBuffer) - 3);\r
if (MessageLength != (2*Length)) {\r
//Message too long/short. New data is not the right size.\r
- SendError (GDB_EBADMEMDATASIZE); \r
+ SendError (GDB_EBADMEMDATASIZE);\r
return;\r
}\r
TransferFromInBufToMem (Length, (unsigned char *)Address, InBufPtr);\r
\r
/**\r
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
//\r
// replace _, or previous value, with Exception type\r
//\r
- *TSignalPtr++ = mHexToStr [GdbExceptionType >> 4]; \r
+ *TSignalPtr++ = mHexToStr [GdbExceptionType >> 4];\r
*TSignalPtr++ = mHexToStr [GdbExceptionType & 0x0f];\r
- \r
+\r
ProcessorSendTSignal (SystemContext, GdbExceptionType, TSignalPtr, sizeof (TSignalBuffer) - 2);\r
\r
- SendPacket (TSignalBuffer); \r
+ SendPacket (TSignalBuffer);\r
}\r
\r
VOID\r
\r
for( ; ; ) {\r
ReceivePacket (gInBuffer, MAX_BUF_SIZE);\r
- \r
+\r
switch (gInBuffer[0]) {\r
case 'm':\r
ReadFromMemory (gInBuffer);\r
/**\r
Exception Hanldler for GDB. It will be called for all exceptions\r
registered via the gExceptionType[] array.\r
- \r
+\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-GdbExceptionHandler ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbExceptionHandler (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
UINT8 GdbExceptionType;\r
CHAR8 *Ptr;\r
- \r
+\r
if (ProcessorControlC (ExceptionType, SystemContext)) {\r
// We tried to process a control C handler and there is nothing to do\r
return;\r
\r
GdbExceptionType = ConvertEFItoGDBtype (ExceptionType);\r
GdbSendTSignal (SystemContext, GdbExceptionType);\r
- \r
+\r
for( ; ; ) {\r
ReceivePacket (gInBuffer, MAX_BUF_SIZE);\r
- \r
+\r
switch (gInBuffer[0]) {\r
case '?':\r
GdbSendTSignal (SystemContext, GdbExceptionType);\r
break;\r
- \r
+\r
case 'c':\r
- ContinueAtAddress (SystemContext, gInBuffer); \r
+ ContinueAtAddress (SystemContext, gInBuffer);\r
return;\r
\r
case 'D':\r
- // gdb wants to disconnect so return "OK" packet since. \r
+ // gdb wants to disconnect so return "OK" packet since.\r
SendSuccess ();\r
return;\r
\r
case 'g':\r
ReadGeneralRegisters (SystemContext);\r
break;\r
- \r
+\r
case 'G':\r
WriteGeneralRegisters (SystemContext, gInBuffer);\r
break;\r
- \r
+\r
case 'H':\r
- //Return "OK" packet since we don't have more than one thread. \r
+ //Return "OK" packet since we don't have more than one thread.\r
SendSuccess ();\r
break;\r
- \r
+\r
case 'm':\r
ReadFromMemory (gInBuffer);\r
break;\r
//\r
// Still debugging this code. Not used in Darwin\r
//\r
- case 'q': \r
+ case 'q':\r
// General Query Packets\r
if (AsciiStrnCmp (gInBuffer, "qSupported", 10) == 0) {\r
// return what we currently support, we don't parse what gdb suports\r
// \91qXfer:libraries:read::offset,length\r
// gInBuffer[22] is offset string, ++Ptr is length string\92\r
for (Ptr = &gInBuffer[22]; *Ptr != ','; Ptr++);\r
- \r
+\r
// Not sure if multi-radix support is required. Currently only support decimal\r
QxferLibrary (AsciiStrHexToUintn (&gInBuffer[22]), AsciiStrHexToUintn (++Ptr));\r
} else if (AsciiStrnCmp (gInBuffer, "qOffsets", 8) == 0) {\r
break;\r
\r
case 's':\r
- SingleStep (SystemContext, gInBuffer); \r
+ SingleStep (SystemContext, gInBuffer);\r
return;\r
- \r
+\r
case 'z':\r
RemoveBreakPoint (SystemContext, gInBuffer);\r
break;\r
- \r
+\r
case 'Z':\r
InsertBreakPoint (SystemContext, gInBuffer);\r
break;\r
- \r
- default: \r
+\r
+ default:\r
//Send empty packet\r
SendNotSupported ();\r
break;\r
extern CONST CHAR8 mHexToStr[];\r
\r
// maximum size of input and output buffers\r
-// This value came from the show remote command of the gdb we tested against \r
+// This value came from the show remote command of the gdb we tested against\r
#define MAX_BUF_SIZE 2000\r
\r
// maximum size of address buffer\r
// GDB Signal definitions - generic names for interrupts\r
//\r
#define GDB_SIGINT 2 // Interrupt process via ctrl-c\r
-#define GDB_SIGILL 4 // Illegal instruction \r
+#define GDB_SIGILL 4 // Illegal instruction\r
#define GDB_SIGTRAP 5 // Trace Trap (Breakpoint and SingleStep)\r
#define GDB_SIGEMT 7 // Emulator Trap\r
#define GDB_SIGFPE 8 // Floating point exception\r
-#define GDB_SIGSEGV 11 // Setgment violation, page fault \r
+#define GDB_SIGSEGV 11 // Setgment violation, page fault\r
\r
\r
//\r
// Includes all general GDB Unix like error values\r
//\r
#define GDB_EBADMEMADDRBUFSIZE 11 // the buffer that stores memory Address to be read from/written to is not the right size\r
-#define GDB_EBADMEMLENGBUFSIZE 12 // the buffer that stores Length is not the right size \r
+#define GDB_EBADMEMLENGBUFSIZE 12 // the buffer that stores Length is not the right size\r
#define GDB_EBADMEMLENGTH 13 // Length, the given number of bytes to read or write, is not the right size\r
-#define GDB_EBADMEMDATA 14 // one of the bytes or nibbles of the memory is leess than 0 \r
+#define GDB_EBADMEMDATA 14 // one of the bytes or nibbles of the memory is leess than 0\r
#define GDB_EBADMEMDATASIZE 15 // the memory data, 'XX..', is too short or too long\r
#define GDB_EBADBUFSIZE 21 // the buffer created is not the correct size\r
#define GDB_EINVALIDARG 31 // argument is invalid\r
//\r
//Define Register size for different architectures\r
//\r
-#if defined (MDE_CPU_IA32) \r
+#if defined (MDE_CPU_IA32)\r
#define REG_SIZE 32\r
#elif defined (MDE_CPU_X64)\r
#define REG_SIZE 64\r
UINT32 B1:1; // Breakpoint condition detected\r
UINT32 B2:1; // Breakpoint condition detected\r
UINT32 B3:1; // Breakpoint condition detected\r
- UINT32 Reserved_1:9; // Reserved \r
+ UINT32 Reserved_1:9; // Reserved\r
UINT32 BD:1; // Debug register access detected\r
UINT32 BS:1; // Single step\r
UINT32 BT:1; // Task switch\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
- \r
+\r
@retval TRUE if Isa is supported,\r
FALSE otherwise.\r
**/\r
\r
/**\r
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
\r
/**\r
Translates the EFI mapping to GDB mapping\r
- \r
+\r
@param EFIExceptionType EFI Exception that is being processed\r
@retval UINTN that corresponds to EFIExceptionType's GDB exception type number\r
**/\r
UINT8\r
-ConvertEFItoGDBtype ( \r
+ConvertEFItoGDBtype (\r
IN EFI_EXCEPTION_TYPE EFIExceptionType\r
);\r
\r
\r
/**\r
- Empties the given buffer \r
+ Empties the given buffer\r
@param *Buf pointer to the first element in buffer to be emptied\r
**/\r
VOID\r
-EmptyBuffer ( \r
+EmptyBuffer (\r
IN CHAR8 *Buf\r
);\r
\r
\r
/**\r
Converts an 8-bit Hex Char into a INTN.\r
- \r
+\r
@param Char - the hex character to be converted into UINTN\r
@retval a INTN, from 0 to 15, that corressponds to Char\r
-1 if Char is not a hex character\r
Send an error with the given error number after converting to hex.\r
The error number is put into the buffer in hex. '255' is the biggest errno we can send.\r
ex: 162 will be sent as A2.\r
- \r
+\r
@param errno the error number that will be sent\r
**/\r
VOID\r
VOID\r
);\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer This is the input buffer received from gdb server\r
**/\r
);\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
\r
/** ‘m addr,length ’\r
- Find the Length of the area to read and the start addres. Finally, pass them to \r
- another function, TransferFromMemToOutBufAndSend, that will read from that memory space and \r
+ Find the Length of the area to read and the start addres. Finally, pass them to\r
+ another function, TransferFromMemToOutBufAndSend, that will read from that memory space and\r
send it as a packet.\r
- \r
+\r
@param *PacketData Pointer to Payload data for the packet\r
**/\r
VOID\r
\r
\r
/** ‘M addr,length :XX...’\r
- Find the Length of the area in bytes to write and the start addres. Finally, pass them to \r
+ Find the Length of the area in bytes to write and the start addres. Finally, pass them to\r
another function, TransferFromInBufToMem, that will write to that memory space the info in\r
the input buffer.\r
- \r
+\r
@param PacketData Pointer to Payload data for the packet\r
**/\r
VOID\r
);\r
\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
@param *PacketData Pointer to PacketData\r
**/\r
\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param PacketData Pointer to Payload data for the packet\r
**/\r
IN CHAR8 *PacketData\r
);\r
\r
-/** \r
+/**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
AddSingleStep (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
- \r
-/** \r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
RemoveSingleStep (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
);\r
- \r
- \r
+\r
+\r
/**\r
‘Z1, [addr], [length]’\r
‘Z2, [addr], [length]’\r
/**\r
Exception Hanldler for GDB. It will be called for all exceptions\r
registered via the gExceptionType[] array.\r
- \r
+\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
- \r
+ @param SystemContext Register content at time of the exception\r
+\r
**/\r
VOID\r
EFIAPI\r
-GdbExceptionHandler ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbExceptionHandler (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
/**\r
- Periodic callback for GDB. This function is used to catch a ctrl-c or other \r
+ Periodic callback for GDB. This function is used to catch a ctrl-c or other\r
break in type command from GDB.\r
- \r
+\r
@param SystemContext Register content at time of the call\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
-GdbPeriodicCallBack ( \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+GdbPeriodicCallBack (\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
/**\r
Make two serail consoles: 1) StdIn and StdOut via GDB. 2) StdErr via GDB.\r
- \r
+\r
These console show up on the remote system running GDB\r
\r
**/\r
\r
/**\r
Send a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
- If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up \r
+\r
+ If an ack '+' is not sent resend the packet, but timeout eventually so we don't end up\r
in an infinit loop. This is so if you unplug the debugger code just keeps running\r
\r
- @param PacketData Payload data for the packet \r
- \r
+ @param PacketData Payload data for the packet\r
+\r
@retval Number of bytes of packet data sent.\r
\r
**/\r
SendPacket (\r
IN CHAR8 *PacketData\r
);\r
- \r
+\r
\r
/**\r
Receive a GDB Remote Serial Protocol Packet\r
- \r
- $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$', \r
+\r
+ $PacketData#checksum PacketData is passed in and this function adds the packet prefix '$',\r
the packet teminating character '#' and the two digit checksum.\r
- \r
+\r
If host re-starts sending a packet without ending the previous packet, only the last valid packet is proccessed.\r
(In other words, if received packet is '$12345$12345$123456#checksum', only '$123456#checksum' will be processed.)\r
- \r
+\r
If an ack '+' is not sent resend the packet\r
- \r
- @param PacketData Payload data for the packet \r
- \r
+\r
+ @param PacketData Payload data for the packet\r
+\r
@retval Number of bytes of packet data received.\r
\r
**/\r
OUT CHAR8 *PacketData,\r
IN UINTN PacketDataSize\r
);\r
- \r
+\r
\r
/**\r
- Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates \r
+ Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates\r
the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that were read\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes read.\r
OUT VOID *Buffer,\r
IN UINTN Count\r
);\r
- \r
+\r
\r
/**\r
- Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates \r
- nothing was written. On error -1 is returned. \r
+ Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates\r
+ nothing was written. On error -1 is returned.\r
\r
@param FileDescriptor Device to talk to.\r
@param Buffer Buffer to hold Count bytes that are to be written\r
- @param Count Number of bytes to transfer. \r
+ @param Count Number of bytes to transfer.\r
\r
@retval -1 Error\r
@retval {other} Number of bytes written.\r
IN UINTN Count\r
);\r
\r
-UINTN * \r
+UINTN *\r
FindPointerToRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
);\r
\r
-CHAR8 * \r
+CHAR8 *\r
BasicReadRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
IN UINTN RegNumber,\r
IN CHAR8 *InBufPtr\r
);\r
\r
-VOID \r
+VOID\r
PrintReg (\r
EFI_SYSTEM_CONTEXT SystemContext\r
);\r
UINTN\r
GetBreakpointDataAddress (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN BreakpointNumber \r
+ IN UINTN BreakpointNumber\r
);\r
\r
UINTN\r
BREAK_TYPE\r
GetBreakpointType (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN BreakpointNumber \r
+ IN UINTN BreakpointNumber\r
);\r
\r
UINTN\r
\r
/**\r
Send the T signal with the given exception type (in gdb order) and possibly with n:r pairs related to the watchpoints\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param GdbExceptionType GDB exception type\r
**/\r
\r
/**\r
Check to see if this exception is related to ctrl-c handling.\r
- \r
+\r
@param ExceptionType Exception that is being processed\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
\r
@return TRUE This was a ctrl-c check that did not find a ctrl-c\r
@return FALSE This was not a ctrl-c check or some one hit ctrl-c\r
**/\r
BOOLEAN\r
-ProcessorControlC ( \r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ProcessorControlC (\r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
);\r
\r
\r
ArmPkg/ArmPkg.dec\r
\r
[LibraryClasses]\r
- BaseLib \r
- DebugLib \r
- BaseMemoryLib \r
- PcdLib \r
+ BaseLib\r
+ DebugLib\r
+ BaseMemoryLib\r
+ PcdLib\r
GdbSerialLib\r
CacheMaintenanceLib\r
DebugAgentTimerLib\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// {EFI mapping, GDB mapping}\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
- { EXCEPT_IA32_DIVIDE_ERROR, GDB_SIGFPE }, \r
+ { EXCEPT_IA32_DIVIDE_ERROR, GDB_SIGFPE },\r
{ EXCEPT_IA32_DEBUG, GDB_SIGTRAP },\r
{ EXCEPT_IA32_NMI, GDB_SIGEMT },\r
{ EXCEPT_IA32_BREAKPOINT, GDB_SIGTRAP },\r
\r
\r
//Debug only..\r
-VOID \r
+VOID\r
PrintReg (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
}\r
\r
//Debug only..\r
-VOID \r
+VOID\r
PrintDRreg (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
- \r
+\r
@retval TRUE if Isa is supported,\r
FALSE otherwise.\r
**/\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the IA32 member\r
\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
**/\r
UINTN *\r
FindPointerToRegister(\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
)\r
{\r
UINTN RegSize;\r
- \r
+\r
RegSize = 0;\r
while (RegSize < REG_SIZE) {\r
*OutBufPtr++ = mHexToStr[((*FindPointerToRegister(SystemContext, RegNumber) >> (RegSize+4)) & 0xf)];\r
}\r
\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
UINTN RegNumber;\r
CHAR8 OutBuffer[9]; // 1 reg=8 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
\r
if ((RegNumber < 0) || (RegNumber >= sizeof (gRegisterOffsets)/sizeof (UINTN))) {\r
}\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
\r
OutBufPtr = OutBuffer;\r
- for(i = 0 ; i < sizeof (gRegisterOffsets)/sizeof (UINTN) ; i++) { // there are only 16 registers to read \r
+ for(i = 0 ; i < sizeof (gRegisterOffsets)/sizeof (UINTN) ; i++) { // there are only 16 registers to read\r
OutBufPtr = BasicReadRegister(SystemContext, i, OutBufPtr);\r
}\r
\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT32 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
NewValue = 0;\r
RegSize = 0;\r
while (RegSize < REG_SIZE) {\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister(SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= sizeof (gRegisterOffsets)/sizeof (UINTN))) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
UINTN i;\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
\r
- // check to see if the buffer is the right size which is \r
- // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129 \r
+ // check to see if the buffer is the right size which is\r
+ // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 129\r
if (AsciiStrLen(InBuffer) != 129) { // 16 regs, 8 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for(i=0; i < sizeof (gRegisterOffsets)/sizeof (UINTN); i++) { // there are only 16 registers to write\r
SendSuccess();\r
}\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextIa32->Eip = AsciiStrHexToUintn (&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
\r
@param SystemContext Register content at time of the exception\r
\r
- @retval {1-4} Currently detected breakpoint value \r
+ @retval {1-4} Currently detected breakpoint value\r
@retval 0 No breakpoint detected.\r
- \r
+\r
**/\r
UINTN\r
GetBreakpointDetected (\r
} else if (Dr6.Bits.B3 == 1) {\r
BreakpointNumber = 4;\r
} else {\r
- BreakpointNumber = 0; //No breakpoint detected \r
+ BreakpointNumber = 0; //No breakpoint detected\r
}\r
\r
return BreakpointNumber;\r
/**\r
Returns Breakpoint type (InstructionExecution, DataWrite, DataRead or DataReadWrite)\r
based on the Breakpoint number\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
- \r
+\r
@retval BREAK_TYPE Breakpoint type value read from register DR7 RWn field\r
For unknown value, it returns NotSupported.\r
- \r
+\r
**/\r
BREAK_TYPE\r
GetBreakpointType (\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
if (BreakpointNumber == 1) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW0; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW0;\r
} else if (BreakpointNumber == 2) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW1; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW1;\r
} else if (BreakpointNumber == 3) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW2; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW2;\r
} else if (BreakpointNumber == 4) {\r
- Type = (BREAK_TYPE) Dr7.Bits.RW3; \r
+ Type = (BREAK_TYPE) Dr7.Bits.RW3;\r
}\r
\r
return Type;\r
}\r
\r
\r
-/** \r
+/**\r
Parses Length and returns the length which DR7 LENn field accepts.\r
- For example: If we receive 1-Byte length then we should return 0. \r
+ For example: If we receive 1-Byte length then we should return 0.\r
Zero gets written to DR7 LENn field.\r
\r
@param Length Breakpoint length in Bytes (1 byte, 2 byte, 4 byte)\r
IN UINTN Length\r
)\r
{\r
- if (Length == 1) { //1-Byte length \r
+ if (Length == 1) { //1-Byte length\r
return 0;\r
} else if (Length == 2) { //2-Byte length\r
return 1;\r
\r
\r
/**\r
- Finds the next free debug register. If all the registers are occupied then \r
- EFI_OUT_OF_RESOURCES is returned. \r
+ Finds the next free debug register. If all the registers are occupied then\r
+ EFI_OUT_OF_RESOURCES is returned.\r
\r
@param SystemContext Register content at time of the exception\r
@param Register Register value (0 - 3 for the first free debug register)\r
/**\r
Enables the debug register. Writes Address value to appropriate DR0-3 register.\r
Sets LENn, Gn, RWn bits in DR7 register.\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
- @param Register Register value (0 - 3) \r
+ @param Register Register value (0 - 3)\r
@param Address Breakpoint address value\r
- @param Type Breakpoint type (Instruction, Data write, Data read \r
+ @param Type Breakpoint type (Instruction, Data write, Data read\r
or write etc.)\r
\r
@retval EFI_STATUS Appropriate status value.\r
//Convert length data\r
Length = ConvertLengthData (Length);\r
\r
- //For Instruction execution, length should be 0 \r
+ //For Instruction execution, length should be 0\r
//(Ref. Intel reference manual 18.2.4)\r
if ((Type == 0) && (Length != 0)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- //Update Dr7 with appropriate Gn, RWn and LENn bits \r
+ //Update Dr7 with appropriate Gn, RWn and LENn bits\r
SystemContext.SystemContextIa32->Dr7 = Dr7.UintN;\r
\r
return EFI_SUCCESS;\r
@param SystemContext Register content at time of the exception\r
@param Address Breakpoint address value\r
@param Length Breakpoint length value\r
- @param Type Breakpoint type (Instruction, Data write, \r
+ @param Type Breakpoint type (Instruction, Data write,\r
Data read or write etc.)\r
@param Register Register value to be returned\r
\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
- if ((Dr7.Bits.G0 == 1) && \r
+ if ((Dr7.Bits.G0 == 1) &&\r
(Dr7.Bits.LEN0 == Length) &&\r
- (Dr7.Bits.RW0 == Type) && \r
+ (Dr7.Bits.RW0 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr0)) {\r
*Register = 0;\r
- } else if ((Dr7.Bits.G1 == 1) && \r
+ } else if ((Dr7.Bits.G1 == 1) &&\r
(Dr7.Bits.LEN1 == Length) &&\r
- (Dr7.Bits.RW1 == Type) && \r
+ (Dr7.Bits.RW1 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr1)) {\r
*Register = 1;\r
- } else if ((Dr7.Bits.G2 == 1) && \r
+ } else if ((Dr7.Bits.G2 == 1) &&\r
(Dr7.Bits.LEN2 == Length) &&\r
- (Dr7.Bits.RW2 == Type) && \r
+ (Dr7.Bits.RW2 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr2)) {\r
*Register = 2;\r
- } else if ((Dr7.Bits.G3 == 1) && \r
+ } else if ((Dr7.Bits.G3 == 1) &&\r
(Dr7.Bits.LEN3 == Length) &&\r
- (Dr7.Bits.RW3 == Type) && \r
+ (Dr7.Bits.RW3 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr3)) {\r
*Register = 3;\r
} else {\r
EFI_STATUS\r
DisableDebugRegister (\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN Register \r
+ IN UINTN Register\r
)\r
{\r
IA32_DR7 Dr7;\r
UINTN Address = 0;\r
- \r
+\r
//Read DR7 register so appropriate Gn, RWn and LENn bits can be turned off.\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
}\r
\r
switch (Type) {\r
- \r
+\r
case 0: //Software breakpoint\r
BreakType = SoftwareBreakpoint;\r
break;\r
- \r
+\r
case 1: //Hardware breakpoint\r
BreakType = InstructionExecution;\r
break;\r
- \r
+\r
case 2: //Write watchpoint\r
BreakType = DataWrite;\r
break;\r
Processor specific parts of the GDB stub\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
// Array of exception types that need to be hooked by the debugger\r
//\r
EFI_EXCEPTION_TYPE_ENTRY gExceptionType[] = {\r
- { EXCEPT_X64_DIVIDE_ERROR, GDB_SIGFPE }, \r
+ { EXCEPT_X64_DIVIDE_ERROR, GDB_SIGFPE },\r
{ EXCEPT_X64_DEBUG, GDB_SIGTRAP },\r
{ EXCEPT_X64_NMI, GDB_SIGEMT },\r
{ EXCEPT_X64_BREAKPOINT, GDB_SIGTRAP },\r
\r
\r
// The offsets of registers SystemContextX64.\r
-// The fields in the array are in the gdb ordering. \r
+// The fields in the array are in the gdb ordering.\r
// HAVE TO DOUBLE-CHECK THE ORDER of the 24 regs\r
//\r
UINTN gRegisterOffsets[] = {\r
\r
/**\r
Return the number of entries in the gExceptionType[]\r
- \r
- @retval UINTN, the number of entries in the gExceptionType[] array. \r
+\r
+ @retval UINTN, the number of entries in the gExceptionType[] array.\r
**/\r
UINTN\r
MaxEfiException (\r
\r
/**\r
Return the number of entries in the gRegisters[]\r
- \r
- @retval UINTN, the number of entries (registers) in the gRegisters[] array. \r
+\r
+ @retval UINTN, the number of entries (registers) in the gRegisters[] array.\r
**/\r
UINTN\r
MaxRegisterCount (\r
return sizeof (gRegisterOffsets)/sizeof (UINTN);\r
}\r
\r
- \r
+\r
/**\r
- Check to see if the ISA is supported. \r
+ Check to see if the ISA is supported.\r
ISA = Instruction Set Architecture\r
\r
@retval TRUE if Isa is supported\r
/**\r
This takes in the register number and the System Context, and returns a pointer to the RegNumber-th register in gdb ordering\r
It is, by default, set to find the register pointer of the X64 member\r
- @param SystemContext Register content at time of the exception \r
+ @param SystemContext Register content at time of the exception\r
@param RegNumber The register to which we want to find a pointer\r
@retval the pointer to the RegNumber-th pointer\r
**/\r
UINTN *\r
FindPointerToRegister(\r
IN EFI_SYSTEM_CONTEXT SystemContext,\r
- IN UINTN RegNumber \r
+ IN UINTN RegNumber\r
)\r
{\r
UINT8 *TempPtr;\r
)\r
{\r
UINTN RegSize;\r
- \r
+\r
RegSize = 0;\r
while (RegSize < 64) {\r
*OutBufPtr++ = mHexToStr[((*FindPointerToRegister(SystemContext, RegNumber) >> (RegSize+4)) & 0xf)];\r
}\r
\r
\r
-/** ‘p n’ \r
- Reads the n-th register's value into an output buffer and sends it as a packet \r
+/** ‘p n’\r
+ Reads the n-th register's value into an output buffer and sends it as a packet\r
@param SystemContext Register content at time of the exception\r
@param InBuffer Pointer to the input buffer received from gdb server\r
**/\r
UINTN RegNumber;\r
CHAR8 OutBuffer[17]; // 1 reg=16 hex chars, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
RegNumber = AsciiStrHexToUintn (&InBuffer[1]);\r
- \r
+\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
- \r
+\r
OutBufPtr = OutBuffer;\r
OutBufPtr = BasicReadRegister(SystemContext, RegNumber, OutBufPtr);\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket (OutBuffer);\r
}\r
\r
\r
-/** ‘g’ \r
- Reads the general registers into an output buffer and sends it as a packet \r
+/** ‘g’\r
+ Reads the general registers into an output buffer and sends it as a packet\r
\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
-ReadGeneralRegisters ( \r
+ReadGeneralRegisters (\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
UINTN i;\r
CHAR8 OutBuffer[385]; // 24 regs, 16 hex chars each, and the end '\0' (escape seq)\r
CHAR8 *OutBufPtr; // pointer to the output buffer\r
- \r
+\r
OutBufPtr = OutBuffer;\r
- for(i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 24 registers to read \r
+ for(i = 0 ; i < MaxRegisterCount() ; i++) { // there are only 24 registers to read\r
OutBufPtr = BasicReadRegister(SystemContext, i, OutBufPtr);\r
}\r
- \r
+\r
*OutBufPtr = '\0'; // the end of the buffer\r
SendPacket (OutBuffer);\r
}\r
UINTN RegSize;\r
UINTN TempValue; // the value transferred from a hex char\r
UINT64 NewValue; // the new value of the RegNumber-th Register\r
- \r
+\r
NewValue = 0;\r
RegSize = 0;\r
while (RegSize < 64) {\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
+\r
NewValue += (TempValue << (RegSize+4));\r
TempValue = HexCharToInt(*InBufPtr++);\r
- \r
+\r
if (TempValue < 0) {\r
- SendError (GDB_EBADMEMDATA); \r
+ SendError (GDB_EBADMEMDATA);\r
return NULL;\r
}\r
- \r
- NewValue += (TempValue << RegSize); \r
+\r
+ NewValue += (TempValue << RegSize);\r
RegSize = RegSize + 8;\r
}\r
*(FindPointerToRegister(SystemContext, RegNumber)) = NewValue;\r
CHAR8 RegNumBuffer[MAX_REG_NUM_BUF_SIZE]; // put the 'n..' part of the message into this array\r
CHAR8 *RegNumBufPtr;\r
CHAR8 *InBufPtr; // pointer to the input buffer\r
- \r
+\r
// find the register number to write\r
InBufPtr = &InBuffer[1];\r
RegNumBufPtr = RegNumBuffer;\r
while (*InBufPtr != '=') {\r
*RegNumBufPtr++ = *InBufPtr++;\r
- } \r
+ }\r
*RegNumBufPtr = '\0';\r
- RegNumber = AsciiStrHexToUintn (RegNumBuffer); \r
+ RegNumber = AsciiStrHexToUintn (RegNumBuffer);\r
\r
// check if this is a valid Register Number\r
if ((RegNumber < 0) || (RegNumber >= MaxRegisterCount())) {\r
- SendError (GDB_EINVALIDREGNUM); \r
+ SendError (GDB_EINVALIDREGNUM);\r
return;\r
}\r
InBufPtr++; // skips the '=' character\r
{\r
UINTN i;\r
CHAR8 *InBufPtr; /// pointer to the input buffer\r
- \r
- // check to see if the buffer is the right size which is \r
- // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 385 \r
+\r
+ // check to see if the buffer is the right size which is\r
+ // 1 (for 'G') + 16 (for 16 registers) * 8 ( for 8 hex chars each) = 385\r
if (AsciiStrLen(InBuffer) != 385) { // 24 regs, 16 hex chars each, and the end '\0' (escape seq)\r
- //Bad message. Message is not the right length \r
- SendError (GDB_EBADBUFSIZE); \r
+ //Bad message. Message is not the right length\r
+ SendError (GDB_EBADBUFSIZE);\r
return;\r
}\r
- \r
+\r
InBufPtr = &InBuffer[1];\r
- \r
+\r
// Read the new values for the registers from the input buffer to an array, NewValueArray.\r
// The values in the array are in the gdb ordering\r
for(i=0; i < MaxRegisterCount(); i++) { // there are only 16 registers to write\r
InBufPtr = BasicWriteRegister(SystemContext, i, InBufPtr);\r
}\r
- \r
+\r
SendSuccess();\r
}\r
\r
\r
- /** \r
+ /**\r
Insert Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
SystemContext.SystemContextX64->Rflags |= TF_BIT; //Setting the TF bit.\r
}\r
\r
- \r
- \r
-/** \r
+\r
+\r
+/**\r
Remove Single Step in the SystemContext\r
- \r
+\r
@param SystemContext Register content at time of the exception\r
**/\r
VOID\r
\r
\r
\r
-/** ‘c [addr ]’ \r
- Continue. addr is Address to resume. If addr is omitted, resume at current \r
+/** ‘c [addr ]’\r
+ Continue. addr is Address to resume. If addr is omitted, resume at current\r
Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
{\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextX64->Rip = AsciiStrHexToUintn(&PacketData[1]);\r
- } \r
+ }\r
}\r
\r
\r
/** ‘s [addr ]’\r
- Single step. addr is the Address at which to resume. If addr is omitted, resume \r
+ Single step. addr is the Address at which to resume. If addr is omitted, resume\r
at same Address.\r
- \r
- @param SystemContext Register content at time of the exception \r
+\r
+ @param SystemContext Register content at time of the exception\r
**/\r
VOID\r
EFIAPI\r
if (PacketData[1] != '\0') {\r
SystemContext.SystemContextX64->Rip = AsciiStrHexToUintn (&PacketData[1]);\r
}\r
- \r
+\r
AddSingleStep (SystemContext);\r
}\r
\r
\r
/**\r
- Returns breakpoint data address from DR0-DR3 based on the input breakpoint \r
+ Returns breakpoint data address from DR0-DR3 based on the input breakpoint\r
number\r
\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
\r
- @retval Address Data address from DR0-DR3 based on the \r
+ @retval Address Data address from DR0-DR3 based on the\r
breakpoint number.\r
\r
**/\r
}\r
\r
/**\r
- Returns currently detected breakpoint value based on the register \r
+ Returns currently detected breakpoint value based on the register\r
DR6 B0-B3 field.\r
If no breakpoint is detected then it returns 0.\r
\r
}\r
\r
/**\r
- Returns Breakpoint type (InstructionExecution, DataWrite, DataRead \r
+ Returns Breakpoint type (InstructionExecution, DataWrite, DataRead\r
or DataReadWrite) based on the Breakpoint number\r
\r
@param SystemContext Register content at time of the exception\r
@param BreakpointNumber Breakpoint number\r
\r
- @retval BREAK_TYPE Breakpoint type value read from register DR7 RWn \r
+ @retval BREAK_TYPE Breakpoint type value read from register DR7 RWn\r
field. For unknown value, it returns NotSupported.\r
\r
**/\r
}\r
\r
\r
-/** \r
+/**\r
Parses Length and returns the length which DR7 LENn field accepts.\r
- For example: If we receive 1-Byte length then we should return 0. \r
+ For example: If we receive 1-Byte length then we should return 0.\r
Zero gets written to DR7 LENn field.\r
\r
@param Length Breakpoint length in Bytes (1 byte, 2 byte, 4 byte)\r
IN UINTN Length\r
)\r
{\r
- if (Length == 1) { //1-Byte length \r
+ if (Length == 1) { //1-Byte length\r
return 0;\r
} else if (Length == 2) { //2-Byte length\r
return 1;\r
@param SystemContext Register content at time of the exception\r
@param Register Register value (0 - 3)\r
@param Address Breakpoint address value\r
- @param Type Breakpoint type (Instruction, Data write, \r
+ @param Type Breakpoint type (Instruction, Data write,\r
Data read or write etc.)\r
\r
@retval EFI_STATUS Appropriate status value.\r
//Convert length data\r
Length = ConvertLengthData (Length);\r
\r
- //For Instruction execution, length should be 0 \r
+ //For Instruction execution, length should be 0\r
//(Ref. Intel reference manual 18.2.4)\r
if ((Type == 0) && (Length != 0)) {\r
return EFI_INVALID_PARAMETER;\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
}\r
\r
\r
-/** \r
- Returns register number 0 - 3 for the maching debug register. \r
- This function compares incoming Address, Type, Length and \r
+/**\r
+ Returns register number 0 - 3 for the maching debug register.\r
+ This function compares incoming Address, Type, Length and\r
if there is a match then it returns the appropriate register number.\r
In case of mismatch, function returns EFI_NOT_FOUND message.\r
\r
@param SystemContext Register content at time of the exception\r
- @param Address Breakpoint address value \r
+ @param Address Breakpoint address value\r
@param Length Breakpoint length value\r
@param Type Breakpoint type (Instruction, Data write, Data read\r
or write etc.)\r
\r
//Hardware doesn't support ReadWatch (z3 packet) type. GDB can handle\r
//software breakpoint. We should send empty packet in both these cases.\r
- if ((Type == (BREAK_TYPE)DataRead) || \r
+ if ((Type == (BREAK_TYPE)DataRead) ||\r
(Type == (BREAK_TYPE)SoftwareBreakpoint)) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
Dr7.UintN = SystemContext.SystemContextIa32->Dr7;\r
\r
- if ((Dr7.Bits.G0 == 1) && \r
+ if ((Dr7.Bits.G0 == 1) &&\r
(Dr7.Bits.LEN0 == Length) &&\r
- (Dr7.Bits.RW0 == Type) && \r
+ (Dr7.Bits.RW0 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr0)) {\r
*Register = 0;\r
- } else if ((Dr7.Bits.G1 == 1) && \r
+ } else if ((Dr7.Bits.G1 == 1) &&\r
(Dr7.Bits.LEN1 == Length) &&\r
- (Dr7.Bits.RW1 == Type) && \r
+ (Dr7.Bits.RW1 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr1)) {\r
*Register = 1;\r
- } else if ((Dr7.Bits.G2 == 1) && \r
+ } else if ((Dr7.Bits.G2 == 1) &&\r
(Dr7.Bits.LEN2 == Length) &&\r
- (Dr7.Bits.RW2 == Type) && \r
+ (Dr7.Bits.RW2 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr2)) {\r
*Register = 2;\r
- } else if ((Dr7.Bits.G3 == 1) && \r
+ } else if ((Dr7.Bits.G3 == 1) &&\r
(Dr7.Bits.LEN3 == Length) &&\r
- (Dr7.Bits.RW3 == Type) && \r
+ (Dr7.Bits.RW3 == Type) &&\r
(Address == SystemContext.SystemContextIa32->Dr3)) {\r
*Register = 3;\r
} else {\r
}\r
\r
switch (Type) {\r
- \r
+\r
case 0: //Software breakpoint\r
BreakType = SoftwareBreakpoint;\r
break;\r
- \r
+\r
case 1: //Hardware breakpoint\r
BreakType = InstructionExecution;\r
break;\r
- \r
+\r
case 2: //Write watchpoint\r
BreakType = DataWrite;\r
break;\r
\r
BOOLEAN\r
ValidateException (\r
- IN EFI_EXCEPTION_TYPE ExceptionType, \r
- IN OUT EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_EXCEPTION_TYPE ExceptionType,\r
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
return TRUE;\r
Basic serial IO abstaction for GDB\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
/**\r
The constructor function initializes the UART.\r
- \r
+\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->LocateProtocol (&gEfiDebugPortProtocolGuid, NULL, (VOID **)&gDebugPort);\r
if (!EFI_ERROR (Status)) {\r
gTimeOut = PcdGet32 (PcdGdbMaxPacketRetryCount);\r
gDebugPort->Reset (gDebugPort);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
\r
\r
/**\r
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
data buts, and stop bits on a serial device. This call is optional as the serial\r
port will be set up with defaults base on PCD values.\r
\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gDebugPort->Reset (gDebugPort);\r
return Status;\r
}\r
\r
@return TRUE - Character availible\r
@return FALSE - Character not availible\r
- \r
+\r
**/\r
BOOLEAN\r
EFIAPI\r
GdbIsCharAvailable (\r
VOID\r
- ) \r
+ )\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gDebugPort->Poll (gDebugPort);\r
- \r
+\r
return (Status == EFI_SUCCESS ? TRUE : FALSE);\r
}\r
\r
Get a character from GDB. This function must be able to run in interrupt context.\r
\r
@return A character from GDB\r
- \r
+\r
**/\r
CHAR8\r
EFIAPI\r
EFI_STATUS Status;\r
CHAR8 Char;\r
UINTN BufferSize;\r
- \r
+\r
do {\r
BufferSize = sizeof (Char);\r
Status = gDebugPort->Read (gDebugPort, gTimeOut, &BufferSize, &Char);\r
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));\r
- \r
+\r
return Char;\r
}\r
\r
{\r
EFI_STATUS Status;\r
UINTN BufferSize;\r
- \r
+\r
do {\r
BufferSize = sizeof (Char);\r
Status = gDebugPort->Write (gDebugPort, gTimeOut, &BufferSize, &Char);\r
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));\r
- \r
+\r
return;\r
}\r
\r
\r
[Protocols.common]\r
gEfiDebugPortProtocolGuid\r
- \r
+\r
[FixedPcd.common]\r
gEmbeddedTokenSpaceGuid.PcdGdbBaudRate|115200\r
gEmbeddedTokenSpaceGuid.PcdGdbDataBits|8\r
Basic serial IO abstaction for GDB\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
/**\r
The constructor function initializes the UART.\r
- \r
+\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
UINT8 DataBits;\r
UINT8 Parity;\r
UINT8 StopBits;\r
- \r
+\r
gPort = (UINTN)PcdGet32 (PcdGdbUartPort);\r
- \r
+\r
BaudRate = PcdGet64 (PcdGdbBaudRate);\r
Parity = PcdGet8 (PcdGdbParity);\r
DataBits = PcdGet8 (PcdGdbDataBits);\r
\r
\r
/**\r
- Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+ Sets the baud rate, receive FIFO depth, transmit/receice time out, parity,\r
data buts, and stop bits on a serial device. This call is optional as the serial\r
port will be set up with defaults base on PCD values.\r
\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
UINTN Divisor;\r
//\r
// We assume the UART has been turned on to decode gPort address range\r
//\r
- \r
+\r
//\r
// Map 5..8 to 0..3\r
//\r
//\r
// Calculate divisor for baud generator\r
//\r
- Divisor = 115200/(UINTN)BaudRate; \r
- \r
+ Divisor = 115200/(UINTN)BaudRate;\r
+\r
//\r
// Set communications format\r
//\r
\r
@return TRUE - Character availible\r
@return FALSE - Character not availible\r
- \r
+\r
**/\r
BOOLEAN\r
EFIAPI\r
GdbIsCharAvailable (\r
VOID\r
- ) \r
+ )\r
{\r
UINT8 Data;\r
- \r
+\r
Data = IoRead8 (gPort + LSR_OFFSET);\r
- \r
+\r
return ((Data & LSR_RXDA) == LSR_RXDA);\r
}\r
\r
Get a character from GDB. This function must be able to run in interrupt context.\r
\r
@return A character from GDB\r
- \r
+\r
**/\r
CHAR8\r
EFIAPI\r
} while ((Data & LSR_RXDA) == 0);\r
\r
Char = IoRead8 (gPort);\r
- \r
+\r
// Make this an EFI_D_INFO after we get everything debugged.\r
DEBUG ((EFI_D_ERROR, "<%c<", Char));\r
return Char;\r
)\r
{\r
UINT8 Data;\r
- \r
+\r
// Make this an EFI_D_INFO after we get everything debugged.\r
DEBUG ((EFI_D_ERROR, ">%c>", Char));\r
- \r
+\r
// Wait for the serial port to be ready\r
do {\r
Data = IoRead8 (gPort + LSR_OFFSET);\r
} while ((Data & LSR_TXRDY) == 0);\r
- \r
+\r
IoWrite8 (gPort, Char);\r
}\r
\r
Generic Capsule services\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//\r
//Max size capsule services support are platform policy,to populate capsules we just need\r
//memory to maintain them across reset,it is not a problem. And to special capsules ,for\r
-//example,update flash,it is mostly decided by the platform. Here is a sample size for \r
+//example,update flash,it is mostly decided by the platform. Here is a sample size for\r
//different type capsules.\r
//\r
#define MAX_SIZE_POPULATE (0)\r
)\r
{\r
//\r
- //If the platform has a way to guarantee the memory integrity across a system reset, return \r
- //TRUE, else FALSE. \r
+ //If the platform has a way to guarantee the memory integrity across a system reset, return\r
+ //TRUE, else FALSE.\r
//\r
return FALSE;\r
}\r
//\r
*MaxSizePopulate = MAX_SIZE_POPULATE;\r
*MaxSizeNonPopulate = MAX_SIZE_NON_POPULATE;\r
- return; \r
+ return;\r
}\r
\r
\r
CapsuleHeaderArray A array of pointers to capsule headers passed in\r
CapsuleCount The number of capsule\r
ScatterGatherList Physical address of datablock list points to capsule\r
- \r
+\r
Returns:\r
\r
EFI STATUS\r
not set, the capsule has been successfully processed by the firmware.\r
If it set, the ScattlerGatherList is successfully to be set.\r
EFI_INVALID_PARAMETER CapsuleCount is less than 1,CapsuleGuid is not supported.\r
- EFI_DEVICE_ERROR Failed to SetVariable or AllocatePool or ProcessFirmwareVolume. \r
- \r
+ EFI_DEVICE_ERROR Failed to SetVariable or AllocatePool or ProcessFirmwareVolume.\r
+\r
--*/\r
{\r
UINTN CapsuleSize;\r
for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) {\r
CapsuleHeader = CapsuleHeaderArray[ArrayNumber];\r
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &gEfiCapsuleGuid)) {\r
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {\r
return EFI_UNSUPPORTED;\r
- } \r
- } \r
+ }\r
+ }\r
}\r
\r
//\r
- //Assume that capsules have the same flags on reseting or not. \r
+ //Assume that capsules have the same flags on reseting or not.\r
//\r
CapsuleHeader = CapsuleHeaderArray[0];\r
\r
if (!SupportUpdateCapsuleRest()) {\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
if (ScatterGatherList == 0) {\r
return EFI_INVALID_PARAMETER;\r
} else {\r
Status = EfiSetVariable (\r
- EFI_CAPSULE_VARIABLE_NAME, \r
- &gEfiCapsuleVendorGuid, \r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS, \r
- sizeof (UINTN), \r
- (VOID *) &ScatterGatherList \r
+ EFI_CAPSULE_VARIABLE_NAME,\r
+ &gEfiCapsuleVendorGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
+ sizeof (UINTN),\r
+ (VOID *) &ScatterGatherList\r
);\r
- if (Status != EFI_SUCCESS) { \r
+ if (Status != EFI_SUCCESS) {\r
return EFI_DEVICE_ERROR;\r
}\r
}\r
return EFI_SUCCESS;\r
}\r
- \r
+\r
//\r
//The rest occurs in the condition of non-reset mode\r
//\r
- if (EfiAtRuntime ()) { \r
+ if (EfiAtRuntime ()) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
gBS->CopyMem (BufferPtr, (UINT8*)CapsuleHeader+ CapsuleHeader->HeaderSize, CapsuleSize);\r
\r
//\r
- //Call DXE service ProcessFirmwareVolume to process immediatelly \r
+ //Call DXE service ProcessFirmwareVolume to process immediatelly\r
//\r
Status = gDS->ProcessFirmwareVolume (BufferPtr, CapsuleSize, &FvHandle);\r
if (Status != EFI_SUCCESS) {\r
Done:\r
if (BufferPtr != NULL) {\r
gBS->FreePool (BufferPtr);\r
- } \r
+ }\r
return EFI_DEVICE_ERROR;\r
}\r
\r
\r
if ((MaxiumCapsuleSize == NULL) ||(ResetType == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
- } \r
+ }\r
\r
CapsuleHeader = NULL;\r
- \r
+\r
//\r
//Compare GUIDs with EFI_CAPSULE_GUID, if capsule header contains CAPSULE_FLAGS_PERSIST_ACROSS_RESET\r
//and CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flags,whatever the GUID is ,the service supports.\r
for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) {\r
CapsuleHeader = CapsuleHeaderArray[ArrayNumber];\r
if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) {\r
- return EFI_INVALID_PARAMETER; \r
+ return EFI_INVALID_PARAMETER;\r
}\r
if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &gEfiCapsuleGuid)) {\r
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) {\r
return EFI_UNSUPPORTED;\r
}\r
- } \r
+ }\r
}\r
\r
SupportCapsuleSize(&MaxSizePopulate,&MaxSizeNonPopulate);\r
//\r
- //Assume that capsules have the same flags on reseting or not. \r
+ //Assume that capsules have the same flags on reseting or not.\r
//\r
- CapsuleHeader = CapsuleHeaderArray[0]; \r
+ CapsuleHeader = CapsuleHeaderArray[0];\r
if ((CapsuleHeader->Flags & CAPSULE_FLAGS_PERSIST_ACROSS_RESET) != 0) {\r
//\r
//Check if the platform supports update capsule across a system reset\r
return EFI_UNSUPPORTED;\r
}\r
*ResetType = EfiResetWarm;\r
- *MaxiumCapsuleSize = MaxSizePopulate; \r
+ *MaxiumCapsuleSize = MaxSizePopulate;\r
} else {\r
*ResetType = EfiResetCold;\r
*MaxiumCapsuleSize = MaxSizeNonPopulate;\r
- } \r
+ }\r
return EFI_SUCCESS;\r
}\r
\r
\r
Returns:\r
\r
- EFI_SUCCESS The event has been handled properly \r
+ EFI_SUCCESS The event has been handled properly\r
EFI_NOT_FOUND An error occurred updating the variable.\r
\r
--*/\r
\r
*HighCount = (UINT32) RShiftU64 (mEfiMtc, 32) + 1;\r
mEfiMtc = LShiftU64 (*HighCount, 32);\r
- \r
+\r
if (!EfiAtRuntime ()) {\r
gBS->RestoreTPL (OldTpl);\r
}\r
Report status code lib on top of either SerialLib and/or EFI Serial Protocol.\r
Based on PcdStatusCodeUseEfiSerial & PcdStatusCodeUseHardSerial settings\r
\r
- There is just a single runtime memory buffer that contans all the data. \r
+ There is just a single runtime memory buffer that contans all the data.\r
\r
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
// Print DEBUG() information into output buffer.\r
//\r
CharCount = AsciiVSPrint (\r
- Buffer, \r
- EFI_STATUS_CODE_DATA_MAX_SIZE, \r
- Format, \r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ Format,\r
Marker\r
);\r
- } else if (Data != NULL && \r
+ } else if (Data != NULL &&\r
CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&\r
(CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {\r
//\r
// Print ERROR information into output buffer.\r
//\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- EFI_STATUS_CODE_DATA_MAX_SIZE, \r
- "ERROR: C%x:V%x I%x", \r
- CodeType, \r
- Value, \r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ "ERROR: C%x:V%x I%x",\r
+ CodeType,\r
+ Value,\r
Instance\r
);\r
\r
//\r
- // Make sure we don't try to print values that weren't \r
+ // Make sure we don't try to print values that weren't\r
// intended to be printed, especially NULL GUID pointers.\r
//\r
- \r
+\r
if (CallerId != NULL) {\r
CharCount += AsciiSPrint (\r
&Buffer[CharCount - 1],\r
);\r
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- EFI_STATUS_CODE_DATA_MAX_SIZE, \r
- "PROGRESS CODE: V%x I%x\n\r", \r
- Value, \r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ "PROGRESS CODE: V%x I%x\n\r",\r
+ Value,\r
Instance\r
);\r
} else {\r
CharCount = AsciiSPrint (\r
- Buffer, \r
- EFI_STATUS_CODE_DATA_MAX_SIZE, \r
- "Undefined: C%x:V%x I%x\n\r", \r
- CodeType, \r
- Value, \r
+ Buffer,\r
+ EFI_STATUS_CODE_DATA_MAX_SIZE,\r
+ "Undefined: C%x:V%x I%x\n\r",\r
+ CodeType,\r
+ Value,\r
Instance\r
);\r
}\r
gBS->LocateProtocol (&gEfiSerialIoProtocolGuid, NULL, (VOID **) &mSerialIoProtocol);\r
}\r
\r
- if (mSerialIoProtocol == NULL) { \r
+ if (mSerialIoProtocol == NULL) {\r
mSerialIoProtocol->Write (\r
mSerialIoProtocol,\r
&CharCount,\r
\r
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
\r
**/\r
- \r
+\r
\r
\r
VOID\r
\r
\r
**/\r
- \r
+\r
\r
\r
typedef struct {\r
Routine Description:\r
\r
Arguments:\r
- \r
- Returns: \r
+\r
+ Returns:\r
--*/\r
// TODO: Time - add argument and description to function comment\r
// TODO: EFI_INVALID_PARAMETER - add return value to function comment\r
/** @file\r
Variable services implemented from system memory\r
\r
- There is just a single runtime memory buffer that contans all the data. \r
+ There is just a single runtime memory buffer that contans all the data.\r
\r
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_TPL CurrentTpl;\r
\r
\r
- SizeOfString = StrSize (VariableName); \r
+ SizeOfString = StrSize (VariableName);\r
Size = SizeOfString + sizeof (VARIABLE_ARRAY_ENTRY) + DataSize;\r
if ((VARIABLE_ARRAY_ENTRY *)(((UINT8 *)mVariableArrayNextFree) + Size) > mVariableArrayEnd) {\r
// ran out of space\r
mVariableArrayNextFree = (VARIABLE_ARRAY_ENTRY *)(((UINT8 *)mVariableArrayNextFree) + SizeOfString);\r
CopyMem (mVariableArrayNextFree, Data, DataSize);\r
mVariableArrayNextFree = (VARIABLE_ARRAY_ENTRY *)(((UINT8 *)mVariableArrayNextFree) + DataSize);\r
- \r
+\r
if (!EfiAtRuntime ()) {\r
// Exit Critical section\r
gBS->RestoreTPL (CurrentTpl);\r
\r
return Entry;\r
}\r
- \r
+\r
VOID\r
DeleteEntry (\r
IN VARIABLE_ARRAY_ENTRY *Entry\r
if (Entry == NULL) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
// If we are at runtime skip variables that do not have the Runitme attribute set.\r
Done = (EfiAtRuntime () && ((Entry->Attribute & EFI_VARIABLE_RUNTIME_ACCESS) == 0)) ? FALSE : TRUE;\r
- } \r
+ }\r
\r
StringSize = StrSize ((CHAR16 *)(Entry + 1));\r
Entry = (VARIABLE_ARRAY_ENTRY *)(((UINT8 *)Entry) + (StringSize + sizeof (VARIABLE_ARRAY_ENTRY) + Entry->DataSize));\r
if (Entry >= mVariableArrayEnd) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
if (*VariableNameSize < StringSize) {\r
*VariableNameSize = StringSize;\r
return EFI_BUFFER_TOO_SMALL;\r
}\r
- \r
+\r
*VariableNameSize = StringSize;\r
CopyMem (VariableName, (CHAR16 *)(Entry + 1), StringSize);\r
CopyMem (VendorGuid, &Entry->VendorGuid, sizeof (EFI_GUID));\r
ASSERT (mVariableArray != NULL);\r
\r
mVariableArrayEnd = (VARIABLE_ARRAY_ENTRY *)(((UINT8 *)mVariableArray) + Size);\r
- \r
+\r
mMaximumVariableStorageSize = Size - sizeof (VARIABLE_ARRAY_ENTRY);\r
mRemainingVariableStorageSize = mMaximumVariableStorageSize;\r
mMaximumVariableSize = mMaximumVariableStorageSize;\r
}\r
- \r
+\r
)\r
{\r
EXTRACT_SECTION_HOB *Hob;\r
- \r
+\r
Hob = GetFirstGuidHob (&gLzmaCustomDecompressGuid);\r
if (Hob == NULL) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
- // Locate Guided Hob \r
+\r
+ // Locate Guided Hob\r
\r
return ExtractGuidedSectionRegisterHandlers (\r
&gLzmaCustomDecompressGuid,\r
Hob->Data.SectionGetInfo,\r
Hob->Data.SectionExtraction\r
- ); \r
+ );\r
}\r
# LzmaCustomDecompressLib produces LZMA custom decompression algorithm.\r
#\r
# It is based on the LZMA SDK 4.65.\r
-# LZMA SDK 4.65 was placed in the public domain on 2009-02-03. \r
+# LZMA SDK 4.65 was placed in the public domain on 2009-02-03.\r
# It was released on the http://www.7-zip.org/sdk.html website.\r
#\r
# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
Generic ARM implementation of DmaLib.h\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
\r
\r
-/** \r
+/**\r
Provides the DMA controller-specific addresses needed to access system memory.\r
- \r
+\r
Operation is relative to the DMA bus master.\r
- \r
+\r
@param Operation Indicates if the bus master is going to read or write to system memory.\r
@param HostAddress The system memory address to map to the DMA controller.\r
@param NumberOfBytes On input the number of bytes to map. On output the number of bytes\r
- that were mapped. \r
+ that were mapped.\r
@param DeviceAddress The resulting map address for the bus master controller to use to\r
- access the hosts HostAddress. \r
+ access the hosts HostAddress.\r
@param Mapping A resulting value to pass to Unmap().\r
- \r
+\r
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r
- @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. \r
+ @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested address.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
}\r
\r
\r
-/** \r
+/**\r
Completes the DmaMapBusMasterRead(), DmaMapBusMasterWrite(), or DmaMapBusMasterCommonBuffer()\r
operation and releases any corresponding resources.\r
- \r
+\r
@param Mapping The mapping value returned from DmaMap*().\r
- \r
+\r
@retval EFI_SUCCESS The range was unmapped.\r
@retval EFI_DEVICE_ERROR The data was not committed to the target system memory.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
return EFI_SUCCESS;\r
}\r
\r
-/** \r
+/**\r
Allocates pages that are suitable for an DmaMap() of type MapOperationBusMasterCommonBuffer.\r
- mapping. \r
- \r
+ mapping.\r
+\r
@param MemoryType The type of memory to allocate, EfiBootServicesData or\r
- EfiRuntimeServicesData. \r
- @param Pages The number of pages to allocate. \r
+ EfiRuntimeServicesData.\r
+ @param Pages The number of pages to allocate.\r
@param HostAddress A pointer to store the base system memory address of the\r
- allocated range. \r
+ allocated range.\r
\r
@retval EFI_SUCCESS The requested memory pages were allocated.\r
@retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are\r
- MEMORY_WRITE_COMBINE and MEMORY_CACHED. \r
+ MEMORY_WRITE_COMBINE and MEMORY_CACHED.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. \r
- \r
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.\r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
}\r
\r
\r
-/** \r
+/**\r
Frees memory that was allocated with DmaAllocateBuffer().\r
- \r
- @param Pages The number of pages to free. \r
- @param HostAddress The base system memory address of the allocated range. \r
- \r
+\r
+ @param Pages The number of pages to free.\r
+ @param HostAddress The base system memory address of the allocated range.\r
+\r
@retval EFI_SUCCESS The requested memory pages were freed.\r
@retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
was not allocated with DmaAllocateBuffer().\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
{\r
if (HostAddress == NULL) {\r
return EFI_INVALID_PARAMETER;\r
- } \r
- \r
+ }\r
+\r
FreePages (HostAddress, Pages);\r
return EFI_SUCCESS;\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
FILE_GUID = 0F2A0816-D319-4ee7-A6B8-D58524E4428F\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = DmaLib \r
+ LIBRARY_CLASS = DmaLib\r
\r
[Sources.common]\r
NullDmaLib.c\r
[LibraryClasses]\r
DebugLib\r
MemoryAllocationLib\r
- \r
- \r
+\r
+\r
[Protocols]\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
\r
[Depex]\r
- TRUE\r
\ No newline at end of file
+ TRUE\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
GuidHob = GetFirstGuidHob(&SavedDataGuid);\r
GuidHob++;\r
- \r
+\r
return (PRE_PI_EXTRACT_GUIDED_SECTION_DATA *)GuidHob;\r
}\r
\r
SavedData->ExtractGetInfoHandlerTable [Index] = GetInfoHandler;\r
return RETURN_SUCCESS;\r
}\r
- \r
+\r
//\r
// Check the global table is enough to contain new Handler.\r
//\r
if (SavedData->NumberOfExtractHandler >= PcdGet32 (PcdMaximumGuidedExtractHandler)) {\r
return RETURN_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// Register new Handler and guid value.\r
//\r
CopyGuid (&SavedData->ExtractHandlerGuidTable [SavedData->NumberOfExtractHandler], SectionGuid);\r
SavedData->ExtractDecodeHandlerTable [SavedData->NumberOfExtractHandler] = DecodeHandler;\r
SavedData->ExtractGetInfoHandlerTable [SavedData->NumberOfExtractHandler++] = GetInfoHandler;\r
- \r
+\r
return RETURN_SUCCESS;\r
}\r
\r
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;\r
\r
ASSERT(ExtractHandlerGuidTable != NULL);\r
- \r
+\r
SavedData = GetSavedData();\r
- \r
+\r
*ExtractHandlerGuidTable = SavedData->ExtractHandlerGuidTable;\r
return SavedData->NumberOfExtractHandler;\r
}\r
IN CONST VOID *InputSection,\r
OUT UINT32 *OutputBufferSize,\r
OUT UINT32 *ScratchBufferSize,\r
- OUT UINT16 *SectionAttribute \r
+ OUT UINT16 *SectionAttribute\r
)\r
{\r
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;\r
UINT32 Index;\r
- \r
+\r
if (InputSection == NULL) {\r
return RETURN_INVALID_PARAMETER;\r
}\r
- \r
+\r
ASSERT (OutputBufferSize != NULL);\r
ASSERT (ScratchBufferSize != NULL);\r
ASSERT (SectionAttribute != NULL);\r
- \r
+\r
SavedData = GetSavedData();\r
\r
//\r
}\r
\r
//\r
- // Not found, the input guided section is not supported. \r
+ // Not found, the input guided section is not supported.\r
//\r
if (Index == SavedData->NumberOfExtractHandler) {\r
return RETURN_INVALID_PARAMETER;\r
IN CONST VOID *InputSection,\r
OUT VOID **OutputBuffer,\r
OUT VOID *ScratchBuffer, OPTIONAL\r
- OUT UINT32 *AuthenticationStatus \r
+ OUT UINT32 *AuthenticationStatus\r
)\r
{\r
PRE_PI_EXTRACT_GUIDED_SECTION_DATA *SavedData;\r
UINT32 Index;\r
- \r
+\r
if (InputSection == NULL) {\r
return RETURN_INVALID_PARAMETER;\r
}\r
- \r
+\r
ASSERT (OutputBuffer != NULL);\r
ASSERT (AuthenticationStatus != NULL);\r
\r
}\r
\r
//\r
- // Not found, the input guided section is not supported. \r
+ // Not found, the input guided section is not supported.\r
//\r
if (Index == SavedData->NumberOfExtractHandler) {\r
return RETURN_INVALID_PARAMETER;\r
if (SavedData.ExtractHandlerGuidTable == NULL) {\r
return RETURN_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
SavedData.ExtractDecodeHandlerTable = (EXTRACT_GUIDED_SECTION_DECODE_HANDLER *)AllocatePool(PcdGet32(PcdMaximumGuidedExtractHandler) * sizeof(EXTRACT_GUIDED_SECTION_DECODE_HANDLER));\r
if (SavedData.ExtractDecodeHandlerTable == NULL) {\r
return RETURN_OUT_OF_RESOURCES;\r
if (SavedData.ExtractGetInfoHandlerTable == NULL) {\r
return RETURN_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// the initialized number is Zero.\r
//\r
SavedData.NumberOfExtractHandler = 0;\r
- \r
+\r
BuildGuidDataHob(&HobGuid, &SavedData, sizeof(SavedData));\r
- \r
+\r
return RETURN_SUCCESS;\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
DebugLib\r
\r
[FixedPcd.common]\r
- gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler \r
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler\r
/** @file\r
\r
Copyright (c) 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
SetHobList (Hob);\r
\r
BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize));\r
- \r
+\r
Attributes =(\r
EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
BuildStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN)StackBase, ((UINTN)MemoryBegin + MemoryLength) - (UINTN)StackBase);\r
\r
if (FeaturePcdGet (PcdPrePiProduceMemoryTypeInformationHob)) {\r
- // Optional feature that helps prevent EFI memory map fragmentation. \r
+ // Optional feature that helps prevent EFI memory map fragmentation.\r
BuildMemoryTypeInformationHob ();\r
}\r
-} \r
- \r
+}\r
+\r
\r
VOID\r
EFIAPI\r
-BuildFvHobs ( \r
+BuildFvHobs (\r
IN EFI_PHYSICAL_ADDRESS PhysicalStart,\r
IN UINT64 NumberOfBytes,\r
IN EFI_RESOURCE_ATTRIBUTE_TYPE *ResourceAttribute\r
- ) \r
+ )\r
{\r
\r
EFI_RESOURCE_ATTRIBUTE_TYPE Resource;\r
- \r
+\r
BuildFvHob (PhysicalStart, NumberOfBytes);\r
- \r
+\r
if (ResourceAttribute == NULL) {\r
Resource = (EFI_RESOURCE_ATTRIBUTE_PRESENT |\r
EFI_RESOURCE_ATTRIBUTE_INITIALIZED |\r
} else {\r
Resource = *ResourceAttribute;\r
}\r
- \r
+\r
BuildResourceDescriptorHob (EFI_RESOURCE_FIRMWARE_DEVICE, Resource, PhysicalStart, NumberOfBytes);\r
}\r
\r
/**\r
Returns the next instance of a HOB type from the starting HOB.\r
\r
- This function searches the first instance of a HOB type from the starting HOB pointer. \r
+ This function searches the first instance of a HOB type from the starting HOB pointer.\r
If there does not exist such HOB type from the starting HOB pointer, it will return NULL.\r
In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r
unconditionally: it returns HobStart back if HobStart itself meets the requirement;\r
EFI_PEI_HOB_POINTERS Hob;\r
\r
ASSERT (HobStart != NULL);\r
- \r
+\r
Hob.Raw = (UINT8 *) HobStart;\r
//\r
// Parse the HOB list until end of list or matching type is found.\r
}\r
return NULL;\r
}\r
- \r
- \r
+\r
+\r
\r
/**\r
Returns the first instance of a HOB type among the whole HOB list.\r
\r
- This function searches the first instance of a HOB type among the whole HOB list. \r
- If there does not exist such HOB type in the HOB list, it will return NULL. \r
+ This function searches the first instance of a HOB type among the whole HOB list.\r
+ If there does not exist such HOB type in the HOB list, it will return NULL.\r
\r
@param Type The HOB type to return.\r
\r
\r
\r
/**\r
- This function searches the first instance of a HOB from the starting HOB pointer. \r
- Such HOB should satisfy two conditions: \r
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. \r
- If there does not exist such HOB from the starting HOB pointer, it will return NULL. \r
+ This function searches the first instance of a HOB from the starting HOB pointer.\r
+ Such HOB should satisfy two conditions:\r
+ its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r
+ If there does not exist such HOB from the starting HOB pointer, it will return NULL.\r
Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()\r
to extract the data section and its size info respectively.\r
In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer\r
\r
\r
/**\r
- This function searches the first instance of a HOB among the whole HOB list. \r
+ This function searches the first instance of a HOB among the whole HOB list.\r
Such HOB should satisfy two conditions:\r
its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.\r
If there does not exist such HOB from the starting HOB pointer, it will return NULL.\r
/**\r
Get the Boot Mode from the HOB list.\r
\r
- This function returns the system boot mode information from the \r
+ This function returns the system boot mode information from the\r
PHIT HOB in HOB list.\r
\r
@param VOID\r
/**\r
Get the Boot Mode from the HOB list.\r
\r
- This function returns the system boot mode information from the \r
+ This function returns the system boot mode information from the\r
PHIT HOB in HOB list.\r
\r
@param VOID\r
// Zero the reserved space to match HOB spec\r
//\r
ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob->MemoryAllocationHeader.Reserved));\r
- \r
+\r
CopyGuid (&Hob->ModuleName, ModuleName);\r
Hob->EntryPoint = EntryPoint;\r
}\r
/**\r
Builds a GUID HOB with a certain data length.\r
\r
- This function builds a customized HOB tagged with a GUID for identification \r
- and returns the start address of GUID HOB data so that caller can fill the customized data. \r
+ This function builds a customized HOB tagged with a GUID for identification\r
+ and returns the start address of GUID HOB data so that caller can fill the customized data.\r
The HOB Header and Name field is already stripped.\r
It can only be invoked during PEI phase;\r
for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.\r
@param Length The size of the Firmware Volume in bytes.\r
@param FvName The name of the Firmware Volume.\r
@param FileName The name of the file.\r
- \r
+\r
**/\r
VOID\r
EFIAPI\r
//\r
// Zero the reserved space to match HOB spec\r
//\r
- ZeroMem (Hob->Reserved, sizeof (Hob->Reserved)); \r
+ ZeroMem (Hob->Reserved, sizeof (Hob->Reserved));\r
}\r
\r
\r
\r
ASSERT (((BaseAddress & (EFI_PAGE_SIZE - 1)) == 0) &&\r
((Length & (EFI_PAGE_SIZE - 1)) == 0));\r
- \r
+\r
Hob = CreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, sizeof (EFI_HOB_MEMORY_ALLOCATION));\r
- \r
+\r
ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID));\r
Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;\r
Hob->AllocDescriptor.MemoryLength = Length;\r
)\r
{\r
EXTRACT_SECTION_DATA Data;\r
- \r
+\r
Data.SectionGetInfo = SectionGetInfo;\r
Data.SectionExtraction = SectionExtraction;\r
BuildGuidDataHob (Guid, &Data, sizeof (Data));\r
VOID\r
)\r
{\r
- VOID *Ptr; \r
- \r
+ VOID *Ptr;\r
+\r
Ptr = &gPeCoffProtocol;\r
- BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Ptr, sizeof (VOID *)); \r
+ BuildGuidDataHob (&gPeCoffLoaderProtocolGuid, &Ptr, sizeof (VOID *));\r
}\r
\r
// May want to put this into a library so you only need the PCD setings if you are using the feature?\r
FILE_GUID = 1F3A3278-82EB-4C0D-86F1-5BCDA5846CB2\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = HobLib \r
+ LIBRARY_CLASS = HobLib\r
\r
\r
#\r
BaseMemoryLib\r
DebugLib\r
PrePiHobListPointerLib\r
- \r
+\r
[Guids]\r
gEfiHobMemoryAllocModuleGuid\r
gEfiHobMemoryAllocStackGuid\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
Updates the pointer to the HOB list.\r
\r
@param HobList Hob list pointer to store\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
)\r
{\r
gHobList = HobList;\r
- \r
+\r
//\r
// If this code is running from ROM this could fail\r
//\r
#/** @file\r
#\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
\r
[LibraryClasses]\r
#DebugLib\r
- \r
+\r
[FixedPcd.common]\r
gEmbeddedTokenSpaceGuid.PcdPrePiHobBase\r
- \r
\ No newline at end of file
/** @file\r
Implementation of the 6 PEI Ffs (FV) APIs in library form.\r
- \r
+\r
This code only knows about a FV if it has a EFI_HOB_TYPE_FV entry in the HOB list\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
/**\r
Returns the highest bit set of the State field\r
- \r
+\r
@param ErasePolarity Erase Polarity as defined by EFI_FVB2_ERASE_POLARITY\r
in the Attributes field.\r
@param FfsHeader Pointer to FFS File Header\r
- \r
+\r
\r
@retval the highest bit in the State field\r
\r
}\r
\r
return HighestBit;\r
-} \r
+}\r
\r
\r
/**\r
Calculates the checksum of the header of a file.\r
The header is a zero byte checksum, so zero means header is good\r
- \r
+\r
@param FfsHeader Pointer to FFS File Header\r
- \r
+\r
@retval Checksum of the header\r
\r
**/\r
UINT8 *Ptr;\r
UINTN Index;\r
UINT8 Sum;\r
- \r
+\r
Sum = 0;\r
Ptr = (UINT8 *)FileHeader;\r
\r
for (; Index < sizeof(EFI_FFS_FILE_HEADER); Index++) {\r
Sum = (UINT8)(Sum + Ptr[Index]);\r
}\r
- \r
+\r
//\r
- // State field (since this indicates the different state of file). \r
+ // State field (since this indicates the different state of file).\r
//\r
Sum = (UINT8)(Sum - FileHeader->State);\r
//\r
\r
/**\r
Given a FileHandle return the VolumeHandle\r
- \r
+\r
@param FileHandle File handle to look up\r
@param VolumeHandle Match for FileHandle\r
- \r
+\r
@retval TRUE VolumeHandle is valid\r
\r
**/\r
if (Hob.Raw == NULL) {\r
return FALSE;\r
}\r
- \r
+\r
do {\r
Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, Hob.Raw);\r
if (Hob.Raw != NULL) {\r
Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, GET_NEXT_HOB (Hob));\r
}\r
} while (Hob.Raw != NULL);\r
- \r
+\r
return FALSE;\r
}\r
\r
Given the input file pointer, search for the next matching file in the\r
FFS volume as defined by SearchType. The search starts from FileHeader inside\r
the Firmware Volume defined by FwVolHeader.\r
- \r
+\r
@param FileHandle File handle to look up\r
@param VolumeHandle Match for FileHandle\r
- \r
+\r
\r
**/\r
EFI_STATUS\r
FileOccupiedSize = GET_OCCUPIED_SIZE (FileLength, 8);\r
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)*FileHeader + FileOccupiedSize);\r
}\r
- \r
+\r
FileOffset = (UINT32) ((UINT8 *)FfsFileHeader - (UINT8 *)FwVolHeader);\r
ASSERT (FileOffset <= 0xFFFFFFFF);\r
\r
while (FileOffset < (FvLength - sizeof (EFI_FFS_FILE_HEADER))) {\r
//\r
- // Get FileState which is the highest bit of the State \r
+ // Get FileState which is the highest bit of the State\r
//\r
FileState = GetFileState (ErasePolarity, FfsFileHeader);\r
\r
FileOffset += sizeof(EFI_FFS_FILE_HEADER);\r
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)FfsFileHeader + sizeof(EFI_FFS_FILE_HEADER));\r
break;\r
- \r
+\r
case EFI_FILE_DATA_VALID:\r
case EFI_FILE_MARKED_FOR_UPDATE:\r
if (CalculateHeaderChecksum (FfsFileHeader) != 0) {\r
*FileHeader = FfsFileHeader;\r
return EFI_SUCCESS;\r
}\r
- } else if (((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) && \r
- (FfsFileHeader->Type != EFI_FV_FILETYPE_FFS_PAD)) { \r
+ } else if (((SearchType == FfsFileHeader->Type) || (SearchType == EFI_FV_FILETYPE_ALL)) &&\r
+ (FfsFileHeader->Type != EFI_FV_FILETYPE_FFS_PAD)) {\r
*FileHeader = FfsFileHeader;\r
return EFI_SUCCESS;\r
}\r
\r
- FileOffset += FileOccupiedSize; \r
+ FileOffset += FileOccupiedSize;\r
FfsFileHeader = (EFI_FFS_FILE_HEADER *)((UINT8 *)FfsFileHeader + FileOccupiedSize);\r
break;\r
- \r
+\r
case EFI_FILE_DELETED:\r
FileLength = *(UINT32 *)(FfsFileHeader->Size) & 0x00FFFFFF;\r
FileOccupiedSize = GET_OCCUPIED_SIZE(FileLength, 8);\r
default:\r
*FileHeader = NULL;\r
return EFI_NOT_FOUND;\r
- } \r
+ }\r
}\r
\r
- \r
+\r
*FileHeader = NULL;\r
- return EFI_NOT_FOUND; \r
+ return EFI_NOT_FOUND;\r
}\r
\r
\r
/**\r
Go through the file to search SectionType section,\r
- when meeting an encapsuled section. \r
- \r
+ when meeting an encapsuled section.\r
+\r
@param SectionType - Filter to find only section of this type.\r
@param Section - From where to search.\r
@param SectionSize - The file size to search.\r
@param OutputBuffer - Pointer to the section to search.\r
- \r
+\r
@retval EFI_SUCCESS\r
**/\r
EFI_STATUS\r
\r
return EFI_SUCCESS;\r
} else if ((Section->Type == EFI_SECTION_COMPRESSION) || (Section->Type == EFI_SECTION_GUID_DEFINED)) {\r
- \r
+\r
if (Section->Type == EFI_SECTION_COMPRESSION) {\r
CompressionSection = (EFI_COMPRESSION_SECTION *) Section;\r
SectionLength = *(UINT32 *)Section->Size & 0x00FFFFFF;\r
- \r
+\r
if (CompressionSection->CompressionType != EFI_STANDARD_COMPRESSION) {\r
return EFI_UNSUPPORTED;\r
}\r
&SectionAttribute\r
);\r
}\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
//\r
// GetInfo failed\r
return EFI_OUT_OF_RESOURCES;\r
}\r
//\r
- // Allocate destination buffer, extra one page for adjustment \r
+ // Allocate destination buffer, extra one page for adjustment\r
//\r
DstBuffer = (VOID *)(UINTN)AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize) + 1);\r
if (DstBuffer == NULL) {\r
&AuthenticationStatus\r
);\r
}\r
- \r
+\r
if (EFI_ERROR (Status)) {\r
//\r
// Decompress failed\r
return EFI_NOT_FOUND;\r
} else {\r
return FfsProcessSection (\r
- SectionType, \r
- DstBuffer, \r
- DstBufferSize, \r
- OutputBuffer \r
+ SectionType,\r
+ DstBuffer,\r
+ DstBufferSize,\r
+ OutputBuffer\r
);\r
- } \r
+ }\r
}\r
\r
//\r
- // Size is 24 bits wide so mask upper 8 bits. \r
+ // Size is 24 bits wide so mask upper 8 bits.\r
// SectionLength is adjusted it is 4 byte aligned.\r
// Go to the next section\r
//\r
ParsedLength += SectionLength;\r
Section = (EFI_COMMON_SECTION_HEADER *)((UINT8 *)Section + SectionLength);\r
}\r
- \r
+\r
return EFI_NOT_FOUND;\r
}\r
\r
FfsFileHeader = (EFI_FFS_FILE_HEADER *)(FileHandle);\r
\r
//\r
- // Size is 24 bits wide so mask upper 8 bits. \r
+ // Size is 24 bits wide so mask upper 8 bits.\r
// Does not include FfsFileHeader header size\r
// FileSize is adjusted to FileOccupiedSize as it is 8 byte aligned.\r
//\r
FileSize -= sizeof (EFI_FFS_FILE_HEADER);\r
\r
return FfsProcessSection (\r
- SectionType, \r
- Section, \r
- FileSize, \r
+ SectionType,\r
+ Section,\r
+ FileSize,\r
SectionData\r
);\r
}\r
)\r
{\r
EFI_PEI_HOB_POINTERS Hob;\r
- \r
+\r
\r
Hob.Raw = GetHobList ();\r
if (Hob.Raw == NULL) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
do {\r
Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, Hob.Raw);\r
if (Hob.Raw != NULL) {\r
Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, GET_NEXT_HOB (Hob));\r
}\r
} while (Hob.Raw != NULL);\r
- \r
+\r
return EFI_NOT_FOUND;\r
\r
}\r
\r
/**\r
Find a file in the volume by name\r
- \r
+\r
@param FileName A pointer to the name of the file to\r
find within the firmware volume.\r
\r
\r
**/\r
EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
FfsFindFileByName (\r
IN CONST EFI_GUID *FileName,\r
IN EFI_PEI_FV_HANDLE VolumeHandle,\r
information.\r
\r
@retval EFI_SUCCESS File information returned.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
- \r
+\r
**/\r
EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
FfsGetFileInfo (\r
IN EFI_PEI_FILE_HANDLE FileHandle,\r
OUT EFI_FV_FILE_INFO *FileInfo\r
}\r
\r
//\r
- // Get FileState which is the highest bit of the State \r
+ // Get FileState which is the highest bit of the State\r
//\r
FileState = GetFileState (ErasePolarity, (EFI_FFS_FILE_HEADER*)FileHandle);\r
\r
switch (FileState) {\r
case EFI_FILE_DATA_VALID:\r
case EFI_FILE_MARKED_FOR_UPDATE:\r
- break; \r
+ break;\r
default:\r
return EFI_INVALID_PARAMETER;\r
}\r
information.\r
\r
@retval EFI_SUCCESS File information returned.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileHandle does not\r
represent a valid file.\r
- \r
+\r
@retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
\r
**/\r
EFI_STATUS\r
-EFIAPI \r
+EFIAPI\r
FfsGetVolumeInfo (\r
IN EFI_PEI_FV_HANDLE VolumeHandle,\r
OUT EFI_FV_INFO *VolumeInfo\r
if (VolumeInfo == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
- // VolumeHandle may not align at 8 byte, \r
- // but FvLength is UINT64 type, which requires FvHeader align at least 8 byte. \r
+ // VolumeHandle may not align at 8 byte,\r
+ // but FvLength is UINT64 type, which requires FvHeader align at least 8 byte.\r
// So, Copy FvHeader into the local FvHeader structure.\r
//\r
CopyMem (&FwVolHeader, VolumeHandle, sizeof (EFI_FIRMWARE_VOLUME_HEADER));\r
@param FileType File handle of a Fv type file.\r
@param Volumehandle On succes Volume Handle of the match\r
@param FileHandle On success File Handle of the match\r
- \r
+\r
@retval EFI_NOT_FOUND FV image can't be found.\r
@retval EFI_SUCCESS Successfully found FileType\r
\r
break;\r
}\r
}\r
- \r
+\r
return Status;\r
}\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
//\r
// Collect FvImage Info.\r
//\r
ZeroMem (&FvImageInfo, sizeof (FvImageInfo));\r
Status = FfsGetVolumeInfo (FvImageHandle, &FvImageInfo);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
//\r
// FvAlignment must be more than 8 bytes required by FvHeader structure.\r
//\r
if (FvAlignment < 8) {\r
FvAlignment = 8;\r
}\r
- \r
+\r
//\r
// Check FvImage\r
//\r
// Inform HOB consumer phase, i.e. DXE core, the existance of this FV\r
//\r
BuildFvHob ((EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart, FvImageInfo.FvSize);\r
- \r
+\r
//\r
// Makes the encapsulated volume show up in DXE phase to skip processing of\r
// encapsulated file again.\r
#define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)\r
\r
//\r
-// Get the data and data size field of GUID \r
+// Get the data and data size field of GUID\r
//\r
#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))\r
#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
VOID *Buffer;\r
\r
ZeroMem (&ImageContext, sizeof (ImageContext));\r
- \r
+\r
ImageContext.Handle = PeCoffImage;\r
ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory;\r
\r
Status = PeCoffLoaderGetImageInfo (&ImageContext);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
\r
//\r
// Allocate Memory for the image\r
\r
\r
\r
-typedef \r
+typedef\r
VOID\r
(EFIAPI *DXE_CORE_ENTRY_POINT) (\r
IN VOID *HobStart\r
return Status;\r
}\r
\r
- \r
+\r
Status = LoadPeCoffImage (PeCoffImage, &ImageAddress, &ImageSize, &EntryPoint);\r
// For NT32 Debug Status = SecWinNtPeiLoadFile (PeCoffImage, &ImageAddress, &ImageSize, &EntryPoint);\r
ASSERT_EFI_ERROR (Status);\r
ASSERT_EFI_ERROR (Status);\r
\r
BuildModuleHob (&FvFileInfo.FileName, (EFI_PHYSICAL_ADDRESS)(UINTN)ImageAddress, EFI_SIZE_TO_PAGES ((UINT32) ImageSize) * EFI_PAGE_SIZE, EntryPoint);\r
- \r
+\r
DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading DxeCore at 0x%10p EntryPoint=0x%10p\n", (VOID *)(UINTN)ImageAddress, (VOID *)(UINTN)EntryPoint));\r
\r
Hob = GetHobList ();\r
if (StackSize == 0) {\r
// User the current stack\r
- \r
+\r
((DXE_CORE_ENTRY_POINT)(UINTN)EntryPoint) (Hob);\r
} else {\r
- \r
+\r
//\r
// Allocate 128KB for the Stack\r
//\r
BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (StackSize));\r
ASSERT (BaseOfStack != NULL);\r
- \r
+\r
//\r
// Compute the top of the stack we were allocated. Pre-allocate a UINTN\r
// for safety.\r
\r
//\r
// Update the contents of BSP stack HOB to reflect the real stack info passed to DxeCore.\r
- // \r
+ //\r
UpdateStackHob ((EFI_PHYSICAL_ADDRESS)(UINTN) BaseOfStack, StackSize);\r
\r
SwitchStack (\r
);\r
\r
}\r
- \r
+\r
// Should never get here as DXE Core does not return\r
DEBUG ((EFI_D_ERROR, "DxeCore returned\n"));\r
ASSERT (FALSE);\r
- \r
+\r
return EFI_DEVICE_ERROR;\r
}\r
\r
\r
if (!EFI_ERROR (Status)) {\r
return LoadDxeCoreFromFfsFile (FileHandle, StackSize);\r
- } \r
- \r
- return Status; \r
+ }\r
+\r
+ return Status;\r
}\r
\r
\r
if (!EFI_ERROR (Status)) {\r
Status = FfsProcessFvFile (FileHandle);\r
}\r
- \r
+\r
return Status;\r
}\r
\r
#/** @file\r
# Component description file for Apple Pre PI Library\r
#\r
-# LIbrary helps you build a platform that skips PEI and loads DXE Core \r
+# LIbrary helps you build a platform that skips PEI and loads DXE Core\r
# directly. Helps building HOBs, reading data from the FV, and doing\r
-# decompression. \r
+# decompression.\r
#\r
# Copyright (c) 2008, Apple Inc. All rights reserved.<BR>\r
#\r
FILE_GUID = 1F3A3278-82EB-4C0D-86F1-5BCDA5846CB2\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = PrePiLib \r
+ LIBRARY_CLASS = PrePiLib\r
\r
\r
#\r
[Protocols]\r
gEfiStatusCodeRuntimeProtocolGuid\r
gPeCoffLoaderProtocolGuid\r
- \r
+\r
\r
[FixedPcd.common]\r
gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize\r
Library that helps implement monolithic PEI\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
);\r
\r
\r
-EFI_STATUS_CODE_PROTOCOL gStatusCode = { \r
- (EFI_REPORT_STATUS_CODE)SerialReportStatusCode \r
+EFI_STATUS_CODE_PROTOCOL gStatusCode = {\r
+ (EFI_REPORT_STATUS_CODE)SerialReportStatusCode\r
};\r
\r
/**\r
\r
} else if (Data != NULL &&\r
ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {\r
- \r
+\r
//\r
// Print DEBUG() information into output buffer.\r
//\r
Implementation of the 6 PEI Ffs (FV) APIs in library form.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
Hob = GetHobList ();\r
\r
- \r
+\r
//\r
// Verify that there is sufficient memory to satisfy the allocation\r
//\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
/** @file\r
Implement EFI RealTimeClock runtime services via RTC Lib.\r
- \r
+\r
Currently this driver does not support runtime virtual calling.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
//\r
// Only needed if you are going to support the OS calling RTC functions in virtual mode.\r
- // You will need to call EfiConvertPointer (). To convert any stored physical addresses \r
+ // You will need to call EfiConvertPointer (). To convert any stored physical addresses\r
// to virtual address. After the OS transistions to calling in virtual mode, all future\r
// runtime calls will be made in virtual mode.\r
//\r
[LibraryClasses]\r
IoLib\r
DebugLib\r
- \r
\ No newline at end of file
/** @file\r
Template library implementation to support ResetSystem Runtime call.\r
- \r
+\r
Fill in the templates with what ever makes you system reset.\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
{\r
UINTN Address;\r
UINT8 Data;\r
- \r
- \r
+\r
+\r
switch (ResetType) {\r
case EfiResetCold:\r
// system power cycle\r
- \r
+\r
// Example using IoLib functions to do IO.\r
Address = 0x12345678;\r
Data = MmioRead8 (Address);\r
MmioWrite8 (Address, Data | 0x01);\r
- \r
+\r
// Note this is a bad example asa MmioOr8 (Address, 0x01) does the same thing\r
break;\r
- \r
+\r
case EfiResetWarm:\r
- // not a full power cycle, maybe memory stays around. \r
+ // not a full power cycle, maybe memory stays around.\r
// if not support do the same thing as EfiResetCold.\r
break;\r
- \r
+\r
case EfiResetShutdown:\r
// turn off the system.\r
// if not support do the same thing as EfiResetCold.\r
break;\r
- \r
+\r
default:\r
return EFI_INVALID_PARAMETER;\r
}\r
//\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
\r
\r
/**\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
Extended Serial I/O Port library functions\r
\r
Copyright (c) 2012, ARM Ltd. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2012, ARM Ltd. All rights reserved.\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Poll the serial device to see if there is any data waiting.\r
\r
If there is data waiting to be read from the serial port, then return\r
- TRUE. If there is no data waiting to be read from the serial port, then \r
+ TRUE. If there is no data waiting to be read from the serial port, then\r
return FALSE.\r
\r
@retval TRUE Data is waiting to be read.\r
#/** @file\r
-# \r
+#\r
# Component description file for Bds module\r
#\r
# Copyright (c) 2008, Apple Inc. All rights reserved.\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
\r
[FixedPcd]\r
gEmbeddedTokenSpaceGuid.PcdMetronomeTickPeriod\r
- \r
+\r
[Protocols]\r
- gEfiMetronomeArchProtocolGuid \r
+ gEfiMetronomeArchProtocolGuid\r
\r
[depex]\r
TRUE\r
/** @file\r
Implement EFI RealTimeClock runtime services via RTC Lib.\r
- \r
+\r
Currently this driver does not support runtime virtual calling.\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
-#include <PiDxe.h> \r
+#include <PiDxe.h>\r
#include <Library/UefiLib.h>\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/RealTimeClockLib.h>\r
RealTimeClockLib\r
\r
[Protocols]\r
- gEfiRealTimeClockArchProtocolGuid \r
+ gEfiRealTimeClockArchProtocolGuid\r
\r
[Depex]\r
TRUE\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
EFI_HANDLE Handle;\r
\r
LibInitializeResetSystem (ImageHandle, SystemTable);\r
- \r
+\r
SystemTable->RuntimeServices->ResetSystem = ResetSystemViaLib;\r
\r
Handle = NULL;\r
#/** @file\r
-# \r
+#\r
# Convert SerialLib into SerialIo protocol\r
-# \r
+#\r
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
SerialPortExtLib\r
\r
[Protocols]\r
- gEfiSerialIoProtocolGuid \r
+ gEfiSerialIoProtocolGuid\r
gEfiDevicePathProtocolGuid\r
\r
[FixedPcd]\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity\r
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits\r
\r
-[Depex] \r
+[Depex]\r
TRUE\r
/** @file\r
- Serial IO Abstraction for GDB stub. This allows an EFI consoles that shows up on the system \r
+ Serial IO Abstraction for GDB stub. This allows an EFI consoles that shows up on the system\r
running GDB. One console for error information and another console for user input/output.\r
\r
Basic packet format is $packet-data#checksum. So every command has 4 bytes of overhead: $,\r
- #, 0, 0. The 0 and 0 are the ascii characters for the checksum. \r
+ #, 0, 0. The 0 and 0 are the ascii characters for the checksum.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
Reset the serial device.\r
\r
@param This Protocol instance pointer.\r
- \r
+\r
@retval EFI_SUCCESS The device was reset.\r
@retval EFI_DEVICE_ERROR The serial device could not be reset.\r
\r
\r
@param This Protocol instance pointer.\r
@param Control A pointer to return the current Control signals from the serial device.\r
- \r
+\r
@retval EFI_SUCCESS The control bits were read from the serial device.\r
@retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
\r
)\r
{\r
UINTN Count;\r
- \r
+\r
Count = SerialPortWrite (Buffer, *BufferSize);\r
\r
if (Count != *BufferSize) {\r
return EFI_SUCCESS;\r
}\r
\r
-// \r
+//\r
// Template used to initialize the GDB Serial IO protocols\r
//\r
EFI_SERIAL_IO_MODE gSerialIoMode = {\r
\r
// Make a new handle with Serial IO protocol and its device path on it.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &gHandle, \r
+ &gHandle,\r
&gEfiSerialIoProtocolGuid, &gSerialIoTemplate,\r
- &gEfiDevicePathProtocolGuid, &mDevicePath, \r
+ &gEfiDevicePathProtocolGuid, &mDevicePath,\r
NULL\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
return Status;\r
}\r
\r
/** @file\r
- Simple Console that sits on a SerialLib. \r
+ Simple Console that sits on a SerialLib.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
**/\r
\r
-/* \r
+/*\r
Symbols used in table below\r
===========================\r
ESC = 0x1B\r
)\r
{\r
CHAR8 Char;\r
- \r
+\r
if (!SerialPortPoll ()) {\r
return EFI_NOT_READY;\r
}\r
- \r
+\r
SerialPortRead ((UINT8 *)&Char, 1);\r
- \r
+\r
//\r
// Check for ESC sequence. This code is not techincally correct VT100 code.\r
// An illegal ESC sequence represents an ESC and the characters that follow.\r
- // This code will eat one or two chars after an escape. This is done to \r
+ // This code will eat one or two chars after an escape. This is done to\r
// prevent some complex FIFOing of the data. It is good enough to get\r
// the arrow and delete keys working\r
//\r
Key->ScanCode = SCAN_HOME;\r
break;\r
case 'K':\r
- case 'F': // PC ANSI \r
+ case 'F': // PC ANSI\r
Key->ScanCode = SCAN_END;\r
break;\r
case '@':\r
Key->ScanCode = SCAN_INSERT;\r
break;\r
case 'P':\r
- case 'X': // PC ANSI \r
+ case 'X': // PC ANSI\r
Key->ScanCode = SCAN_DELETE;\r
break;\r
case 'U':\r
}\r
}\r
} else if (Char < ' ') {\r
- if ((Char == CHAR_BACKSPACE) || \r
- (Char == CHAR_TAB) || \r
- (Char == CHAR_LINEFEED) || \r
+ if ((Char == CHAR_BACKSPACE) ||\r
+ (Char == CHAR_TAB) ||\r
+ (Char == CHAR_LINEFEED) ||\r
(Char == CHAR_CARRIAGE_RETURN)) {\r
// Only let through EFI required control characters\r
- Key->UnicodeChar = (CHAR16)Char; \r
+ Key->UnicodeChar = (CHAR16)Char;\r
}\r
} else if (Char == 0x7f) {\r
Key->ScanCode = SCAN_DELETE;\r
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r
UINTN MaxColumn;\r
UINTN MaxRow;\r
- \r
+\r
Size = StrLen(String) + 1;\r
OutputString = AllocatePool(Size);\r
\r
//If there is any non-ascii characters in String buffer then replace it with '?'\r
//Eventually, UnicodeStrToAsciiStr API should be fixed.\r
- SafeUnicodeStrToAsciiStr(String, OutputString); \r
+ SafeUnicodeStrToAsciiStr(String, OutputString);\r
SerialPortWrite ((UINT8 *)OutputString, Size - 1);\r
\r
//\r
This,\r
Mode->Mode,\r
&MaxColumn,\r
- &MaxRow \r
+ &MaxRow\r
);\r
if (EFI_ERROR(Status)) {\r
return EFI_UNSUPPORTED;\r
&mSimpleTextIn.WaitForKey\r
);\r
ASSERT_EFI_ERROR (Status);\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces(\r
&mInstallHandle,\r
&gEfiSimpleTextInProtocolGuid, &mSimpleTextIn,\r
gST->ConOut = &mSimpleTextOut;\r
gST->ConIn = &mSimpleTextIn;\r
}\r
- \r
+\r
return Status;\r
}\r
#/** @file\r
-# \r
+#\r
# Component description file for Bds module\r
-# \r
+#\r
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
SerialPortLib\r
\r
[Guids]\r
- \r
+\r
\r
[Protocols]\r
- gEfiSimpleTextInProtocolGuid \r
- gEfiSimpleTextOutProtocolGuid \r
- gEfiSerialIoProtocolGuid \r
+ gEfiSimpleTextInProtocolGuid\r
+ gEfiSimpleTextOutProtocolGuid\r
+ gEfiSerialIoProtocolGuid\r
gEfiDevicePathProtocolGuid\r
\r
[FixedPcd]\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
MemoryLength = (UINT64)MemorySize;\r
HobBase = (VOID *)(UINTN)(FixedPcdGet32(PcdEmbeddedFdBaseAddress) + FixedPcdGet32(PcdEmbeddedFdSize));\r
CreateHobList (MemoryBase, MemorySize, HobBase, StackBase);\r
- \r
+\r
MemoryBegin = (EFI_PHYSICAL_ADDRESS)(UINTN)StackBase;\r
MemoryLength = (UINT64)StackSize;\r
UpdateStackHob (MemoryBegin, MemoryLength);\r
\r
DEBUG ((DEBUG_ERROR, "CEntryPoint (%x,%x,%x,%x)\n", MemoryBase, MemorySize, StackBase, StackSize));\r
- \r
+\r
//\r
// Add your C code stuff here....\r
//\r
- \r
- \r
+\r
+\r
//\r
// Load the DXE Core and transfer control to it\r
//\r
- \r
- // Give the DXE Core access to our DEBUG and ASSERT infrastructure so this will work prior \r
+\r
+ // Give the DXE Core access to our DEBUG and ASSERT infrastructure so this will work prior\r
// to the DXE version being loaded. Thus we close the debugging gap between phases.\r
AddDxeCoreReportStatusCodeCallback ();\r
- \r
+\r
//BuildFvHobs (PcdBfvBase, PcdBfvSize, NULL);\r
- \r
+\r
LoadDxeCoreFromFv (NULL, 0);\r
- \r
+\r
// DXE Core should always load and never return\r
ASSERT (FALSE);\r
}\r
#/** @file\r
-# \r
+#\r
# Component description file for DxeIpl module\r
-# \r
+#\r
# The responsibility of this module is to load the DXE Core from a Firmware Volume. This implementation i used to load a 32-bit DXE Core.\r
-# \r
+#\r
# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MdePkg/MdePkg.dec\r
MdeModulePkg/MdeModulePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
- \r
+\r
\r
[LibraryClasses]\r
BaseLib\r
PeCoffLib\r
CacheMaintenanceLib\r
PrePiLib\r
- \r
+\r
[Pcd]\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize\r
Component Name Protocol implementation for the MMC DXE driver\r
\r
Copyright (c) 2011, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
Diagnostics Protocol implementation for the MMC DXE driver\r
\r
Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+\r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
Main file of the MMC Dxe driver. The driver entrypoint is defined into this file.\r
\r
Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
}\r
\r
/**\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
}\r
\r
/**\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
};\r
\r
/**\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
CheckCardsCallback,\r
NULL,\r
&gCheckCardsEvent);\r
- ASSERT_EFI_ERROR (Status); \r
- \r
+ ASSERT_EFI_ERROR (Status);\r
+\r
Status = gBS->SetTimer(\r
gCheckCardsEvent,\r
TimerPeriodic,\r
Main Header file for the MMC DXE driver\r
\r
Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
} CARD_TYPE;\r
\r
typedef struct {\r
- UINT32 Reserved0: 7; // 0 \r
+ UINT32 Reserved0: 7; // 0\r
UINT32 V170_V195: 1; // 1.70V - 1.95V\r
UINT32 V200_V260: 7; // 2.00V - 2.60V\r
UINT32 V270_V360: 9; // 2.70V - 3.60V\r
UINT32 RESERVED_1: 5; // Reserved\r
- UINT32 AccessMode: 2; // 00b (byte mode), 10b (sector mode) \r
+ UINT32 AccessMode: 2; // 00b (byte mode), 10b (sector mode)\r
UINT32 PowerUp: 1; // This bit is set to LOW if the card has not finished the power up routine\r
} OCR;\r
\r
UINT8 PERM_WRITE_PROTECT: 1; // Permanent write protection [13:13]\r
UINT8 COPY: 1; // Copy flag (OTP) [14:14]\r
UINT8 FILE_FORMAT_GRP: 1; // File format group [15:15]\r
- \r
+\r
UINT16 RESERVED_2: 5; // Reserved [20:16]\r
UINT16 WRITE_BL_PARTIAL: 1; // Partial blocks for write allowed [21:21]\r
UINT16 WRITE_BL_LEN: 4; // Max. write data block length [25:22]\r
UINT16 R2W_FACTOR: 3; // Write speed factor [28:26]\r
UINT16 RESERVED_3: 2; // Reserved [30:29]\r
UINT16 WP_GRP_ENABLE: 1; // Write protect group enable [31:31]\r
- \r
+\r
UINT32 WP_GRP_SIZE: 7; // Write protect group size [38:32]\r
UINT32 SECTOR_SIZE: 7; // Erase sector size [45:39]\r
UINT32 ERASE_BLK_EN: 1; // Erase single block enable [46:46]\r
UINT32 VDD_R_CURR_MAX: 3; // Max. read current @ VDD max [58:56]\r
UINT32 VDD_R_CURR_MIN: 3; // Max. read current @ VDD min [61:59]\r
UINT32 C_SIZELow2: 2; // Device size [63:62]\r
- \r
+\r
UINT32 C_SIZEHigh10: 10;// Device size [73:64]\r
UINT32 RESERVED_4: 2; // Reserved [75:74]\r
UINT32 DSR_IMP: 1; // DSR implemented [76:76]\r
UINT8 TRAN_SPEED ; // Max. bus clock frequency [103:96]\r
UINT8 NSAC ; // Data read access-time 2 in CLK cycles (NSAC*100) [111:104]\r
UINT8 TAAC ; // Data read access-time 1 [119:112]\r
- \r
+\r
UINT8 RESERVED_5: 6; // Reserved [125:120]\r
UINT8 CSD_STRUCTURE: 2; // CSD structure [127:126]\r
} CSD;\r
EFI_BLOCK_IO_PROTOCOL BlockIo;\r
CARD_INFO CardInfo;\r
EFI_MMC_HOST_PROTOCOL *MmcHost;\r
- \r
+\r
BOOLEAN Initialized;\r
} MMC_HOST_INSTANCE;\r
\r
/**\r
Reset the block device.\r
\r
- This function implements EFI_BLOCK_IO_PROTOCOL.Reset(). \r
+ This function implements EFI_BLOCK_IO_PROTOCOL.Reset().\r
It resets the block device hardware.\r
ExtendedVerification is ignored in this implementation.\r
\r
/**\r
Reads the requested number of blocks from the device.\r
\r
- This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks(). \r
+ This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks().\r
It reads the requested number of blocks from the device.\r
All the blocks are read, or an error is returned.\r
\r
/**\r
Writes a specified number of blocks to the device.\r
\r
- This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks(). \r
+ This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks().\r
It writes a specified number of blocks to the device.\r
All blocks are written, or an error is returned.\r
\r
# Build file for the MMC DXE driver\r
#\r
# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
#**/\r
\r
gEfiDevicePathProtocolGuid\r
gEfiMmcHostProtocolGuid\r
gEfiDriverDiagnostics2ProtocolGuid\r
- \r
+\r
[Depex]\r
TRUE\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
MmioWrite32 (GPMC_ECC_SIZE_CONFIG, (ECCSIZE0_512BYTES | ECCSIZE1_512BYTES));\r
}\r
\r
-VOID \r
+VOID\r
NandEnableEcc (\r
VOID\r
)\r
EccResult = MmioRead32 (EccResultRegister);\r
\r
//Calculate ECC code from 32-bit ECC result value.\r
- //NOTE: Following calculation is not part of TRM. We got this information \r
+ //NOTE: Following calculation is not part of TRM. We got this information\r
//from Beagleboard mailing list.\r
gEccCode[Index * 3] = EccResult & 0xFF;\r
gEccCode[(Index * 3) + 1] = (EccResult >> 16) & 0xFF;\r
MmioWrite16(GPMC_NAND_DATA_0, *MainAreaWordBuffer++);\r
\r
//After each write access, device has to wait to accept data.\r
- //Currently we may not be programming proper timing parameters to \r
+ //Currently we may not be programming proper timing parameters to\r
//the GPMC_CONFIGi_0 registers and we would need to figure that out.\r
//Without following delay, page programming fails.\r
gBS->Stall(1);\r
\r
//Send RESET command to device.\r
NandSendCommand(RESET_CMD);\r
- \r
+\r
//Wait for 1ms before we check status register.\r
gBS->Stall(1000);\r
\r
ResetBusyTimeout--;\r
}\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
Status = EFI_INVALID_PARAMETER;\r
goto exit;\r
}\r
- \r
+\r
if (Lba > LAST_BLOCK) {\r
Status = EFI_INVALID_PARAMETER;\r
goto exit;\r
}\r
- \r
+\r
if ((BufferSize % gNandFlashInfo->BlockSize) != 0) {\r
Status = EFI_BAD_BUFFER_SIZE;\r
goto exit;\r
Status = EFI_INVALID_PARAMETER;\r
goto exit;\r
}\r
- \r
+\r
if (Lba > LAST_BLOCK) {\r
Status = EFI_INVALID_PARAMETER;\r
goto exit;\r
}\r
- \r
+\r
if ((BufferSize % gNandFlashInfo->BlockSize) != 0) {\r
Status = EFI_BAD_BUFFER_SIZE;\r
goto exit;\r
goto exit;\r
}\r
}\r
- \r
+\r
// Program data\r
Status = NandWriteBlock((UINTN)Lba, EndBlockIndex, Buffer, SpareBuffer);\r
if (EFI_ERROR(Status)) {\r
0 // LastBlock\r
};\r
\r
-EFI_BLOCK_IO_PROTOCOL BlockIo = \r
+EFI_BLOCK_IO_PROTOCOL BlockIo =\r
{\r
EFI_BLOCK_IO_INTERFACE_REVISION, // Revision\r
&gNandFlashMedia, // *Media\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
gNandFlashInfo = (NAND_FLASH_INFO *)AllocateZeroPool (sizeof(NAND_FLASH_INFO));\r
\r
//Initialize GPMC module.\r
\r
//Publish BlockIO.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &ImageHandle, \r
+ &ImageHandle,\r
&gEfiBlockIoProtocolGuid, &BlockIo,\r
- &gEfiDevicePathProtocolGuid, &gDevicePath, \r
+ &gEfiDevicePathProtocolGuid, &gDevicePath,\r
NULL\r
);\r
return Status;\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
IoLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEfiBlockIoProtocolGuid\r
gEfiCpuArchProtocolGuid\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxGpmcOffset\r
\r
[depex]\r
- TRUE\r
\ No newline at end of file
+ TRUE\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces(&ImageHandle, &gEmbeddedGpioProtocolGuid, &Gpio, NULL);\r
return Status;\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
OmapLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEmbeddedGpioProtocolGuid\r
\r
[Pcd]\r
\r
[depex]\r
- TRUE\r
\ No newline at end of file
+ TRUE\r
/** @file\r
\r
- Abstractions for simple OMAP DMA. \r
- OMAP_DMA4 structure elements are described in the OMAP35xx TRM. \r
+ Abstractions for simple OMAP DMA.\r
+ OMAP_DMA4 structure elements are described in the OMAP35xx TRM.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
\r
} OMAP_DMA4;\r
\r
\r
-/** \r
+/**\r
Configure OMAP DMA Channel\r
- \r
+\r
@param Channel DMA Channel to configure\r
- @param Dma4 Pointer to structure used to initialize DMA registers for the Channel \r
- \r
+ @param Dma4 Pointer to structure used to initialize DMA registers for the Channel\r
+\r
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r
@retval EFI_INVALID_PARAMETER Channel is not valid\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested information.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
IN OMAP_DMA4 *Dma4\r
);\r
\r
-/** \r
+/**\r
Turn of DMA channel configured by EnableDma().\r
- \r
+\r
@param Channel DMA Channel to configure\r
@param SuccesMask Bits in DMA4_CSR register indicate EFI_SUCCESS\r
@param ErrorMask Bits in DMA4_CSR register indicate EFI_DEVICE_ERROR\r
- \r
+\r
@retval EFI_SUCCESS DMA hardware disabled\r
@retval EFI_INVALID_PARAMETER Channel is not valid\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested information.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
\r
\r
\r
-#endif \r
+#endif\r
\r
#ifndef __OMAPLIB_H__\r
#define __OMAPLIB_H__\r
\r
-UINT32 \r
+UINT32\r
EFIAPI\r
GpioBase (\r
IN UINTN Port\r
);\r
\r
-UINT32 \r
+UINT32\r
EFIAPI\r
TimerBase (\r
IN UINTN Timer\r
#define DMA4_CSDP_BURST_EN32 (0x2 << 14)\r
#define DMA4_CSDP_BURST_EN64 (0x3 << 14)\r
\r
-#define DMA4_CSDP_WRITE_MODE_NONE_POSTED (0x0 << 16) \r
+#define DMA4_CSDP_WRITE_MODE_NONE_POSTED (0x0 << 16)\r
#define DMA4_CSDP_WRITE_MODE_POSTED (0x1 << 16)\r
-#define DMA4_CSDP_WRITE_MODE_LAST_NON_POSTED (0x2 << 16) \r
+#define DMA4_CSDP_WRITE_MODE_LAST_NON_POSTED (0x2 << 16)\r
\r
#define DMA4_CSDP_DST_ENDIAN_LOCK_LOCK BIT18\r
#define DMA4_CSDP_DST_ENDIAN_LOCK_ADAPT 0\r
#define DMA4_CSDP_SRC_ENDIAN_BIG BIT21\r
#define DMA4_CSDP_SRC_ENDIAN_LITTLE 0\r
\r
-// Channel Control \r
+// Channel Control\r
#define DMA4_CCR_SYNCHRO_CONTROL_MASK 0x1f\r
\r
#define DMA4_CCR_FS_ELEMENT (0 | 0)\r
\r
#define DMA4_CCR_CONST_FILL_ENABLE BIT16\r
#define DMA4_CCR_TRANSPARENT_COPY_ENABLE BIT17\r
- \r
+\r
#define DMA4_CCR_SEL_SRC_DEST_SYNC_SOURCE BIT24\r
\r
#define DMA4_CSR_DROP BIT1\r
#define DMA4_CICR_ENABLE_ALL 0x1FBE\r
\r
\r
-#endif \r
+#endif\r
\r
#define RSP_TYPE_48BITS (0x2UL << 16)\r
#define CCCE_ENABLE BIT19\r
#define CICE_ENABLE BIT20\r
-#define DP_ENABLE BIT21 \r
+#define DP_ENABLE BIT21\r
#define INDX(CMD_INDX) ((CMD_INDX & 0x3F) << 24)\r
\r
#define MMCHS_RSP10 (MMCHS1BASE + 0x110)\r
\r
#define CM_CLKSEL_PLL_MULT(x) (((x) & 0x07FF) << 8)\r
#define CM_CLKSEL_PLL_DIV(x) ((((x) - 1) & 0x7F) << 0)\r
- \r
+\r
#define CM_CLKSEL_DIV_120M(x) (((x) & 0x1F) << 0)\r
\r
#define CM_FCLKEN_USBHOST_EN_USBHOST2_MASK BIT1\r
#define VMMC1_DEV_GRP 0x82\r
#define DEV_GRP_P1 BIT5\r
\r
-#define VMMC1_DEDICATED_REG 0x85 \r
+#define VMMC1_DEDICATED_REG 0x85\r
#define VSEL_1_85V 0x0\r
#define VSEL_2_85V 0x1\r
#define VSEL_3_00V 0x2\r
/** @file\r
- Handle OMAP35xx interrupt controller \r
+ Handle OMAP35xx interrupt controller\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
/**\r
Shutdown our hardware\r
- \r
+\r
DXE Core will disable interrupts and turn off the timer and disable interrupts\r
after all the event handlers have run.\r
\r
if (Source > MAX_VECTOR) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
- } \r
- \r
+ }\r
+\r
if ((MmioRead32 (INTCPS_ILR(Source)) & INTCPS_ILR_FIQ) == INTCPS_ILR_FIQ) {\r
// This vector has been programmed as FIQ so we can't use it for IRQ\r
- // EFI does not use FIQ, but the debugger can use it to check for \r
+ // EFI does not use FIQ, but the debugger can use it to check for\r
// ctrl-c. So this ASSERT means you have a conflict with the debug agent\r
ASSERT (FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
if ((Handler == NULL) && (gRegisteredInterruptHandlers[Source] == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
{\r
UINTN Bank;\r
UINTN Bit;\r
- \r
+\r
if (Source > MAX_VECTOR) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
Bank = Source / 32;\r
Bit = 1UL << (Source % 32);\r
- \r
+\r
MmioWrite32 (INTCPS_MIR_CLEAR(Bank), Bit);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
{\r
UINTN Bank;\r
UINTN Bit;\r
- \r
+\r
if (Source > MAX_VECTOR) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
Bank = Source / 32;\r
Bit = 1UL << (Source % 32);\r
- \r
+\r
MmioWrite32 (INTCPS_MIR_SET(Bank), Bit);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
{\r
UINTN Bank;\r
UINTN Bit;\r
- \r
+\r
if (InterruptState == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
if (Source > MAX_VECTOR) {\r
ASSERT(FALSE);\r
return EFI_UNSUPPORTED;\r
\r
Bank = Source / 32;\r
Bit = 1UL << (Source % 32);\r
- \r
+\r
if ((MmioRead32(INTCPS_MIR(Bank)) & Bit) == Bit) {\r
*InterruptState = FALSE;\r
} else {\r
*InterruptState = TRUE;\r
}\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
/**\r
- Signal to the hardware that the End Of Intrrupt state \r
+ Signal to the hardware that the End Of Intrrupt state\r
has been reached.\r
\r
@param This Instance pointer for this protocol\r
{\r
UINT32 Vector;\r
HARDWARE_INTERRUPT_HANDLER InterruptHandler;\r
- \r
+\r
Vector = MmioRead32 (INTCPS_SIR_IRQ) & INTCPS_SIR_IRQ_MASK;\r
\r
// Needed to prevent infinite nesting when Time Driver lowers TPL\r
MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);\r
ArmDataSyncronizationBarrier ();\r
- \r
+\r
InterruptHandler = gRegisteredInterruptHandlers[Vector];\r
if (InterruptHandler != NULL) {\r
// Call the registered interrupt handler.\r
InterruptHandler (Vector, SystemContext);\r
}\r
- \r
+\r
// Needed to clear after running the handler\r
MmioWrite32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);\r
ArmDataSyncronizationBarrier ();\r
MmioWrite32 (INTCPS_MIR(1), 0xFFFFFFFF);\r
MmioWrite32 (INTCPS_MIR(2), 0xFFFFFFFF);\r
MmioOr32 (INTCPS_CONTROL, INTCPS_CONTROL_NEWIRQAGR);\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces(&gHardwareInterruptHandle,\r
&gHardwareInterruptProtocolGuid, &gHardwareInterruptProtocol,\r
NULL);\r
ASSERT_EFI_ERROR(Status);\r
- \r
+\r
//\r
// Get the CPU protocol that this driver requires.\r
//\r
#/** @file\r
-# \r
+#\r
# Interrupt DXE driver\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[Protocols]\r
gHardwareInterruptProtocolGuid\r
gEfiCpuArchProtocolGuid\r
- \r
+\r
[FixedPcd.common]\r
gEmbeddedTokenSpaceGuid.PcdInterruptBaseAddress\r
\r
);\r
}\r
}\r
- \r
+\r
return Status;\r
}\r
\r
if (!mDisplayInitialized) {\r
InitializeDisplay (Instance);\r
}\r
- \r
+\r
switch (BltOperation) {\r
case EfiBltVideoFill:\r
Status = BltVideoFill (This, BltBuffer, SourceX, SourceY, DestinationX, DestinationY, Width, Height, Delta);\r
)\r
{\r
// Make sure the interface clock is running\r
- MmioWrite32 (CM_ICLKEN_DSS, EN_DSS); \r
+ MmioWrite32 (CM_ICLKEN_DSS, EN_DSS);\r
\r
// Stop the functional clocks\r
MmioAnd32 (CM_FCLKEN_DSS, ~(EN_DSS1 | EN_DSS2 | EN_TV));\r
\r
// Program the DSS clock divisor\r
MmioWrite32 (CM_CLKSEL_DSS, 0x1000 | (LcdModes[ModeNumber].DssDivisor));\r
- \r
+\r
// Start the functional clocks\r
MmioOr32 (CM_FCLKEN_DSS, (EN_DSS1 | EN_DSS2 | EN_TV));\r
\r
// Reset the subsystem\r
MmioWrite32(DSS_SYSCONFIG, DSS_SOFTRESET);\r
while (!(MmioRead32 (DSS_SYSSTATUS) & DSS_RESETDONE));\r
- \r
+\r
// Configure LCD parameters\r
MmioWrite32 (DISPC_SIZE_LCD,\r
- ((LcdModes[ModeNumber].HorizontalResolution - 1) \r
+ ((LcdModes[ModeNumber].HorizontalResolution - 1)\r
| ((LcdModes[ModeNumber].VerticalResolution - 1) << 16))\r
);\r
MmioWrite32 (DISPC_TIMING_H,\r
MmioWrite32 (DISPC_GFX_PRELD, 0x2D8);\r
MmioWrite32 (DISPC_GFX_BA0, VramBaseAddress);\r
MmioWrite32 (DISPC_GFX_SIZE,\r
- ((LcdModes[ModeNumber].HorizontalResolution - 1) \r
+ ((LcdModes[ModeNumber].HorizontalResolution - 1)\r
| ((LcdModes[ModeNumber].VerticalResolution - 1) << 16))\r
);\r
\r
\r
// Enable power lines used by TFP410\r
Status = gBS->LocateProtocol (&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);\r
- ASSERT_EFI_ERROR (Status); \r
+ ASSERT_EFI_ERROR (Status);\r
\r
OldTpl = gBS->RaiseTPL(TPL_NOTIFY);\r
Data = VAUX_DEV_GRP_P1;\r
\r
Data = VAUX_DEDICATED_18V;\r
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VPLL2_DEDICATED), 1, &Data);\r
- ASSERT_EFI_ERROR (Status); \r
+ ASSERT_EFI_ERROR (Status);\r
\r
// Power up TFP410 (set GPIO2 on TPS - for BeagleBoard-xM)\r
Status = gTPS65950->Read (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID2, GPIODATADIR1), 1, &Data);\r
\r
// Power up TFP410 (set GPIO 170 - for older BeagleBoards)\r
MmioAnd32 (GPIO6_BASE + GPIO_OE, ~BIT10);\r
- MmioOr32 (GPIO6_BASE + GPIO_SETDATAOUT, BIT10); \r
+ MmioOr32 (GPIO6_BASE + GPIO_SETDATAOUT, BIT10);\r
\r
return EFI_SUCCESS;\r
}\r
IN LCD_INSTANCE* Instance\r
)\r
{\r
- EFI_STATUS Status; \r
+ EFI_STATUS Status;\r
UINTN VramSize;\r
EFI_PHYSICAL_ADDRESS VramBaseAddress;\r
\r
#define LCDENABLE BIT0\r
#define ACTIVEMATRIX BIT3\r
#define GOLCD BIT5\r
-#define DATALINES24 (BIT8 | BIT9) \r
+#define DATALINES24 (BIT8 | BIT9)\r
#define LCDENABLESIGNAL BIT28\r
\r
#define GFXENABLE BIT0\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
Debug Agent timer lib for OMAP 35xx.\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
Bank = gVector / 32;\r
Bit = 1UL << (gVector % 32);\r
- \r
+\r
MmioWrite32 (INTCPS_MIR_CLEAR(Bank), Bit);\r
}\r
\r
{\r
UINTN Bank;\r
UINTN Bit;\r
- \r
+\r
Bank = gVector / 32;\r
- Bit = 1UL << (gVector % 32); \r
+ Bit = 1UL << (gVector % 32);\r
\r
MmioWrite32 (INTCPS_MIR_SET(Bank), Bit);\r
}\r
CpuDeadLoop ();\r
}\r
// Set source clock for GPT2 - GPT9 to SYS_CLK\r
- MmioOr32 (CM_CLKSEL_PER, 1 << (TimerNumber - 2)); \r
+ MmioOr32 (CM_CLKSEL_PER, 1 << (TimerNumber - 2));\r
\r
}\r
- \r
- \r
+\r
+\r
/**\r
Set the period for the debug agent timer. Zero means disable the timer.\r
\r
@param[in] TimerPeriodMilliseconds Frequency of the debug agent timer.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerSetPeriod (\r
{\r
UINT64 TimerCount;\r
INT32 LoadValue;\r
- \r
+\r
if (TimerPeriodMilliseconds == 0) {\r
// Turn off GPTIMER3\r
MmioWrite32 (gTCLR, TCLR_ST_OFF);\r
- \r
+\r
DisableInterruptSource ();\r
- } else { \r
+ } else {\r
// Calculate required timer count\r
TimerCount = DivU64x32(TimerPeriodMilliseconds * 1000000, PcdGet32(PcdDebugAgentTimerFreqNanoSeconds));\r
\r
EnableInterruptSource ();\r
}\r
}\r
- \r
+\r
\r
/**\r
- Perform End Of Interrupt for the debug agent timer. This is called in the \r
- interrupt handler after the interrupt has been processed. \r
+ Perform End Of Interrupt for the debug agent timer. This is called in the\r
+ interrupt handler after the interrupt has been processed.\r
\r
-**/ \r
+**/\r
VOID\r
EFIAPI\r
DebugAgentTimerEndOfInterrupt (\r
)\r
{\r
// Clear all timer interrupts\r
- MmioWrite32 (gTISR, TISR_CLEAR_ALL); \r
+ MmioWrite32 (gTISR, TISR_CLEAR_ALL);\r
\r
// Poll interrupt status bits to ensure clearing\r
while ((MmioRead32 (gTISR) & TISR_ALL_INTERRUPT_MASK) != TISR_NO_INTERRUPTS_PENDING);\r
\r
}\r
\r
- \r
\ No newline at end of file
EmbeddedPkg/EmbeddedPkg.dec\r
Omap35xxPkg/Omap35xxPkg.dec\r
ArmPkg/ArmPkg.dec\r
- \r
+\r
\r
[LibraryClasses]\r
BaseLib\r
[Pcd]\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxDebugAgentTimer\r
gOmap35xxTokenSpaceGuid.PcdDebugAgentTimerFreqNanoSeconds\r
- \r
\ No newline at end of file
Add custom commands for BeagleBoard development.\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
Argv[0] - "%CommandName%"\r
\r
@param Argc Number of command arguments in Argv\r
- @param Argv Array of strings that represent the parsed command line. \r
+ @param Argv Array of strings that represent the parsed command line.\r
Argv[0] is the command name\r
\r
@return EFI_SUCCESS\r
FILE_GUID = ea62bdc3-1063-425f-8851-98cb47f213a8\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER \r
+ LIBRARY_CLASS = EblCmdLib|DXE_DRIVER UEFI_APPLICATION UEFI_DRIVER\r
\r
\r
#\r
[LibraryClasses]\r
BaseLib\r
DebugLib\r
- \r
+\r
[Protocols]\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
Basic serial IO abstaction for GDB\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate, \r
- IN UINT8 Parity, \r
- IN UINT8 DataBits, \r
- IN UINT8 StopBits \r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
return RETURN_SUCCESS;\r
EFIAPI\r
GdbIsCharAvailable (\r
VOID\r
- ) \r
+ )\r
{\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 RBR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_RBR_REG;\r
CHAR8 Char;\r
- \r
+\r
while ((MmioRead8(LSR) & UART_LSR_RX_FIFO_E_MASK) == UART_LSR_RX_FIFO_E_EMPTY);\r
Char = MmioRead8(RBR);\r
\r
{\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 THR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_THR_REG;\r
- \r
+\r
while ((MmioRead8(LSR) & UART_LSR_TX_FIFO_E_MASK) == UART_LSR_TX_FIFO_E_NOT_EMPTY);\r
MmioWrite8(THR, Char);\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[LibraryClasses]\r
DebugLib\r
IoLib\r
- OmapLib \r
+ OmapLib\r
\r
[FixedPcd]\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxConsoleUart\r
FILE_GUID = fe1d7183-9abb-42ce-9a3b-36d7c6a8959f\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = TimerLib \r
+ LIBRARY_CLASS = TimerLib\r
\r
[Sources.common]\r
TimerLib.c\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
UINT64 NanoSeconds;\r
- \r
+\r
NanoSeconds = MultU64x32(MicroSeconds, 1000);\r
\r
- while (NanoSeconds > (UINTN)-1) { \r
+ while (NanoSeconds > (UINTN)-1) {\r
NanoSecondDelay((UINTN)-1);\r
NanoSeconds -= (UINTN)-1;\r
}\r
UINT32 TimerCountRegister;\r
\r
Delay = (NanoSeconds / PcdGet32(PcdEmbeddedPerformanceCounterPeriodInNanoseconds)) + 1;\r
- \r
+\r
TimerCountRegister = TimerBase(PcdGet32(PcdOmap35xxFreeTimer)) + GPTIMER_TCRR;\r
\r
StartTime = MmioRead32 (TimerCountRegister);\r
\r
- do \r
+ do\r
{\r
CurrentTime = MmioRead32 (TimerCountRegister);\r
ElapsedTime = CurrentTime - StartTime;\r
GetPerformanceCounter (\r
VOID\r
)\r
-{ \r
+{\r
return (UINT64)MmioRead32 (TimerBase(PcdGet32(PcdOmap35xxFreeTimer)) + GPTIMER_TCRR);\r
}\r
\r
// Timer starts with the reload value\r
*StartValue = (UINT64)MmioRead32 (TimerBase(PcdGet32(PcdOmap35xxFreeTimer)) + GPTIMER_TLDR);\r
}\r
- \r
+\r
if (EndValue != NULL) {\r
// Timer counts up to 0xFFFFFFFF\r
*EndValue = 0xFFFFFFFF;\r
}\r
- \r
+\r
return PcdGet64(PcdEmbeddedPerformanceCounterFrequencyInHz);\r
}\r
/** @file\r
Abstractions for simple OMAP DMA channel.\r
- \r
+\r
\r
Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#include <Omap3530/Omap3530.h>\r
\r
\r
-/** \r
+/**\r
Configure OMAP DMA Channel\r
- \r
+\r
@param Channel DMA Channel to configure\r
- @param Dma4 Pointer to structure used to initialize DMA registers for the Channel \r
- \r
+ @param Dma4 Pointer to structure used to initialize DMA registers for the Channel\r
+\r
@retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.\r
@retval EFI_INVALID_PARAMETER Channel is not valid\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested information.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
/* 1) Configure the transfer parameters in the logical DMA registers */\r
/*-------------------------------------------------------------------*/\r
\r
- /* a) Set the data type CSDP[1:0], the Read/Write Port access type \r
- CSDP[8:7]/[15:14], the Source/dest endianism CSDP[21]/CSDP[19], \r
+ /* a) Set the data type CSDP[1:0], the Read/Write Port access type\r
+ CSDP[8:7]/[15:14], the Source/dest endianism CSDP[21]/CSDP[19],\r
write mode CSDP[17:16], source/dest packed or nonpacked CSDP[6]/CSDP[13] */\r
- \r
+\r
// Read CSDP\r
RegVal = MmioRead32 (DMA4_CSDP (Channel));\r
- \r
+\r
// Build reg\r
RegVal = ((RegVal & ~ 0x3) | DMA4->DataType );\r
RegVal = ((RegVal & ~(0x3 << 7)) | (DMA4->ReadPortAccessType << 7));\r
RegVal = ((RegVal & ~(0x1 << 13)) | (DMA4->DestinationPacked << 13));\r
// Write CSDP\r
MmioWrite32 (DMA4_CSDP (Channel), RegVal);\r
- \r
+\r
/* b) Set the number of element per frame CEN[23:0]*/\r
MmioWrite32 (DMA4_CEN (Channel), DMA4->NumberOfElementPerFrame);\r
- \r
+\r
/* c) Set the number of frame per block CFN[15:0]*/\r
MmioWrite32 (DMA4_CFN (Channel), DMA4->NumberOfFramePerTransferBlock);\r
- \r
+\r
/* d) Set the Source/dest start address index CSSA[31:0]/CDSA[31:0]*/\r
MmioWrite32 (DMA4_CSSA (Channel), DMA4->SourceStartAddress);\r
MmioWrite32 (DMA4_CDSA (Channel), DMA4->DestinationStartAddress);\r
- \r
+\r
/* e) Set the Read Port addressing mode CCR[13:12], the Write Port addressing mode CCR[15:14],\r
read/write priority CCR[6]/CCR[26]\r
- I changed LCH CCR[20:19]=00 and CCR[4:0]=00000 to \r
+ I changed LCH CCR[20:19]=00 and CCR[4:0]=00000 to\r
LCH CCR[20:19]= DMA4->WriteRequestNumber and CCR[4:0]=DMA4->ReadRequestNumber\r
*/\r
- \r
+\r
// Read CCR\r
RegVal = MmioRead32 (DMA4_CCR (Channel));\r
\r
RegVal = ((RegVal & ~(0x3 << 14)) | (DMA4->WritePortAccessMode << 14));\r
RegVal = ((RegVal & ~(0x1 << 6)) | (DMA4->ReadPriority << 6));\r
RegVal = ((RegVal & ~(0x1 << 26)) | (DMA4->WritePriority << 26));\r
- \r
+\r
// Write CCR\r
MmioWrite32 (DMA4_CCR (Channel), RegVal);\r
- \r
+\r
/* f)- Set the source element index CSEI[15:0]*/\r
MmioWrite32 (DMA4_CSEI (Channel), DMA4->SourceElementIndex);\r
- \r
+\r
/* - Set the source frame index CSFI[15:0]*/\r
MmioWrite32 (DMA4_CSFI (Channel), DMA4->SourceFrameIndex);\r
\r
\r
/* - Set the destination frame index CDFI[31:0]*/\r
MmioWrite32 (DMA4_CDFI (Channel), DMA4->DestinationFrameIndex);\r
- \r
+\r
MmioWrite32 (DMA4_CDFI (Channel), DMA4->DestinationFrameIndex);\r
\r
// Enable all the status bits since we are polling\r
return EFI_SUCCESS;\r
}\r
\r
-/** \r
+/**\r
Turn of DMA channel configured by EnableDma().\r
- \r
+\r
@param Channel DMA Channel to configure\r
@param SuccesMask Bits in DMA4_CSR register indicate EFI_SUCCESS\r
@param ErrorMask Bits in DMA4_CSR register indicate EFI_DEVICE_ERROR\r
- \r
+\r
@retval EFI_SUCCESS DMA hardware disabled\r
@retval EFI_INVALID_PARAMETER Channel is not valid\r
@retval EFI_DEVICE_ERROR The system hardware could not map the requested information.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
MmioWrite32 (DMA4_CICR (Channel), 0);\r
MmioWrite32 (DMA4_CSR (Channel), DMA4_CSR_RESET);\r
\r
- MmioAnd32 (DMA4_CCR(0), ~(DMA4_CCR_ENABLE | DMA4_CCR_RD_ACTIVE | DMA4_CCR_WR_ACTIVE)); \r
+ MmioAnd32 (DMA4_CCR(0), ~(DMA4_CCR_ENABLE | DMA4_CCR_RD_ACTIVE | DMA4_CCR_WR_ACTIVE));\r
return Status;\r
}\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
FILE_GUID = 09B17D99-BB07-49a8-B0D2-06D6AFCBE3AB\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = OmapDmaLib \r
+ LIBRARY_CLASS = OmapDmaLib\r
\r
\r
[Sources.common]\r
IoLib\r
BaseMemoryLib\r
ArmLib\r
- \r
- \r
+\r
+\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
\r
[Depex]\r
- gEfiCpuArchProtocolGuid\r
\ No newline at end of file
+ gEfiCpuArchProtocolGuid\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#include <Library/OmapLib.h>\r
#include <Omap3530/Omap3530.h>\r
\r
-UINT32 \r
+UINT32\r
GpioBase (\r
IN UINTN Port\r
)\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
FILE_GUID = d035f5c2-1b92-4746-9f6c-5ff6202970df\r
MODULE_TYPE = UEFI_DRIVER\r
VERSION_STRING = 1.0\r
- LIBRARY_CLASS = OmapLib \r
+ LIBRARY_CLASS = OmapLib\r
\r
[Sources.common]\r
OmapLib.c\r
\r
[LibraryClasses]\r
DebugLib\r
- \r
+\r
[Protocols]\r
- \r
+\r
[Guids]\r
- \r
+\r
[Pcd]\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
[Defines]\r
INF_VERSION = 0x00010005\r
- BASE_NAME = RealTimeClockLib \r
+ BASE_NAME = RealTimeClockLib\r
FILE_GUID = EC1713DB-7DB5-4c99-8FE2-6F52F95A1132\r
MODULE_TYPE = BASE\r
VERSION_STRING = 1.0\r
MdePkg/MdePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
Omap35xxPkg/Omap35xxPkg.dec\r
- \r
+\r
[LibraryClasses]\r
IoLib\r
UefiLib\r
/** @file\r
Template library implementation to support ResetSystem Runtime call.\r
- \r
+\r
Fill in the templates with what ever makes you system reset.\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
ASSERT (FALSE);\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
\r
\r
/**\r
\r
@param ImageHandle The firmware allocated handle for the EFI image.\r
@param SystemTable A pointer to the EFI System Table.\r
- \r
+\r
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
**/\r
[Pcd.common]\r
gArmTokenSpaceGuid.PcdCpuResetAddress\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress\r
- \r
+\r
[LibraryClasses]\r
DebugLib\r
BeagleBoardSystemLib\r
\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 THR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_THR_REG;\r
UINTN Count;\r
- \r
+\r
for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {\r
while ((MmioRead8(LSR) & UART_LSR_TX_FIFO_E_MASK) == UART_LSR_TX_FIFO_E_NOT_EMPTY);\r
MmioWrite8(THR, *Buffer);\r
UINT32 LSR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_LSR_REG;\r
UINT32 RBR = UartBase(PcdGet32(PcdOmap35xxConsoleUart)) + UART_RBR_REG;\r
UINTN Count;\r
- \r
+\r
for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {\r
while ((MmioRead8(LSR) & UART_LSR_RX_FIFO_E_MASK) == UART_LSR_RX_FIFO_E_EMPTY);\r
*Buffer = MmioRead8(RBR);\r
EmbeddedPkg/EmbeddedPkg.dec\r
MdePkg/MdePkg.dec\r
Omap35xxPkg/Omap35xxPkg.dec\r
- \r
+\r
[FixedPcd]\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxConsoleUart\r
\r
MMC/SD Card driver for OMAP 35xx (SDIO not supported)\r
\r
This driver always produces a BlockIo protocol but it starts off with no Media\r
- present. A TimerCallBack detects when media is inserted or removed and after \r
- a media change event a call to BlockIo ReadBlocks/WriteBlocks will cause the \r
+ present. A TimerCallBack detects when media is inserted or removed and after\r
+ a media change event a call to BlockIo ReadBlocks/WriteBlocks will cause the\r
media to be detected (or removed) and the BlockIo Media structure will get\r
updated. No MMC/SD Card harward registers are updated until the first BlockIo\r
- ReadBlocks/WriteBlocks after media has been insterted (booting with a card \r
- plugged in counts as an insertion event). \r
+ ReadBlocks/WriteBlocks after media has been insterted (booting with a card\r
+ plugged in counts as an insertion event).\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
HW_VENDOR_DP,\r
(UINT8)(sizeof(VENDOR_DEVICE_PATH)),\r
(UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8),\r
- 0xb615f1f5, 0x5088, 0x43cd, 0x80, 0x9c, 0xa1, 0x6e, 0x52, 0x48, 0x7d, 0x00 \r
+ 0xb615f1f5, 0x5088, 0x43cd, 0x80, 0x9c, 0xa1, 0x6e, 0x52, 0x48, 0x7d, 0x00\r
},\r
{\r
END_DEVICE_PATH_TYPE,\r
\r
VOID\r
ParseCardCIDData (\r
- UINT32 Response0, \r
- UINT32 Response1, \r
+ UINT32 Response0,\r
+ UINT32 Response1,\r
UINT32 Response2,\r
UINT32 Response3\r
)\r
MmioAnd32 (MMCHS_SYSCTL, ~CEN);\r
\r
//Set new clock frequency.\r
- MmioAndThenOr32 (MMCHS_SYSCTL, ~CLKD_MASK, NewCLKD << 6); \r
+ MmioAndThenOr32 (MMCHS_SYSCTL, ~CLKD_MASK, NewCLKD << 6);\r
\r
//Poll till Internal Clock Stable\r
while ((MmioRead32 (MMCHS_SYSCTL) & ICS_MASK) != ICS);\r
Data = VSEL_3_00V;\r
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VMMC1_DEDICATED_REG), 1, &Data);\r
ASSERT_EFI_ERROR(Status);\r
- \r
+\r
//After ramping up voltage, set VDDS stable bit to indicate that voltage level is stable.\r
MmioOr32 (CONTROL_PBIAS_LITE, (PBIASLITEVMODE0 | PBIASLITEPWRDNZ0 | PBIASSPEEDCTRL0 | PBIASLITEVMODE1 | PBIASLITEWRDNZ1));\r
\r
\r
DEBUG ((EFI_D_INFO, "CMD0 response: %x\n", MmioRead32 (MMCHS_RSP10)));\r
\r
- //Send CMD5 command. \r
+ //Send CMD5 command.\r
Status = SendCmd (CMD5, CMD5_INT_EN, CmdArgument);\r
if (Status == EFI_SUCCESS) {\r
DEBUG ((EFI_D_ERROR, "CMD5 Success. SDIO card. Follow SDIO card specification.\n"));\r
DEBUG ((EFI_D_INFO, "CMD5 response: %x\n", MmioRead32 (MMCHS_RSP10)));\r
//NOTE: Returning unsupported error for now. Need to implement SDIO specification.\r
- return EFI_UNSUPPORTED; \r
+ return EFI_UNSUPPORTED;\r
} else {\r
DEBUG ((EFI_D_INFO, "CMD5 fails. Not an SDIO card.\n"));\r
}\r
\r
//Poll till card is busy\r
while (RetryCount < MAX_RETRY_COUNT) {\r
- //Send CMD55 command. \r
+ //Send CMD55 command.\r
CmdArgument = 0;\r
Status = SendCmd (CMD55, CMD55_INT_EN, CmdArgument);\r
if (Status == EFI_SUCCESS) {\r
if ((gCardInfo.CardType != UNKNOWN_CARD) && (gCardInfo.CardType != MMC_CARD)) {\r
// We could read SCR register, but SD Card Phys spec stats any SD Card shall\r
// set SCR.SD_BUS_WIDTHS to support 4-bit mode, so why bother?\r
- \r
+\r
// Send ACMD6 (application specific commands must be prefixed with CMD55)\r
Status = SendCmd (CMD55, CMD55_INT_EN, CmdArgument);\r
if (!EFI_ERROR (Status)) {\r
}\r
\r
ZeroMem (&DmaOperation, sizeof (DMA_MAP_OPERATION));\r
- \r
+\r
\r
Dma4.DataType = 2; // DMA4_CSDPi[1:0] 32-bit elements from MMCHS_DATA\r
\r
- Dma4.SourceEndiansim = 0; // DMA4_CSDPi[21] \r
+ Dma4.SourceEndiansim = 0; // DMA4_CSDPi[21]\r
\r
Dma4.DestinationEndianism = 0; // DMA4_CSDPi[19]\r
\r
\r
Dma4.DestinationPacked = 0; // DMA4_CSDPi[13]\r
\r
- Dma4.NumberOfElementPerFrame = This->Media->BlockSize/4; // DMA4_CENi (TRM 4K is optimum value) \r
+ Dma4.NumberOfElementPerFrame = This->Media->BlockSize/4; // DMA4_CENi (TRM 4K is optimum value)\r
\r
- Dma4.NumberOfFramePerTransferBlock = BlockCount; // DMA4_CFNi \r
+ Dma4.NumberOfFramePerTransferBlock = BlockCount; // DMA4_CFNi\r
\r
- Dma4.ReadPriority = 0; // DMA4_CCRi[6] Low priority read \r
+ Dma4.ReadPriority = 0; // DMA4_CCRi[6] Low priority read\r
\r
Dma4.WritePriority = 0; // DMA4_CCRi[23] Prefetech disabled\r
\r
\r
Dma4.WriteMode = 1; // DMA4_CSDPi[17:16] Write posted\r
\r
- \r
+\r
\r
Dma4.SourceStartAddress = MMCHS_DATA; // DMA4_CSSAi\r
\r
\r
Dma4.WritePortAccessMode = 1; // DMA4_CCRi[15:14] Post increment memory address\r
\r
- Dma4.ReadRequestNumber = 0x1e; // DMA4_CCRi[4:0] Syncro with MMCA_DMA_RX (61) \r
+ Dma4.ReadRequestNumber = 0x1e; // DMA4_CCRi[4:0] Syncro with MMCA_DMA_RX (61)\r
\r
Dma4.WriteRequestNumber = 1; // DMA4_CCRi[20:19] Syncro upper 0x3e == 62 (one based)\r
\r
- } else if (OperationType == WRITE) { \r
+ } else if (OperationType == WRITE) {\r
Cmd = CMD25; //Multiple block write\r
CmdInterruptEnable = CMD25_INT_EN;\r
DmaOperation = MapOperationBusMasterRead;\r
\r
Dma4.WriteMode = 1; // DMA4_CSDPi[17:16] Write posted ???\r
\r
- \r
+\r
\r
Dma4.SourceStartAddress = (UINT32)BufferAddress; // DMA4_CSSAi\r
\r
\r
Dma4.WritePortAccessMode = 0; // DMA4_CCRi[15:14] Always write MMCHS_DATA\r
\r
- Dma4.ReadRequestNumber = 0x1d; // DMA4_CCRi[4:0] Syncro with MMCA_DMA_TX (60) \r
+ Dma4.ReadRequestNumber = 0x1d; // DMA4_CCRi[4:0] Syncro with MMCA_DMA_TX (60)\r
\r
Dma4.WriteRequestNumber = 1; // DMA4_CCRi[20:19] Syncro upper 0x3d == 61 (one based)\r
\r
\r
\r
EnableDmaChannel (2, &Dma4);\r
- \r
+\r
\r
//Set command argument based on the card access mode (Byte mode or Block mode)\r
if (gCardInfo.OCRData.AccessMode & BIT1) {\r
}\r
}\r
RetryCount++;\r
- } \r
+ }\r
\r
DisableDmaChannel (2, DMA4_CSR_BLOCK, DMA4_CSR_ERR);\r
Status = DmaUnmap (BufferMap);\r
if (OperationType == READ) {\r
Cmd = CMD17; //Single block read\r
CmdInterruptEnable = CMD18_INT_EN;\r
- } else if (OperationType == WRITE) { \r
+ } else if (OperationType == WRITE) {\r
Cmd = CMD24; //Single block write\r
CmdInterruptEnable = CMD24_INT_EN;\r
}\r
}\r
}\r
RetryCount++;\r
- } \r
+ }\r
\r
if (RetryCount == MAX_RETRY_COUNT) {\r
DEBUG ((EFI_D_ERROR, "TransferBlockData timed out.\n"));\r
DEBUG ((EFI_D_ERROR, "No MMC/SD card detected.\n"));\r
return Status;\r
}\r
- \r
+\r
//Get CSD (Card specific data) for the detected card.\r
Status = GetCardSpecificData();\r
if (EFI_ERROR(Status)) {\r
return Status;\r
}\r
- \r
+\r
//Configure the card in data transfer mode.\r
Status = PerformCardConfiguration();\r
if (EFI_ERROR(Status)) {\r
gMMCHSMedia.LastBlock = (gCardInfo.NumBlocks - 1);\r
gMMCHSMedia.BlockSize = gCardInfo.BlockSize;\r
gMMCHSMedia.ReadOnly = (MmioRead32 (GPIO1_BASE + GPIO_DATAIN) & BIT23) == BIT23;\r
- gMMCHSMedia.MediaPresent = TRUE; \r
- gMMCHSMedia.MediaId++; \r
+ gMMCHSMedia.MediaPresent = TRUE;\r
+ gMMCHSMedia.MediaId++;\r
\r
DEBUG ((EFI_D_INFO, "SD Card Media Change on Handle 0x%08x\n", gImageHandle));\r
\r
EFI_STATUS\r
SdReadWrite (\r
IN EFI_BLOCK_IO_PROTOCOL *This,\r
- IN UINTN Lba, \r
- OUT VOID *Buffer, \r
+ IN UINTN Lba,\r
+ OUT VOID *Buffer,\r
IN UINTN BufferSize,\r
IN OPERATION_TYPE OperationType\r
)\r
BOOLEAN Update;\r
\r
\r
- \r
+\r
Update = FALSE;\r
\r
if (gMediaChange) {\r
gMMCHSMedia.MediaPresent = FALSE;\r
gMMCHSMedia.LastBlock = 0;\r
gMMCHSMedia.BlockSize = 512; // Should be zero but there is a bug in DiskIo\r
- gMMCHSMedia.ReadOnly = FALSE; \r
+ gMMCHSMedia.ReadOnly = FALSE;\r
}\r
gMediaChange = FALSE;\r
} else if (!gMMCHSMedia.MediaPresent) {\r
Status = EFI_INVALID_PARAMETER;\r
goto Done;\r
}\r
- \r
+\r
if ((BufferSize % This->Media->BlockSize) != 0) {\r
Status = EFI_BAD_BUFFER_SIZE;\r
goto Done;\r
IN BOOLEAN ExtendedVerification\r
)\r
{\r
- return EFI_SUCCESS; \r
+ return EFI_SUCCESS;\r
}\r
\r
\r
\r
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r
\r
- @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid, \r
+ @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r
\r
or the buffer is not on proper alignment.\r
\r
\r
@retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.\r
\r
- @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid, \r
+ @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,\r
\r
or the buffer is not on proper alignment.\r
\r
\r
Timer callback to convert card present hardware into a boolean that indicates\r
\r
- a media change event has happened. If you just check the GPIO you could see \r
+ a media change event has happened. If you just check the GPIO you could see\r
\r
card 1 and then check again after card 1 was removed and card 2 was inserted\r
\r
}\r
} else {\r
if (Present && !gMediaChange) {\r
- gMediaChange = TRUE; \r
+ gMediaChange = TRUE;\r
}\r
}\r
}\r
\r
Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, TimerCallback, NULL, &gTimerEvent);\r
ASSERT_EFI_ERROR (Status);\r
- \r
- Status = gBS->SetTimer (gTimerEvent, TimerPeriodic, FixedPcdGet32 (PcdMmchsTimerFreq100NanoSeconds)); \r
+\r
+ Status = gBS->SetTimer (gTimerEvent, TimerPeriodic, FixedPcdGet32 (PcdMmchsTimerFreq100NanoSeconds));\r
ASSERT_EFI_ERROR (Status);\r
\r
//Publish BlockIO.\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &ImageHandle, \r
- &gEfiBlockIoProtocolGuid, &gBlockIo, \r
+ &ImageHandle,\r
+ &gEfiBlockIoProtocolGuid, &gBlockIo,\r
&gEfiDevicePathProtocolGuid, &gMmcHsDevicePath,\r
NULL\r
);\r
#define HCS BIT30 //Host capacity support/1 = Supporting high capacity\r
#define CCS BIT30 //Card capacity status/1 = High capacity card\r
typedef struct {\r
- UINT32 Reserved0: 7; // 0 \r
+ UINT32 Reserved0: 7; // 0\r
UINT32 V170_V195: 1; // 1.70V - 1.95V\r
UINT32 V200_V260: 7; // 2.00V - 2.60V\r
UINT32 V270_V360: 9; // 2.70V - 3.60V\r
UINT32 RESERVED_1: 5; // Reserved\r
- UINT32 AccessMode: 2; // 00b (byte mode), 10b (sector mode) \r
+ UINT32 AccessMode: 2; // 00b (byte mode), 10b (sector mode)\r
UINT32 Busy: 1; // This bit is set to LOW if the card has not finished the power up routine\r
}OCR;\r
\r
UINT8 PERM_WRITE_PROTECT: 1; // Permanent write protection [13:13]\r
UINT8 COPY: 1; // Copy flag (OTP) [14:14]\r
UINT8 FILE_FORMAT_GRP: 1; // File format group [15:15]\r
- \r
+\r
UINT16 RESERVED_2: 5; // Reserved [20:16]\r
UINT16 WRITE_BL_PARTIAL: 1; // Partial blocks for write allowed [21:21]\r
UINT16 WRITE_BL_LEN: 4; // Max. write data block length [25:22]\r
UINT16 R2W_FACTOR: 3; // Write speed factor [28:26]\r
UINT16 RESERVED_3: 2; // Reserved [30:29]\r
UINT16 WP_GRP_ENABLE: 1; // Write protect group enable [31:31]\r
- \r
+\r
UINT32 WP_GRP_SIZE: 7; // Write protect group size [38:32]\r
UINT32 SECTOR_SIZE: 7; // Erase sector size [45:39]\r
UINT32 ERASE_BLK_EN: 1; // Erase single block enable [46:46]\r
UINT32 VDD_R_CURR_MAX: 3; // Max. read current @ VDD max [58:56]\r
UINT32 VDD_R_CURR_MIN: 3; // Max. read current @ VDD min [61:59]\r
UINT32 C_SIZELow2: 2; // Device size [63:62]\r
- \r
+\r
UINT32 C_SIZEHigh10: 10;// Device size [73:64]\r
UINT32 RESERVED_4: 2; // Reserved [75:74]\r
UINT32 DSR_IMP: 1; // DSR implemented [76:76]\r
UINT8 TRAN_SPEED ; // Max. bus clock frequency [103:96]\r
UINT8 NSAC ; // Data read access-time 2 in CLK cycles (NSAC*100) [111:104]\r
UINT8 TAAC ; // Data read access-time 1 [119:112]\r
- \r
+\r
UINT8 RESERVED_5: 6; // Reserved [125:120]\r
UINT8 CSD_STRUCTURE: 2; // CSD structure [127:126]\r
}CSD;\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
DmaLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEfiBlockIoProtocolGuid\r
gEfiCpuArchProtocolGuid\r
MmioAnd32 (MMCHS_SYSCTL, ~CEN);\r
\r
// Set new clock frequency.\r
- MmioAndThenOr32 (MMCHS_SYSCTL, ~CLKD_MASK, NewCLKD << 6); \r
+ MmioAndThenOr32 (MMCHS_SYSCTL, ~CLKD_MASK, NewCLKD << 6);\r
\r
// Poll till Internal Clock Stable\r
while ((MmioRead32 (MMCHS_SYSCTL) & ICS_MASK) != ICS);\r
Data = VSEL_3_00V;\r
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VMMC1_DEDICATED_REG), 1, &Data);\r
ASSERT_EFI_ERROR(Status);\r
- \r
+\r
// After ramping up voltage, set VDDS stable bit to indicate that voltage level is stable.\r
MmioOr32 (CONTROL_PBIAS_LITE, (PBIASLITEVMODE0 | PBIASLITEPWRDNZ0 | PBIASSPEEDCTRL0 | PBIASLITEVMODE1 | PBIASLITEWRDNZ1));\r
\r
)\r
{\r
/* Note:\r
- * On our BeagleBoard the SD card WP pin is always read as TRUE. \r
+ * On our BeagleBoard the SD card WP pin is always read as TRUE.\r
* Probably something wrong with GPIO configuration.\r
* BeagleBoard-xM uses microSD cards so there is no write protect at all.\r
- * Hence commenting out SD card WP pin read status. \r
+ * Hence commenting out SD card WP pin read status.\r
*/\r
//return (MmioRead32 (GPIO1_BASE + GPIO_DATAIN) & BIT23) == BIT23;\r
return 0;\r
ASSERT_EFI_ERROR(Status);\r
\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
- &Handle, \r
+ &Handle,\r
&gEfiMmcHostProtocolGuid, &gMMCHost,\r
NULL\r
);\r
/** @file\r
*\r
* Copyright (c) 2011, ARM Limited. All rights reserved.\r
-* \r
-* This program and the accompanying materials \r
-* are licensed and made available under the terms and conditions of the BSD License \r
-* which accompanies this distribution. The full text of the license may be found at \r
-* http://opensource.org/licenses/bsd-license.php \r
*\r
-* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
*\r
**/\r
\r
# Copyright (c) 2011, ARM Limited. All rights reserved.\r
-# \r
-# This program and the accompanying materials \r
-# are licensed and made available under the terms and conditions of the BSD License \r
-# which accompanies this distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php \r
#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution. The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#\r
\r
[Defines]\r
DmaLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEfiBlockIoProtocolGuid\r
gEfiCpuArchProtocolGuid\r
## @libraryclass Abstract location of basic OMAP components\r
##\r
OmapLib|Include/Library/OmapLib.h\r
- \r
+\r
## @libraryclass Abstract OMAP and ARM DMA, modeled after PCI IO protocol\r
##\r
OmapDmaLib|Include/Library/OmapDmaLib.h\r
\r
\r
[Guids.common]\r
- gOmap35xxTokenSpaceGuid = { 0x24b09abe, 0x4e47, 0x481c, { 0xa9, 0xad, 0xce, 0xf1, 0x2c, 0x39, 0x23, 0x27} } \r
+ gOmap35xxTokenSpaceGuid = { 0x24b09abe, 0x4e47, 0x481c, { 0xa9, 0xad, 0xce, 0xf1, 0x2c, 0x39, 0x23, 0x27} }\r
\r
[PcdsFeatureFlag.common]\r
\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxDebugAgentTimer|5|UINT32|0x00000207\r
gOmap35xxTokenSpaceGuid.PcdDebugAgentTimerFreqNanoSeconds|77|UINT32|0x00000208\r
gOmap35xxTokenSpaceGuid.PcdMmchsTimerFreq100NanoSeconds|1000000|UINT32|0x00000209\r
- \r
+\r
\r
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
- \r
+\r
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf\r
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf\r
\r
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf\r
- \r
+\r
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf\r
DefaultExceptioHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf\r
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf\r
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf\r
- \r
+\r
RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf\r
\r
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf\r
OmapLib|Omap35xxPkg/Library/OmapLib/OmapLib.inf\r
OmapDmaLib|Omap35xxPkg/Library/OmapDmaLib/OmapDmaLib.inf\r
- \r
+\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf\r
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf\r
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
\r
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf\r
- \r
+\r
# UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf\r
UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf\r
\r
\r
[LibraryClasses.ARM]\r
#\r
- # Note: This NULL library feature is not yet in the edk2/BaseTools, but it is checked in to \r
+ # Note: This NULL library feature is not yet in the edk2/BaseTools, but it is checked in to\r
# the BaseTools project. So you need to build with the BaseTools project util this feature gets synced.\r
#\r
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf\r
\r
RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu 7-A\r
RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu 7-A\r
- \r
+\r
\r
################################################################################\r
#\r
#\r
################################################################################\r
\r
- \r
+\r
[PcdsFixedAtBuild.common]\r
\r
# DEBUG_ASSERT_ENABLED 0x01\r
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000004\r
\r
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07\r
- \r
+\r
gEmbeddedTokenSpaceGuid.PcdPrePiTempMemorySize|0\r
gEmbeddedTokenSpaceGuid.PcdPrePiBfvBaseAddress|0\r
gEmbeddedTokenSpaceGuid.PcdPrePiBfvSize|0\r
gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x20000 # 128K stack\r
gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x80000000\r
gArmTokenSpaceGuid.PcdCpuResetAddress|0x80008000\r
- \r
+\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxGpmcOffset|0x6E000000\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxMMCHS1Base|0x4809C000\r
\r
- # Console \r
+ # Console\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxConsoleUart|3\r
- \r
+\r
# Timers\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxArchTimer|3\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxFreeTimer|4\r
gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77\r
gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000\r
- \r
+\r
#\r
# ARM Pcds\r
#\r
#\r
################################################################################\r
[Components.common]\r
- Omap35xxPkg/Library/Omap35xxTimerLib/Omap35xxTimerLib.inf \r
+ Omap35xxPkg/Library/Omap35xxTimerLib/Omap35xxTimerLib.inf\r
Omap35xxPkg/Library/OmapLib/OmapLib.inf\r
Omap35xxPkg/Library/OmapDmaLib/OmapDmaLib.inf\r
- \r
+\r
Omap35xxPkg/Flash/Flash.inf\r
Omap35xxPkg/MMCHSDxe/MMCHS.inf\r
Omap35xxPkg/SmbusDxe/Smbus.inf\r
Omap35xxPkg/Gpio/Gpio.inf\r
Omap35xxPkg/InterruptDxe/InterruptDxe.inf\r
- Omap35xxPkg/TimerDxe/TimerDxe.inf \r
+ Omap35xxPkg/TimerDxe/TimerDxe.inf\r
Omap35xxPkg/TPS65950Dxe/TPS65950.inf\r
- \r
- \r
+\r
+\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
#define EFI_PCI_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32('p', 'c', 'i', 'o')\r
#define EFI_PCI_IO_PRIVATE_DATA_FROM_THIS(a) CR(a, EFI_PCI_IO_PRIVATE_DATA, PciIoProtocol, EFI_PCI_IO_PRIVATE_DATA_SIGNATURE)\r
\r
-EFI_PCI_IO_DEVICE_PATH PciIoDevicePathTemplate = \r
+EFI_PCI_IO_DEVICE_PATH PciIoDevicePathTemplate =\r
{\r
{\r
{ ACPI_DEVICE_PATH, ACPI_DP, { sizeof (ACPI_HID_DEVICE_PATH), 0 } },\r
\r
// Get the Power IC protocol\r
Status = gBS->LocateProtocol (&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);\r
- ASSERT_EFI_ERROR (Status); \r
+ ASSERT_EFI_ERROR (Status);\r
\r
// Power the USB PHY\r
Data = VAUX_DEV_GRP_P1;\r
\r
Data = VAUX_DEDICATED_18V;\r
Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VAUX2_DEDICATED), 1, &Data);\r
- ASSERT_EFI_ERROR (Status); \r
+ ASSERT_EFI_ERROR (Status);\r
\r
// Enable power to the USB hub\r
Status = gTPS65950->Read (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID3, LEDEN), 1, &Data);\r
{\r
EFI_PCI_IO_PRIVATE_DATA *Private = EFI_PCI_IO_PRIVATE_DATA_FROM_THIS(This);\r
\r
- return PciRootBridgeIoMemRead (&Private->RootBridge.Io, \r
+ return PciRootBridgeIoMemRead (&Private->RootBridge.Io,\r
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,\r
Private->ConfigSpace->Device.Bar[BarIndex] + Offset,\r
Count,\r
{\r
EFI_PCI_IO_PRIVATE_DATA *Private = EFI_PCI_IO_PRIVATE_DATA_FROM_THIS(This);\r
\r
- return PciRootBridgeIoMemWrite (&Private->RootBridge.Io, \r
+ return PciRootBridgeIoMemWrite (&Private->RootBridge.Io,\r
(EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,\r
Private->ConfigSpace->Device.Bar[BarIndex] + Offset,\r
Count,\r
{\r
EFI_PCI_IO_PRIVATE_DATA *Private = EFI_PCI_IO_PRIVATE_DATA_FROM_THIS(This);\r
\r
- return PciRootBridgeIoMemRW ((EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH)Width, \r
- Count, \r
- TRUE, \r
- (PTR)(UINTN)Buffer, \r
- TRUE, \r
+ return PciRootBridgeIoMemRW ((EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH)Width,\r
+ Count,\r
+ TRUE,\r
+ (PTR)(UINTN)Buffer,\r
+ TRUE,\r
(PTR)(UINTN)(((UINT8 *)Private->ConfigSpace) + Offset)\r
);\r
}\r
{\r
EFI_PCI_IO_PRIVATE_DATA *Private = EFI_PCI_IO_PRIVATE_DATA_FROM_THIS(This);\r
\r
- return PciRootBridgeIoMemRW ((EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width, \r
- Count, \r
- TRUE, \r
- (PTR)(UINTN)(((UINT8 *)Private->ConfigSpace) + Offset), \r
- TRUE, \r
+ return PciRootBridgeIoMemRW ((EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH) Width,\r
+ Count,\r
+ TRUE,\r
+ (PTR)(UINTN)(((UINT8 *)Private->ConfigSpace) + Offset),\r
+ TRUE,\r
(PTR)(UINTN)Buffer\r
);\r
}\r
case EfiPciIoAttributeOperationDisable:\r
// Since we are not a real PCI device no enable/set or disable operations exist.\r
return EFI_SUCCESS;\r
- \r
+\r
default:\r
ASSERT (FALSE);\r
return EFI_INVALID_PARAMETER;\r
return EFI_UNSUPPORTED;\r
}\r
\r
-EFI_PCI_IO_PROTOCOL PciIoTemplate = \r
+EFI_PCI_IO_PROTOCOL PciIoTemplate =\r
{\r
PciIoPollMem,\r
PciIoPollIo,\r
Status = EFI_OUT_OF_RESOURCES;\r
return Status;\r
}\r
- \r
+\r
Private->Signature = EFI_PCI_IO_PRIVATE_DATA_SIGNATURE; // Fill in signature\r
Private->RootBridge.Signature = PCI_ROOT_BRIDGE_SIGNATURE; // Fake Root Bridge structure needs a signature too\r
Private->RootBridge.MemoryStart = USB_EHCI_HCCAPBASE; // Get the USB capability register base\r
// Unique device path.\r
CopyMem(&Private->DevicePath, &PciIoDevicePathTemplate, sizeof(PciIoDevicePathTemplate));\r
Private->DevicePath.AcpiDevicePath.UID = 0;\r
- \r
+\r
// Copy protocol structure\r
CopyMem(&Private->PciIoProtocol, &PciIoTemplate, sizeof(PciIoTemplate));\r
\r
EFI_HANDLE Handle;\r
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL Io;\r
EFI_PCI_ROOT_BRIDGE_DEVICE_PATH DevicePath;\r
- \r
+\r
UINT8 StartBus;\r
UINT8 EndBus;\r
UINT16 Type;\r
UINTN IoOffset;\r
UINT32 IoStart;\r
UINT32 IoSize;\r
- UINT64 PciAttributes; \r
+ UINT64 PciAttributes;\r
\r
ACPI_CONFIG_INFO *Config;\r
\r
\r
EFI_STATUS\r
EFIAPI\r
-PciRootBridgeIoPollMem ( \r
+PciRootBridgeIoPollMem (\r
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r
IN UINT64 Address,\r
IN UINT64 Delay,\r
OUT UINT64 *Result\r
);\r
- \r
+\r
EFI_STATUS\r
EFIAPI\r
-PciRootBridgeIoPollIo ( \r
+PciRootBridgeIoPollIo (\r
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r
IN UINT64 Address,\r
IN UINT64 Delay,\r
OUT UINT64 *Result\r
);\r
- \r
+\r
EFI_STATUS\r
EFIAPI\r
PciRootBridgeIoMemRead (\r
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r
IN UINT64 Attributes,\r
IN OUT UINT64 *ResourceBase,\r
- IN OUT UINT64 *ResourceLength \r
- ); \r
+ IN OUT UINT64 *ResourceLength\r
+ );\r
\r
EFI_STATUS\r
EFIAPI\r
/** @file\r
- \r
+\r
Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
gEmbeddedExternalDeviceProtocolGuid\r
\r
[Depex]\r
- gEfiMetronomeArchProtocolGuid AND \r
+ gEfiMetronomeArchProtocolGuid AND\r
gEmbeddedExternalDeviceProtocolGuid\r
- \r
\ No newline at end of file
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
return EFI_SUCCESS;\r
}\r
\r
-/** \r
+/**\r
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.\r
- \r
+\r
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
@param Width Signifies the width of the memory operations.\r
- @param Address The base address of the memory operations. \r
+ @param Address The base address of the memory operations.\r
@param Count The number of memory operations to perform.\r
@param Buffer For read operations, the destination buffer to store the results. For write\r
- operations, the source buffer to write data from. \r
- \r
- @retval EFI_SUCCESS The data was read from or written to the PCI root bridge. \r
+ operations, the source buffer to write data from.\r
+\r
+ @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
if ( Buffer == NULL ) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Private = INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS (This);\r
\r
if (!PciRootBridgeMemAddressValid (Private, Address)) {\r
case EfiPciWidthFillUint32:\r
case EfiPciWidthFillUint64:\r
return PciRootBridgeIoMemRW (Width, Count, FALSE, In, TRUE, Out);\r
- \r
+\r
default:\r
break;\r
}\r
- \r
+\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
\r
\r
-/** \r
+/**\r
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.\r
- \r
+\r
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
@param Width Signifies the width of the memory operations.\r
- @param Address The base address of the memory operations. \r
+ @param Address The base address of the memory operations.\r
@param Count The number of memory operations to perform.\r
@param Buffer For read operations, the destination buffer to store the results. For write\r
- operations, the source buffer to write data from. \r
- \r
- @retval EFI_SUCCESS The data was read from or written to the PCI root bridge. \r
+ operations, the source buffer to write data from.\r
+\r
+ @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
if ( Buffer == NULL ) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
Private = INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS (This);\r
\r
if (!PciRootBridgeMemAddressValid (Private, Address)) {\r
case EfiPciWidthUint32:\r
case EfiPciWidthUint64:\r
return PciRootBridgeIoMemRW (Width, Count, TRUE, In, TRUE, Out);\r
- \r
+\r
case EfiPciWidthFifoUint8:\r
case EfiPciWidthFifoUint16:\r
case EfiPciWidthFifoUint32:\r
case EfiPciWidthFillUint32:\r
case EfiPciWidthFillUint64:\r
return PciRootBridgeIoMemRW (Width, Count, TRUE, In, FALSE, Out);\r
- \r
+\r
default:\r
break;\r
}\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
-/** \r
+/**\r
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.\r
- \r
+\r
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
@param Width Signifies the width of the memory operations.\r
- @param Address The base address of the memory operations. \r
+ @param Address The base address of the memory operations.\r
@param Count The number of memory operations to perform.\r
@param Buffer For read operations, the destination buffer to store the results. For write\r
- operations, the source buffer to write data from. \r
- \r
- @retval EFI_SUCCESS The data was read from or written to the PCI root bridge. \r
+ operations, the source buffer to write data from.\r
+\r
+ @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
\r
\r
\r
-/** \r
+/**\r
Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.\r
- \r
+\r
@param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
@param Width Signifies the width of the memory operations.\r
- @param Address The base address of the memory operations. \r
+ @param Address The base address of the memory operations.\r
@param Count The number of memory operations to perform.\r
@param Buffer For read operations, the destination buffer to store the results. For write\r
- operations, the source buffer to write data from. \r
- \r
- @retval EFI_SUCCESS The data was read from or written to the PCI root bridge. \r
+ operations, the source buffer to write data from.\r
+\r
+ @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
- \r
+\r
**/\r
EFI_STATUS\r
EFIAPI\r
if (Buffer == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
return PciRootBridgeIoPciRW (This, TRUE, Width, Address, Count, Buffer);\r
}\r
\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
//Program prescaler to obtain 12-MHz clock\r
MmioWrite16(I2C_PSC, 0x0000);\r
\r
- //Program SCLL and SCLH \r
- //NOTE: Following values are the register dump after U-Boot code executed. \r
+ //Program SCLL and SCLH\r
+ //NOTE: Following values are the register dump after U-Boot code executed.\r
//We need to figure out how its calculated based on the I2C functional clock and I2C_PSC.\r
MmioWrite16(I2C_SCLL, 0x0035);\r
MmioWrite16(I2C_SCLH, 0x0035);\r
STATIC\r
EFI_STATUS\r
I2CWriteOneByte (\r
- UINT8 Data \r
+ UINT8 Data\r
)\r
{\r
EFI_STATUS Status;\r
// Install the SMBUS interface\r
Status = gBS->InstallMultipleProtocolInterfaces(&Handle, &gEfiSmbusHcProtocolGuid, &SmbusProtocol, NULL);\r
ASSERT_EFI_ERROR(Status);\r
- \r
+\r
return Status;\r
}\r
\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
IoLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEfiSmbusHcProtocolGuid\r
\r
[Pcd]\r
\r
[depex]\r
- TRUE\r
\ No newline at end of file
+ TRUE\r
/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_SMBUS_DEVICE_ADDRESS SlaveAddress; \r
+ EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;\r
UINT8 DeviceRegister;\r
UINTN DeviceRegisterLength = 1;\r
\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_SMBUS_DEVICE_ADDRESS SlaveAddress; \r
+ EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;\r
UINT8 DeviceRegister;\r
UINTN DeviceBufferLength = Length + 1;\r
UINT8 *DeviceBuffer;\r
)\r
{\r
EFI_STATUS Status;\r
- \r
+\r
Status = gBS->LocateProtocol(&gEfiSmbusHcProtocolGuid, NULL, (VOID **)&Smbus);\r
ASSERT_EFI_ERROR(Status);\r
- \r
+\r
Status = gBS->InstallMultipleProtocolInterfaces(&ImageHandle, &gEmbeddedExternalDeviceProtocolGuid, &ExternalDevice, NULL);\r
return Status;\r
}\r
#/** @file\r
-# \r
+#\r
# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
MemoryAllocationLib\r
\r
[Guids]\r
- \r
+\r
[Protocols]\r
gEfiSmbusHcProtocolGuid\r
gEmbeddedExternalDeviceProtocolGuid\r
Template for Timer Architecture Protocol driver of the ARM flavor\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- \r
- This program and the accompanying materials \r
- are licensed and made available under the terms and conditions of the BSD License \r
- which accompanies this distribution. The full text of the license may be found at \r
- http://opensource.org/licenses/bsd-license.php \r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+ This program and the accompanying materials\r
+ are licensed and made available under the terms and conditions of the BSD License\r
+ which accompanies this distribution. The full text of the license may be found at\r
+ http://opensource.org/licenses/bsd-license.php\r
+\r
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
what source means.\r
\r
@param SystemContext Pointer to system register context. Mostly used by debuggers and will\r
- update the system context after the return from the interrupt if \r
+ update the system context after the return from the interrupt if\r
modified. Don't change these values unless you know what you are doing\r
\r
**/\r
EFIAPI\r
TimerInterruptHandler (\r
IN HARDWARE_INTERRUPT_SOURCE Source,\r
- IN EFI_SYSTEM_CONTEXT SystemContext \r
+ IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
EFI_TPL OriginalTPL;\r
\r
\r
//\r
- // DXE core uses this callback for the EFI timer tick. The DXE core uses locks \r
+ // DXE core uses this callback for the EFI timer tick. The DXE core uses locks\r
// that raise to TPL_HIGH and then restore back to current level. Thus we need\r
- // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick. \r
+ // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick.\r
//\r
OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
\r
}\r
\r
// Clear all timer interrupts\r
- MmioWrite32 (TISR, TISR_CLEAR_ALL); \r
+ MmioWrite32 (TISR, TISR_CLEAR_ALL);\r
\r
// Poll interrupt status bits to ensure clearing\r
while ((MmioRead32 (TISR) & TISR_ALL_INTERRUPT_MASK) != TISR_NO_INTERRUPTS_PENDING);\r
}\r
\r
/**\r
- This function registers the handler NotifyFunction so it is called every time \r
- the timer interrupt fires. It also passes the amount of time since the last \r
- handler call to the NotifyFunction. If NotifyFunction is NULL, then the \r
- handler is unregistered. If the handler is registered, then EFI_SUCCESS is \r
- returned. If the CPU does not support registering a timer interrupt handler, \r
- then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler \r
- when a handler is already registered, then EFI_ALREADY_STARTED is returned. \r
- If an attempt is made to unregister a handler when a handler is not registered, \r
- then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to \r
- register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
+ This function registers the handler NotifyFunction so it is called every time\r
+ the timer interrupt fires. It also passes the amount of time since the last\r
+ handler call to the NotifyFunction. If NotifyFunction is NULL, then the\r
+ handler is unregistered. If the handler is registered, then EFI_SUCCESS is\r
+ returned. If the CPU does not support registering a timer interrupt handler,\r
+ then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler\r
+ when a handler is already registered, then EFI_ALREADY_STARTED is returned.\r
+ If an attempt is made to unregister a handler when a handler is not registered,\r
+ then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to\r
+ register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR\r
is returned.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
\r
/**\r
\r
- This function adjusts the period of timer interrupts to the value specified \r
- by TimerPeriod. If the timer period is updated, then the selected timer \r
- period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If \r
- the timer hardware is not programmable, then EFI_UNSUPPORTED is returned. \r
- If an error occurs while attempting to update the timer period, then the \r
- timer hardware will be put back in its state prior to this call, and \r
- EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt \r
- is disabled. This is not the same as disabling the CPU's interrupts. \r
- Instead, it must either turn off the timer hardware, or it must adjust the \r
- interrupt controller so that a CPU interrupt is not generated when the timer \r
- interrupt fires. \r
+ This function adjusts the period of timer interrupts to the value specified\r
+ by TimerPeriod. If the timer period is updated, then the selected timer\r
+ period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If\r
+ the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.\r
+ If an error occurs while attempting to update the timer period, then the\r
+ timer hardware will be put back in its state prior to this call, and\r
+ EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt\r
+ is disabled. This is not the same as disabling the CPU's interrupts.\r
+ Instead, it must either turn off the timer hardware, or it must adjust the\r
+ interrupt controller so that a CPU interrupt is not generated when the timer\r
+ interrupt fires.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
@param TimerPeriod The rate to program the timer interrupt in 100 nS units. If\r
EFI_STATUS Status;\r
UINT64 TimerCount;\r
INT32 LoadValue;\r
- \r
+\r
if (TimerPeriod == 0) {\r
// Turn off GPTIMER3\r
MmioWrite32 (TCLR, TCLR_ST_OFF);\r
- \r
- Status = gInterrupt->DisableInterruptSource(gInterrupt, gVector); \r
- } else { \r
+\r
+ Status = gInterrupt->DisableInterruptSource(gInterrupt, gVector);\r
+ } else {\r
// Calculate required timer count\r
TimerCount = DivU64x32(TimerPeriod * 100, PcdGet32(PcdEmbeddedPerformanceCounterPeriodInNanoseconds));\r
\r
// Turn on GPTIMER3, it will reload at overflow\r
MmioWrite32 (TCLR, TCLR_AR_AUTORELOAD | TCLR_ST_ON);\r
\r
- Status = gInterrupt->EnableInterruptSource(gInterrupt, gVector); \r
+ Status = gInterrupt->EnableInterruptSource(gInterrupt, gVector);\r
}\r
\r
//\r
\r
\r
/**\r
- This function retrieves the period of timer interrupts in 100 ns units, \r
- returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod \r
- is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is \r
+ This function retrieves the period of timer interrupts in 100 ns units,\r
+ returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod\r
+ is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is\r
returned, then the timer is currently disabled.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
}\r
\r
/**\r
- This function generates a soft timer interrupt. If the platform does not support soft \r
- timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
- If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
- service, then a soft timer interrupt will be generated. If the timer interrupt is \r
- enabled when this service is called, then the registered handler will be invoked. The \r
- registered handler should not be able to distinguish a hardware-generated timer \r
+ This function generates a soft timer interrupt. If the platform does not support soft\r
+ timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.\r
+ If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()\r
+ service, then a soft timer interrupt will be generated. If the timer interrupt is\r
+ enabled when this service is called, then the registered handler will be invoked. The\r
+ registered handler should not be able to distinguish a hardware-generated timer\r
interrupt from a software-generated timer interrupt.\r
\r
@param This The EFI_TIMER_ARCH_PROTOCOL instance.\r
Interface stucture for the Timer Architectural Protocol.\r
\r
@par Protocol Description:\r
- This protocol provides the services to initialize a periodic timer \r
+ This protocol provides the services to initialize a periodic timer\r
interrupt, and to register a handler that is called each time the timer\r
interrupt fires. It may also provide a service to adjust the rate of the\r
- periodic timer interrupt. When a timer interrupt occurs, the handler is \r
- passed the amount of time that has passed since the previous timer \r
+ periodic timer interrupt. When a timer interrupt occurs, the handler is\r
+ passed the amount of time that has passed since the previous timer\r
interrupt.\r
\r
@param RegisterHandler\r
- Registers a handler that will be called each time the \r
- timer interrupt fires. TimerPeriod defines the minimum \r
- time between timer interrupts, so TimerPeriod will also \r
- be the minimum time between calls to the registered \r
+ Registers a handler that will be called each time the\r
+ timer interrupt fires. TimerPeriod defines the minimum\r
+ time between timer interrupts, so TimerPeriod will also\r
+ be the minimum time between calls to the registered\r
handler.\r
\r
@param SetTimerPeriod\r
- Sets the period of the timer interrupt in 100 nS units. \r
- This function is optional, and may return EFI_UNSUPPORTED. \r
- If this function is supported, then the timer period will \r
+ Sets the period of the timer interrupt in 100 nS units.\r
+ This function is optional, and may return EFI_UNSUPPORTED.\r
+ If this function is supported, then the timer period will\r
be rounded up to the nearest supported timer period.\r
\r
\r
Retrieves the period of the timer interrupt in 100 nS units.\r
\r
@param GenerateSoftInterrupt\r
- Generates a soft timer interrupt that simulates the firing of \r
- the timer interrupt. This service can be used to invoke the registered handler if the timer interrupt has been masked for \r
+ Generates a soft timer interrupt that simulates the firing of\r
+ the timer interrupt. This service can be used to invoke the registered handler if the timer interrupt has been masked for\r
a period of time.\r
\r
**/\r
#/** @file\r
-# \r
+#\r
# Component description file for Timer module\r
-# \r
+#\r
# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
-# \r
+#\r
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-# \r
+#\r
#**/\r
\r
[Defines]\r
[Guids]\r
\r
[Protocols]\r
- gEfiTimerArchProtocolGuid \r
+ gEfiTimerArchProtocolGuid\r
gHardwareInterruptProtocolGuid\r
\r
[Pcd.common]\r
gOmap35xxTokenSpaceGuid.PcdOmap35xxArchTimer\r
\r
[Depex]\r
- gHardwareInterruptProtocolGuid\r
\ No newline at end of file
+ gHardwareInterruptProtocolGuid\r