[ARM] 4189/1: AT91: MACB Ethernet clock
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / s390 / char / sclp_quiesce.c
blobffa9282ce97a97b65a0874d516c9b7c10b60df5f
1 /*
2 * drivers/s390/char/sclp_quiesce.c
3 * signal quiesce handler
5 * (C) Copyright IBM Corp. 1999,2004
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 * Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
8 */
10 #include <linux/module.h>
11 #include <linux/types.h>
12 #include <linux/cpumask.h>
13 #include <linux/smp.h>
14 #include <linux/init.h>
15 #include <linux/reboot.h>
16 #include <asm/atomic.h>
17 #include <asm/ptrace.h>
18 #include <asm/sigp.h>
20 #include "sclp.h"
22 /* Shutdown handler. Signal completion of shutdown by loading special PSW. */
23 static void
24 do_machine_quiesce(void)
26 psw_t quiesce_psw;
28 smp_send_stop();
29 quiesce_psw.mask = PSW_BASE_BITS | PSW_MASK_WAIT;
30 quiesce_psw.addr = 0xfff;
31 __load_psw(quiesce_psw);
34 /* Handler for quiesce event. Start shutdown procedure. */
35 static void
36 sclp_quiesce_handler(struct evbuf_header *evbuf)
38 _machine_restart = (void *) do_machine_quiesce;
39 _machine_halt = do_machine_quiesce;
40 _machine_power_off = do_machine_quiesce;
41 ctrl_alt_del();
44 static struct sclp_register sclp_quiesce_event = {
45 .receive_mask = EvTyp_SigQuiesce_Mask,
46 .receiver_fn = sclp_quiesce_handler
49 /* Initialize quiesce driver. */
50 static int __init
51 sclp_quiesce_init(void)
53 int rc;
55 rc = sclp_register(&sclp_quiesce_event);
56 if (rc)
57 printk(KERN_WARNING "sclp: could not register quiesce handler "
58 "(rc=%d)\n", rc);
59 return rc;
62 module_init(sclp_quiesce_init);