2 # $NetBSD: fskeletn.s,v 1.1 2000/04/14 20:24:38 is Exp $
5 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
7 # M68000 Hi-Performance Microprocessor Division
8 # M68060 Software Package Production Release
10 # M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc.
11 # All rights reserved.
13 # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
14 # To the maximum extent permitted by applicable law,
15 # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
16 # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
17 # FOR A PARTICULAR PURPOSE and any warranty against infringement with
18 # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
19 # and any accompanying written materials.
21 # To the maximum extent permitted by applicable law,
22 # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
23 # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
24 # BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
25 # ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
27 # Motorola assumes no responsibility for the maintenance and support
30 # You are hereby granted a copyright license to use, modify, and distribute the
31 # SOFTWARE so long as this entire notice is retained without alteration
32 # in any modified and/or redistributed versions, and that such modified
33 # versions are clearly identified as such.
34 # No licenses are granted by implication, estoppel or otherwise under any
35 # patents or trademarks of Motorola, Inc.
36 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 # (1) example "Call-out"s
43 # (2) example package entry code
44 # (3) example "Call-out" table
48 #################################
49 # (1) EXAMPLE CALL-OUTS #
60 # _060_real_fpu_disabled() #
62 #################################
67 # This is the main exit point for the 68060 Floating-Point
68 # Software Package. For a normal exit, all 060FPSP routines call this
69 # routine. The operating system can do system dependent clean-up or
70 # simply execute an "rte" as with the sample code below.
79 # This is the exit point for the 060FPSP when an enabled overflow exception
80 # is present. The routine below should point to the operating system handler
81 # for enabled overflow conditions. The exception stack frame is an overflow
82 # stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
84 # The sample routine below simply clears the exception status bit and
90 mov.w
&0x6000,0x2(%sp
)
97 # This is the exit point for the 060FPSP when an enabled underflow exception
98 # is present. The routine below should point to the operating system handler
99 # for enabled underflow conditions. The exception stack frame is an underflow
100 # stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
102 # The sample routine below simply clears the exception status bit and
105 global _060_real_unfl
108 mov.w
&0x6000,0x2(%sp
)
115 # This is the exit point for the 060FPSP when an enabled operand error exception
116 # is present. The routine below should point to the operating system handler
117 # for enabled operand error exceptions. The exception stack frame is an operand error
118 # stack frame. The FP state frame holds the source operand of the faulting
121 # The sample routine below simply clears the exception status bit and
124 global _060_real_operr
127 mov.w
&0x6000,0x2(%sp
)
134 # This is the exit point for the 060FPSP when an enabled signalling NaN exception
135 # is present. The routine below should point to the operating system handler
136 # for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN
137 # stack frame. The FP state frame holds the source operand of the faulting
140 # The sample routine below simply clears the exception status bit and
143 global _060_real_snan
146 mov.w
&0x6000,0x2(%sp
)
153 # This is the exit point for the 060FPSP when an enabled divide-by-zero exception
154 # is present. The routine below should point to the operating system handler
155 # for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero
156 # stack frame. The FP state frame holds the source operand of the faulting
159 # The sample routine below simply clears the exception status bit and
165 mov.w
&0x6000,0x2(%sp
)
172 # This is the exit point for the 060FPSP when an enabled inexact exception
173 # is present. The routine below should point to the operating system handler
174 # for enabled inexact exceptions. The exception stack frame is an inexact
175 # stack frame. The FP state frame holds the source operand of the faulting
178 # The sample routine below simply clears the exception status bit and
181 global _060_real_inex
184 mov.w
&0x6000,0x2(%sp
)
191 # This is the exit point for the 060FPSP when an enabled bsun exception
192 # is present. The routine below should point to the operating system handler
193 # for enabled bsun exceptions. The exception stack frame is a bsun
196 # The sample routine below clears the exception status bit, clears the NaN
197 # bit in the FPSR, and does an "rte". The instruction that caused the
198 # bsun will now be re-executed but with the NaN FPSR bit cleared.
200 global _060_real_bsun
214 # This is the exit point for the 060FPSP when an F-Line Illegal exception is
215 # encountered. Three different types of exceptions can enter the F-Line exception
216 # vector number 11: FP Unimplemented Instructions, FP implemented instructions when
217 # the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
218 # _fpsp_fline() distinguishes between the three and acts appropriately. F-Line
219 # Illegals branch here.
221 global _060_real_fline
223 bra.
b _060_real_fline
226 # _060_real_fpu_disabled():
228 # This is the exit point for the 060FPSP when an FPU disabled exception is
229 # encountered. Three different types of exceptions can enter the F-Line exception
230 # vector number 11: FP Unimplemented Instructions, FP implemented instructions when
231 # the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
232 # _fpsp_fline() distinguishes between the three and acts appropriately. FPU disabled
233 # exceptions branch here.
235 # The sample code below enables the FPU, sets the PC field in the exception stack
236 # frame to the PC of the instruction causing the exception, and does an "rte".
237 # The execution of the instruction then proceeds with an enabled floating-point
240 global _060_real_fpu_disabled
241 _060_real_fpu_disabled
:
242 mov.
l %d0
,-(%sp
) # enabled the fpu
248 mov.
l 0xc(%sp
),0x2(%sp
) # set "Current PC"
254 # This is the exit point for the 060FPSP when an emulated "ftrapcc" instruction
255 # discovers that the trap condition is true and it should branch to the operating
256 # system handler for the trap exception vector number 7.
258 # The sample code below simply executes an "rte".
260 global _060_real_trap
264 #############################################################################
266 ##################################
267 # (2) EXAMPLE PACKAGE ENTRY CODE #
268 ##################################
270 global _060_fpsp_snan
272 bra.
l _FP_CALL_TOP+
0x80+0x00
274 global _060_fpsp_operr
276 bra.
l _FP_CALL_TOP+
0x80+0x08
278 global _060_fpsp_ovfl
280 bra.
l _FP_CALL_TOP+
0x80+0x10
282 global _060_fpsp_unfl
284 bra.
l _FP_CALL_TOP+
0x80+0x18
288 bra.
l _FP_CALL_TOP+
0x80+0x20
290 global _060_fpsp_inex
292 bra.
l _FP_CALL_TOP+
0x80+0x28
294 global _060_fpsp_fline
296 bra.
l _FP_CALL_TOP+
0x80+0x30
298 global _060_fpsp_unsupp
300 bra.
l _FP_CALL_TOP+
0x80+0x38
302 global _060_fpsp_effadd
304 bra.
l _FP_CALL_TOP+
0x80+0x40
306 #############################################################################
308 ################################
309 # (3) EXAMPLE CALL-OUT SECTION #
310 ################################
312 # The size of this section MUST be 128 bytes!!!
316 long _060_real_bsun
- _FP_CALL_TOP
317 long _060_real_snan
- _FP_CALL_TOP
318 long _060_real_operr
- _FP_CALL_TOP
319 long _060_real_ovfl
- _FP_CALL_TOP
320 long _060_real_unfl
- _FP_CALL_TOP
321 long _060_real_dz
- _FP_CALL_TOP
322 long _060_real_inex
- _FP_CALL_TOP
323 long _060_real_fline
- _FP_CALL_TOP
324 long _060_real_fpu_disabled
- _FP_CALL_TOP
325 long _060_real_trap
- _FP_CALL_TOP
326 long _060_real_trace
- _FP_CALL_TOP
327 long _060_real_access
- _FP_CALL_TOP
328 long _060_fpsp_done
- _FP_CALL_TOP
330 long
0x00000000, 0x00000000, 0x00000000
332 long _060_imem_read
- _FP_CALL_TOP
333 long _060_dmem_read
- _FP_CALL_TOP
334 long _060_dmem_write
- _FP_CALL_TOP
335 long _060_imem_read_word
- _FP_CALL_TOP
336 long _060_imem_read_long
- _FP_CALL_TOP
337 long _060_dmem_read_byte
- _FP_CALL_TOP
338 long _060_dmem_read_word
- _FP_CALL_TOP
339 long _060_dmem_read_long
- _FP_CALL_TOP
340 long _060_dmem_write_byte
- _FP_CALL_TOP
341 long _060_dmem_write_word
- _FP_CALL_TOP
342 long _060_dmem_write_long
- _FP_CALL_TOP
346 long
0x00000000, 0x00000000, 0x00000000, 0x00000000
348 #############################################################################
350 # 060 FPSP KERNEL PACKAGE NEEDS TO GO HERE!!!