/** Platform final initialization */
int (*final_init)(bool cold_boot);
+ /** Platform early exit */
+ void (*early_exit)(void);
+ /** Platform final exit */
+ void (*final_exit)(void);
+
/** For platforms that do not implement misa, non-standard
* methods are needed to determine cpu extension.
*/
}
/**
+ * Early exit for current HART
+ *
+ * @param plat pointer to struct sbi_platform
+ */
+static inline void sbi_platform_early_exit(const struct sbi_platform *plat)
+{
+ if (plat && sbi_platform_ops(plat)->early_exit)
+ sbi_platform_ops(plat)->early_exit();
+}
+
+/**
+ * Final exit for current HART
+ *
+ * @param plat pointer to struct sbi_platform
+ */
+static inline void sbi_platform_final_exit(const struct sbi_platform *plat)
+{
+ if (plat && sbi_platform_ops(plat)->final_exit)
+ sbi_platform_ops(plat)->final_exit();
+}
+
+/**
* Check CPU extension in MISA
*
* @param plat pointer to struct sbi_platform
int sbi_system_final_init(struct sbi_scratch *scratch, bool cold_boot);
+void sbi_system_early_exit(struct sbi_scratch *scratch);
+
+void sbi_system_final_exit(struct sbi_scratch *scratch);
+
void __attribute__((noreturn))
sbi_system_reboot(struct sbi_scratch *scratch, u32 type);
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)