7 #include "jdb_module.h"
8 #include "jdb_screen.h"
9 #include "kernel_console.h"
10 #include "static_init.h"
11 #include "terminate.h"
16 * Private 'exit' module.
18 * This module handles the 'exit' or '^' command that
19 * makes a call to exit() and virtually reboots the system.
21 class Jdb_exit_module : public Jdb_module
24 Jdb_exit_module() FIASCO_INIT;
27 static Jdb_exit_module jdb_exit_module INIT_PRIORITY(JDB_MODULE_INIT_PRIO);
30 Jdb_module::Action_code
31 Jdb_exit_module::action (int cmd, void *&, char const *&, int &)
36 // re-enable output of all consoles but GZIP and DEBUG
37 Kconsole::console()->change_state(0, Console::GZIP | Console::DEBUG,
38 ~0UL, Console::OUTENABLED);
39 // re-enable input of all consoles but PUSH and DEBUG
40 Kconsole::console()->change_state(0, Console::PUSH | Console::DEBUG,
41 ~0UL, Console::INENABLED);
43 Jdb::screen_scroll(1, 127);
44 Jdb::blink_cursor(Jdb_screen::height(), 1);
52 Jdb_exit_module::num_cmds() const
58 Jdb_module::Cmd const *
59 Jdb_exit_module::cmds() const
62 { { 0, "^", "exit", "", "^\treboot the system", (void*)0 } };
68 Jdb_exit_module::Jdb_exit_module()
69 : Jdb_module("GENERAL")