xref: /netbsd-src/sys/arch/amiga/stand/bootblock/boot/libstubs.s (revision 50728e7823a76d5bd1a7bfa3a4eac400269b1339)
1/* $NetBSD: libstubs.s,v 1.9 2008/04/28 20:23:13 martin 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 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*
33 * Exec.library functions.
34 */
35#include <machine/asm.h>
36	.comm _C_LABEL(SysBase),4
37
38ENTRY_NOPROFILE(OpenLibrary)
39	movl	%a6,%sp@-
40	movl	%pc@(_C_LABEL(SysBase):w),%a6
41	movl	%sp@(8),%a1
42	movl	%sp@(12),%d0
43	jsr	%a6@(-0x228)
44	movl	%sp@+,%a6
45	movl	%d0,%a0			| Comply with ELF ABI
46	rts
47
48#ifdef _PRIMARY_BOOT
49ENTRY_NOPROFILE(CloseLibrary)
50	movl	%a6,%sp@-
51	movl	%pc@(_C_LABEL(SysBase):w),%a6
52	movl	%sp@(8),%a1
53	jsr	%a6@(-0x19e)
54	movl	%sp@+,%a6
55	rts
56#endif
57ENTRY_NOPROFILE(CreateIORequest)
58	movl	%a6,%sp@-
59	movl	%pc@(_C_LABEL(SysBase):w),%a6
60	movl	%sp@(8),%a0
61	movl	%sp@(12),%d0
62	jsr	%a6@(-0x28e)
63	movl	%sp@+,%a6
64	movl	%d0,%a0			| Comply with ELF ABI
65	rts
66
67ENTRY_NOPROFILE(CreateMsgPort)
68	movl	%a6,%sp@-
69	movl	%pc@(_C_LABEL(SysBase):w),%a6
70	jsr	%a6@(-0x29a)
71	movl	%sp@+,%a6
72	movl	%d0,%a0			| Comply with ELF ABI
73	rts
74
75#ifdef _PRIMARY_BOOT
76ENTRY_NOPROFILE(DeleteMsgPort)
77	movl	%a6,%sp@-
78	movl	%pc@(_C_LABEL(SysBase):w),%a6
79	movl	%sp@(8),%a0
80	jsr	%a6@(-0x2a0)
81	movl	%sp@+,%a6
82	rts
83
84ENTRY_NOPROFILE(DeleteIORequest)
85	movl	%a6,%sp@-
86	movl	%pc@(_C_LABEL(SysBase):w),%a6
87	movl	%sp@(8),%a0
88	jsr	%a6@(-0x294)
89	movl	%sp@+,%a6
90	rts
91#endif
92
93ENTRY_NOPROFILE(OpenDevice)
94	movl	%a6,%sp@-
95	movl	%pc@(_C_LABEL(SysBase):w),%a6
96	movl	%sp@(8),%a0
97	movl	%sp@(12),%d0
98	movl	%sp@(16),%a1
99	movl	%sp@(20),%d1
100	jsr	%a6@(-0x1bc)
101	movl	%sp@+,%a6
102	rts
103
104#ifdef _PRIMARY_BOOT
105ENTRY_NOPROFILE(CloseDevice)
106	movl	%a6,%sp@-
107	movl	%pc@(_C_LABEL(SysBase):w),%a6
108	movl	%sp@(8),%a1
109	jsr	%a6@(-0x1c2)
110	movl	%sp@+,%a6
111	rts
112#endif
113
114ENTRY_NOPROFILE(DoIO)
115	movl	%a6,%sp@-
116	movl	%pc@(_C_LABEL(SysBase):w),%a6
117	movl	%sp@(8),%a1
118	jsr	%a6@(-0x1c8)
119	movl	%sp@+,%a6
120	rts
121#ifdef nomore
122ENTRY_NOPROFILE(CheckIO)
123	movl	%a6,%sp@-
124	movl	%pc@(_C_LABEL(SysBase):w),%a6
125	movl	%sp@(8),%a1
126	jsr	%a6@(-0x1d4)
127	movl	%sp@+,%a6
128	movl	%d0,%a0			| Comply with ELF ABI
129	rts
130#endif
131ENTRY_NOPROFILE(WaitIO)
132	movl	%a6,%sp@-
133	movl	%pc@(_C_LABEL(SysBase):w),%a6
134	movl	%sp@(8),%a1
135	jsr	%a6@(-0x1da)
136	movl	%sp@+,%a6
137	rts
138
139ENTRY_NOPROFILE(SendIO)
140	movl	%a6,%sp@-
141	movl	%pc@(_C_LABEL(SysBase):w),%a6
142	movl	%sp@(8),%a1
143	jsr	%a6@(-0x1ce)
144	movl	%sp@+,%a6
145	rts
146
147ENTRY_NOPROFILE(AbortIO)
148	movl	%a6,%sp@-
149	movl	%pc@(_C_LABEL(SysBase):w),%a6
150	movl	%sp@(8),%a1
151	jsr	%a6@(-0x1e0)
152	movl	%sp@+,%a6
153	rts
154
155ENTRY_NOPROFILE(WaitPort)
156	movl	%a6,%sp@-
157	movl	%pc@(_C_LABEL(SysBase):w),%a6
158	movl	%sp@(8),%a0
159	jsr	%a6@(-0x180)
160	movl	%sp@+,%a6
161	movl	%d0,%a0			| Comply with ELF ABI
162	rts
163
164#ifndef DOINLINES
165ENTRY_NOPROFILE(CacheClearU)
166	movl	%a6,%sp@-
167	movl	%pc@(_C_LABEL(SysBase):w),%a6
168	jsr	%a6@(-0x27c)
169	movl	%sp@+,%a6
170	rts
171#endif
172ENTRY_NOPROFILE(CachePreDMA)
173	movl	%a6,%sp@-
174	movl	%pc@(_C_LABEL(SysBase):w),%a6
175	movl	%sp@(8),%a0
176	movl	%sp@(12),%a1
177	movl	%sp@(16),%d0
178	jsr	%a6@(-0x2fa)
179	movl	%sp@+,%a6
180	rts
181
182ENTRY_NOPROFILE(FindResident)
183	movl	%a6,%sp@-
184	movl	%pc@(_C_LABEL(SysBase):w),%a6
185	movl	%sp@(8),%a1
186	jsr	%a6@(-0x60)
187	movl	%sp@+,%a6
188	movl	%d0,%a0			| Comply with ELF ABI
189	rts
190
191ENTRY_NOPROFILE(OpenResource)
192	movl	%a6,%sp@-
193	movl	%pc@(_C_LABEL(SysBase):w),%a6
194	movl	%sp@(8),%a1
195	jsr	%a6@(-0x1f2)
196	movl	%sp@+,%a6
197	movl	%d0,%a0			| Comply with ELF ABI
198	rts
199#ifdef notyet
200ENTRY_NOPROFILE(Forbid)
201	movl	%a6,%sp@-
202	movl	%pc@(_C_LABEL(SysBase):W),%a6
203	jsr	%a6@(-0x84)
204	movl	%sp@+,%a6
205	rts
206
207ENTRY_NOPROFILE(Permit)
208	movl	%a6,%sp@-
209	movl	%pc@(_C_LABEL(SysBase):W),%a6
210	jsr	%a6@(-0x8a)
211	movl	%sp@+,%a6
212	rts
213#endif
214
215/*
216 * Intuition.library functions.
217 */
218
219	.comm _C_LABEL(IntuitionBase),4
220
221ENTRY_NOPROFILE(OpenScreenTagList)
222	movl	%a6,%sp@-
223	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
224	movl	%sp@(8),%a0
225	movl	%sp@(12),%a1
226	jsr	%a6@(-0x264)
227	movl	%sp@+,%a6
228	movl	%d0,%a0			| Comply with ELF ABI
229	rts
230
231#ifdef _PRIMARY_BOOT
232ENTRY_NOPROFILE(CloseScreen)
233	movl	%a6,%sp@-
234	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
235	movl	%sp@(8),%a0
236	jsr	%a6@(-0x42)
237	movl	%sp@+,%a6
238	rts
239#endif
240
241ENTRY_NOPROFILE(OpenWindowTagList)
242	movl	%a6,%sp@-
243	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
244	movl	%sp@(8),%a0
245	movl	%sp@(12),%a1
246	jsr	%a6@(-0x25e)
247	movl	%sp@+,%a6
248	movl	%d0,%a0			| Comply with ELF ABI
249	rts
250
251#ifdef _PRIMARY_BOOT
252ENTRY_NOPROFILE(CloseWindow)
253	movl	%a6,%sp@-
254	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
255	movl	%sp@(8),%a0
256	jsr	%a6@(-0x48)
257	movl	%sp@+,%a6
258	rts
259#endif
260#ifdef nomore
261ENTRY_NOPROFILE(mytime)
262	movl	%a6,%sp@-
263	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
264	subql	#8,%sp
265	movl	%sp,%a0
266	lea	%sp@(4),%a1
267	jsr	%a6@(-0x54)
268	movl	%sp@+,%d0
269	addql	#4,%sp
270	movl	%sp@+,%a6
271	rts
272#endif
273	.comm _C_LABEL(ExpansionBase),4
274ENTRY_NOPROFILE(FindConfigDev)
275	movl	%a6,%sp@-
276	movl	%pc@(_C_LABEL(ExpansionBase):w),%a6
277	movl	%sp@(8),%a0
278	movl	%sp@(12),%d0
279	movl	%sp@(16),%d1
280	jsr	%a6@(-0x48)
281	movl	%sp@+,%a6
282	movl	%d0,%a0			| Comply with ELF ABI
283	rts
284