diff options
author | Anup Patel <anup.patel@wdc.com> | 2020-01-03 06:40:41 +0300 |
---|---|---|
committer | Anup Patel <anup.patel@wdc.com> | 2020-01-07 09:40:48 +0300 |
commit | 55e191e3b09c4979212c592a4e86e0f561ce1f97 (patch) | |
tree | f23986fe49fd1291b03d2da152e31f189b2ad388 /lib/sbi | |
parent | c3e406f1609af8f14e93419aa6722e646a8f4f56 (diff) | |
download | opensbi-55e191e3b09c4979212c592a4e86e0f561ce1f97.tar.xz |
lib: Add system early_exit and final_exit APIs
This patch adds system-level early_exit and final_exit APIs
with corresponding platform hooks. These new APIs will be
primarily used by sbi_exit() in OpenSBI exit path.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi')
-rw-r--r-- | lib/sbi/sbi_init.c | 4 | ||||
-rw-r--r-- | lib/sbi/sbi_system.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c index b4c242f..d5d3513 100644 --- a/lib/sbi/sbi_init.c +++ b/lib/sbi/sbi_init.c @@ -203,5 +203,9 @@ void __noreturn sbi_exit(struct sbi_scratch *scratch) sbi_hart_unmark_available(hartid); + sbi_platform_early_exit(plat); + + sbi_platform_final_exit(plat); + sbi_hart_hang(); } diff --git a/lib/sbi/sbi_system.c b/lib/sbi/sbi_system.c index cdc85d6..9ea3c21 100644 --- a/lib/sbi/sbi_system.c +++ b/lib/sbi/sbi_system.c @@ -23,6 +23,16 @@ int sbi_system_final_init(struct sbi_scratch *scratch, bool cold_boot) return sbi_platform_final_init(sbi_platform_ptr(scratch), cold_boot); } +void sbi_system_early_exit(struct sbi_scratch *scratch) +{ + sbi_platform_early_exit(sbi_platform_ptr(scratch)); +} + +void sbi_system_final_exit(struct sbi_scratch *scratch) +{ + sbi_platform_final_exit(sbi_platform_ptr(scratch)); +} + void __attribute__((noreturn)) sbi_system_reboot(struct sbi_scratch *scratch, u32 type) |