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
7 |M68060 Software Package Copyright © 1993, 1994 Motorola Inc. All rights reserved.
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.
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.
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 |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 | (1) example "Call-out"s
33 | (2) example package entry code
34 | (3) example "Call-out" table
37 #include <linux/linkage.h>
38 #include <asm/entry.h>
39 #include "../kernel/m68k_defs.h"
42 |################################
43 | (1) EXAMPLE CALL-OUTS #
47 | _060_real_divbyzero() #
51 | _060_real_lock_page() #
52 | _060_real_unlock_page() #
53 |################################
58 | This is and example main exit point for the Unimplemented Integer
59 | Instruction exception handler. For a normal exit, the
60 | _isp_unimp() branches to here so that the operating system
61 | can do any clean-up desired. The stack frame is the
62 | Unimplemented Integer Instruction stack frame with
63 | the PC pointing to the instruction following the instruction
65 | To simply continue execution at the next instruction, just
68 | Linux/68k: If returning to user space, check for needed reselections.
72 btst #0x5,%sp@ | supervisor bit set in saved SR?
78 tstl %curptr@(TASK_NEEDRESCHED)
79 jne SYMBOL_NAME(ret_from_exception) | deliver signals,
86 | This is an alternate exit point for the Unimplemented Integer
87 | Instruction exception handler. If the instruction was a "chk2"
88 | and the operand was out of bounds, then _isp_unimp() creates
89 | a CHK exception stack frame from the Unimplemented Integer Instrcution
90 | stack frame and branches to this routine.
92 | Linux/68k: commented out test for tracing
96 | tst.b (%sp) | is tracing enabled?
97 | bpls real_chk_end | no
100 | CHK FRAME TRACE FRAME
101 | ***************** *****************
102 | * Current PC * * Current PC *
103 | ***************** *****************
104 | * 0x2 * 0x018 * * 0x2 * 0x024 *
105 | ***************** *****************
108 | ***************** *****************
110 | ***************** *****************
112 | move.b #0x24,0x7(%sp) | set trace vecno
113 | bral _060_real_trace
116 bral SYMBOL_NAME(trap) | jump to trap handler
119 | _060_real_divbyzero:
121 | This is an alternate exit point for the Unimplemented Integer
122 | Instruction exception handler isp_unimp(). If the instruction is a 64-bit
123 | integer divide where the source operand is a zero, then the _isp_unimp()
124 | creates a Divide-by-zero exception stack frame from the Unimplemented
125 | Integer Instruction stack frame and branches to this routine.
127 | Remember that a trace exception may be pending. The code below performs
128 | no action associated with the "chk" exception. If tracing is enabled,
129 | then it create a Trace exception stack frame from the "chk" exception
130 | stack frame and branches to the _real_trace() entry point.
132 | Linux/68k: commented out test for tracing
134 .global _060_real_divbyzero
136 | tst.b (%sp) | is tracing enabled?
137 | bpls real_divbyzero_end | no
140 | DIVBYZERO FRAME TRACE FRAME
141 | ***************** *****************
142 | * Current PC * * Current PC *
143 | ***************** *****************
144 | * 0x2 * 0x014 * * 0x2 * 0x024 *
145 | ***************** *****************
148 | ***************** *****************
150 | ***************** *****************
152 | move.b #0x24,0x7(%sp) | set trace vecno
153 | bral _060_real_trace
156 bral SYMBOL_NAME(trap) | jump to trap handler
158 |##########################
163 | Entry point for the selected cas emulation code implementation.
164 | If the implementation provided by the 68060ISP is sufficient,
165 | then this routine simply re-enters the package through _isp_cas.
167 .global _060_real_cas
169 bral _I_CALL_TOP+0x80+0x08
174 | Entry point for the selected cas2 emulation code implementation.
175 | If the implementation provided by the 68060ISP is sufficient,
176 | then this routine simply re-enters the package through _isp_cas2.
178 .global _060_real_cas2
180 bral _I_CALL_TOP+0x80+0x10
185 | Entry point for the operating system`s routine to "lock" a page
186 | from being paged out. This routine is needed by the cas/cas2
187 | algorithms so that no page faults occur within the "core" code
188 | region. Note: the routine must lock two pages if the operand
190 | NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE
191 | SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME.
193 | a0 = operand address
194 | d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
195 | d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
197 | d0 = 0 -> success; non-zero -> failure
199 | Linux/68k: As long as ints are disabled, no swapping out should
200 | occur (hopefully...)
202 .global _060_real_lock_page
208 | _060_unlock_page():
210 | Entry point for the operating system`s routine to "unlock" a
211 | page that has been "locked" previously with _real_lock_page.
212 | Note: the routine must unlock two pages if the operand spans
215 | a0 = operand address
216 | d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
217 | d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
219 | Linux/68k: As we do no special locking operation, also no unlocking
222 .global _060_real_unlock_page
223 _060_real_unlock_page:
227 |###########################################################################
229 |#################################
230 | (2) EXAMPLE PACKAGE ENTRY CODE #
231 |#################################
233 .global _060_isp_unimp
235 bral _I_CALL_TOP+0x80+0x00
239 bral _I_CALL_TOP+0x80+0x08
241 .global _060_isp_cas2
243 bral _I_CALL_TOP+0x80+0x10
245 .global _060_isp_cas_finish
247 bra.l _I_CALL_TOP+0x80+0x18
249 .global _060_isp_cas2_finish
250 _060_isp_cas2_finish:
251 bral _I_CALL_TOP+0x80+0x20
253 .global _060_isp_cas_inrange
254 _060_isp_cas_inrange:
255 bral _I_CALL_TOP+0x80+0x28
257 .global _060_isp_cas_terminate
258 _060_isp_cas_terminate:
259 bral _I_CALL_TOP+0x80+0x30
261 .global _060_isp_cas_restart
262 _060_isp_cas_restart:
263 bral _I_CALL_TOP+0x80+0x38
265 |###########################################################################
267 |###############################
268 | (3) EXAMPLE CALL-OUT SECTION #
269 |###############################
271 | The size of this section MUST be 128 bytes!!!
275 .long _060_real_chk - _I_CALL_TOP
276 .long _060_real_divbyzero - _I_CALL_TOP
277 .long _060_real_trace - _I_CALL_TOP
278 .long _060_real_access - _I_CALL_TOP
279 .long _060_isp_done - _I_CALL_TOP
281 .long _060_real_cas - _I_CALL_TOP
282 .long _060_real_cas2 - _I_CALL_TOP
283 .long _060_real_lock_page - _I_CALL_TOP
284 .long _060_real_unlock_page - _I_CALL_TOP
286 .long 0x00000000, 0x00000000, 0x00000000, 0x00000000
287 .long 0x00000000, 0x00000000, 0x00000000
289 .long _060_imem_read - _I_CALL_TOP
290 .long _060_dmem_read - _I_CALL_TOP
291 .long _060_dmem_write - _I_CALL_TOP
292 .long _060_imem_read_word - _I_CALL_TOP
293 .long _060_imem_read_long - _I_CALL_TOP
294 .long _060_dmem_read_byte - _I_CALL_TOP
295 .long _060_dmem_read_word - _I_CALL_TOP
296 .long _060_dmem_read_long - _I_CALL_TOP
297 .long _060_dmem_write_byte - _I_CALL_TOP
298 .long _060_dmem_write_word - _I_CALL_TOP
299 .long _060_dmem_write_long - _I_CALL_TOP
302 .long 0x00000000, 0x00000000, 0x00000000, 0x00000000
304 |###########################################################################
306 | 060 INTEGER KERNEL PACKAGE MUST GO HERE!!!