Annotation of sys/arch/m68k/060sp/iskeletn.s, Revision 1.1.1.1
1.1 nbrk 1: #
2: # $OpenBSD: iskeletn.s,v 1.2 1996/05/30 22:14:43 niklas Exp $
3: # $NetBSD: iskeletn.s,v 1.2 1996/05/15 19:48:41 is Exp $
4: #
5:
6: #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7: # MOTOROLA MICROPROCESSOR & MEMORY TECHNOLOGY GROUP
8: # M68000 Hi-Performance Microprocessor Division
9: # M68060 Software Package Production Release
10: #
11: # M68060 Software Package Copyright (C) 1993, 1994, 1995, 1996 Motorola Inc.
12: # All rights reserved.
13: #
14: # THE SOFTWARE is provided on an "AS IS" basis and without warranty.
15: # To the maximum extent permitted by applicable law,
16: # MOTOROLA DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
17: # INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS
18: # FOR A PARTICULAR PURPOSE and any warranty against infringement with
19: # regard to the SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
20: # and any accompanying written materials.
21: #
22: # To the maximum extent permitted by applicable law,
23: # IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER
24: # (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
25: # BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS)
26: # ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
27: #
28: # Motorola assumes no responsibility for the maintenance and support
29: # of the SOFTWARE.
30: #
31: # You are hereby granted a copyright license to use, modify, and distribute the
32: # SOFTWARE so long as this entire notice is retained without alteration
33: # in any modified and/or redistributed versions, and that such modified
34: # versions are clearly identified as such.
35: # No licenses are granted by implication, estoppel or otherwise under any
36: # patents or trademarks of Motorola, Inc.
37: #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38:
39: #
40: # iskeleton.s
41: #
42: # This file contains:
43: # (1) example "Call-out"s
44: # (2) example package entry code
45: # (3) example "Call-out" table
46: #
47:
48:
49: #################################
50: # (1) EXAMPLE CALL-OUTS #
51: # #
52: # _060_isp_done() #
53: # _060_real_chk() #
54: # _060_real_divbyzero() #
55: # #
56: # _060_real_cas() #
57: # _060_real_cas2() #
58: # _060_real_lock_page() #
59: # _060_real_unlock_page() #
60: #################################
61:
62: #
63: # _060_isp_done():
64: #
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
71: # just emulated.
72: # To simply continue execution at the next instruction, just
73: # do an "rte".
74: #
75: global _060_isp_done
76: _060_isp_done:
77: rte
78:
79: #
80: # _060_real_chk():
81: #
82: # This is an alternate exit point for the Unimplemented Integer
83: # Instruction exception handler. If the instruction was a "chk2"
84: # and the operand was out of bounds, then _isp_unimp() creates
85: # a CHK exception stack frame from the Unimplemented Integer Instrcution
86: # stack frame and branches to this routine.
87: #
88: global _060_real_chk
89: _060_real_chk:
90: tst.b (%sp) # is tracing enabled?
91: bpl.b real_chk_end # no
92:
93: #
94: # CHK FRAME TRACE FRAME
95: # ***************** *****************
96: # * Current PC * * Current PC *
97: # ***************** *****************
98: # * 0x2 * 0x018 * * 0x2 * 0x024 *
99: # ***************** *****************
100: # * Next * * Next *
101: # * PC * * PC *
102: # ***************** *****************
103: # * SR * * SR *
104: # ***************** *****************
105: #
106: mov.b &0x24,0x7(%sp) # set trace vecno
107: bra.l _060_real_trace
108:
109: real_chk_end:
110: rte
111:
112: #
113: # _060_real_divbyzero:
114: #
115: # This is an alternate exit point for the Unimplemented Integer
116: # Instruction exception handler isp_unimp(). If the instruction is a 64-bit
117: # integer divide where the source operand is a zero, then the _isp_unimp()
118: # creates a Divide-by-zero exception stack frame from the Unimplemented
119: # Integer Instruction stack frame and branches to this routine.
120: #
121: # Remember that a trace exception may be pending. The code below performs
122: # no action associated with the "chk" exception. If tracing is enabled,
123: # then it create a Trace exception stack frame from the "chk" exception
124: # stack frame and branches to the _real_trace() entry point.
125: #
126: global _060_real_divbyzero
127: _060_real_divbyzero:
128: tst.b (%sp) # is tracing enabled?
129: bpl.b real_divbyzero_end # no
130:
131: #
132: # DIVBYZERO FRAME TRACE FRAME
133: # ***************** *****************
134: # * Current PC * * Current PC *
135: # ***************** *****************
136: # * 0x2 * 0x014 * * 0x2 * 0x024 *
137: # ***************** *****************
138: # * Next * * Next *
139: # * PC * * PC *
140: # ***************** *****************
141: # * SR * * SR *
142: # ***************** *****************
143: #
144: mov.b &0x24,0x7(%sp) # set trace vecno
145: bra.l _060_real_trace
146:
147: real_divbyzero_end:
148: rte
149:
150: ###########################
151:
152: #
153: # _060_real_cas():
154: #
155: # Entry point for the selected cas emulation code implementation.
156: # If the implementation provided by the 68060ISP is sufficient,
157: # then this routine simply re-enters the package through _isp_cas.
158: #
159: global _060_real_cas
160: _060_real_cas:
161: bra.l _I_CALL_TOP+0x80+0x08
162:
163: #
164: # _060_real_cas2():
165: #
166: # Entry point for the selected cas2 emulation code implementation.
167: # If the implementation provided by the 68060ISP is sufficient,
168: # then this routine simply re-enters the package through _isp_cas2.
169: #
170: global _060_real_cas2
171: _060_real_cas2:
172: bra.l _I_CALL_TOP+0x80+0x10
173:
174: #
175: # _060_lock_page():
176: #
177: # Entry point for the operating system's routine to "lock" a page
178: # from being paged out. This routine is needed by the cas/cas2
179: # algorithms so that no page faults occur within the "core" code
180: # region. Note: the routine must lock two pages if the operand
181: # spans two pages.
182: # NOTE: THE ROUTINE SHOULD RETURN AN FSLW VALUE IN D0 ON FAILURE
183: # SO THAT THE 060SP CAN CREATE A PROPER ACCESS ERROR FRAME.
184: # Arguments:
185: # a0 = operand address
186: # d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
187: # d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
188: # Expected outputs:
189: # d0 = 0 -> success; non-zero -> failure
190: #
191: global _060_real_lock_page
192: _060_real_lock_page:
193: clr.l %d0
194: rts
195:
196: #
197: # _060_unlock_page():
198: #
199: # Entry point for the operating system's routine to "unlock" a
200: # page that has been "locked" previously with _real_lock_page.
201: # Note: the routine must unlock two pages if the operand spans
202: # two pages.
203: # Arguments:
204: # a0 = operand address
205: # d0 = `xxxxxxff -> supervisor; `xxxxxx00 -> user
206: # d1 = `xxxxxxff -> longword; `xxxxxx00 -> word
207: #
208: global _060_real_unlock_page
209: _060_real_unlock_page:
210: clr.l %d0
211: rts
212:
213: ############################################################################
214:
215: ##################################
216: # (2) EXAMPLE PACKAGE ENTRY CODE #
217: ##################################
218:
219: global _060_isp_unimp
220: _060_isp_unimp:
221: bra.l _I_CALL_TOP+0x80+0x00
222:
223: global _060_isp_cas
224: _060_isp_cas:
225: bra.l _I_CALL_TOP+0x80+0x08
226:
227: global _060_isp_cas2
228: _060_isp_cas2:
229: bra.l _I_CALL_TOP+0x80+0x10
230:
231: global _060_isp_cas_finish
232: _060_isp_cas_finish:
233: bra.l _I_CALL_TOP+0x80+0x18
234:
235: global _060_isp_cas2_finish
236: _060_isp_cas2_finish:
237: bra.l _I_CALL_TOP+0x80+0x20
238:
239: global _060_isp_cas_inrange
240: _060_isp_cas_inrange:
241: bra.l _I_CALL_TOP+0x80+0x28
242:
243: global _060_isp_cas_terminate
244: _060_isp_cas_terminate:
245: bra.l _I_CALL_TOP+0x80+0x30
246:
247: global _060_isp_cas_restart
248: _060_isp_cas_restart:
249: bra.l _I_CALL_TOP+0x80+0x38
250:
251: ############################################################################
252:
253: ################################
254: # (3) EXAMPLE CALL-OUT SECTION #
255: ################################
256:
257: # The size of this section MUST be 128 bytes!!!
258:
259: global _I_CALL_TOP
260: _I_CALL_TOP:
261: long _060_real_chk - _I_CALL_TOP
262: long _060_real_divbyzero - _I_CALL_TOP
263: long _060_real_trace - _I_CALL_TOP
264: long _060_real_access - _I_CALL_TOP
265: long _060_isp_done - _I_CALL_TOP
266:
267: long _060_real_cas - _I_CALL_TOP
268: long _060_real_cas2 - _I_CALL_TOP
269: long _060_real_lock_page - _I_CALL_TOP
270: long _060_real_unlock_page - _I_CALL_TOP
271:
272: long 0x00000000, 0x00000000, 0x00000000, 0x00000000
273: long 0x00000000, 0x00000000, 0x00000000
274:
275: long _060_imem_read - _I_CALL_TOP
276: long _060_dmem_read - _I_CALL_TOP
277: long _060_dmem_write - _I_CALL_TOP
278: long _060_imem_read_word - _I_CALL_TOP
279: long _060_imem_read_long - _I_CALL_TOP
280: long _060_dmem_read_byte - _I_CALL_TOP
281: long _060_dmem_read_word - _I_CALL_TOP
282: long _060_dmem_read_long - _I_CALL_TOP
283: long _060_dmem_write_byte - _I_CALL_TOP
284: long _060_dmem_write_word - _I_CALL_TOP
285: long _060_dmem_write_long - _I_CALL_TOP
286:
287: long 0x00000000
288: long 0x00000000, 0x00000000, 0x00000000, 0x00000000
289:
290: ############################################################################
291:
292: # 060 INTEGER KERNEL PACKAGE MUST GO HERE!!!
CVSweb