4
* Copyright Roman Zippel, 1997. All rights reserved.
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, and the entire permission notice in its entirety,
11
* including the disclaimer of warranties.
12
* 2. Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
* 3. The name of the author may not be used to endorse or promote
16
* products derived from this software without specific prior
19
* ALTERNATIVELY, this product may be distributed under the terms of
20
* the GNU General Public License, in which case the provisions of the GPL are
21
* required INSTEAD OF the above restrictions. (This clause is
22
* necessary due to a potential bad interaction between the GPL and
23
* the restrictions contained in a BSD-style copyright.)
25
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
26
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
29
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35
* OF THE POSSIBILITY OF SUCH DAMAGE.
38
#include <linux/linkage.h>
39
#include <asm/entry.h>
45
.globl fp_err_ua1,fp_err_ua2
52
#if defined(CPU_M68020_OR_M68030) && defined(CPU_M68040_OR_M68060)
56
#if defined(CPU_M68040_OR_M68060)
57
move.l (FPS_PC2,%sp),(FPS_PC,%sp)
60
| emulate the instruction
63
#if defined(CONFIG_M68060)
64
#if !defined(CPU_M68060_ONLY)
65
btst #3,m68k_cputype+3
72
| emulation successful?
74
jeq ret_from_exception
76
| send some signal to program here
78
jra ret_from_exception
80
| we jump here after an access error while trying to access
81
| user space, we correct stackpointer and send a SIGSEGV to
92
jra ret_from_exception
94
#if defined(CONFIG_M68060)
95
| send a trace signal if we are debugged
96
| it does not really belong here, but...
98
move.l (FPS_PC,%sp),-(%sp)
103
jra ret_from_exception
106
.globl fp_get_data_reg, fp_put_data_reg
107
.globl fp_get_addr_reg, fp_put_addr_reg
109
| Entry points to get/put a register. Some of them can be get/put
110
| directly, others are on the stack, as we read/write the stack
111
| directly here, these function may only be called from within
112
| instruction decoding, otherwise the stack pointer is incorrect
113
| and the stack gets corrupted.
115
jmp ([0f:w,%pc,%d0.w*4])
119
.long fp_get_d0, fp_get_d1
120
.long fp_get_d2, fp_get_d3
121
.long fp_get_d4, fp_get_d5
122
.long fp_get_d6, fp_get_d7
125
move.l (PT_OFF_D0+8,%sp),%d0
126
printf PREGISTER,"{d0->%08x}",1,%d0
130
move.l (PT_OFF_D1+8,%sp),%d0
131
printf PREGISTER,"{d1->%08x}",1,%d0
135
move.l (PT_OFF_D2+8,%sp),%d0
136
printf PREGISTER,"{d2->%08x}",1,%d0
141
printf PREGISTER,"{d3->%08x}",1,%d0
146
printf PREGISTER,"{d4->%08x}",1,%d0
151
printf PREGISTER,"{d5->%08x}",1,%d0
156
printf PREGISTER,"{d6->%08x}",1,%d0
161
printf PREGISTER,"{d7->%08x}",1,%d0
165
jmp ([0f:w,%pc,%d1.w*4])
169
.long fp_put_d0, fp_put_d1
170
.long fp_put_d2, fp_put_d3
171
.long fp_put_d4, fp_put_d5
172
.long fp_put_d6, fp_put_d7
175
printf PREGISTER,"{d0<-%08x}",1,%d0
176
move.l %d0,(PT_OFF_D0+8,%sp)
180
printf PREGISTER,"{d1<-%08x}",1,%d0
181
move.l %d0,(PT_OFF_D1+8,%sp)
185
printf PREGISTER,"{d2<-%08x}",1,%d0
186
move.l %d0,(PT_OFF_D2+8,%sp)
190
printf PREGISTER,"{d3<-%08x}",1,%d0
192
move.l %d0,(PT_OFF_D3+8,%sp)
196
printf PREGISTER,"{d4<-%08x}",1,%d0
198
move.l %d0,(PT_OFF_D4+8,%sp)
202
printf PREGISTER,"{d5<-%08x}",1,%d0
204
move.l %d0,(PT_OFF_D5+8,%sp)
208
printf PREGISTER,"{d6<-%08x}",1,%d0
213
printf PREGISTER,"{d7<-%08x}",1,%d0
218
jmp ([0f:w,%pc,%d0.w*4])
222
.long fp_get_a0, fp_get_a1
223
.long fp_get_a2, fp_get_a3
224
.long fp_get_a4, fp_get_a5
225
.long fp_get_a6, fp_get_a7
228
move.l (PT_OFF_A0+8,%sp),%a0
229
printf PREGISTER,"{a0->%08x}",1,%a0
233
move.l (PT_OFF_A1+8,%sp),%a0
234
printf PREGISTER,"{a1->%08x}",1,%a0
238
move.l (PT_OFF_A2+8,%sp),%a0
239
printf PREGISTER,"{a2->%08x}",1,%a0
244
printf PREGISTER,"{a3->%08x}",1,%a0
249
printf PREGISTER,"{a4->%08x}",1,%a0
254
printf PREGISTER,"{a5->%08x}",1,%a0
259
printf PREGISTER,"{a6->%08x}",1,%a0
264
printf PREGISTER,"{a7->%08x}",1,%a0
268
jmp ([0f:w,%pc,%d0.w*4])
272
.long fp_put_a0, fp_put_a1
273
.long fp_put_a2, fp_put_a3
274
.long fp_put_a4, fp_put_a5
275
.long fp_put_a6, fp_put_a7
278
printf PREGISTER,"{a0<-%08x}",1,%a0
279
move.l %a0,(PT_OFF_A0+8,%sp)
283
printf PREGISTER,"{a1<-%08x}",1,%a0
284
move.l %a0,(PT_OFF_A1+8,%sp)
288
printf PREGISTER,"{a2<-%08x}",1,%a0
289
move.l %a0,(PT_OFF_A2+8,%sp)
293
printf PREGISTER,"{a3<-%08x}",1,%a0
298
printf PREGISTER,"{a4<-%08x}",1,%a0
303
printf PREGISTER,"{a5<-%08x}",1,%a0
308
printf PREGISTER,"{a6<-%08x}",1,%a0
313
printf PREGISTER,"{a7<-%08x}",1,%a0
322
.long PMINSTR+PMDECODE+PMCONV+PMNORM
323
| .long PMCONV+PMNORM+PMINSTR