blob: 4a0def32e32327edf4f586e421e97a60b4f92617 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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"
Paolo 'Blaisorblade' Giarrusso72e55252006-02-01 03:06:29 -08008#include "asm/smp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#include "kern_util.h"
10#include "kern.h"
11#include "os.h"
12#include "mode.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Eric W. Biederman5e382912006-01-08 01:03:46 -080014void (*pm_power_off)(void);
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016static void kill_off_processes(void)
17{
Jeff Dike6aa802c2007-10-16 01:26:56 -070018 kill_off_processes_skas();
Linus Torvalds1da177e2005-04-16 15:20:36 -070019}
20
21void uml_cleanup(void)
22{
Jeff Dike026549d2005-06-25 14:55:23 -070023 kmalloc_ok = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 do_uml_exitcalls();
Jeff Dike026549d2005-06-25 14:55:23 -070025 kill_off_processes();
Linus Torvalds1da177e2005-04-16 15:20:36 -070026}
27
28void machine_restart(char * __unused)
29{
Jeff Dike026549d2005-06-25 14:55:23 -070030 uml_cleanup();
Jeff Dike6aa802c2007-10-16 01:26:56 -070031 reboot_skas();
Linus Torvalds1da177e2005-04-16 15:20:36 -070032}
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034void machine_power_off(void)
35{
Jeff Dike026549d2005-06-25 14:55:23 -070036 uml_cleanup();
Jeff Dike6aa802c2007-10-16 01:26:56 -070037 halt_skas();
Linus Torvalds1da177e2005-04-16 15:20:36 -070038}
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040void machine_halt(void)
41{
42 machine_power_off();
43}