Added "shutdown" debugger command. Implemented arch_cpu_shutdown() for
PPC. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15862 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
85af525e59
commit
8baf8813c0
@ -29,6 +29,8 @@ public:
|
||||
|
||||
virtual void SetHardwareRTC(uint32 seconds) = 0;
|
||||
virtual uint32 GetHardwareRTC() = 0;
|
||||
|
||||
virtual void ShutDown(bool reboot) = 0;
|
||||
};
|
||||
|
||||
} // namespace BPrivate
|
||||
|
@ -6,7 +6,7 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) $(DOTDOT) generic ] ;
|
||||
|
||||
KernelStaticLibrary libppc :
|
||||
arch_atomic.c
|
||||
arch_cpu.c
|
||||
arch_cpu.cpp
|
||||
arch_cpu_asm.S
|
||||
arch_debug_console.cpp
|
||||
arch_debug.c
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
|
||||
#include <arch_platform.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <boot/kernel_args.h>
|
||||
|
||||
@ -196,7 +198,8 @@ error:
|
||||
status_t
|
||||
arch_cpu_shutdown(bool reboot)
|
||||
{
|
||||
return EOPNOTSUPP;
|
||||
PPCPlatform::Default()->ShutDown(reboot);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
virtual void SetHardwareRTC(uint32 seconds);
|
||||
virtual uint32 GetHardwareRTC();
|
||||
|
||||
virtual void ShutDown(bool reboot);
|
||||
|
||||
private:
|
||||
int fInput;
|
||||
int fOutput;
|
||||
@ -203,6 +205,18 @@ PPCOpenFirmware::GetHardwareRTC()
|
||||
return rtc_tm_to_secs(&t);
|
||||
}
|
||||
|
||||
// ShutDown
|
||||
void
|
||||
PPCOpenFirmware::ShutDown(bool reboot)
|
||||
{
|
||||
if (reboot) {
|
||||
of_interpret("reset-all", 0, 0);
|
||||
} else {
|
||||
// not standardized, so it might fail
|
||||
of_interpret("shut-down", 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// # pragma mark -
|
||||
|
||||
|
@ -325,6 +325,14 @@ cmd_reboot(int argc, char **argv)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
cmd_shutdown(int argc, char **argv)
|
||||
{
|
||||
arch_cpu_shutdown(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
cmd_help(int argc, char **argv)
|
||||
{
|
||||
@ -412,6 +420,7 @@ debug_init_post_vm(kernel_args *args)
|
||||
|
||||
add_debugger_command("help", &cmd_help, "List all debugger commands");
|
||||
add_debugger_command("reboot", &cmd_reboot, "Reboot the system");
|
||||
add_debugger_command("shutdown", &cmd_shutdown, "Shut down the system");
|
||||
add_debugger_command("gdb", &cmd_gdb, "Connect to remote gdb");
|
||||
add_debugger_command("continue", &cmd_continue, "Leave kernel debugger");
|
||||
add_debugger_command("exit", &cmd_continue, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user