Back to home page

LXR

 
 

    


0001 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0002 |MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
0003 |M68000 Hi-Performance Microprocessor Division
0004 |M68060 Software Package
0005 |Production Release P1.00 -- October 10, 1994
0006 |
0007 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc.  All rights reserved.
0008 |
0009 |THE SOFTWARE is provided on an "AS IS" basis and without warranty.
0010 |To the maximum extent permitted by applicable law,
0011 |MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
0012 |INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
0013 |and any warranty against infringement with regard to the SOFTWARE
0014 |(INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials.
0015 |
0016 |To the maximum extent permitted by applicable law,
0017 |IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
0018 |(INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
0019 |BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
0020 |ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
0021 |Motorola assumes no responsibility for the maintenance and support of the SOFTWARE.
0022 |
0023 |You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE
0024 |so long as this entire notice is retained without alteration in any modified and/or
0025 |redistributed versions, and that such modified versions are clearly identified as such.
0026 |No licenses are granted by implication, estoppel or otherwise under any patents
0027 |or trademarks of Motorola, Inc.
0028 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0029 | fskeleton.s
0030 |
0031 | This file contains:
0032 |   (1) example "Call-out"s
0033 |   (2) example package entry code
0034 |   (3) example "Call-out" table
0035 |
0036 
0037 #include <linux/linkage.h>
0038 
0039 |################################
0040 | (1) EXAMPLE CALL-OUTS     #
0041 |               #
0042 | _060_fpsp_done()      #
0043 | _060_real_ovfl()      #
0044 | _060_real_unfl()      #
0045 | _060_real_operr()     #
0046 | _060_real_snan()      #
0047 | _060_real_dz()        #
0048 | _060_real_inex()      #
0049 | _060_real_bsun()      #
0050 | _060_real_fline()     #
0051 | _060_real_fpu_disabled()  #
0052 | _060_real_trap()      #
0053 |################################
0054 
0055 |
0056 | _060_fpsp_done():
0057 |
0058 | This is the main exit point for the 68060 Floating-Point
0059 | Software Package. For a normal exit, all 060FPSP routines call this
0060 | routine. The operating system can do system dependent clean-up or
0061 | simply execute an "rte" as with the sample code below.
0062 |
0063     .global     _060_fpsp_done
0064 _060_fpsp_done:
0065     bral     _060_isp_done  | do the same as isp_done
0066 
0067 |
0068 | _060_real_ovfl():
0069 |
0070 | This is the exit point for the 060FPSP when an enabled overflow exception
0071 | is present. The routine below should point to the operating system handler
0072 | for enabled overflow conditions. The exception stack frame is an overflow
0073 | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
0074 |
0075 | The sample routine below simply clears the exception status bit and
0076 | does an "rte".
0077 |
0078     .global     _060_real_ovfl
0079 _060_real_ovfl:
0080     fsave       -(%sp)
0081     move.w      #0x6000,0x2(%sp)
0082     frestore    (%sp)+
0083     bral        trap    | jump to trap handler
0084 
0085 
0086 |
0087 | _060_real_unfl():
0088 |
0089 | This is the exit point for the 060FPSP when an enabled underflow exception
0090 | is present. The routine below should point to the operating system handler
0091 | for enabled underflow conditions. The exception stack frame is an underflow
0092 | stack frame. The FP state frame holds the EXCEPTIONAL OPERAND.
0093 |
0094 | The sample routine below simply clears the exception status bit and
0095 | does an "rte".
0096 |
0097     .global     _060_real_unfl
0098 _060_real_unfl:
0099     fsave       -(%sp)
0100     move.w      #0x6000,0x2(%sp)
0101     frestore    (%sp)+
0102     bral        trap    | jump to trap handler
0103 
0104 |
0105 | _060_real_operr():
0106 |
0107 | This is the exit point for the 060FPSP when an enabled operand error exception
0108 | is present. The routine below should point to the operating system handler
0109 | for enabled operand error exceptions. The exception stack frame is an operand error
0110 | stack frame. The FP state frame holds the source operand of the faulting
0111 | instruction.
0112 |
0113 | The sample routine below simply clears the exception status bit and
0114 | does an "rte".
0115 |
0116     .global     _060_real_operr
0117 _060_real_operr:
0118     fsave       -(%sp)
0119     move.w      #0x6000,0x2(%sp)
0120     frestore    (%sp)+
0121     bral        trap    | jump to trap handler
0122 
0123 |
0124 | _060_real_snan():
0125 |
0126 | This is the exit point for the 060FPSP when an enabled signalling NaN exception
0127 | is present. The routine below should point to the operating system handler
0128 | for enabled signalling NaN exceptions. The exception stack frame is a signalling NaN
0129 | stack frame. The FP state frame holds the source operand of the faulting
0130 | instruction.
0131 |
0132 | The sample routine below simply clears the exception status bit and
0133 | does an "rte".
0134 |
0135     .global     _060_real_snan
0136 _060_real_snan:
0137     fsave       -(%sp)
0138     move.w      #0x6000,0x2(%sp)
0139     frestore    (%sp)+
0140     bral        trap    | jump to trap handler
0141 
0142 |
0143 | _060_real_dz():
0144 |
0145 | This is the exit point for the 060FPSP when an enabled divide-by-zero exception
0146 | is present. The routine below should point to the operating system handler
0147 | for enabled divide-by-zero exceptions. The exception stack frame is a divide-by-zero
0148 | stack frame. The FP state frame holds the source operand of the faulting
0149 | instruction.
0150 |
0151 | The sample routine below simply clears the exception status bit and
0152 | does an "rte".
0153 |
0154     .global     _060_real_dz
0155 _060_real_dz:
0156     fsave       -(%sp)
0157     move.w      #0x6000,0x2(%sp)
0158     frestore    (%sp)+
0159     bral        trap    | jump to trap handler
0160 
0161 |
0162 | _060_real_inex():
0163 |
0164 | This is the exit point for the 060FPSP when an enabled inexact exception
0165 | is present. The routine below should point to the operating system handler
0166 | for enabled inexact exceptions. The exception stack frame is an inexact
0167 | stack frame. The FP state frame holds the source operand of the faulting
0168 | instruction.
0169 |
0170 | The sample routine below simply clears the exception status bit and
0171 | does an "rte".
0172 |
0173     .global     _060_real_inex
0174 _060_real_inex:
0175     fsave       -(%sp)
0176     move.w      #0x6000,0x2(%sp)
0177     frestore    (%sp)+
0178     bral        trap    | jump to trap handler
0179 
0180 |
0181 | _060_real_bsun():
0182 |
0183 | This is the exit point for the 060FPSP when an enabled bsun exception
0184 | is present. The routine below should point to the operating system handler
0185 | for enabled bsun exceptions. The exception stack frame is a bsun
0186 | stack frame.
0187 |
0188 | The sample routine below clears the exception status bit, clears the NaN
0189 | bit in the FPSR, and does an "rte". The instruction that caused the
0190 | bsun will now be re-executed but with the NaN FPSR bit cleared.
0191 |
0192     .global     _060_real_bsun
0193 _060_real_bsun:
0194 |   fsave       -(%sp)
0195 
0196     fmove.l     %fpsr,-(%sp)
0197     andi.b      #0xfe,(%sp)
0198     fmove.l     (%sp)+,%fpsr
0199 
0200     bral        trap    | jump to trap handler
0201 
0202 |
0203 | _060_real_fline():
0204 |
0205 | This is the exit point for the 060FPSP when an F-Line Illegal exception is
0206 | encountered. Three different types of exceptions can enter the F-Line exception
0207 | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
0208 | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
0209 | _fpsp_fline() distinguishes between the three and acts appropriately. F-Line
0210 | Illegals branch here.
0211 |
0212     .global     _060_real_fline
0213 _060_real_fline:
0214     bral        trap    | jump to trap handler
0215 
0216 |
0217 | _060_real_fpu_disabled():
0218 |
0219 | This is the exit point for the 060FPSP when an FPU disabled exception is
0220 | encountered. Three different types of exceptions can enter the F-Line exception
0221 | vector number 11: FP Unimplemented Instructions, FP implemented instructions when
0222 | the FPU is disabled, and F-Line Illegal instructions. The 060FPSP module
0223 | _fpsp_fline() distinguishes between the three and acts appropriately. FPU disabled
0224 | exceptions branch here.
0225 |
0226 | The sample code below enables the FPU, sets the PC field in the exception stack
0227 | frame to the PC of the instruction causing the exception, and does an "rte".
0228 | The execution of the instruction then proceeds with an enabled floating-point
0229 | unit.
0230 |
0231     .global     _060_real_fpu_disabled
0232 _060_real_fpu_disabled:
0233     move.l      %d0,-(%sp)      | enabled the fpu
0234     .long   0x4E7A0808          |movec      pcr,%d0
0235     bclr        #0x1,%d0
0236     .long   0x4E7B0808          |movec      %d0,pcr
0237     move.l      (%sp)+,%d0
0238 
0239     move.l      0xc(%sp),0x2(%sp)   | set "Current PC"
0240     rte
0241 
0242 |
0243 | _060_real_trap():
0244 |
0245 | This is the exit point for the 060FPSP when an emulated "ftrapcc" instruction
0246 | discovers that the trap condition is true and it should branch to the operating
0247 | system handler for the trap exception vector number 7.
0248 |
0249 | The sample code below simply executes an "rte".
0250 |
0251     .global     _060_real_trap
0252 _060_real_trap:
0253     bral        trap    | jump to trap handler
0254 
0255 |############################################################################
0256 
0257 |#################################
0258 | (2) EXAMPLE PACKAGE ENTRY CODE #
0259 |#################################
0260 
0261     .global     _060_fpsp_snan
0262 _060_fpsp_snan:
0263     bra.l       _FP_CALL_TOP+0x80+0x00
0264 
0265     .global     _060_fpsp_operr
0266 _060_fpsp_operr:
0267     bra.l       _FP_CALL_TOP+0x80+0x08
0268 
0269     .global     _060_fpsp_ovfl
0270 _060_fpsp_ovfl:
0271     bra.l       _FP_CALL_TOP+0x80+0x10
0272 
0273     .global     _060_fpsp_unfl
0274 _060_fpsp_unfl:
0275     bra.l       _FP_CALL_TOP+0x80+0x18
0276 
0277     .global     _060_fpsp_dz
0278 _060_fpsp_dz:
0279     bra.l       _FP_CALL_TOP+0x80+0x20
0280 
0281     .global     _060_fpsp_inex
0282 _060_fpsp_inex:
0283     bra.l       _FP_CALL_TOP+0x80+0x28
0284 
0285     .global     _060_fpsp_fline
0286 _060_fpsp_fline:
0287     bra.l       _FP_CALL_TOP+0x80+0x30
0288 
0289     .global     _060_fpsp_unsupp
0290 _060_fpsp_unsupp:
0291     bra.l       _FP_CALL_TOP+0x80+0x38
0292 
0293     .global     _060_fpsp_effadd
0294 _060_fpsp_effadd:
0295     bra.l       _FP_CALL_TOP+0x80+0x40
0296 
0297 |############################################################################
0298 
0299 |###############################
0300 | (3) EXAMPLE CALL-OUT SECTION #
0301 |###############################
0302 
0303 | The size of this section MUST be 128 bytes!!!
0304 
0305 _FP_CALL_TOP:
0306     .long   _060_real_bsun      - _FP_CALL_TOP
0307     .long   _060_real_snan      - _FP_CALL_TOP
0308     .long   _060_real_operr     - _FP_CALL_TOP
0309     .long   _060_real_ovfl      - _FP_CALL_TOP
0310     .long   _060_real_unfl      - _FP_CALL_TOP
0311     .long   _060_real_dz        - _FP_CALL_TOP
0312     .long   _060_real_inex      - _FP_CALL_TOP
0313     .long   _060_real_fline     - _FP_CALL_TOP
0314     .long   _060_real_fpu_disabled  - _FP_CALL_TOP
0315     .long   _060_real_trap      - _FP_CALL_TOP
0316     .long   _060_real_trace     - _FP_CALL_TOP
0317     .long   _060_real_access    - _FP_CALL_TOP
0318     .long   _060_fpsp_done      - _FP_CALL_TOP
0319 
0320     .long   0x00000000, 0x00000000, 0x00000000
0321 
0322     .long   _060_imem_read      - _FP_CALL_TOP
0323     .long   _060_dmem_read      - _FP_CALL_TOP
0324     .long   _060_dmem_write     - _FP_CALL_TOP
0325     .long   _060_imem_read_word - _FP_CALL_TOP
0326     .long   _060_imem_read_long - _FP_CALL_TOP
0327     .long   _060_dmem_read_byte - _FP_CALL_TOP
0328     .long   _060_dmem_read_word - _FP_CALL_TOP
0329     .long   _060_dmem_read_long - _FP_CALL_TOP
0330     .long   _060_dmem_write_byte    - _FP_CALL_TOP
0331     .long   _060_dmem_write_word    - _FP_CALL_TOP
0332     .long   _060_dmem_write_long    - _FP_CALL_TOP
0333 
0334     .long   0x00000000
0335 
0336     .long   0x00000000, 0x00000000, 0x00000000, 0x00000000
0337 
0338 |############################################################################
0339 
0340 | 060 FPSP KERNEL PACKAGE NEEDS TO GO HERE!!!
0341 
0342 #include "fpsp.sa"