diff options
author | Hans-Joachim Picht <hans@linux.vnet.ibm.com> | 2009-06-16 04:30:52 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-16 04:31:22 -0400 |
commit | 155af2f95f905c830688dd0ca7c7cac4107334fd (patch) | |
tree | 4304a39e713d1594903e838830c4029715cc7a2a /arch/s390/include/asm | |
parent | c369527f18f8560bd3580be2676cb55b54b02ee6 (diff) |
[S390] s390: hibernation support for s390
This patch introduces the hibernation backend support to the
s390 architecture. Now it is possible to suspend a mainframe Linux
guest using the following command:
echo disk > /sys/power/state
Signed-off-by: Hans-Joachim Picht <hans@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm')
-rw-r--r-- | arch/s390/include/asm/suspend.h | 10 | ||||
-rw-r--r-- | arch/s390/include/asm/system.h | 22 |
2 files changed, 26 insertions, 6 deletions
diff --git a/arch/s390/include/asm/suspend.h b/arch/s390/include/asm/suspend.h new file mode 100644 index 000000000000..dc75c616eafe --- /dev/null +++ b/arch/s390/include/asm/suspend.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __ASM_S390_SUSPEND_H | ||
2 | #define __ASM_S390_SUSPEND_H | ||
3 | |||
4 | static inline int arch_prepare_suspend(void) | ||
5 | { | ||
6 | return 0; | ||
7 | } | ||
8 | |||
9 | #endif | ||
10 | |||
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index 3a8b26eb1f2e..4fb83c1cdb77 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
@@ -1,11 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * include/asm-s390/system.h | 2 | * Copyright IBM Corp. 1999, 2009 |
3 | * | 3 | * |
4 | * S390 version | 4 | * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> |
5 | * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation | ||
6 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com), | ||
7 | * | ||
8 | * Derived from "include/asm-i386/system.h" | ||
9 | */ | 5 | */ |
10 | 6 | ||
11 | #ifndef __ASM_SYSTEM_H | 7 | #ifndef __ASM_SYSTEM_H |
@@ -469,6 +465,20 @@ extern psw_t sysc_restore_trace_psw; | |||
469 | extern psw_t io_restore_trace_psw; | 465 | extern psw_t io_restore_trace_psw; |
470 | #endif | 466 | #endif |
471 | 467 | ||
468 | static inline int tprot(unsigned long addr) | ||
469 | { | ||
470 | int rc = -EFAULT; | ||
471 | |||
472 | asm volatile( | ||
473 | " tprot 0(%1),0\n" | ||
474 | "0: ipm %0\n" | ||
475 | " srl %0,28\n" | ||
476 | "1:\n" | ||
477 | EX_TABLE(0b,1b) | ||
478 | : "+d" (rc) : "a" (addr) : "cc"); | ||
479 | return rc; | ||
480 | } | ||
481 | |||
472 | #endif /* __KERNEL__ */ | 482 | #endif /* __KERNEL__ */ |
473 | 483 | ||
474 | #endif | 484 | #endif |