diff options
author | Alistair Popple <alistair@popple.id.au> | 2015-02-04 16:07:44 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-09 13:55:26 +1100 |
commit | e8b2e4ab0683dbbdf975c96a22c374d05dac8d90 (patch) | |
tree | 423c2a2a83914750a65ba03323193033c513d103 | |
parent | 91b9a6f43ab16a66c4fe792a5d2615eea8a5620c (diff) | |
download | skiboot-e8b2e4ab0683dbbdf975c96a22c374d05dac8d90.zip skiboot-e8b2e4ab0683dbbdf975c96a22c374d05dac8d90.tar.gz skiboot-e8b2e4ab0683dbbdf975c96a22c374d05dac8d90.tar.bz2 |
platform: Add exit platform hook
Add a platform hook that is called just prior to loading
and running the payload.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/init.c | 3 | ||||
-rw-r--r-- | include/platform.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/init.c b/core/init.c index 3923164..a4a64d3 100644 --- a/core/init.c +++ b/core/init.c @@ -366,6 +366,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; |