arm64: kernel: Rework finisher callback out of __cpu_suspend_enter()
authorJames Morse <james.morse@arm.com>
Wed, 27 Apr 2016 16:47:06 +0000 (17:47 +0100)
committerAlex Shi <alex.shi@linaro.org>
Thu, 10 Nov 2016 07:50:16 +0000 (15:50 +0800)
commitbe5d6aa0cc805bb6f7bc936042620f5826322009
treed9be10e74139b9c29f1b1fb913993e06074205a1
parent46f269e394b70c332389818cb378a84f27026f24
arm64: kernel: Rework finisher callback out of __cpu_suspend_enter()

Hibernate could make use of the cpu_suspend() code to save/restore cpu
state, however it needs to be able to return '0' from the 'finisher'.

Rework cpu_suspend() so that the finisher is called from C code,
independently from the save/restore of cpu state. Space to save the context
in is allocated in the caller's stack frame, and passed into
__cpu_suspend_enter().

Hibernate's use of this API will look like a copy of the cpu_suspend()
function.

Signed-off-by: James Morse <james.morse@arm.com>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit adc9b2dfd00924e9e9b98613f36a6cb8c51f0dc6)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/include/asm/suspend.h
arch/arm64/kernel/asm-offsets.c
arch/arm64/kernel/sleep.S
arch/arm64/kernel/suspend.c