aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-06-04 09:05:43 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-06-05 07:23:36 -0400
commiteb546195a7d8bc492ec6865980bf767474e74d87 (patch)
tree75dd288f9c3a2870000bc64857d8230030bfcb31
parenta095a8a9d5c2ffa15589298aabb64c75c39bf9be (diff)
s390/sigp: use sigp order code defines in assembly code
Use sigp order code defines in assembly code as well. With this change all places that use sigp constants should have been converted to use self describing defines instead of directly using constants. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/kernel/base.S3
-rw-r--r--arch/s390/kernel/entry.S5
-rw-r--r--arch/s390/kernel/entry64.S5
-rw-r--r--arch/s390/kernel/head_kdump.S6
-rw-r--r--arch/s390/kernel/reipl.S3
-rw-r--r--arch/s390/kernel/reipl64.S3
-rw-r--r--arch/s390/kernel/relocate_kernel.S3
-rw-r--r--arch/s390/kernel/relocate_kernel64.S5
-rw-r--r--arch/s390/kernel/smp.c8
-rw-r--r--arch/s390/kernel/swsusp_asm64.S13
10 files changed, 33 insertions, 21 deletions
diff --git a/arch/s390/kernel/base.S b/arch/s390/kernel/base.S
index c880ff72db44..8c20d0efd483 100644
--- a/arch/s390/kernel/base.S
+++ b/arch/s390/kernel/base.S
@@ -9,6 +9,7 @@
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/ptrace.h> 11#include <asm/ptrace.h>
12#include <asm/sigp.h>
12 13
13#ifdef CONFIG_64BIT 14#ifdef CONFIG_64BIT
14 15
@@ -100,7 +101,7 @@ ENTRY(diag308_reset)
100.Lrestart_part2: 101.Lrestart_part2:
101 lhi %r0,0 # Load r0 with zero 102 lhi %r0,0 # Load r0 with zero
102 lhi %r1,2 # Use mode 2 = ESAME (dump) 103 lhi %r1,2 # Use mode 2 = ESAME (dump)
103 sigp %r1,%r0,0x12 # Switch to ESAME mode 104 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
104 sam64 # Switch to 64 bit addressing mode 105 sam64 # Switch to 64 bit addressing mode
105 larl %r4,.Lctlregs # Restore control registers 106 larl %r4,.Lctlregs # Restore control registers
106 lctlg %c0,%c15,0(%r4) 107 lctlg %c0,%c15,0(%r4)
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 1ae93b573d7d..3787f9e6907a 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -18,6 +18,7 @@
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19#include <asm/unistd.h> 19#include <asm/unistd.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/sigp.h>
21 22
22__PT_R0 = __PT_GPRS 23__PT_R0 = __PT_GPRS
23__PT_R1 = __PT_GPRS + 4 24__PT_R1 = __PT_GPRS + 4
@@ -726,12 +727,12 @@ ENTRY(restart_int_handler)
726 lm %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu 727 lm %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu
727 ltr %r3,%r3 # test source cpu address 728 ltr %r3,%r3 # test source cpu address
728 jm 1f # negative -> skip source stop 729 jm 1f # negative -> skip source stop
7290: sigp %r4,%r3,1 # sigp sense to source cpu 7300: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu
730 brc 10,0b # wait for status stored 731 brc 10,0b # wait for status stored
7311: basr %r14,%r1 # call function 7321: basr %r14,%r1 # call function
732 stap __SF_EMPTY(%r15) # store cpu address 733 stap __SF_EMPTY(%r15) # store cpu address
733 lh %r3,__SF_EMPTY(%r15) 734 lh %r3,__SF_EMPTY(%r15)
7342: sigp %r4,%r3,5 # sigp stop to current cpu 7352: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu
735 brc 2,2b 736 brc 2,2b
7363: j 3b 7373: j 3b
737 738
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index bf80a5921173..d5f02e480e51 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -18,6 +18,7 @@
18#include <asm/asm-offsets.h> 18#include <asm/asm-offsets.h>
19#include <asm/unistd.h> 19#include <asm/unistd.h>
20#include <asm/page.h> 20#include <asm/page.h>
21#include <asm/sigp.h>
21 22
22__PT_R0 = __PT_GPRS 23__PT_R0 = __PT_GPRS
23__PT_R1 = __PT_GPRS + 8 24__PT_R1 = __PT_GPRS + 8
@@ -753,12 +754,12 @@ ENTRY(restart_int_handler)
753 lmg %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu 754 lmg %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu
754 ltgr %r3,%r3 # test source cpu address 755 ltgr %r3,%r3 # test source cpu address
755 jm 1f # negative -> skip source stop 756 jm 1f # negative -> skip source stop
7560: sigp %r4,%r3,1 # sigp sense to source cpu 7570: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu
757 brc 10,0b # wait for status stored 758 brc 10,0b # wait for status stored
7581: basr %r14,%r1 # call function 7591: basr %r14,%r1 # call function
759 stap __SF_EMPTY(%r15) # store cpu address 760 stap __SF_EMPTY(%r15) # store cpu address
760 llgh %r3,__SF_EMPTY(%r15) 761 llgh %r3,__SF_EMPTY(%r15)
7612: sigp %r4,%r3,5 # sigp stop to current cpu 7622: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu
762 brc 2,2b 763 brc 2,2b
7633: j 3b 7643: j 3b
764 765
diff --git a/arch/s390/kernel/head_kdump.S b/arch/s390/kernel/head_kdump.S
index 796c976b5fdc..acaaaf4b7055 100644
--- a/arch/s390/kernel/head_kdump.S
+++ b/arch/s390/kernel/head_kdump.S
@@ -5,6 +5,8 @@
5 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com> 5 * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
6 */ 6 */
7 7
8#include <asm/sigp.h>
9
8#define DATAMOVER_ADDR 0x4000 10#define DATAMOVER_ADDR 0x4000
9#define COPY_PAGE_ADDR 0x6000 11#define COPY_PAGE_ADDR 0x6000
10 12
@@ -19,7 +21,7 @@
19.align 2 21.align 2
20.Lep_startup_kdump: 22.Lep_startup_kdump:
21 lhi %r1,2 # mode 2 = esame (dump) 23 lhi %r1,2 # mode 2 = esame (dump)
22 sigp %r1,%r0,0x12 # Switch to esame mode 24 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to esame mode
23 sam64 # Switch to 64 bit addressing 25 sam64 # Switch to 64 bit addressing
24 basr %r13,0 26 basr %r13,0
25.Lbase: 27.Lbase:
@@ -88,7 +90,7 @@ startup_kdump_relocated:
88 sam31 # Switch to 31 bit addr mode 90 sam31 # Switch to 31 bit addr mode
89 sr %r1,%r1 # Erase register r1 91 sr %r1,%r1 # Erase register r1
90 sr %r2,%r2 # Erase register r2 92 sr %r2,%r2 # Erase register r2
91 sigp %r1,%r2,0x12 # Switch to 31 bit arch mode 93 sigp %r1,%r2,SIGP_SET_ARCHITECTURE # Switch to 31 bit arch mode
92 lpsw 0 # Start new kernel... 94 lpsw 0 # Start new kernel...
93.align 8 95.align 8
94.Lrestart_psw: 96.Lrestart_psw:
diff --git a/arch/s390/kernel/reipl.S b/arch/s390/kernel/reipl.S
index ad67c214be04..1c5e9e3e2aa4 100644
--- a/arch/s390/kernel/reipl.S
+++ b/arch/s390/kernel/reipl.S
@@ -8,6 +8,7 @@
8 8
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/asm-offsets.h> 10#include <asm/asm-offsets.h>
11#include <asm/sigp.h>
11 12
12# 13#
13# store_status: Empty implementation until kdump is supported on 31 bit 14# store_status: Empty implementation until kdump is supported on 31 bit
@@ -60,7 +61,7 @@ ENTRY(do_reipl_asm)
60 bas %r14,.Ldisab-.Lpg0(%r13) 61 bas %r14,.Ldisab-.Lpg0(%r13)
61.L003: st %r1,__LC_SUBCHANNEL_ID 62.L003: st %r1,__LC_SUBCHANNEL_ID
62 lpsw 0 63 lpsw 0
63 sigp 0,0,0(6) 64 sigp 0,0,SIGP_RESTART
64.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13) 65.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13)
65 lpsw .Ldispsw-.Lpg0(%r13) 66 lpsw .Ldispsw-.Lpg0(%r13)
66 .align 8 67 .align 8
diff --git a/arch/s390/kernel/reipl64.S b/arch/s390/kernel/reipl64.S
index 36b32658fb24..02f5a73d1820 100644
--- a/arch/s390/kernel/reipl64.S
+++ b/arch/s390/kernel/reipl64.S
@@ -6,6 +6,7 @@
6 6
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <asm/asm-offsets.h> 8#include <asm/asm-offsets.h>
9#include <asm/sigp.h>
9 10
10# 11#
11# store_status 12# store_status
@@ -106,7 +107,7 @@ ENTRY(do_reipl_asm)
106.L003: st %r1,__LC_SUBCHANNEL_ID 107.L003: st %r1,__LC_SUBCHANNEL_ID
107 lhi %r1,0 # mode 0 = esa 108 lhi %r1,0 # mode 0 = esa
108 slr %r0,%r0 # set cpuid to zero 109 slr %r0,%r0 # set cpuid to zero
109 sigp %r1,%r0,0x12 # switch to esa mode 110 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esa mode
110 lpsw 0 111 lpsw 0
111.Ldisab: sll %r14,1 112.Ldisab: sll %r14,1
112 srl %r14,1 # need to kill hi bit to avoid specification exceptions. 113 srl %r14,1 # need to kill hi bit to avoid specification exceptions.
diff --git a/arch/s390/kernel/relocate_kernel.S b/arch/s390/kernel/relocate_kernel.S
index c91d70aede91..bfad96a64222 100644
--- a/arch/s390/kernel/relocate_kernel.S
+++ b/arch/s390/kernel/relocate_kernel.S
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/sigp.h>
12 13
13/* 14/*
14 * moves the new kernel to its destination... 15 * moves the new kernel to its destination...
@@ -93,7 +94,7 @@ ENTRY(relocate_kernel)
93 .no_diag308: 94 .no_diag308:
94 sr %r1,%r1 # clear %r1 95 sr %r1,%r1 # clear %r1
95 sr %r2,%r2 # clear %r2 96 sr %r2,%r2 # clear %r2
96 sigp %r1,%r2,0x12 # set cpuid to zero 97 sigp %r1,%r2,SIGP_SET_ARCHITECTURE # set cpuid to zero
97 lpsw 0 # hopefully start new kernel... 98 lpsw 0 # hopefully start new kernel...
98 99
99 .align 8 100 .align 8
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S
index 7c3ce589a7f0..35508f335688 100644
--- a/arch/s390/kernel/relocate_kernel64.S
+++ b/arch/s390/kernel/relocate_kernel64.S
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/linkage.h> 11#include <linux/linkage.h>
12#include <asm/sigp.h>
12 13
13/* 14/*
14 * moves the new kernel to its destination... 15 * moves the new kernel to its destination...
@@ -45,7 +46,7 @@ ENTRY(relocate_kernel)
45 diag %r0,%r0,0x308 46 diag %r0,%r0,0x308
46 .back: 47 .back:
47 lhi %r1,1 # mode 1 = esame 48 lhi %r1,1 # mode 1 = esame
48 sigp %r1,%r0,0x12 # switch to esame mode 49 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esame mode
49 sam64 # switch to 64 bit addressing mode 50 sam64 # switch to 64 bit addressing mode
50 basr %r13,0 51 basr %r13,0
51 .back_base: 52 .back_base:
@@ -96,7 +97,7 @@ ENTRY(relocate_kernel)
96 sam31 # 31 bit mode 97 sam31 # 31 bit mode
97 sr %r1,%r1 # erase register r1 98 sr %r1,%r1 # erase register r1
98 sr %r2,%r2 # erase register r2 99 sr %r2,%r2 # erase register r2
99 sigp %r1,%r2,0x12 # set cpuid to zero 100 sigp %r1,%r2,SIGP_SET_ARCHITECTURE # set cpuid to zero
100 lpsw 0 # hopefully start new kernel... 101 lpsw 0 # hopefully start new kernel...
101 102
102 .align 8 103 .align 8
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 53ac2344ca7a..e01408429ad6 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -288,11 +288,13 @@ static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *),
288 /* Restart func on the target cpu and stop the current cpu. */ 288 /* Restart func on the target cpu and stop the current cpu. */
289 memcpy_absolute(&lc->restart_stack, &restart, sizeof(restart)); 289 memcpy_absolute(&lc->restart_stack, &restart, sizeof(restart));
290 asm volatile( 290 asm volatile(
291 "0: sigp 0,%0,6 # sigp restart to target cpu\n" 291 "0: sigp 0,%0,%2 # sigp restart to target cpu\n"
292 " brc 2,0b # busy, try again\n" 292 " brc 2,0b # busy, try again\n"
293 "1: sigp 0,%1,5 # sigp stop to current cpu\n" 293 "1: sigp 0,%1,%3 # sigp stop to current cpu\n"
294 " brc 2,1b # busy, try again\n" 294 " brc 2,1b # busy, try again\n"
295 : : "d" (pcpu->address), "d" (restart.source) : "0", "1", "cc"); 295 : : "d" (pcpu->address), "d" (restart.source),
296 "K" (SIGP_RESTART), "K" (SIGP_STOP)
297 : "0", "1", "cc");
296 for (;;) ; 298 for (;;) ;
297} 299}
298 300
diff --git a/arch/s390/kernel/swsusp_asm64.S b/arch/s390/kernel/swsusp_asm64.S
index dd70ef046058..d4ca4e0617b5 100644
--- a/arch/s390/kernel/swsusp_asm64.S
+++ b/arch/s390/kernel/swsusp_asm64.S
@@ -12,6 +12,7 @@
12#include <asm/ptrace.h> 12#include <asm/ptrace.h>
13#include <asm/thread_info.h> 13#include <asm/thread_info.h>
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/sigp.h>
15 16
16/* 17/*
17 * Save register context in absolute 0 lowcore and call swsusp_save() to 18 * Save register context in absolute 0 lowcore and call swsusp_save() to
@@ -163,7 +164,7 @@ ENTRY(swsusp_arch_resume)
163 diag %r0,%r0,0x308 164 diag %r0,%r0,0x308
164restart_entry: 165restart_entry:
165 lhi %r1,1 166 lhi %r1,1
166 sigp %r1,%r0,0x12 167 sigp %r1,%r0,SIGP_SET_ARCHITECTURE
167 sam64 168 sam64
168 larl %r1,.Lnew_pgm_check_psw 169 larl %r1,.Lnew_pgm_check_psw
169 lpswe 0(%r1) 170 lpswe 0(%r1)
@@ -179,7 +180,7 @@ pgm_check_entry:
179 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ 180 larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
180 mvc __LC_RST_NEW_PSW(16,%r0),0(%r4) 181 mvc __LC_RST_NEW_PSW(16,%r0),0(%r4)
1813: 1823:
182 sigp %r9,%r1,11 /* sigp initial cpu reset */ 183 sigp %r9,%r1,SIGP_INITIAL_CPU_RESET /* sigp initial cpu reset */
183 brc 8,4f /* accepted */ 184 brc 8,4f /* accepted */
184 brc 2,3b /* busy, try again */ 185 brc 2,3b /* busy, try again */
185 186
@@ -190,16 +191,16 @@ pgm_check_entry:
190 larl %r3,_sclp_print_early 191 larl %r3,_sclp_print_early
191 lghi %r1,0 192 lghi %r1,0
192 sam31 193 sam31
193 sigp %r1,%r0,0x12 194 sigp %r1,%r0,SIGP_SET_ARCHITECTURE
194 basr %r14,%r3 195 basr %r14,%r3
195 larl %r3,.Ldisabled_wait_31 196 larl %r3,.Ldisabled_wait_31
196 lpsw 0(%r3) 197 lpsw 0(%r3)
1974: 1984:
198 /* Switch to suspend CPU */ 199 /* Switch to suspend CPU */
199 sigp %r9,%r1,6 /* sigp restart to suspend CPU */ 200 sigp %r9,%r1,SIGP_RESTART /* sigp restart to suspend CPU */
200 brc 2,4b /* busy, try again */ 201 brc 2,4b /* busy, try again */
2015: 2025:
202 sigp %r9,%r2,5 /* sigp stop to current resume CPU */ 203 sigp %r9,%r2,SIGP_STOP /* sigp stop to current resume CPU */
203 brc 2,5b /* busy, try again */ 204 brc 2,5b /* busy, try again */
2046: j 6b 2056: j 6b
205 206
@@ -207,7 +208,7 @@ restart_suspend:
207 larl %r1,.Lresume_cpu 208 larl %r1,.Lresume_cpu
208 llgh %r2,0(%r1) 209 llgh %r2,0(%r1)
2097: 2107:
210 sigp %r9,%r2,1 /* sigp sense, wait for resume CPU */ 211 sigp %r9,%r2,SIGP_SENSE /* sigp sense, wait for resume CPU */
211 brc 8,7b /* accepted, status 0, still running */ 212 brc 8,7b /* accepted, status 0, still running */
212 brc 2,7b /* busy, try again */ 213 brc 2,7b /* busy, try again */
213 tmll %r9,0x40 /* Test if resume CPU is stopped */ 214 tmll %r9,0x40 /* Test if resume CPU is stopped */