Commit eb546195 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent a095a8a9
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/sigp.h>
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
...@@ -100,7 +101,7 @@ ENTRY(diag308_reset) ...@@ -100,7 +101,7 @@ ENTRY(diag308_reset)
.Lrestart_part2: .Lrestart_part2:
lhi %r0,0 # Load r0 with zero lhi %r0,0 # Load r0 with zero
lhi %r1,2 # Use mode 2 = ESAME (dump) lhi %r1,2 # Use mode 2 = ESAME (dump)
sigp %r1,%r0,0x12 # Switch to ESAME mode sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
sam64 # Switch to 64 bit addressing mode sam64 # Switch to 64 bit addressing mode
larl %r4,.Lctlregs # Restore control registers larl %r4,.Lctlregs # Restore control registers
lctlg %c0,%c15,0(%r4) lctlg %c0,%c15,0(%r4)
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/sigp.h>
__PT_R0 = __PT_GPRS __PT_R0 = __PT_GPRS
__PT_R1 = __PT_GPRS + 4 __PT_R1 = __PT_GPRS + 4
...@@ -726,12 +727,12 @@ ENTRY(restart_int_handler) ...@@ -726,12 +727,12 @@ ENTRY(restart_int_handler)
lm %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu lm %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu
ltr %r3,%r3 # test source cpu address ltr %r3,%r3 # test source cpu address
jm 1f # negative -> skip source stop jm 1f # negative -> skip source stop
0: sigp %r4,%r3,1 # sigp sense to source cpu 0: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu
brc 10,0b # wait for status stored brc 10,0b # wait for status stored
1: basr %r14,%r1 # call function 1: basr %r14,%r1 # call function
stap __SF_EMPTY(%r15) # store cpu address stap __SF_EMPTY(%r15) # store cpu address
lh %r3,__SF_EMPTY(%r15) lh %r3,__SF_EMPTY(%r15)
2: sigp %r4,%r3,5 # sigp stop to current cpu 2: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu
brc 2,2b brc 2,2b
3: j 3b 3: j 3b
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/sigp.h>
__PT_R0 = __PT_GPRS __PT_R0 = __PT_GPRS
__PT_R1 = __PT_GPRS + 8 __PT_R1 = __PT_GPRS + 8
...@@ -753,12 +754,12 @@ ENTRY(restart_int_handler) ...@@ -753,12 +754,12 @@ ENTRY(restart_int_handler)
lmg %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu lmg %r1,%r3,__LC_RESTART_FN # load fn, parm & source cpu
ltgr %r3,%r3 # test source cpu address ltgr %r3,%r3 # test source cpu address
jm 1f # negative -> skip source stop jm 1f # negative -> skip source stop
0: sigp %r4,%r3,1 # sigp sense to source cpu 0: sigp %r4,%r3,SIGP_SENSE # sigp sense to source cpu
brc 10,0b # wait for status stored brc 10,0b # wait for status stored
1: basr %r14,%r1 # call function 1: basr %r14,%r1 # call function
stap __SF_EMPTY(%r15) # store cpu address stap __SF_EMPTY(%r15) # store cpu address
llgh %r3,__SF_EMPTY(%r15) llgh %r3,__SF_EMPTY(%r15)
2: sigp %r4,%r3,5 # sigp stop to current cpu 2: sigp %r4,%r3,SIGP_STOP # sigp stop to current cpu
brc 2,2b brc 2,2b
3: j 3b 3: j 3b
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com> * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com>
*/ */
#include <asm/sigp.h>
#define DATAMOVER_ADDR 0x4000 #define DATAMOVER_ADDR 0x4000
#define COPY_PAGE_ADDR 0x6000 #define COPY_PAGE_ADDR 0x6000
...@@ -19,7 +21,7 @@ ...@@ -19,7 +21,7 @@
.align 2 .align 2
.Lep_startup_kdump: .Lep_startup_kdump:
lhi %r1,2 # mode 2 = esame (dump) lhi %r1,2 # mode 2 = esame (dump)
sigp %r1,%r0,0x12 # Switch to esame mode sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to esame mode
sam64 # Switch to 64 bit addressing sam64 # Switch to 64 bit addressing
basr %r13,0 basr %r13,0
.Lbase: .Lbase:
...@@ -88,7 +90,7 @@ startup_kdump_relocated: ...@@ -88,7 +90,7 @@ startup_kdump_relocated:
sam31 # Switch to 31 bit addr mode sam31 # Switch to 31 bit addr mode
sr %r1,%r1 # Erase register r1 sr %r1,%r1 # Erase register r1
sr %r2,%r2 # Erase register r2 sr %r2,%r2 # Erase register r2
sigp %r1,%r2,0x12 # Switch to 31 bit arch mode sigp %r1,%r2,SIGP_SET_ARCHITECTURE # Switch to 31 bit arch mode
lpsw 0 # Start new kernel... lpsw 0 # Start new kernel...
.align 8 .align 8
.Lrestart_psw: .Lrestart_psw:
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/sigp.h>
# #
# store_status: Empty implementation until kdump is supported on 31 bit # store_status: Empty implementation until kdump is supported on 31 bit
...@@ -60,7 +61,7 @@ ENTRY(do_reipl_asm) ...@@ -60,7 +61,7 @@ ENTRY(do_reipl_asm)
bas %r14,.Ldisab-.Lpg0(%r13) bas %r14,.Ldisab-.Lpg0(%r13)
.L003: st %r1,__LC_SUBCHANNEL_ID .L003: st %r1,__LC_SUBCHANNEL_ID
lpsw 0 lpsw 0
sigp 0,0,0(6) sigp 0,0,SIGP_RESTART
.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13) .Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13)
lpsw .Ldispsw-.Lpg0(%r13) lpsw .Ldispsw-.Lpg0(%r13)
.align 8 .align 8
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/sigp.h>
# #
# store_status # store_status
...@@ -106,7 +107,7 @@ ENTRY(do_reipl_asm) ...@@ -106,7 +107,7 @@ ENTRY(do_reipl_asm)
.L003: st %r1,__LC_SUBCHANNEL_ID .L003: st %r1,__LC_SUBCHANNEL_ID
lhi %r1,0 # mode 0 = esa lhi %r1,0 # mode 0 = esa
slr %r0,%r0 # set cpuid to zero slr %r0,%r0 # set cpuid to zero
sigp %r1,%r0,0x12 # switch to esa mode sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esa mode
lpsw 0 lpsw 0
.Ldisab: sll %r14,1 .Ldisab: sll %r14,1
srl %r14,1 # need to kill hi bit to avoid specification exceptions. srl %r14,1 # need to kill hi bit to avoid specification exceptions.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/sigp.h>
/* /*
* moves the new kernel to its destination... * moves the new kernel to its destination...
...@@ -93,7 +94,7 @@ ENTRY(relocate_kernel) ...@@ -93,7 +94,7 @@ ENTRY(relocate_kernel)
.no_diag308: .no_diag308:
sr %r1,%r1 # clear %r1 sr %r1,%r1 # clear %r1
sr %r2,%r2 # clear %r2 sr %r2,%r2 # clear %r2
sigp %r1,%r2,0x12 # set cpuid to zero sigp %r1,%r2,SIGP_SET_ARCHITECTURE # set cpuid to zero
lpsw 0 # hopefully start new kernel... lpsw 0 # hopefully start new kernel...
.align 8 .align 8
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/sigp.h>
/* /*
* moves the new kernel to its destination... * moves the new kernel to its destination...
...@@ -45,7 +46,7 @@ ENTRY(relocate_kernel) ...@@ -45,7 +46,7 @@ ENTRY(relocate_kernel)
diag %r0,%r0,0x308 diag %r0,%r0,0x308
.back: .back:
lhi %r1,1 # mode 1 = esame lhi %r1,1 # mode 1 = esame
sigp %r1,%r0,0x12 # switch to esame mode sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esame mode
sam64 # switch to 64 bit addressing mode sam64 # switch to 64 bit addressing mode
basr %r13,0 basr %r13,0
.back_base: .back_base:
...@@ -96,7 +97,7 @@ ENTRY(relocate_kernel) ...@@ -96,7 +97,7 @@ ENTRY(relocate_kernel)
sam31 # 31 bit mode sam31 # 31 bit mode
sr %r1,%r1 # erase register r1 sr %r1,%r1 # erase register r1
sr %r2,%r2 # erase register r2 sr %r2,%r2 # erase register r2
sigp %r1,%r2,0x12 # set cpuid to zero sigp %r1,%r2,SIGP_SET_ARCHITECTURE # set cpuid to zero
lpsw 0 # hopefully start new kernel... lpsw 0 # hopefully start new kernel...
.align 8 .align 8
......
...@@ -288,11 +288,13 @@ static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), ...@@ -288,11 +288,13 @@ static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *),
/* Restart func on the target cpu and stop the current cpu. */ /* Restart func on the target cpu and stop the current cpu. */
memcpy_absolute(&lc->restart_stack, &restart, sizeof(restart)); memcpy_absolute(&lc->restart_stack, &restart, sizeof(restart));
asm volatile( asm volatile(
"0: sigp 0,%0,6 # sigp restart to target cpu\n" "0: sigp 0,%0,%2 # sigp restart to target cpu\n"
" brc 2,0b # busy, try again\n" " brc 2,0b # busy, try again\n"
"1: sigp 0,%1,5 # sigp stop to current cpu\n" "1: sigp 0,%1,%3 # sigp stop to current cpu\n"
" brc 2,1b # busy, try again\n" " brc 2,1b # busy, try again\n"
: : "d" (pcpu->address), "d" (restart.source) : "0", "1", "cc"); : : "d" (pcpu->address), "d" (restart.source),
"K" (SIGP_RESTART), "K" (SIGP_STOP)
: "0", "1", "cc");
for (;;) ; for (;;) ;
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/sigp.h>
/* /*
* Save register context in absolute 0 lowcore and call swsusp_save() to * Save register context in absolute 0 lowcore and call swsusp_save() to
...@@ -163,7 +164,7 @@ ENTRY(swsusp_arch_resume) ...@@ -163,7 +164,7 @@ ENTRY(swsusp_arch_resume)
diag %r0,%r0,0x308 diag %r0,%r0,0x308
restart_entry: restart_entry:
lhi %r1,1 lhi %r1,1
sigp %r1,%r0,0x12 sigp %r1,%r0,SIGP_SET_ARCHITECTURE
sam64 sam64
larl %r1,.Lnew_pgm_check_psw larl %r1,.Lnew_pgm_check_psw
lpswe 0(%r1) lpswe 0(%r1)
...@@ -179,7 +180,7 @@ pgm_check_entry: ...@@ -179,7 +180,7 @@ pgm_check_entry:
larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */ larl %r4,.Lrestart_suspend_psw /* Set new restart PSW */
mvc __LC_RST_NEW_PSW(16,%r0),0(%r4) mvc __LC_RST_NEW_PSW(16,%r0),0(%r4)
3: 3:
sigp %r9,%r1,11 /* sigp initial cpu reset */ sigp %r9,%r1,SIGP_INITIAL_CPU_RESET /* sigp initial cpu reset */
brc 8,4f /* accepted */ brc 8,4f /* accepted */
brc 2,3b /* busy, try again */ brc 2,3b /* busy, try again */
...@@ -190,16 +191,16 @@ pgm_check_entry: ...@@ -190,16 +191,16 @@ pgm_check_entry:
larl %r3,_sclp_print_early larl %r3,_sclp_print_early
lghi %r1,0 lghi %r1,0
sam31 sam31
sigp %r1,%r0,0x12 sigp %r1,%r0,SIGP_SET_ARCHITECTURE
basr %r14,%r3 basr %r14,%r3
larl %r3,.Ldisabled_wait_31 larl %r3,.Ldisabled_wait_31
lpsw 0(%r3) lpsw 0(%r3)
4: 4:
/* Switch to suspend CPU */ /* Switch to suspend CPU */
sigp %r9,%r1,6 /* sigp restart to suspend CPU */ sigp %r9,%r1,SIGP_RESTART /* sigp restart to suspend CPU */
brc 2,4b /* busy, try again */ brc 2,4b /* busy, try again */
5: 5:
sigp %r9,%r2,5 /* sigp stop to current resume CPU */ sigp %r9,%r2,SIGP_STOP /* sigp stop to current resume CPU */
brc 2,5b /* busy, try again */ brc 2,5b /* busy, try again */
6: j 6b 6: j 6b
...@@ -207,7 +208,7 @@ restart_suspend: ...@@ -207,7 +208,7 @@ restart_suspend:
larl %r1,.Lresume_cpu larl %r1,.Lresume_cpu
llgh %r2,0(%r1) llgh %r2,0(%r1)
7: 7:
sigp %r9,%r2,1 /* sigp sense, wait for resume CPU */ sigp %r9,%r2,SIGP_SENSE /* sigp sense, wait for resume CPU */
brc 8,7b /* accepted, status 0, still running */ brc 8,7b /* accepted, status 0, still running */
brc 2,7b /* busy, try again */ brc 2,7b /* busy, try again */
tmll %r9,0x40 /* Test if resume CPU is stopped */ tmll %r9,0x40 /* Test if resume CPU is stopped */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment