Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 2 | MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP |
| 3 | M68000 Hi-Performance Microprocessor Division |
| 4 | M68060 Software Package |
| 5 | Production Release P1.00 -- October 10, 1994 |
| 6 | |
Jan Engelhardt | 96de0e2 | 2007-10-19 23:21:04 +0200 | [diff] [blame] | 7 | M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| 9 | THE SOFTWARE is provided on an "AS IS" basis and without warranty. |
| 10 | To the maximum extent permitted by applicable law, |
| 11 | MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, |
| 12 | INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE |
| 13 | and any warranty against infringement with regard to the SOFTWARE |
| 14 | (INCLUDING ANY MODIFIED VERSIONS THEREOF) and any accompanying written materials. |
| 15 | |
| 16 | To the maximum extent permitted by applicable law, |
| 17 | IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER |
| 18 | (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, |
| 19 | BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) |
| 20 | ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE. |
| 21 | Motorola assumes no responsibility for the maintenance and support of the SOFTWARE. |
| 22 | |
| 23 | You are hereby granted a copyright license to use, modify, and distribute the SOFTWARE |
| 24 | so long as this entire notice is retained without alteration in any modified and/or |
| 25 | redistributed versions, and that such modified versions are clearly identified as such. |
| 26 | No licenses are granted by implication, estoppel or otherwise under any patents |
| 27 | or trademarks of Motorola, Inc. |
| 28 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 29 | 68060 FLOATING-POINT SOFTWARE PACKAGE (Kernel version) |
| 30 | ------------------------------------------------------- |
| 31 | |
| 32 | The file fpsp.sa contains the 68060 Floating-Point Software |
| 33 | Package. This package is essentially a set of exception handlers |
| 34 | that can be integrated into an operating system. |
| 35 | These exception handlers emulate Unimplemented FP instructions, |
| 36 | instructions using unimplemented data types, and instructions |
| 37 | using unimplemented addressing modes. In addition, this package |
| 38 | includes exception handlers to provide full IEEE-754 compliant |
| 39 | exception handling. |
| 40 | |
| 41 | Release file format: |
| 42 | -------------------- |
| 43 | The file fpsp.sa is essentially a hexadecimal image of the |
| 44 | release package. This is the ONLY format which will be supported. |
| 45 | The hex image was created by assembling the source code and |
| 46 | then converting the resulting binary output image into an |
| 47 | ASCII text file. The hexadecimal numbers are listed |
| 48 | using the Motorola Assembly Syntax assembler directive "dc.l" |
| 49 | (define constant longword). The file can be converted to other |
| 50 | assembly syntaxes by using any word processor with a global |
| 51 | search and replace function. |
| 52 | |
| 53 | To assist in assembling and linking this module with other modules, |
| 54 | the installer should add a symbolic label to the top of the file. |
| 55 | This will allow calling routines to access the entry points |
| 56 | of this package. |
| 57 | |
| 58 | The source code fpsp.s has also been included but only for |
| 59 | documentation purposes. |
| 60 | |
| 61 | Release file structure: |
| 62 | ----------------------- |
| 63 | |
| 64 | (top of module) |
| 65 | ----------------- |
| 66 | | | - 128 byte-sized section |
| 67 | (1) | Call-Out | - 4 bytes per entry (user fills these in) |
| 68 | | | - example routines in fskeleton.s |
| 69 | ----------------- |
| 70 | | | - 8 bytes per entry |
| 71 | (2) | Entry Point | - user does "bra" or "jmp" to this address |
| 72 | | | |
| 73 | ----------------- |
| 74 | | | - code section |
| 75 | (3) ~ ~ |
| 76 | | | |
| 77 | ----------------- |
| 78 | (bottom of module) |
| 79 | |
| 80 | The first section of this module is the "Call-out" section. This section |
| 81 | is NOT INCLUDED in fpsp.sa (an example "Call-out" section is provided at |
| 82 | the end of the file fskeleton.s). The purpose of this section is to allow |
| 83 | the FPSP routines to reference external functions that must be provided |
| 84 | by the host operating system. This section MUST be exactly 128 bytes in |
| 85 | size. There are 32 fields, each 4 bytes in size. Each field corresponds |
| 86 | to a function required by the FPSP (these functions and their location are |
| 87 | listed in "68060FPSP call-outs" below). Each field entry should contain |
| 88 | the address of the corresponding function RELATIVE to the starting address |
| 89 | of the "call-out" section. The "Call-out" section must sit adjacent to the |
| 90 | fpsp.sa image in memory. |
| 91 | |
| 92 | The second section, the "Entry-point" section, is used by external routines |
| 93 | to access the functions within the FPSP. Since the fpsp.sa hex file contains |
| 94 | no symbol names, this section contains function entry points that are fixed |
| 95 | with respect to the top of the package. The currently defined entry-points |
| 96 | are listed in section "68060 FPSP entry points" below. A calling routine |
| 97 | would simply execute a "bra" or "jmp" that jumped to the selected function |
| 98 | entry-point. |
| 99 | |
| 100 | For example, if the 68060 hardware took a "Line-F Emulator" exception |
| 101 | (vector #11), the operating system should execute something similar to: |
| 102 | |
| 103 | bra _060FPSP_TOP+128+48 |
| 104 | |
| 105 | (_060FPSP_TOP is the starting address of the "Call-out" section; the "Call-out" |
| 106 | section is 128 bytes long; and the F-Line FPSP handler entry point is located |
| 107 | 48 bytes from the top of the "Entry-point" section.) |
| 108 | |
| 109 | The third section is the code section. After entering through an "Entry-point", |
| 110 | the entry code jumps to the appropriate emulation code within the code section. |
| 111 | |
| 112 | 68060FPSP call-outs: (details in fskeleton.s) |
| 113 | -------------------- |
| 114 | 0x000: _060_real_bsun |
| 115 | 0x004: _060_real_snan |
| 116 | 0x008: _060_real_operr |
| 117 | 0x00c: _060_real_ovfl |
| 118 | 0x010: _060_real_unfl |
| 119 | 0x014: _060_real_dz |
| 120 | 0x018: _060_real_inex |
| 121 | 0x01c: _060_real_fline |
| 122 | 0x020: _060_real_fpu_disabled |
| 123 | 0x024: _060_real_trap |
| 124 | 0x028: _060_real_trace |
| 125 | 0x02c: _060_real_access |
| 126 | 0x030: _060_fpsp_done |
| 127 | |
| 128 | 0x034: (Motorola reserved) |
| 129 | 0x038: (Motorola reserved) |
| 130 | 0x03c: (Motorola reserved) |
| 131 | |
| 132 | 0x040: _060_imem_read |
| 133 | 0x044: _060_dmem_read |
| 134 | 0x048: _060_dmem_write |
| 135 | 0x04c: _060_imem_read_word |
| 136 | 0x050: _060_imem_read_long |
| 137 | 0x054: _060_dmem_read_byte |
| 138 | 0x058: _060_dmem_read_word |
| 139 | 0x05c: _060_dmem_read_long |
| 140 | 0x060: _060_dmem_write_byte |
| 141 | 0x064: _060_dmem_write_word |
| 142 | 0x068: _060_dmem_write_long |
| 143 | |
| 144 | 0x06c: (Motorola reserved) |
| 145 | 0x070: (Motorola reserved) |
| 146 | 0x074: (Motorola reserved) |
| 147 | 0x078: (Motorola reserved) |
| 148 | 0x07c: (Motorola reserved) |
| 149 | |
| 150 | 68060FPSP entry points: |
| 151 | ----------------------- |
| 152 | 0x000: _060_fpsp_snan |
| 153 | 0x008: _060_fpsp_operr |
| 154 | 0x010: _060_fpsp_ovfl |
| 155 | 0x018: _060_fpsp_unfl |
| 156 | 0x020: _060_fpsp_dz |
| 157 | 0x028: _060_fpsp_inex |
| 158 | 0x030: _060_fpsp_fline |
| 159 | 0x038: _060_fpsp_unsupp |
| 160 | 0x040: _060_fpsp_effadd |
| 161 | |
| 162 | |
| 163 | |
| 164 | Miscellaneous: |
| 165 | -------------- |
| 166 | |
| 167 | _060_fpsp_snan: |
| 168 | ---------------- |
| 169 | - documented in 3.5 of 060SP spec. |
| 170 | - Basic flow: |
| 171 | exception taken ---> enter _060_fpsp_snan --| |
| 172 | | |
| 173 | always exits through _060_real_snan <---- |
| 174 | |
| 175 | _060_fpsp_operr: |
| 176 | ---------------- |
| 177 | - documented in 3.5 of 060SP spec. |
| 178 | - Basic flow: |
| 179 | exception taken ---> enter _060_fpsp_operr --| |
| 180 | | |
| 181 | always exits through _060_real_operr <----- |
| 182 | |
| 183 | _060_fpsp_dz: |
| 184 | ---------------- |
| 185 | - documented in 3.7 of 060SP spec. |
| 186 | - Basic flow: |
| 187 | exception taken ---> enter _060_fpsp_dz --| |
| 188 | | |
| 189 | always exits through _060_real_dz <---- |
| 190 | |
| 191 | _060_fpsp_inex: |
| 192 | ---------------- |
| 193 | - documented in 3.6 of 060SP spec. |
| 194 | - Basic flow: |
| 195 | exception taken ---> enter _060_fpsp_inex --| |
| 196 | | |
| 197 | always exits through _060_real_inex <---- |
| 198 | |
| 199 | |
| 200 | _060_fpsp_ovfl: |
| 201 | ---------------- |
| 202 | - documented in 3.4 of 060SP spec. |
| 203 | - Basic flow: |
| 204 | exception taken ---> enter _060_fpsp_ovfl --| |
| 205 | | |
| 206 | may exit through _060_real_inex <---| |
| 207 | or | |
| 208 | may exit through _060_real_ovfl <---| |
| 209 | or | |
| 210 | may exit through _060_fpsp_done <---| |
| 211 | |
| 212 | _060_fpsp_unfl: |
| 213 | ---------------- |
| 214 | - documented in 3.4 of 060SP spec. |
| 215 | - Basic flow: |
| 216 | exception taken ---> enter _060_fpsp_unfl --| |
| 217 | | |
| 218 | may exit through _060_real_inex <---| |
| 219 | or | |
| 220 | may exit through _060_real_unfl <---| |
| 221 | or | |
| 222 | may exit through _060_fpsp_done <---| |
| 223 | |
| 224 | |
| 225 | _060_fpsp_fline: |
| 226 | ----------------- |
| 227 | - not fully documented in 060SP spec. |
| 228 | - Basic flow: |
| 229 | exception taken ---> enter _060_fpsp_fline --| |
| 230 | | |
| 231 | ------------------------------------------- |
| 232 | | | | |
| 233 | v v v |
| 234 | (unimplemented (fpu disabled) (possible F-line illegal) |
| 235 | stack frame) | v |
| 236 | | v special case "fmovecr"? |
| 237 | | exit through | |
| 238 | | _060_real_fpu_disabled ------------- |
| 239 | | | | |
| 240 | | ^ v v |
| 241 | | | (yes) (no) |
| 242 | | | v v |
| 243 | | | fpu disabled? exit through |
| 244 | | | | _060_real_fline |
| 245 | v | ------------- |
| 246 | | | | | |
| 247 | | | v v |
| 248 | | |-----------(yes) (no) |
| 249 | | | |
| 250 | |----<------------------------------------| |
| 251 | | |
| 252 | | |
| 253 | |----> may exit through _060_real_trace |
| 254 | | |
| 255 | |----> may exit through _060_real_trap |
| 256 | | |
| 257 | |----> may exit through _060_real_bsun |
| 258 | | |
| 259 | |----> may exit through _060_fpsp_done |
| 260 | |
| 261 | |
| 262 | _060_fpsp_unsupp: |
| 263 | ------------------ |
| 264 | - documented in 3.1 of 060SP spec. |
| 265 | - Basic flow: |
| 266 | exception taken ---> enter _060_fpsp_unsupp --| |
| 267 | | |
| 268 | | |
| 269 | may exit through _060_real_snan <----| |
| 270 | or | |
| 271 | may exit through _060_real_operr <----| |
| 272 | or | |
| 273 | may exit through _060_real_ovfl <----| |
| 274 | or | |
| 275 | may exit through _060_real_unfl <----| |
| 276 | or | |
| 277 | may exit through _060_real_inex <----| |
| 278 | or | |
| 279 | may exit through _060_real_trace <----| |
| 280 | or | |
| 281 | may exit through _060_fpsp_done <----| |
| 282 | |
| 283 | |
| 284 | _060_fpsp_effadd: |
| 285 | ------------------ |
| 286 | - documented in 3.3 of 060 spec. |
| 287 | - Basic flow: |
| 288 | exception taken ---> enter _060_fpsp_effadd --| |
| 289 | | |
| 290 | | |
| 291 | may exit through _060_real_trace <----| |
| 292 | or | |
| 293 | may exit through _060_real_fpu_disabled <----| |
| 294 | or | |
| 295 | may exit through _060_fpsp_done <----| |