/** @file\r
\r
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
- Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>\r
+ Copyright (c) 2011-2013, 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
#define DOMAIN_ACCESS_CONTROL_RESERVED(a) (2UL << (2 * (a)))\r
#define DOMAIN_ACCESS_CONTROL_MANAGER(a) (3UL << (2 * (a)))\r
\r
+// CPSR - Coprocessor Status Register definitions\r
+#define CPSR_MODE_USER 0x10\r
+#define CPSR_MODE_FIQ 0x11\r
+#define CPSR_MODE_IRQ 0x12\r
+#define CPSR_MODE_SVC 0x13\r
+#define CPSR_MODE_ABORT 0x17\r
+#define CPSR_MODE_HYP 0x1A\r
+#define CPSR_MODE_UNDEFINED 0x1B\r
+#define CPSR_MODE_SYSTEM 0x1F\r
+#define CPSR_MODE_MASK 0x1F\r
+#define CPSR_ASYNC_ABORT (1 << 8)\r
+#define CPSR_IRQ (1 << 7)\r
+#define CPSR_FIQ (1 << 6)\r
+\r
+\r
// CPACR - Coprocessor Access Control Register definitions\r
#define CPACR_CP_DENIED(cp) 0x00\r
#define CPACR_CP_PRIV(cp) ((0x1 << ((cp) << 1)) & 0x0FFFFFFF)\r
//\r
-// Copyright (c) 2011-2012, ARM Limited. All rights reserved.\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
#include <Library/PcdLib.h>\r
#include <AutoGen.h>\r
\r
+#include <Chipset/ArmV7.h>\r
+\r
.text\r
.align 3\r
\r
\r
_SetSVCMode:\r
// Enter SVC mode, Disable FIQ and IRQ\r
- //TODO: remove hardcoded values\r
- mov r1, #0x13|0x80|0x40\r
+ mov r1, #(CPSR_MODE_SVC | CPSR_IRQ | CPSR_FIQ)\r
msr CPSR_c, r1\r
\r
// Check if we can install the stack at the top of the System Memory or if we need\r
//\r
-// Copyright (c) 2011-2012, ARM Limited. All rights reserved.\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
#include <Library/PcdLib.h>\r
#include <AutoGen.h>\r
\r
+#include <Chipset/ArmV7.h>\r
+\r
INCLUDE AsmMacroIoLib.inc\r
\r
IMPORT CEntryPoint\r
\r
_SetSVCMode\r
// Enter SVC mode, Disable FIQ and IRQ\r
- //TODO: remove hardcoded values\r
- mov r1, #0x13 :OR: 0x80 :OR: 0x40\r
+ mov r1, #(CPSR_MODE_SVC :OR: CPSR_IRQ :OR: CPSR_FIQ)\r
msr CPSR_c, r1\r
\r
// Check if we can install the stack at the top of the System Memory or if we need\r