3 # $NetBSD: inetbsd.S,v 1.4 2000/11/30 21:00:51 scw 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 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 # (1) example "Call-out"s
42 # (2) example package entry code
43 # (3) example "Call-out" table
47 #################################
48 # (1) EXAMPLE CALL-OUTS #
52 # _060_real_divbyzero() #
56 # _060_real_lock_page() #
57 # _060_real_unlock_page() #
58 #################################
65 # This is and example main exit point for the Unimplemented Integer
66 # Instruction exception handler. For a normal exit, the
67 # _isp_unimp() branches to here so that the operating system
68 # can do any clean-up desired. The stack frame is the
69 # Unimplemented Integer Instruction stack frame with
70 # the PC pointing to the instruction following the instruction
72 # To simply continue execution at the next instruction, just
76 ASENTRY_NOPROFILE(_060_isp_done)
83 # This is an alternate exit point for the Unimplemented Integer
84 # Instruction exception handler. If the instruction was a "chk2"
85 # and the operand was out of bounds, then _isp_unimp() creates
86 # a CHK exception stack frame from the Unimplemented Integer Instrcution
87 # stack frame and branches to this routine.
90 ASENTRY_NOPROFILE(_060_real_chk)
91 tstb %sp@ |# is tracing enabled?
92 bpls real_chk_end |# no
96 # CHK FRAME TRACE FRAME
97 # ***************** *****************
98 # * Current PC * * Current PC *
99 # ***************** *****************
100 # * 0x2 * 0x018 * * 0x2 * 0x024 *
101 # ***************** *****************
104 # ***************** *****************
106 # ***************** *****************
109 moveb #0x24,%sp@(0x7) |# set trace vecno
110 bral _ASM_LABEL(_060_real_trace)
113 jmp _C_LABEL(chkinst)
117 # _060_real_divbyzero:
119 # This is an alternate exit point for the Unimplemented Integer
120 # Instruction exception handler isp_unimp(). If the instruction is a 64-bit
121 # integer divide where the source operand is a zero, then the _isp_unimp()
122 # creates a Divide-by-zero exception stack frame from the Unimplemented
123 # Integer Instruction stack frame and branches to this routine.
125 # Remember that a trace exception may be pending. The code below performs
126 # no action associated with the "chk" exception. If tracing is enabled,
127 # then it create a Trace exception stack frame from the "chk" exception
128 # stack frame and branches to the _real_trace() entry point.
131 ASENTRY_NOPROFILE(_060_real_divbyzero)
132 tstb %sp@ |# is tracing enabled?
133 bpls real_divbyzero_end |# no
137 # DIVBYZERO FRAME TRACE FRAME
138 # ***************** *****************
139 # * Current PC * * Current PC *
140 # ***************** *****************
141 # * 0x2 * 0x014 * * 0x2 * 0x024 *
142 # ***************** *****************
145 # ***************** *****************
147 # ***************** *****************
150 moveb #0x24,%sp@(0x7) |# set trace vecno
151 bral _ASM_LABEL(_060_real_trace)
154 jmp _C_LABEL(zerodiv)
156 |###########################
162 # Entry point for the selected cas emulation code implementation.
163 # If the implementation provided by the 68060ISP is sufficient,
164 # then this routine simply re-enters the package through _isp_cas.
167 ASENTRY_NOPROFILE(_060_real_cas)
168 bral _C_LABEL(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.
179 ASENTRY_NOPROFILE(_060_real_cas2)
180 bral _C_LABEL(I_CALL_TOP)+0x80+0x10
186 # Entry point for the operating system's routine to "lock" a page
187 # from being paged out. This routine is needed by the cas/cas2
188 # algorithms so that no page faults occur within the "core" code
189 # region. Note: the routine must lock two pages if the operand
191 # NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE
192 # SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME.
194 # a0 = operand address
195 # d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user
196 # d1 = `xxxxxxff -> longword| `xxxxxx00 -> word
198 # d0 = 0 -> success| non-zero -> failure
201 ASENTRY_NOPROFILE(_060_real_lock_page)
207 # _060_unlock_page():
209 # Entry point for the operating system's routine to "unlock" a
210 # page that has been "locked" previously with _real_lock_page.
211 # Note: the routine must unlock two pages if the operand spans
214 # a0 = operand address
215 # d0 = `xxxxxxff -> supervisor| `xxxxxx00 -> user
216 # d1 = `xxxxxxff -> longword| `xxxxxx00 -> word
219 ASENTRY_NOPROFILE(_060_real_unlock_page)
223 |############################################################################
225 ##################################
226 # (2) EXAMPLE PACKAGE ENTRY CODE #
227 ##################################
230 ASENTRY_NOPROFILE(_060_isp_unimp)
231 bral _C_LABEL(I_CALL_TOP)+0x80+0x00
233 ASENTRY_NOPROFILE(_060_isp_cas)
234 bral _C_LABEL(I_CALL_TOP)+0x80+0x08
236 ASENTRY_NOPROFILE(_060_isp_cas2)
237 bral _C_LABEL(I_CALL_TOP)+0x80+0x10
239 ASENTRY_NOPROFILE(_060_isp_cas_finish)
240 bral _C_LABEL(I_CALL_TOP)+0x80+0x18
242 ASENTRY_NOPROFILE(_060_isp_cas2_finish)
243 bral _C_LABEL(I_CALL_TOP)+0x80+0x20
245 ASENTRY_NOPROFILE(_060_isp_cas_inrange)
246 bral _C_LABEL(I_CALL_TOP)+0x80+0x28
248 ASENTRY_NOPROFILE(_060_isp_cas_terminate)
249 bral _C_LABEL(I_CALL_TOP)+0x80+0x30
251 ASENTRY_NOPROFILE(_060_isp_cas_restart)
252 bral _C_LABEL(I_CALL_TOP)+0x80+0x38
254 |############################################################################
257 ################################
258 # (3) EXAMPLE CALL-OUT SECTION #
259 ################################
261 # The size of this section MUST be 128 bytes!!!
265 .long _ASM_LABEL(_060_real_chk)-_C_LABEL(I_CALL_TOP)
266 .long _ASM_LABEL(_060_real_divbyzero)-_C_LABEL(I_CALL_TOP)
267 .long _ASM_LABEL(_060_real_trace)-_C_LABEL(I_CALL_TOP)
268 .long _ASM_LABEL(_060_real_access)-_C_LABEL(I_CALL_TOP)
269 .long _ASM_LABEL(_060_isp_done)-_C_LABEL(I_CALL_TOP)
271 .long _ASM_LABEL(_060_real_cas)-_C_LABEL(I_CALL_TOP)
272 .long _ASM_LABEL(_060_real_cas2)-_C_LABEL(I_CALL_TOP)
273 .long _ASM_LABEL(_060_real_lock_page)-_C_LABEL(I_CALL_TOP)
274 .long _ASM_LABEL(_060_real_unlock_page)-_C_LABEL(I_CALL_TOP)
276 .long 0x00000000,0x00000000,0x00000000,0x00000000
277 .long 0x00000000,0x00000000,0x00000000
279 .long _ASM_LABEL(_060_imem_read)-_C_LABEL(I_CALL_TOP)
280 .long _ASM_LABEL(_060_dmem_read)-_C_LABEL(I_CALL_TOP)
281 .long _ASM_LABEL(_060_dmem_write)-_C_LABEL(I_CALL_TOP)
282 .long _ASM_LABEL(_060_imem_read_word)-_C_LABEL(I_CALL_TOP)
283 .long _ASM_LABEL(_060_imem_read_long)-_C_LABEL(I_CALL_TOP)
284 .long _ASM_LABEL(_060_dmem_read_byte)-_C_LABEL(I_CALL_TOP)
285 .long _ASM_LABEL(_060_dmem_read_word)-_C_LABEL(I_CALL_TOP)
286 .long _ASM_LABEL(_060_dmem_read_long)-_C_LABEL(I_CALL_TOP)
287 .long _ASM_LABEL(_060_dmem_write_byte)-_C_LABEL(I_CALL_TOP)
288 .long _ASM_LABEL(_060_dmem_write_word)-_C_LABEL(I_CALL_TOP)
289 .long _ASM_LABEL(_060_dmem_write_long)-_C_LABEL(I_CALL_TOP)
292 .long 0x00000000,0x00000000,0x00000000,0x00000000
295 ############################################################################
297 # 060 INTEGER KERNEL PACKAGE MUST GO HERE!!!