Home | History | Annotate | Line # | Download | only in libtos
      1 /*	$NetBSD: biosrw.s,v 1.2 2025/11/19 09:43:27 nia Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1995 Waldi Ravens.
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. The name of the author may not be used to endorse or promote products
     16  *    derived from this software without specific prior written permission.
     17  *
     18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28  */
     29 
     30 /* int	bios_read(buffer, offset, count, dev)	*/
     31 
     32 	.globl	_bios_read
     33 	.text
     34 	.even
     35 
     36 _bios_read:
     37 	movml	d1-d2/a1-a2,sp@-
     38 	movl	sp@(24),sp@-		| offset
     39 	movw	sp@(38),sp@-		| device
     40 	movw	#-1,sp@-
     41 	movw	sp@(38),sp@-		| count
     42 	movl	sp@(30),sp@-		| buffer
     43 	movw	#8,sp@-			| read, physical mode
     44 	movw	#4,sp@-
     45 	trap	#13			| Rwabs()
     46 	lea	sp@(18),sp
     47 	movml	sp@+,d1-d2/a1-a2
     48 	rts
     49 
     50 /* int	bios_write(buffer, offset, count, dev)	*/
     51 
     52 	.globl	_bios_write
     53 	.text
     54 	.even
     55 
     56 _bios_write:
     57 	movml	d1-d2/a1-a2,sp@-
     58 	movl	sp@(20),sp@-		| offset
     59 	movw	sp@(34),sp@-		| device
     60 	movw	#-1,sp@-
     61 	movw	sp@(34),sp@-		| count
     62 	movl	sp@(26),sp@-		| buffer
     63 	movw	#9,sp@-			| write, physical mode
     64 	movw	#4,sp@-
     65 	trap	#13			| Rwabs()
     66 	lea	sp@(18),sp
     67 	movml	sp@+,d1-d2/a1-a2
     68 	rts
     69 
     70 /* int	bios_critic(error)			*/
     71 
     72 	.globl	_bios_critic
     73 	.text
     74 	.even
     75 
     76 _bios_critic:
     77 	movw	sp@(4),d0
     78 	extl	d0
     79 	rts
     80