summaryrefslogtreecommitdiff
path: root/kern/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/shutdown.c')
-rw-r--r--kern/shutdown.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/kern/shutdown.c b/kern/shutdown.c
index 11a51832..1c950415 100644
--- a/kern/shutdown.c
+++ b/kern/shutdown.c
@@ -21,6 +21,7 @@
#include <kern/plist.h>
#include <kern/shell.h>
#include <kern/shutdown.h>
+#include <machine/boot.h>
#include <machine/cpu.h>
static struct plist shutdown_ops_list;
@@ -54,20 +55,40 @@ static struct shell_cmd shutdown_shell_cmds[] = {
"reboot the system"),
};
+static int __init
+shutdown_setup_shell(void)
+{
+ SHELL_REGISTER_CMDS(shutdown_shell_cmds);
+ return 0;
+}
+
+INIT_OP_DEFINE(shutdown_setup_shell,
+ INIT_OP_DEP(shell_setup, true),
+ INIT_OP_DEP(shutdown_setup, true));
+
#endif /* X15_SHELL */
-void __init
-shutdown_setup(void)
+static int __init
+shutdown_bootstrap(void)
{
plist_init(&shutdown_ops_list);
+ return 0;
}
-void __init
-shutdown_register_shell_cmds(void)
+INIT_OP_DEFINE(shutdown_bootstrap);
+
+static int __init
+shutdown_setup(void)
{
- SHELL_REGISTER_CMDS(shutdown_shell_cmds);
+ return 0;
}
+INIT_OP_DEFINE(shutdown_setup,
+ INIT_OP_DEP(boot_setup_shutdown, true),
+ INIT_OP_DEP(cpu_setup, true),
+ INIT_OP_DEP(printf_setup, true),
+ INIT_OP_DEP(shutdown_bootstrap, true));
+
void __init
shutdown_register(struct shutdown_ops *ops, unsigned int priority)
{