[Skiboot] [PATCH 2/3] platform: Add exit platform hook

Alistair Popple alistair at popple.id.au
Tue Jan 13 15:21:14 AEDT 2015


Add a platform hook that is called just prior to loading
and running the payload.

Signed-off-by: Alistair Popple <alistair at popple.id.au>
---
 core/init.c        | 3 +++
 include/platform.h | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/core/init.c b/core/init.c
index 2c7e30c..cffa638 100644
--- a/core/init.c
+++ b/core/init.c
@@ -345,6 +345,9 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
 
 	op_display(OP_LOG, OP_MOD_INIT, 0x000A);
 
+	if (platform.exit)
+		platform.exit();
+
 	/* Load kernel LID */
 	if (!load_kernel()) {
 		op_display(OP_FATAL, OP_MOD_INIT, 1);
diff --git a/include/platform.h b/include/platform.h
index b1aef49..44e67ef 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -131,6 +131,11 @@ struct platform {
 	 */
 	bool		(*load_resource)(enum resource_id id,
 					 void *buf, size_t *len);
+
+	/*
+	 * Executed just prior to handing control over to the payload.
+	 */
+	void		(*exit)(void);
 };
 
 extern struct platform __platforms_start;
-- 
1.8.3.2



More information about the Skiboot mailing list