aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep/poweroff.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/acpi/sleep/poweroff.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/acpi/sleep/poweroff.c')
-rw-r--r--drivers/acpi/sleep/poweroff.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/acpi/sleep/poweroff.c b/drivers/acpi/sleep/poweroff.c
new file mode 100644
index 000000000000..da237754ded9
--- /dev/null
+++ b/drivers/acpi/sleep/poweroff.c
@@ -0,0 +1,39 @@
1/*
2 * poweroff.c - ACPI handler for powering off the system.
3 *
4 * AKA S5, but it is independent of whether or not the kernel supports
5 * any other sleep support in the system.
6 */
7
8#include <linux/pm.h>
9#include <linux/init.h>
10#include <acpi/acpi_bus.h>
11#include <linux/sched.h>
12#include "sleep.h"
13
14static void
15acpi_power_off (void)
16{
17 printk("%s called\n",__FUNCTION__);
18 /* Some SMP machines only can poweroff in boot CPU */
19 set_cpus_allowed(current, cpumask_of_cpu(0));
20 acpi_wakeup_gpe_poweroff_prepare();
21 acpi_enter_sleep_state_prep(ACPI_STATE_S5);
22 ACPI_DISABLE_IRQS();
23 acpi_enter_sleep_state(ACPI_STATE_S5);
24}
25
26static int acpi_poweroff_init(void)
27{
28 if (!acpi_disabled) {
29 u8 type_a, type_b;
30 acpi_status status;
31
32 status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
33 if (ACPI_SUCCESS(status))
34 pm_power_off = acpi_power_off;
35 }
36 return 0;
37}
38
39late_initcall(acpi_poweroff_init);