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