Set process init status register to a default state.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Oct 2007 19:02:44 +0000 (19:02 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 19 Oct 2007 19:02:44 +0000 (19:02 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@917 38d2e660-2303-0410-9eaa-f027e97ec537

cpu/cpu.h

index cf79f7efd4483fbc8c8b1c11ea4f843812a3adad..57072753e0f08a35310024daea3335c15ecf5fbf 100644 (file)
--- a/cpu/cpu.h
+++ b/cpu/cpu.h
                /**
                 * Initialization value for registers in stack frame.
                 * The register index is not directly corrispondent to CPU
-                * register numbers, but is related to how are pushed to stack (\see asm_switch_context).
-                * Index (CPU_SAVED_REGS_CNT - 1) is the CPSR register:
-                * the initial value is taken from current CPSR.
+                * register numbers, but is related to how are pushed to
+                * stack (\see asm_switch_context).
+                * Index (CPU_SAVED_REGS_CNT - 1) is the CPSR register,
+                * the initial value is set to:
+                * - All flags (N, Z, C, V) set to 0.
+                * - IRQ and FIQ enabled.
+                * - ARM state.
+                * - CPU in Supervisor Mode (SVC).
                 */
-               #define CPU_REG_INIT_VALUE(reg) (reg == (CPU_SAVED_REGS_CNT - 1) ? CPU_READ_FLAGS() : 0)
+               #define CPU_REG_INIT_VALUE(reg) (reg == (CPU_SAVED_REGS_CNT - 1) ? 0x13 : 0)
 
        #endif /* !__IAR_SYSTEMS_ICC_ */