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/config.h>
39 #include <linux/linkage.h>
40 #include <asm/entry.h>
46 .globl fp_err_ua1,fp_err_ua2
53 #if defined(CPU_M68020_OR_M68030) && defined(CPU_M68040_OR_M68060)
57 #if defined(CPU_M68040_OR_M68060)
58 move.l (FPS_PC2,%sp),(FPS_PC,%sp)
61 | emulate the instruction
64 #if defined(CONFIG_M68060)
65 #if !defined(CPU_M68060_ONLY)
66 btst #3,m68k_cputype+3
73 | emulation successful?
75 jeq ret_from_exception
77 | send some signal to program here
79 jra ret_from_exception
81 | we jump here after an access error while trying to access
82 | user space, we correct stackpointer and send a SIGSEGV to
93 jra ret_from_exception
95 #if defined(CONFIG_M68060)
96 | send a trace signal if we are debugged
97 | it does not really belong here, but...
99 move.l (FPS_PC,%sp),-(%sp)
104 jra ret_from_exception
107 .globl fp_get_data_reg, fp_put_data_reg
108 .globl fp_get_addr_reg, fp_put_addr_reg
110 | Entry points to get/put a register. Some of them can be get/put
111 | directly, others are on the stack, as we read/write the stack
112 | directly here, these function may only be called from within
113 | instruction decoding, otherwise the stack pointer is incorrect
114 | and the stack gets corrupted.
116 jmp ([0f:w,%pc,%d0.w*4])
120 .long fp_get_d0, fp_get_d1
121 .long fp_get_d2, fp_get_d3
122 .long fp_get_d4, fp_get_d5
123 .long fp_get_d6, fp_get_d7
126 move.l (PT_D0+8,%sp),%d0
127 printf PREGISTER,"{d0->%08x}",1,%d0
131 move.l (PT_D1+8,%sp),%d0
132 printf PREGISTER,"{d1->%08x}",1,%d0
136 move.l (PT_D2+8,%sp),%d0
137 printf PREGISTER,"{d2->%08x}",1,%d0
142 printf PREGISTER,"{d3->%08x}",1,%d0
147 printf PREGISTER,"{d4->%08x}",1,%d0
152 printf PREGISTER,"{d5->%08x}",1,%d0
157 printf PREGISTER,"{d6->%08x}",1,%d0
162 printf PREGISTER,"{d7->%08x}",1,%d0
166 jmp ([0f:w,%pc,%d1.w*4])
170 .long fp_put_d0, fp_put_d1
171 .long fp_put_d2, fp_put_d3
172 .long fp_put_d4, fp_put_d5
173 .long fp_put_d6, fp_put_d7
176 printf PREGISTER,"{d0<-%08x}",1,%d0
177 move.l %d0,(PT_D0+8,%sp)
181 printf PREGISTER,"{d1<-%08x}",1,%d0
182 move.l %d0,(PT_D1+8,%sp)
186 printf PREGISTER,"{d2<-%08x}",1,%d0
187 move.l %d0,(PT_D2+8,%sp)
191 printf PREGISTER,"{d3<-%08x}",1,%d0
193 move.l %d0,(PT_D3+8,%sp)
197 printf PREGISTER,"{d4<-%08x}",1,%d0
199 move.l %d0,(PT_D4+8,%sp)
203 printf PREGISTER,"{d5<-%08x}",1,%d0
205 move.l %d0,(PT_D5+8,%sp)
209 printf PREGISTER,"{d6<-%08x}",1,%d0
214 printf PREGISTER,"{d7<-%08x}",1,%d0
219 jmp ([0f:w,%pc,%d0.w*4])
223 .long fp_get_a0, fp_get_a1
224 .long fp_get_a2, fp_get_a3
225 .long fp_get_a4, fp_get_a5
226 .long fp_get_a6, fp_get_a7
229 move.l (PT_A0+8,%sp),%a0
230 printf PREGISTER,"{a0->%08x}",1,%a0
234 move.l (PT_A1+8,%sp),%a0
235 printf PREGISTER,"{a1->%08x}",1,%a0
239 move.l (PT_A2+8,%sp),%a0
240 printf PREGISTER,"{a2->%08x}",1,%a0
245 printf PREGISTER,"{a3->%08x}",1,%a0
250 printf PREGISTER,"{a4->%08x}",1,%a0
255 printf PREGISTER,"{a5->%08x}",1,%a0
260 printf PREGISTER,"{a6->%08x}",1,%a0
265 printf PREGISTER,"{a7->%08x}",1,%a0
269 jmp ([0f:w,%pc,%d0.w*4])
273 .long fp_put_a0, fp_put_a1
274 .long fp_put_a2, fp_put_a3
275 .long fp_put_a4, fp_put_a5
276 .long fp_put_a6, fp_put_a7
279 printf PREGISTER,"{a0<-%08x}",1,%a0
280 move.l %a0,(PT_A0+8,%sp)
284 printf PREGISTER,"{a1<-%08x}",1,%a0
285 move.l %a0,(PT_A1+8,%sp)
289 printf PREGISTER,"{a2<-%08x}",1,%a0
290 move.l %a0,(PT_A2+8,%sp)
294 printf PREGISTER,"{a3<-%08x}",1,%a0
299 printf PREGISTER,"{a4<-%08x}",1,%a0
304 printf PREGISTER,"{a5<-%08x}",1,%a0
309 printf PREGISTER,"{a6<-%08x}",1,%a0
314 printf PREGISTER,"{a7<-%08x}",1,%a0
323 .long PMINSTR+PMDECODE+PMCONV+PMNORM
324 | .long PMCONV+PMNORM+PMINSTR