1/* $NetBSD: libstubs.s,v 1.8 2001/12/17 05:41:13 mhitch Exp $ */
2
3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Ignatios Souvatzis.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 *    must display the following acknowledgement:
20 *        This product includes software developed by the NetBSD
21 *        Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 *    contributors may be used to endorse or promote products derived
24 *    from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39/*
40 * Exec.library functions.
41 */
42#include <machine/asm.h>
43	.comm _C_LABEL(SysBase),4
44
45ENTRY_NOPROFILE(OpenLibrary)
46	movl	%a6,%sp@-
47	movl	%pc@(_C_LABEL(SysBase):w),%a6
48	movl	%sp@(8),%a1
49	movl	%sp@(12),%d0
50	jsr	%a6@(-0x228)
51	movl	%sp@+,%a6
52	movl	%d0,%a0			| Comply with ELF ABI
53	rts
54
55#ifdef _PRIMARY_BOOT
56ENTRY_NOPROFILE(CloseLibrary)
57	movl	%a6,%sp@-
58	movl	%pc@(_C_LABEL(SysBase):w),%a6
59	movl	%sp@(8),%a1
60	jsr	%a6@(-0x19e)
61	movl	%sp@+,%a6
62	rts
63#endif
64ENTRY_NOPROFILE(CreateIORequest)
65	movl	%a6,%sp@-
66	movl	%pc@(_C_LABEL(SysBase):w),%a6
67	movl	%sp@(8),%a0
68	movl	%sp@(12),%d0
69	jsr	%a6@(-0x28e)
70	movl	%sp@+,%a6
71	movl	%d0,%a0			| Comply with ELF ABI
72	rts
73
74ENTRY_NOPROFILE(CreateMsgPort)
75	movl	%a6,%sp@-
76	movl	%pc@(_C_LABEL(SysBase):w),%a6
77	jsr	%a6@(-0x29a)
78	movl	%sp@+,%a6
79	movl	%d0,%a0			| Comply with ELF ABI
80	rts
81
82#ifdef _PRIMARY_BOOT
83ENTRY_NOPROFILE(DeleteMsgPort)
84	movl	%a6,%sp@-
85	movl	%pc@(_C_LABEL(SysBase):w),%a6
86	movl	%sp@(8),%a0
87	jsr	%a6@(-0x2a0)
88	movl	%sp@+,%a6
89	rts
90
91ENTRY_NOPROFILE(DeleteIORequest)
92	movl	%a6,%sp@-
93	movl	%pc@(_C_LABEL(SysBase):w),%a6
94	movl	%sp@(8),%a0
95	jsr	%a6@(-0x294)
96	movl	%sp@+,%a6
97	rts
98#endif
99
100ENTRY_NOPROFILE(OpenDevice)
101	movl	%a6,%sp@-
102	movl	%pc@(_C_LABEL(SysBase):w),%a6
103	movl	%sp@(8),%a0
104	movl	%sp@(12),%d0
105	movl	%sp@(16),%a1
106	movl	%sp@(20),%d1
107	jsr	%a6@(-0x1bc)
108	movl	%sp@+,%a6
109	rts
110
111#ifdef _PRIMARY_BOOT
112ENTRY_NOPROFILE(CloseDevice)
113	movl	%a6,%sp@-
114	movl	%pc@(_C_LABEL(SysBase):w),%a6
115	movl	%sp@(8),%a1
116	jsr	%a6@(-0x1c2)
117	movl	%sp@+,%a6
118	rts
119#endif
120
121ENTRY_NOPROFILE(DoIO)
122	movl	%a6,%sp@-
123	movl	%pc@(_C_LABEL(SysBase):w),%a6
124	movl	%sp@(8),%a1
125	jsr	%a6@(-0x1c8)
126	movl	%sp@+,%a6
127	rts
128#ifdef nomore
129ENTRY_NOPROFILE(CheckIO)
130	movl	%a6,%sp@-
131	movl	%pc@(_C_LABEL(SysBase):w),%a6
132	movl	%sp@(8),%a1
133	jsr	%a6@(-0x1d4)
134	movl	%sp@+,%a6
135	movl	%d0,%a0			| Comply with ELF ABI
136	rts
137#endif
138ENTRY_NOPROFILE(WaitIO)
139	movl	%a6,%sp@-
140	movl	%pc@(_C_LABEL(SysBase):w),%a6
141	movl	%sp@(8),%a1
142	jsr	%a6@(-0x1da)
143	movl	%sp@+,%a6
144	rts
145
146ENTRY_NOPROFILE(SendIO)
147	movl	%a6,%sp@-
148	movl	%pc@(_C_LABEL(SysBase):w),%a6
149	movl	%sp@(8),%a1
150	jsr	%a6@(-0x1ce)
151	movl	%sp@+,%a6
152	rts
153
154ENTRY_NOPROFILE(AbortIO)
155	movl	%a6,%sp@-
156	movl	%pc@(_C_LABEL(SysBase):w),%a6
157	movl	%sp@(8),%a1
158	jsr	%a6@(-0x1e0)
159	movl	%sp@+,%a6
160	rts
161
162ENTRY_NOPROFILE(WaitPort)
163	movl	%a6,%sp@-
164	movl	%pc@(_C_LABEL(SysBase):w),%a6
165	movl	%sp@(8),%a0
166	jsr	%a6@(-0x180)
167	movl	%sp@+,%a6
168	movl	%d0,%a0			| Comply with ELF ABI
169	rts
170
171#ifndef DOINLINES
172ENTRY_NOPROFILE(CacheClearU)
173	movl	%a6,%sp@-
174	movl	%pc@(_C_LABEL(SysBase):w),%a6
175	jsr	%a6@(-0x27c)
176	movl	%sp@+,%a6
177	rts
178#endif
179ENTRY_NOPROFILE(CachePreDMA)
180	movl	%a6,%sp@-
181	movl	%pc@(_C_LABEL(SysBase):w),%a6
182	movl	%sp@(8),%a0
183	movl	%sp@(12),%a1
184	movl	%sp@(16),%d0
185	jsr	%a6@(-0x2fa)
186	movl	%sp@+,%a6
187	rts
188
189ENTRY_NOPROFILE(FindResident)
190	movl	%a6,%sp@-
191	movl	%pc@(_C_LABEL(SysBase):w),%a6
192	movl	%sp@(8),%a1
193	jsr	%a6@(-0x60)
194	movl	%sp@+,%a6
195	movl	%d0,%a0			| Comply with ELF ABI
196	rts
197
198ENTRY_NOPROFILE(OpenResource)
199	movl	%a6,%sp@-
200	movl	%pc@(_C_LABEL(SysBase):w),%a6
201	movl	%sp@(8),%a1
202	jsr	%a6@(-0x1f2)
203	movl	%sp@+,%a6
204	movl	%d0,%a0			| Comply with ELF ABI
205	rts
206#ifdef notyet
207ENTRY_NOPROFILE(Forbid)
208	movl	%a6,%sp@-
209	movl	%pc@(_C_LABEL(SysBase):W),%a6
210	jsr	%a6@(-0x84)
211	movl	%sp@+,%a6
212	rts
213
214ENTRY_NOPROFILE(Permit)
215	movl	%a6,%sp@-
216	movl	%pc@(_C_LABEL(SysBase):W),%a6
217	jsr	%a6@(-0x8a)
218	movl	%sp@+,%a6
219	rts
220#endif
221
222/*
223 * Intuition.library functions.
224 */
225
226	.comm _C_LABEL(IntuitionBase),4
227
228ENTRY_NOPROFILE(OpenScreenTagList)
229	movl	%a6,%sp@-
230	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
231	movl	%sp@(8),%a0
232	movl	%sp@(12),%a1
233	jsr	%a6@(-0x264)
234	movl	%sp@+,%a6
235	movl	%d0,%a0			| Comply with ELF ABI
236	rts
237
238#ifdef _PRIMARY_BOOT
239ENTRY_NOPROFILE(CloseScreen)
240	movl	%a6,%sp@-
241	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
242	movl	%sp@(8),%a0
243	jsr	%a6@(-0x42)
244	movl	%sp@+,%a6
245	rts
246#endif
247
248ENTRY_NOPROFILE(OpenWindowTagList)
249	movl	%a6,%sp@-
250	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
251	movl	%sp@(8),%a0
252	movl	%sp@(12),%a1
253	jsr	%a6@(-0x25e)
254	movl	%sp@+,%a6
255	movl	%d0,%a0			| Comply with ELF ABI
256	rts
257
258#ifdef _PRIMARY_BOOT
259ENTRY_NOPROFILE(CloseWindow)
260	movl	%a6,%sp@-
261	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
262	movl	%sp@(8),%a0
263	jsr	%a6@(-0x48)
264	movl	%sp@+,%a6
265	rts
266#endif
267#ifdef nomore
268ENTRY_NOPROFILE(mytime)
269	movl	%a6,%sp@-
270	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
271	subql	#8,%sp
272	movl	%sp,%a0
273	lea	%sp@(4),%a1
274	jsr	%a6@(-0x54)
275	movl	%sp@+,%d0
276	addql	#4,%sp
277	movl	%sp@+,%a6
278	rts
279#endif
280	.comm _C_LABEL(ExpansionBase),4
281ENTRY_NOPROFILE(FindConfigDev)
282	movl	%a6,%sp@-
283	movl	%pc@(_C_LABEL(ExpansionBase):w),%a6
284	movl	%sp@(8),%a0
285	movl	%sp@(12),%d0
286	movl	%sp@(16),%d1
287	jsr	%a6@(-0x48)
288	movl	%sp@+,%a6
289	movl	%d0,%a0			| Comply with ELF ABI
290	rts
291