mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-26 23:04:50 +00:00

Changed to save and restore cntpct_el0 using memory mapped register for generic timer when System Suspend and Resume. Reported by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com> Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com> Change-Id: I40fd9f5434c4d52b320cd1d20322b9b8e4e67155
48 lines
760 B
ArmAsm
48 lines
760 B
ArmAsm
/*
|
|
* Copyright (c) 2015-2019, Renesas Electronics Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch.h>
|
|
#include <asm_macros.S>
|
|
|
|
.global rcar_pwrc_switch_stack
|
|
|
|
/*
|
|
* x0 : jump address,
|
|
* x1 : stack address,
|
|
* x2 : arg,
|
|
* x3 : stack address (temporary)
|
|
*/
|
|
func rcar_pwrc_switch_stack
|
|
|
|
/* lr to stack */
|
|
stp x29, x30, [sp,#-16]
|
|
|
|
/* change stack pointer */
|
|
mov x3, sp
|
|
mov sp, x1
|
|
|
|
/* save stack pointer */
|
|
sub sp, sp, #16
|
|
stp x0, x3, [sp]
|
|
|
|
/* data synchronization barrier */
|
|
dsb sy
|
|
|
|
/* jump to code */
|
|
mov x1, x0
|
|
mov x0, x2
|
|
blr x1
|
|
|
|
/* load stack pointer */
|
|
ldp x0, x2, [sp,#0]
|
|
|
|
/* change stack pointer */
|
|
mov sp, x2
|
|
|
|
/* return */
|
|
ldp x29, x30, [sp,#-16]
|
|
ret
|
|
endfunc rcar_pwrc_switch_stack
|