Module Name: src
Committed By: ryo
Date: Wed Jun 27 11:05:50 UTC 2018
Modified Files:
src/sys/arch/arm/cortex: a9_mpsubr.S
Log Message:
keep stack pointer even if chainging CPU mode.
To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/arm/cortex/a9_mpsubr.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/cortex/a9_mpsubr.S
diff -u src/sys/arch/arm/cortex/a9_mpsubr.S:1.55 src/sys/arch/arm/cortex/a9_mpsubr.S:1.56
--- src/sys/arch/arm/cortex/a9_mpsubr.S:1.55 Thu Jan 18 12:49:09 2018
+++ src/sys/arch/arm/cortex/a9_mpsubr.S Wed Jun 27 11:05:50 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: a9_mpsubr.S,v 1.55 2018/01/18 12:49:09 skrll Exp $ */
+/* $NetBSD: a9_mpsubr.S,v 1.56 2018/06/27 11:05:50 ryo Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -351,6 +351,7 @@ xputc:
//
cortex_init:
mov r10, lr // save lr
+ mov r9, sp // save sp
#if defined(CPU_CORTEXVIRT)
/* Leave HYP mode and move into supervisor mode with IRQs/FIQs disabled. */
@@ -380,6 +381,8 @@ cortex_init:
mov r0, #0
msr spsr_sxc, r0 // set SPSR[23:8] to known value
+ mov sp, r9 // restore sp
+
#if 0
mrc p14, 0, r0, c0, c0, 0 // MIDR read
ufbx r0, r0, #4, #4 // extract cortex part.