1 /* 2 * Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com) 3 * Licensed under the GPL 4 */ 5 6 #include "linux/module.h" 7 #include "linux/sched.h" 8 #include "asm/smp.h" 9 #include "kern_util.h" 10 #include "kern.h" 11 #include "os.h" 12 #include "mode.h" 13 #include "choose-mode.h" 14 15 void (*pm_power_off)(void); 16 17 static void kill_off_processes(void) 18 { 19 CHOOSE_MODE(kill_off_processes_tt(), kill_off_processes_skas()); 20 } 21 22 void uml_cleanup(void) 23 { 24 kmalloc_ok = 0; 25 do_uml_exitcalls(); 26 kill_off_processes(); 27 } 28 29 void machine_restart(char * __unused) 30 { 31 uml_cleanup(); 32 CHOOSE_MODE(reboot_tt(), reboot_skas()); 33 } 34 35 void machine_power_off(void) 36 { 37 uml_cleanup(); 38 CHOOSE_MODE(halt_tt(), halt_skas()); 39 } 40 41 void machine_halt(void) 42 { 43 machine_power_off(); 44 } 45