diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-04-30 07:38:45 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-04-30 07:38:47 -0400 |
commit | 2e5061e40af88070984e3769eafb5a06022375fd (patch) | |
tree | 2964cc88a68f826fc8e025d145f692e1e78740e0 /arch/s390/kernel/head64.S | |
parent | 8fc63658681f32e6e29f6d1138de933d7272e0ec (diff) |
[S390] Convert machine feature detection code to C.
From: Heiko Carstens <heiko.carstens@de.ibm.com>
From: Carsten Otte <cotte@de.ibm.com>
This lets us use defines for the magic bits in machine flags instead
of using plain numbers all over the place.
In addition on newer machines features/facilities are indicated by the
result of the stfl instruction. So we use these bits instead of trying
to execute new instructions and check wether we get an exception or
not.
Also the mvpg instruction is always available when in zArch mode,
whereas the idte instruction is only available in zArch mode. This
results in some minor optimizations.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/head64.S')
-rw-r--r-- | arch/s390/kernel/head64.S | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index 79dccd206a6e..9c2c6f7d37e7 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
@@ -125,68 +125,6 @@ startup_continue: | |||
125 | # and create a kernel NSS if the SAVESYS= parm is defined | 125 | # and create a kernel NSS if the SAVESYS= parm is defined |
126 | # | 126 | # |
127 | brasl %r14,startup_init | 127 | brasl %r14,startup_init |
128 | # set program check new psw mask | ||
129 | mvc __LC_PGM_NEW_PSW(8),.Lpcmsk-.LPG1(%r13) | ||
130 | larl %r12,machine_flags | ||
131 | # | ||
132 | # find out if we have the MVPG instruction | ||
133 | # | ||
134 | la %r1,0f-.LPG1(%r13) # set program check address | ||
135 | stg %r1,__LC_PGM_NEW_PSW+8 | ||
136 | sgr %r0,%r0 | ||
137 | lghi %r1,0 | ||
138 | lghi %r2,0 | ||
139 | mvpg %r1,%r2 # test MVPG instruction | ||
140 | oi 7(%r12),16 # set MVPG flag | ||
141 | 0: | ||
142 | |||
143 | # | ||
144 | # find out if the diag 0x44 works in 64 bit mode | ||
145 | # | ||
146 | la %r1,0f-.LPG1(%r13) # set program check address | ||
147 | stg %r1,__LC_PGM_NEW_PSW+8 | ||
148 | diag 0,0,0x44 # test diag 0x44 | ||
149 | oi 7(%r12),32 # set diag44 flag | ||
150 | 0: | ||
151 | |||
152 | # | ||
153 | # find out if we have the IDTE instruction | ||
154 | # | ||
155 | la %r1,0f-.LPG1(%r13) # set program check address | ||
156 | stg %r1,__LC_PGM_NEW_PSW+8 | ||
157 | .long 0xb2b10000 # store facility list | ||
158 | tm 0xc8,0x08 # check bit for clearing-by-ASCE | ||
159 | bno 0f-.LPG1(%r13) | ||
160 | lhi %r1,2048 | ||
161 | lhi %r2,0 | ||
162 | .long 0xb98e2001 | ||
163 | oi 7(%r12),0x80 # set IDTE flag | ||
164 | 0: | ||
165 | |||
166 | # | ||
167 | # find out if the diag 0x9c is available | ||
168 | # | ||
169 | la %r1,0f-.LPG1(%r13) # set program check address | ||
170 | stg %r1,__LC_PGM_NEW_PSW+8 | ||
171 | stap __LC_CPUID+4 # store cpu address | ||
172 | lh %r1,__LC_CPUID+4 | ||
173 | diag %r1,0,0x9c # test diag 0x9c | ||
174 | oi 6(%r12),1 # set diag9c flag | ||
175 | 0: | ||
176 | |||
177 | # | ||
178 | # find out if we have the MVCOS instruction | ||
179 | # | ||
180 | la %r1,0f-.LPG1(%r13) # set program check address | ||
181 | stg %r1,__LC_PGM_NEW_PSW+8 | ||
182 | .short 0xc800 # mvcos 0(%r0),0(%r0),%r0 | ||
183 | .short 0x0000 | ||
184 | .short 0x0000 | ||
185 | 0: tm 0x8f,0x13 # special-operation exception? | ||
186 | bno 1f-.LPG1(%r13) # if yes, MVCOS is present | ||
187 | oi 6(%r12),2 # set MVCOS flag | ||
188 | 1: | ||
189 | |||
190 | lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, | 128 | lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, |
191 | # virtual and never return ... | 129 | # virtual and never return ... |
192 | .align 16 | 130 | .align 16 |