]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePi: Removed magic values
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 12:05:17 +0000 (12:05 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 25 Jan 2013 12:05:17 +0000 (12:05 +0000)
Introduced CPSR (Coprocessor Status Register) definitions

Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14097 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Include/Chipset/ArmV7.h
ArmPlatformPkg/PrePi/ModuleEntryPoint.S
ArmPlatformPkg/PrePi/ModuleEntryPoint.asm

index 3d1b4eea4bb37f2a0d9f113efc0e6ef8a48d622a..8bff941b9e17fe4977fc71ae062b41194fe3e22d 100644 (file)
@@ -1,7 +1,7 @@
 /** @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
index 9215198d93eab08390710dd24d080159fd0daae6..c0c20a920645f2603bcf8f1d5a3d50c4e915523d 100755 (executable)
@@ -1,5 +1,5 @@
 //\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
@@ -16,6 +16,8 @@
 #include <Library/PcdLib.h>\r
 #include <AutoGen.h>\r
 \r
+#include <Chipset/ArmV7.h>\r
+\r
 .text\r
 .align 3\r
 \r
@@ -35,8 +37,7 @@ ASM_PFX(_ModuleEntryPoint):
 \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
index 0dea1c32718da205857f55f2272671ec8f8d6789..5efdb532af5beb1d423915d8ee443e1894c9c120 100644 (file)
@@ -1,5 +1,5 @@
 //\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
@@ -16,6 +16,8 @@
 #include <Library/PcdLib.h>\r
 #include <AutoGen.h>\r
 \r
+#include <Chipset/ArmV7.h>\r
+\r
   INCLUDE AsmMacroIoLib.inc\r
   \r
   IMPORT  CEntryPoint\r
@@ -37,8 +39,7 @@ _ModuleEntryPoint
 \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