2 # $NetBSD: fpsp.doc,v 1.2 2007/04/29 20:23:35 msaitoh 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 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 68060 FLOATING-POINT SOFTWARE PACKAGE (Kernel version)
39 -------------------------------------------------------
41 The file fpsp.sa contains the 68060 Floating-Point Software
42 Package. This package is essentially a set of exception handlers
43 that can be integrated into an operating system.
44 These exception handlers emulate Unimplemented FP instructions,
45 instructions using unimplemented data types, and instructions
46 using unimplemented addressing modes. In addition, this package
47 includes exception handlers to provide full IEEE-754 compliant
52 The file fpsp.sa is essentially a hexadecimal image of the
53 release package. This is the ONLY format which will be supported.
54 The hex image was created by assembling the source code and
55 then converting the resulting binary output image into an
56 ASCII text file. The hexadecimal numbers are listed
57 using the Motorola Assembly Syntax assembler directive "dc.l"
58 (define constant longword). The file can be converted to other
59 assembly syntaxes by using any word processor with a global
60 search and replace function.
62 To assist in assembling and linking this module with other modules,
63 the installer should add a symbolic label to the top of the file.
64 This will allow calling routines to access the entry points
67 The source code fpsp.s has also been included but only for
68 documentation purposes.
70 Release file structure:
71 -----------------------
75 | | - 128 byte-sized section
76 (1) | Call-Out | - 4 bytes per entry (user fills these in)
77 | | - example routines in fskeleton.s
79 | | - 8 bytes per entry
80 (2) | Entry Point | - user does "bra" or "jmp" to this address
89 The first section of this module is the "Call-out" section. This section
90 is NOT INCLUDED in fpsp.sa (an example "Call-out" section is provided at
91 the end of the file fskeleton.s). The purpose of this section is to allow
92 the FPSP routines to reference external functions that must be provided
93 by the host operating system. This section MUST be exactly 128 bytes in
94 size. There are 32 fields, each 4 bytes in size. Each field corresponds
95 to a function required by the FPSP (these functions and their location are
96 listed in "68060FPSP call-outs" below). Each field entry should contain
97 the address of the corresponding function RELATIVE to the starting address
98 of the "call-out" section. The "Call-out" section must sit adjacent to the
99 fpsp.sa image in memory.
101 The second section, the "Entry-point" section, is used by external routines
102 to access the functions within the FPSP. Since the fpsp.sa hex file contains
103 no symbol names, this section contains function entry points that are fixed
104 with respect to the top of the package. The currently defined entry-points
105 are listed in section "68060 FPSP entry points" below. A calling routine
106 would simply execute a "bra" or "jmp" that jumped to the selected function
109 For example, if the 68060 hardware took a "Line-F Emulator" exception
110 (vector #11), the operating system should execute something similar to:
112 bra _060FPSP_TOP+128+48
114 (_060FPSP_TOP is the starting address of the "Call-out" section; the "Call-out"
115 section is 128 bytes long; and the F-Line FPSP handler entry point is located
116 48 bytes from the top of the "Entry-point" section.)
118 The third section is the code section. After entering through an "Entry-point",
119 the entry code jumps to the appropriate emulation code within the code section.
121 68060FPSP call-outs: (details in fskeleton.s)
123 0x000: _060_real_bsun
124 0x004: _060_real_snan
125 0x008: _060_real_operr
126 0x00c: _060_real_ovfl
127 0x010: _060_real_unfl
129 0x018: _060_real_inex
130 0x01c: _060_real_fline
131 0x020: _060_real_fpu_disabled
132 0x024: _060_real_trap
133 0x028: _060_real_trace
134 0x02c: _060_real_access
135 0x030: _060_fpsp_done
137 0x034: (Motorola reserved)
138 0x038: (Motorola reserved)
139 0x03c: (Motorola reserved)
141 0x040: _060_imem_read
142 0x044: _060_dmem_read
143 0x048: _060_dmem_write
144 0x04c: _060_imem_read_word
145 0x050: _060_imem_read_long
146 0x054: _060_dmem_read_byte
147 0x058: _060_dmem_read_word
148 0x05c: _060_dmem_read_long
149 0x060: _060_dmem_write_byte
150 0x064: _060_dmem_write_word
151 0x068: _060_dmem_write_long
153 0x06c: (Motorola reserved)
154 0x070: (Motorola reserved)
155 0x074: (Motorola reserved)
156 0x078: (Motorola reserved)
157 0x07c: (Motorola reserved)
159 68060FPSP entry points:
160 -----------------------
161 0x000: _060_fpsp_snan
162 0x008: _060_fpsp_operr
163 0x010: _060_fpsp_ovfl
164 0x018: _060_fpsp_unfl
166 0x028: _060_fpsp_inex
167 0x030: _060_fpsp_fline
168 0x038: _060_fpsp_unsupp
169 0x040: _060_fpsp_effadd
177 - documented in 3.5 of 060SP spec.
179 exception taken ---> enter _060_fpsp_snan --|
181 always exits through _060_real_snan <----
185 - documented in 3.5 of 060SP spec.
187 exception taken ---> enter _060_fpsp_operr --|
189 always exits through _060_real_operr <-----
193 - documented in 3.7 of 060SP spec.
195 exception taken ---> enter _060_fpsp_dz --|
197 always exits through _060_real_dz <----
201 - documented in 3.6 of 060SP spec.
203 exception taken ---> enter _060_fpsp_inex --|
205 always exits through _060_real_inex <----
209 - documented in 3.4 of 060SP spec.
211 exception taken ---> enter _060_fpsp_ovfl --|
213 may exit through _060_real_inex <---|
215 may exit through _060_real_ovfl <---|
217 may exit through _060_fpsp_done <---|
221 - documented in 3.4 of 060SP spec.
223 exception taken ---> enter _060_fpsp_unfl --|
225 may exit through _060_real_inex <---|
227 may exit through _060_real_unfl <---|
229 may exit through _060_fpsp_done <---|
233 - not fully documented in 060SP spec.
235 exception taken ---> enter _060_fpsp_fline --|
237 -------------------------------------------
240 (unimplemented (fpu disabled) (possible F-line illegal)
242 | v special case "fmovecr"?
244 | _060_real_fpu_disabled -------------
249 | | fpu disabled? exit through
250 | | | _060_real_fline
254 | |-----------(yes) (no)
256 |----<------------------------------------|
259 |----> may exit through _060_real_trace
261 |----> may exit through _060_real_trap
263 |----> may exit through _060_real_bsun
265 |----> may exit through _060_fpsp_done
269 - documented in 3.1 of 060SP spec.
271 exception taken ---> enter _060_fpsp_unsupp --|
274 may exit through _060_real_snan <----|
276 may exit through _060_real_operr <----|
278 may exit through _060_real_ovfl <----|
280 may exit through _060_real_unfl <----|
282 may exit through _060_real_inex <----|
284 may exit through _060_real_trace <----|
286 may exit through _060_fpsp_done <----|
290 - documented in 3.3 of 060 spec.
292 exception taken ---> enter _060_fpsp_effadd --|
295 may exit through _060_real_trace <----|
297 may exit through _060_real_fpu_disabled <----|
299 may exit through _060_fpsp_done <----|