[SPARC64]: Support CONFIG_HZ
[wandboard.git] / arch / um / kernel / reboot.c
blobfcec51da1d3771abe84944ca1138853417df6bec
1 /*
2 * Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
6 #include "linux/module.h"
7 #include "linux/sched.h"
8 #include "user_util.h"
9 #include "kern_util.h"
10 #include "kern.h"
11 #include "os.h"
12 #include "mode.h"
13 #include "choose-mode.h"
15 #ifdef CONFIG_SMP
16 static void kill_idlers(int me)
18 #ifdef CONFIG_MODE_TT
19 struct task_struct *p;
20 int i;
22 for(i = 0; i < sizeof(idle_threads)/sizeof(idle_threads[0]); i++){
23 p = idle_threads[i];
24 if((p != NULL) && (p->thread.mode.tt.extern_pid != me))
25 os_kill_process(p->thread.mode.tt.extern_pid, 0);
27 #endif
29 #endif
31 static void kill_off_processes(void)
33 CHOOSE_MODE(kill_off_processes_tt(), kill_off_processes_skas());
34 #ifdef CONFIG_SMP
35 kill_idlers(os_getpid());
36 #endif
39 void uml_cleanup(void)
41 kmalloc_ok = 0;
42 do_uml_exitcalls();
43 kill_off_processes();
46 void machine_restart(char * __unused)
48 uml_cleanup();
49 CHOOSE_MODE(reboot_tt(), reboot_skas());
52 EXPORT_SYMBOL(machine_restart);
54 void machine_power_off(void)
56 uml_cleanup();
57 CHOOSE_MODE(halt_tt(), halt_skas());
60 EXPORT_SYMBOL(machine_power_off);
62 void machine_halt(void)
64 machine_power_off();
67 EXPORT_SYMBOL(machine_halt);
70 * Overrides for Emacs so that we follow Linus's tabbing style.
71 * Emacs will notice this stuff at the end of the file and automatically
72 * adjust the settings for this buffer only. This must remain at the end
73 * of the file.
74 * ---------------------------------------------------------------------------
75 * Local variables:
76 * c-file-style: "linux"
77 * End: