From cb6b6452b85928bd1cbb9f54e28520799604a60d Mon Sep 17 00:00:00 2001 From: batt Date: Fri, 19 Oct 2007 19:02:44 +0000 Subject: [PATCH] Set process init status register to a default state. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@917 38d2e660-2303-0410-9eaa-f027e97ec537 --- cpu/cpu.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cpu/cpu.h b/cpu/cpu.h index cf79f7ef..57072753 100644 --- a/cpu/cpu.h +++ b/cpu/cpu.h @@ -219,11 +219,16 @@ /** * 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_ */ -- 2.25.1