el3_entrypoint_common: avoid overwriting arg3
At each BL entry point, the registers r9 to r12 are used to save info from the previous BL parameters put in r0 to r3. But zeromem uses r12, leading to a corruption of arg3. Therefore this change copies r12 to r7 before zeromem() call and restores r12 afterwards. It may be better to save it in r7 in el3_arch_init_common and not at the entrypoint as r7 could be used in other functions, especially platform ones. This is a fix for Task T661. Change-Id: Icc11990c69b5d4c542d08aca1a77b1f754b61a53 Signed-off-by: Yann Gautier <yann.gautier@st.com>
This commit is contained in:
parent
876b38497e
commit
30f3100526
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
|
||||
* Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
@ -329,6 +329,11 @@
|
|||
bl inv_dcache_range
|
||||
#endif
|
||||
|
||||
/*
|
||||
* zeromem uses r12 whereas it is used to save previous BL arg3,
|
||||
* save it in r7
|
||||
*/
|
||||
mov r7, r12
|
||||
ldr r0, =__BSS_START__
|
||||
ldr r1, =__BSS_SIZE__
|
||||
bl zeromem
|
||||
|
@ -339,6 +344,9 @@
|
|||
bl zeromem
|
||||
#endif
|
||||
|
||||
/* Restore r12 */
|
||||
mov r12, r7
|
||||
|
||||
#if defined(IMAGE_BL1) || (defined(IMAGE_BL2) && BL2_AT_EL3 && BL2_IN_XIP_MEM)
|
||||
/* -----------------------------------------------------
|
||||
* Copy data from ROM to RAM.
|
||||
|
|
Loading…
Reference in New Issue