libstubs.s revision 1.7.8.2 1 /* $NetBSD: libstubs.s,v 1.7.8.2 2002/01/08 00:23:00 nathanw 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
45 ENTRY_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
56 ENTRY_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
64 ENTRY_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
74 ENTRY_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
83 ENTRY_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
91 ENTRY_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
100 ENTRY_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
112 ENTRY_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
121 ENTRY_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
129 ENTRY_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
138 ENTRY_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
146 ENTRY_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
154 ENTRY_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
162 ENTRY_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
172 ENTRY_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
179 ENTRY_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
189 ENTRY_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
198 ENTRY_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
207 ENTRY_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
214 ENTRY_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
228 ENTRY_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
239 ENTRY_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
248 ENTRY_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
259 ENTRY_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
268 ENTRY_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
281 ENTRY_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