|
| 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 | +| |
| 7 | +|M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved. |
| 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 | +| iskeleton.s |
| 30 | +| |
| 31 | +| This file contains: |
| 32 | +| (1) example "Call-out"s |
| 33 | +| (2) example package entry code |
| 34 | +| (3) example "Call-out" table |
| 35 | +| |
| 36 | +| littlekernel general changes: |
| 37 | +| - Removed Linux-specific includes |
| 38 | +| - Modified 'isp.sa' file path |
| 39 | +| - Convert branch instruction in _060_real_divbyzero |
| 40 | +| |
| 41 | + |
| 42 | + |
| 43 | +|################################ |
| 44 | +| (1) EXAMPLE CALL-OUTS # |
| 45 | +| # |
| 46 | +| _060_isp_done() # |
| 47 | +| _060_real_chk() # |
| 48 | +| _060_real_divbyzero() # |
| 49 | +| # |
| 50 | +| _060_real_cas() # |
| 51 | +| _060_real_cas2() # |
| 52 | +| _060_real_lock_page() # |
| 53 | +| _060_real_unlock_page() # |
| 54 | +|################################ |
| 55 | + |
| 56 | +| |
| 57 | +| _060_isp_done(): |
| 58 | +| |
| 59 | +| This is and example main exit point for the Unimplemented Integer |
| 60 | +| Instruction exception handler. For a normal exit, the |
| 61 | +| _isp_unimp() branches to here so that the operating system |
| 62 | +| can do any clean-up desired. The stack frame is the |
| 63 | +| Unimplemented Integer Instruction stack frame with |
| 64 | +| the PC pointing to the instruction following the instruction |
| 65 | +| just emulated. |
| 66 | +| To simply continue execution at the next instruction, just |
| 67 | +| do an "rte". |
| 68 | +| |
| 69 | +| littlekernel changes: Remove user space exception check |
| 70 | +| |
| 71 | + |
| 72 | + .global _060_isp_done |
| 73 | +_060_isp_done: |
| 74 | + rte |
| 75 | + |
| 76 | +| |
| 77 | +| _060_real_chk(): |
| 78 | +| |
| 79 | +| This is an alternate exit point for the Unimplemented Integer |
| 80 | +| Instruction exception handler. If the instruction was a "chk2" |
| 81 | +| and the operand was out of bounds, then _isp_unimp() creates |
| 82 | +| a CHK exception stack frame from the Unimplemented Integer Instrcution |
| 83 | +| stack frame and branches to this routine. |
| 84 | +| |
| 85 | +| littlekernel changes: Call m68k_trap_exception, remove tracing check |
| 86 | +| |
| 87 | + |
| 88 | + .global _060_real_chk |
| 89 | +_060_real_chk: |
| 90 | +| |
| 91 | +| CHK FRAME TRACE FRAME |
| 92 | +| ***************** ***************** |
| 93 | +| * Current PC * * Current PC * |
| 94 | +| ***************** ***************** |
| 95 | +| * 0x2 * 0x018 * * 0x2 * 0x024 * |
| 96 | +| ***************** ***************** |
| 97 | +| * Next * * Next * |
| 98 | +| * PC * * PC * |
| 99 | +| ***************** ***************** |
| 100 | +| * SR * * SR * |
| 101 | +| ***************** ***************** |
| 102 | +| |
| 103 | + |
| 104 | +real_chk_end: |
| 105 | + bral m68k_trap_exception |
| 106 | + |
| 107 | +| |
| 108 | +| _060_real_divbyzero: |
| 109 | +| |
| 110 | +| This is an alternate exit point for the Unimplemented Integer |
| 111 | +| Instruction exception handler isp_unimp(). If the instruction is a 64-bit |
| 112 | +| integer divide where the source operand is a zero, then the _isp_unimp() |
| 113 | +| creates a Divide-by-zero exception stack frame from the Unimplemented |
| 114 | +| Integer Instruction stack frame and branches to this routine. |
| 115 | +| |
| 116 | +| Remember that a trace exception may be pending. The code below performs |
| 117 | +| no action associated with the "chk" exception. If tracing is enabled, |
| 118 | +| then it create a Trace exception stack frame from the "chk" exception |
| 119 | +| stack frame and branches to the _real_trace() entry point. |
| 120 | +| |
| 121 | +| littlekernel changes: |
| 122 | +| - bpls -> bplw in _060_real_divbyzero |
| 123 | +| - Remove tracing check |
| 124 | +| |
| 125 | + |
| 126 | + .global _060_real_divbyzero |
| 127 | +_060_real_divbyzero: |
| 128 | +| |
| 129 | +| DIVBYZERO FRAME TRACE FRAME |
| 130 | +| ***************** ***************** |
| 131 | +| * Current PC * * Current PC * |
| 132 | +| ***************** ***************** |
| 133 | +| * 0x2 * 0x014 * * 0x2 * 0x024 * |
| 134 | +| ***************** ***************** |
| 135 | +| * Next * * Next * |
| 136 | +| * PC * * PC * |
| 137 | +| ***************** ***************** |
| 138 | +| * SR * * SR * |
| 139 | +| ***************** ***************** |
| 140 | +| |
| 141 | +| littlekernel changes: Call m68k_trap_exception |
| 142 | +| |
| 143 | + |
| 144 | +real_divbyzero_end: |
| 145 | + bral m68k_trap_exception |
| 146 | + |
| 147 | +|########################## |
| 148 | + |
| 149 | +| |
| 150 | +| _060_real_cas(): |
| 151 | +| |
| 152 | +| Entry point for the selected cas emulation code implementation. |
| 153 | +| If the implementation provided by the 68060ISP is sufficient, |
| 154 | +| then this routine simply re-enters the package through _isp_cas. |
| 155 | +| |
| 156 | + .global _060_real_cas |
| 157 | +_060_real_cas: |
| 158 | + bral _I_CALL_TOP+0x80+0x08 |
| 159 | + |
| 160 | +| |
| 161 | +| _060_real_cas2(): |
| 162 | +| |
| 163 | +| Entry point for the selected cas2 emulation code implementation. |
| 164 | +| If the implementation provided by the 68060ISP is sufficient, |
| 165 | +| then this routine simply re-enters the package through _isp_cas2. |
| 166 | +| |
| 167 | + .global _060_real_cas2 |
| 168 | +_060_real_cas2: |
| 169 | + bral _I_CALL_TOP+0x80+0x10 |
| 170 | + |
| 171 | +| |
| 172 | +| _060_lock_page(): |
| 173 | +| |
| 174 | +| Entry point for the operating system`s routine to "lock" a page |
| 175 | +| from being paged out. This routine is needed by the cas/cas2 |
| 176 | +| algorithms so that no page faults occur within the "core" code |
| 177 | +| region. Note: the routine must lock two pages if the operand |
| 178 | +| spans two pages. |
| 179 | +| NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE |
| 180 | +| SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME. |
| 181 | +| Arguments: |
| 182 | +| a0 = operand address |
| 183 | +| d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user |
| 184 | +| d1 = `xxxxxxff -> longword; `xxxxxx00 -> word |
| 185 | +| Expected outputs: |
| 186 | +| d0 = 0 -> success; non-zero -> failure |
| 187 | +| |
| 188 | + .global _060_real_lock_page |
| 189 | +_060_real_lock_page: |
| 190 | + clr.l %d0 |
| 191 | + rts |
| 192 | + |
| 193 | +| |
| 194 | +| _060_unlock_page(): |
| 195 | +| |
| 196 | +| Entry point for the operating system`s routine to "unlock" a |
| 197 | +| page that has been "locked" previously with _real_lock_page. |
| 198 | +| Note: the routine must unlock two pages if the operand spans |
| 199 | +| two pages. |
| 200 | +| Arguments: |
| 201 | +| a0 = operand address |
| 202 | +| d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user |
| 203 | +| d1 = `xxxxxxff -> longword; `xxxxxx00 -> word |
| 204 | +| |
| 205 | + |
| 206 | + .global _060_real_unlock_page |
| 207 | +_060_real_unlock_page: |
| 208 | + clr.l %d0 |
| 209 | + rts |
| 210 | + |
| 211 | +|########################################################################### |
| 212 | + |
| 213 | +|################################# |
| 214 | +| (2) EXAMPLE PACKAGE ENTRY CODE # |
| 215 | +|################################# |
| 216 | + |
| 217 | + .global _060_isp_unimp |
| 218 | +_060_isp_unimp: |
| 219 | + bral _I_CALL_TOP+0x80+0x00 |
| 220 | + |
| 221 | + .global _060_isp_cas |
| 222 | +_060_isp_cas: |
| 223 | + bral _I_CALL_TOP+0x80+0x08 |
| 224 | + |
| 225 | + .global _060_isp_cas2 |
| 226 | +_060_isp_cas2: |
| 227 | + bral _I_CALL_TOP+0x80+0x10 |
| 228 | + |
| 229 | + .global _060_isp_cas_finish |
| 230 | +_060_isp_cas_finish: |
| 231 | + bra.l _I_CALL_TOP+0x80+0x18 |
| 232 | + |
| 233 | + .global _060_isp_cas2_finish |
| 234 | +_060_isp_cas2_finish: |
| 235 | + bral _I_CALL_TOP+0x80+0x20 |
| 236 | + |
| 237 | + .global _060_isp_cas_inrange |
| 238 | +_060_isp_cas_inrange: |
| 239 | + bral _I_CALL_TOP+0x80+0x28 |
| 240 | + |
| 241 | + .global _060_isp_cas_terminate |
| 242 | +_060_isp_cas_terminate: |
| 243 | + bral _I_CALL_TOP+0x80+0x30 |
| 244 | + |
| 245 | + .global _060_isp_cas_restart |
| 246 | +_060_isp_cas_restart: |
| 247 | + bral _I_CALL_TOP+0x80+0x38 |
| 248 | + |
| 249 | +|########################################################################### |
| 250 | + |
| 251 | +|############################### |
| 252 | +| (3) EXAMPLE CALL-OUT SECTION # |
| 253 | +|############################### |
| 254 | + |
| 255 | +| The size of this section MUST be 128 bytes!!! |
| 256 | + |
| 257 | +_I_CALL_TOP: |
| 258 | + .long _060_real_chk - _I_CALL_TOP |
| 259 | + .long _060_real_divbyzero - _I_CALL_TOP |
| 260 | + .long _060_real_trace - _I_CALL_TOP |
| 261 | + .long _060_real_access - _I_CALL_TOP |
| 262 | + .long _060_isp_done - _I_CALL_TOP |
| 263 | + |
| 264 | + .long _060_real_cas - _I_CALL_TOP |
| 265 | + .long _060_real_cas2 - _I_CALL_TOP |
| 266 | + .long _060_real_lock_page - _I_CALL_TOP |
| 267 | + .long _060_real_unlock_page - _I_CALL_TOP |
| 268 | + |
| 269 | + .long 0x00000000, 0x00000000, 0x00000000, 0x00000000 |
| 270 | + .long 0x00000000, 0x00000000, 0x00000000 |
| 271 | + |
| 272 | + .long _060_imem_read - _I_CALL_TOP |
| 273 | + .long _060_dmem_read - _I_CALL_TOP |
| 274 | + .long _060_dmem_write - _I_CALL_TOP |
| 275 | + .long _060_imem_read_word - _I_CALL_TOP |
| 276 | + .long _060_imem_read_long - _I_CALL_TOP |
| 277 | + .long _060_dmem_read_byte - _I_CALL_TOP |
| 278 | + .long _060_dmem_read_word - _I_CALL_TOP |
| 279 | + .long _060_dmem_read_long - _I_CALL_TOP |
| 280 | + .long _060_dmem_write_byte - _I_CALL_TOP |
| 281 | + .long _060_dmem_write_word - _I_CALL_TOP |
| 282 | + .long _060_dmem_write_long - _I_CALL_TOP |
| 283 | + |
| 284 | + .long 0x00000000 |
| 285 | + .long 0x00000000, 0x00000000, 0x00000000, 0x00000000 |
| 286 | + |
| 287 | +|########################################################################### |
| 288 | + |
| 289 | +| 060 INTEGER KERNEL PACKAGE MUST GO HERE!!! |
| 290 | +| |
| 291 | +| littlekernel changes: Adjust path to isp.sa in source tree |
| 292 | +| |
| 293 | +.include "external/arch/m68k/68060SP/isp.sa" |
0 commit comments