blob: 07fc5244aed4917392542399e8547ed276aa3518 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
Ralf Baechlefcdb27a2006-01-18 17:37:07 +00006 * Copyright (C) 2001, 06 by Ralf Baechle (ralf@linux-mips.org)
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * Copyright (C) 2001 MIPS Technologies, Inc.
8 */
9#include <linux/kernel.h>
Paul Gortmaker73bc2562011-07-23 16:30:40 -040010#include <linux/export.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000011#include <linux/pm.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/types.h>
13#include <linux/reboot.h>
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000014
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <asm/reboot.h>
16
17/*
18 * Urgs ... Too many MIPS machines to handle this in a generic way.
19 * So handle all using function pointers to machine specific
20 * functions.
21 */
22void (*_machine_restart)(char *command);
23void (*_machine_halt)(void);
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000024void (*pm_power_off)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Ralf Baechlef8bf35a2006-12-10 15:09:38 +000026EXPORT_SYMBOL(pm_power_off);
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028void machine_restart(char *command)
29{
Ralf Baechle9414d362006-01-17 21:14:01 +000030 if (_machine_restart)
31 _machine_restart(command);
Linus Torvalds1da177e2005-04-16 15:20:36 -070032}
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034void machine_halt(void)
35{
Ralf Baechle9414d362006-01-17 21:14:01 +000036 if (_machine_halt)
37 _machine_halt();
Linus Torvalds1da177e2005-04-16 15:20:36 -070038}
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040void machine_power_off(void)
41{
Ralf Baechlefcdb27a2006-01-18 17:37:07 +000042 if (pm_power_off)
43 pm_power_off();
Linus Torvalds1da177e2005-04-16 15:20:36 -070044}