diff options
author | Volker Sameske <sameske@de.ibm.com> | 2005-09-16 22:27:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-17 14:49:59 -0400 |
commit | c782268be8892962a1ae2c09a2e87e7849454ef1 (patch) | |
tree | b1bdba4a96894c8cc6f07f8ec57716dbec5b2854 /arch/s390 | |
parent | b7ae9dd80a3ecf070ea0c5fe1d405cd7687d6c51 (diff) |
[PATCH] s390: diag 0x308 reipl
Add code to support the re-IPL method using diagnose 0x308.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/s390/kernel/reipl_diag.c | 39 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 3 |
4 files changed, 46 insertions, 1 deletions
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index ab1e49d2e518..8584dd823218 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile | |||
@@ -6,7 +6,7 @@ EXTRA_AFLAGS := -traditional | |||
6 | 6 | ||
7 | obj-y := bitmap.o traps.o time.o process.o \ | 7 | obj-y := bitmap.o traps.o time.o process.o \ |
8 | setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ | 8 | setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ |
9 | semaphore.o s390_ext.o debug.o profile.o irq.o | 9 | semaphore.o s390_ext.o debug.o profile.o irq.o reipl_diag.o |
10 | 10 | ||
11 | extra-$(CONFIG_ARCH_S390_31) += head.o | 11 | extra-$(CONFIG_ARCH_S390_31) += head.o |
12 | extra-$(CONFIG_ARCH_S390X) += head64.o | 12 | extra-$(CONFIG_ARCH_S390X) += head64.o |
diff --git a/arch/s390/kernel/reipl_diag.c b/arch/s390/kernel/reipl_diag.c new file mode 100644 index 000000000000..83cb42bc0b76 --- /dev/null +++ b/arch/s390/kernel/reipl_diag.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * This file contains the implementation of the | ||
3 | * Linux re-IPL support | ||
4 | * | ||
5 | * (C) Copyright IBM Corp. 2005 | ||
6 | * | ||
7 | * Author(s): Volker Sameske (sameske@de.ibm.com) | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | |||
13 | static unsigned int reipl_diag_rc1; | ||
14 | static unsigned int reipl_diag_rc2; | ||
15 | |||
16 | /* | ||
17 | * re-IPL the system using the last used IPL parameters | ||
18 | */ | ||
19 | void reipl_diag(void) | ||
20 | { | ||
21 | asm volatile ( | ||
22 | " la %%r4,0\n" | ||
23 | " la %%r5,0\n" | ||
24 | " diag %%r4,%2,0x308\n" | ||
25 | "0:\n" | ||
26 | " st %%r4,%0\n" | ||
27 | " st %%r5,%1\n" | ||
28 | ".section __ex_table,\"a\"\n" | ||
29 | #ifdef __s390x__ | ||
30 | " .align 8\n" | ||
31 | " .quad 0b, 0b\n" | ||
32 | #else | ||
33 | " .align 4\n" | ||
34 | " .long 0b, 0b\n" | ||
35 | #endif | ||
36 | ".previous\n" | ||
37 | : "=m" (reipl_diag_rc1), "=m" (reipl_diag_rc2) | ||
38 | : "d" (3) : "cc", "4", "5" ); | ||
39 | } | ||
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 907d16ac9dc9..5204778b8e5e 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -261,8 +261,11 @@ void (*_machine_power_off)(void) = machine_power_off_smp; | |||
261 | * Reboot, halt and power_off routines for non SMP. | 261 | * Reboot, halt and power_off routines for non SMP. |
262 | */ | 262 | */ |
263 | extern void reipl(unsigned long devno); | 263 | extern void reipl(unsigned long devno); |
264 | extern void reipl_diag(void); | ||
264 | static void do_machine_restart_nonsmp(char * __unused) | 265 | static void do_machine_restart_nonsmp(char * __unused) |
265 | { | 266 | { |
267 | reipl_diag(); | ||
268 | |||
266 | if (MACHINE_IS_VM) | 269 | if (MACHINE_IS_VM) |
267 | cpcmd ("IPL", NULL, 0); | 270 | cpcmd ("IPL", NULL, 0); |
268 | else | 271 | else |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 85222fee4361..e13c87b446b2 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -65,6 +65,7 @@ extern char vmhalt_cmd[]; | |||
65 | extern char vmpoff_cmd[]; | 65 | extern char vmpoff_cmd[]; |
66 | 66 | ||
67 | extern void reipl(unsigned long devno); | 67 | extern void reipl(unsigned long devno); |
68 | extern void reipl_diag(void); | ||
68 | 69 | ||
69 | static void smp_ext_bitcall(int, ec_bit_sig); | 70 | static void smp_ext_bitcall(int, ec_bit_sig); |
70 | static void smp_ext_bitcall_others(ec_bit_sig); | 71 | static void smp_ext_bitcall_others(ec_bit_sig); |
@@ -283,6 +284,8 @@ static void do_machine_restart(void * __unused) | |||
283 | * interrupted by an external interrupt and s390irq | 284 | * interrupted by an external interrupt and s390irq |
284 | * locks are always held disabled). | 285 | * locks are always held disabled). |
285 | */ | 286 | */ |
287 | reipl_diag(); | ||
288 | |||
286 | if (MACHINE_IS_VM) | 289 | if (MACHINE_IS_VM) |
287 | cpcmd ("IPL", NULL, 0, NULL); | 290 | cpcmd ("IPL", NULL, 0, NULL); |
288 | else | 291 | else |