diff options
Diffstat (limited to 'arch/s390/kernel/relocate_kernel64.S')
-rw-r--r-- | arch/s390/kernel/relocate_kernel64.S | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/arch/s390/kernel/relocate_kernel64.S b/arch/s390/kernel/relocate_kernel64.S index 96290cc4eb3c..8cdb86e8911f 100644 --- a/arch/s390/kernel/relocate_kernel64.S +++ b/arch/s390/kernel/relocate_kernel64.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * (C) Copyright IBM Corp. 2005 | 4 | * (C) Copyright IBM Corp. 2005 |
5 | * | 5 | * |
6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> | 6 | * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com> |
7 | * Heiko Carstens <heiko.carstens@de.ibm.com> | ||
7 | * | 8 | * |
8 | */ | 9 | */ |
9 | 10 | ||
@@ -26,8 +27,34 @@ | |||
26 | relocate_kernel: | 27 | relocate_kernel: |
27 | basr %r13,0 #base address | 28 | basr %r13,0 #base address |
28 | .base: | 29 | .base: |
30 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQs | ||
29 | spx zero64-.base(%r13) #absolute addressing mode | 31 | spx zero64-.base(%r13) #absolute addressing mode |
30 | stnsm sys_msk-.base(%r13),0xf8 #disable DAT and IRQ (external) | 32 | stctg %c0,%c15,ctlregs-.base(%r13) |
33 | stmg %r0,%r15,gprregs-.base(%r13) | ||
34 | lghi %r0,3 | ||
35 | sllg %r0,%r0,31 | ||
36 | stg %r0,0x1d0(%r0) | ||
37 | la %r0,.back_pgm-.base(%r13) | ||
38 | stg %r0,0x1d8(%r0) | ||
39 | la %r1,load_psw-.base(%r13) | ||
40 | mvc 0(8,%r0),0(%r1) | ||
41 | la %r0,.back-.base(%r13) | ||
42 | st %r0,4(%r0) | ||
43 | oi 4(%r0),0x80 | ||
44 | lghi %r0,0 | ||
45 | diag %r0,%r0,0x308 | ||
46 | .back: | ||
47 | lhi %r1,1 #mode 1 = esame | ||
48 | sigp %r1,%r0,0x12 #switch to esame mode | ||
49 | sam64 #switch to 64 bit addressing mode | ||
50 | basr %r13,0 | ||
51 | .back_base: | ||
52 | oi have_diag308-.back_base(%r13),0x01 | ||
53 | lctlg %c0,%c15,ctlregs-.back_base(%r13) | ||
54 | lmg %r0,%r15,gprregs-.back_base(%r13) | ||
55 | j .top | ||
56 | .back_pgm: | ||
57 | lmg %r0,%r15,gprregs-.base(%r13) | ||
31 | .top: | 58 | .top: |
32 | lghi %r7,4096 #load PAGE_SIZE in r7 | 59 | lghi %r7,4096 #load PAGE_SIZE in r7 |
33 | lghi %r9,4096 #load PAGE_SIZE in r9 | 60 | lghi %r9,4096 #load PAGE_SIZE in r9 |
@@ -62,6 +89,10 @@ | |||
62 | o %r3,4(%r4) #or load address into psw | 89 | o %r3,4(%r4) #or load address into psw |
63 | st %r3,4(%r4) | 90 | st %r3,4(%r4) |
64 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 | 91 | mvc 0(8,%r0),0(%r4) #copy psw to absolute address 0 |
92 | tm have_diag308-.base(%r13),0x01 | ||
93 | jno .no_diag308 | ||
94 | diag %r0,%r0,0x308 | ||
95 | .no_diag308: | ||
65 | sam31 #31 bit mode | 96 | sam31 #31 bit mode |
66 | sr %r1,%r1 #erase register r1 | 97 | sr %r1,%r1 #erase register r1 |
67 | sr %r2,%r2 #erase register r2 | 98 | sr %r2,%r2 #erase register r2 |
@@ -75,8 +106,18 @@ | |||
75 | .long 0x00080000,0x80000000 | 106 | .long 0x00080000,0x80000000 |
76 | sys_msk: | 107 | sys_msk: |
77 | .quad 0 | 108 | .quad 0 |
109 | ctlregs: | ||
110 | .rept 16 | ||
111 | .quad 0 | ||
112 | .endr | ||
113 | gprregs: | ||
114 | .rept 16 | ||
115 | .quad 0 | ||
116 | .endr | ||
117 | have_diag308: | ||
118 | .byte 0 | ||
119 | .align 8 | ||
78 | relocate_kernel_end: | 120 | relocate_kernel_end: |
79 | .globl relocate_kernel_len | 121 | .globl relocate_kernel_len |
80 | relocate_kernel_len: | 122 | relocate_kernel_len: |
81 | .quad relocate_kernel_end - relocate_kernel | 123 | .quad relocate_kernel_end - relocate_kernel |
82 | |||