Home | History | Annotate | Line # | Download | only in boot
libstubs.s revision 1.10
      1 /* $NetBSD: libstubs.s,v 1.10 2009/10/17 11:18:18 mlelstv 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 
     38 ENTRY_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
     49 ENTRY_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
     57 ENTRY_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 
     67 ENTRY_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
     76 ENTRY_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 
     84 ENTRY_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 
     93 ENTRY_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
    105 ENTRY_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 
    114 ENTRY_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
    122 ENTRY_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
    131 ENTRY_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 
    139 ENTRY_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 
    147 ENTRY_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 
    155 ENTRY_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 ENTRY_NOPROFILE(RawIOInit)
    165 	movl	%a6,%sp@-
    166 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    167 	jsr	%a6@(-0x1f8)
    168 	movl	%sp@+,%a6
    169 	rts
    170 ENTRY_NOPROFILE(RawPutChar)
    171 	movl	%a6,%sp@-
    172 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    173 	movl	%sp@(8),%d0
    174 	jsr	%a6@(-0x204)
    175 	movl	%sp@+,%a6
    176 	rts
    177 ENTRY_NOPROFILE(RawMayGetChar)
    178 	movl	%a6,%sp@-
    179 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    180 	jsr	%a6@(-0x1fe)
    181 	movl	%sp@+,%a6
    182 	rts
    183 
    184 #ifndef DOINLINES
    185 ENTRY_NOPROFILE(CacheClearU)
    186 	movl	%a6,%sp@-
    187 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    188 	jsr	%a6@(-0x27c)
    189 	movl	%sp@+,%a6
    190 	rts
    191 #endif
    192 ENTRY_NOPROFILE(CachePreDMA)
    193 	movl	%a6,%sp@-
    194 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    195 	movl	%sp@(8),%a0
    196 	movl	%sp@(12),%a1
    197 	movl	%sp@(16),%d0
    198 	jsr	%a6@(-0x2fa)
    199 	movl	%sp@+,%a6
    200 	rts
    201 
    202 ENTRY_NOPROFILE(FindResident)
    203 	movl	%a6,%sp@-
    204 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    205 	movl	%sp@(8),%a1
    206 	jsr	%a6@(-0x60)
    207 	movl	%sp@+,%a6
    208 	movl	%d0,%a0			| Comply with ELF ABI
    209 	rts
    210 
    211 ENTRY_NOPROFILE(OpenResource)
    212 	movl	%a6,%sp@-
    213 	movl	%pc@(_C_LABEL(SysBase):w),%a6
    214 	movl	%sp@(8),%a1
    215 	jsr	%a6@(-0x1f2)
    216 	movl	%sp@+,%a6
    217 	movl	%d0,%a0			| Comply with ELF ABI
    218 	rts
    219 #ifdef notyet
    220 ENTRY_NOPROFILE(Forbid)
    221 	movl	%a6,%sp@-
    222 	movl	%pc@(_C_LABEL(SysBase):W),%a6
    223 	jsr	%a6@(-0x84)
    224 	movl	%sp@+,%a6
    225 	rts
    226 
    227 ENTRY_NOPROFILE(Permit)
    228 	movl	%a6,%sp@-
    229 	movl	%pc@(_C_LABEL(SysBase):W),%a6
    230 	jsr	%a6@(-0x8a)
    231 	movl	%sp@+,%a6
    232 	rts
    233 #endif
    234 
    235 /*
    236  * Intuition.library functions.
    237  */
    238 
    239 	.comm _C_LABEL(IntuitionBase),4
    240 
    241 ENTRY_NOPROFILE(OpenScreenTagList)
    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@(-0x264)
    247 	movl	%sp@+,%a6
    248 	movl	%d0,%a0			| Comply with ELF ABI
    249 	rts
    250 
    251 #ifdef _PRIMARY_BOOT
    252 ENTRY_NOPROFILE(CloseScreen)
    253 	movl	%a6,%sp@-
    254 	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
    255 	movl	%sp@(8),%a0
    256 	jsr	%a6@(-0x42)
    257 	movl	%sp@+,%a6
    258 	rts
    259 #endif
    260 
    261 ENTRY_NOPROFILE(OpenWindowTagList)
    262 	movl	%a6,%sp@-
    263 	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
    264 	movl	%sp@(8),%a0
    265 	movl	%sp@(12),%a1
    266 	jsr	%a6@(-0x25e)
    267 	movl	%sp@+,%a6
    268 	movl	%d0,%a0			| Comply with ELF ABI
    269 	rts
    270 
    271 #ifdef _PRIMARY_BOOT
    272 ENTRY_NOPROFILE(CloseWindow)
    273 	movl	%a6,%sp@-
    274 	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
    275 	movl	%sp@(8),%a0
    276 	jsr	%a6@(-0x48)
    277 	movl	%sp@+,%a6
    278 	rts
    279 #endif
    280 #ifdef nomore
    281 ENTRY_NOPROFILE(mytime)
    282 	movl	%a6,%sp@-
    283 	movl	%pc@(_C_LABEL(IntuitionBase):w),%a6
    284 	subql	#8,%sp
    285 	movl	%sp,%a0
    286 	lea	%sp@(4),%a1
    287 	jsr	%a6@(-0x54)
    288 	movl	%sp@+,%d0
    289 	addql	#4,%sp
    290 	movl	%sp@+,%a6
    291 	rts
    292 #endif
    293 	.comm _C_LABEL(ExpansionBase),4
    294 ENTRY_NOPROFILE(FindConfigDev)
    295 	movl	%a6,%sp@-
    296 	movl	%pc@(_C_LABEL(ExpansionBase):w),%a6
    297 	movl	%sp@(8),%a0
    298 	movl	%sp@(12),%d0
    299 	movl	%sp@(16),%d1
    300 	jsr	%a6@(-0x48)
    301 	movl	%sp@+,%a6
    302 	movl	%d0,%a0			| Comply with ELF ABI
    303 	rts
    304