Home | History | Annotate | Line # | Download | only in common
romread.S revision 1.1
      1  1.1  matt /*	$NetBSD: romread.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */
      2  1.1  matt /*
      3  1.1  matt  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
      4  1.1  matt  * All rights reserved.
      5  1.1  matt  *
      6  1.1  matt  * This code is derived from software contributed to Ludd by
      7  1.1  matt  * Bertram Barth.
      8  1.1  matt  *
      9  1.1  matt  * Redistribution and use in source and binary forms, with or without
     10  1.1  matt  * modification, are permitted provided that the following conditions
     11  1.1  matt  * are met:
     12  1.1  matt  * 1. Redistributions of source code must retain the above copyright
     13  1.1  matt  *    notice, this list of conditions and the following disclaimer.
     14  1.1  matt  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  matt  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  matt  *    documentation and/or other materials provided with the distribution.
     17  1.1  matt  * 3. All advertising materials mentioning features or use of this software
     18  1.1  matt  *    must display the following acknowledgement:
     19  1.1  matt  *      This product includes software developed at Ludd, University of
     20  1.1  matt  *      Lule}, Sweden and its contributors.
     21  1.1  matt  * 4. The name of the author may not be used to endorse or promote products
     22  1.1  matt  *    derived from this software without specific prior written permission
     23  1.1  matt  *
     24  1.1  matt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     25  1.1  matt  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     26  1.1  matt  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     27  1.1  matt  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     28  1.1  matt  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     29  1.1  matt  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     30  1.1  matt  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     31  1.1  matt  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     32  1.1  matt  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     33  1.1  matt  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     34  1.1  matt  */
     35  1.1  matt 
     36  1.1  matt  /* All bugs are subject to removal without further notice */
     37  1.1  matt 
     38  1.1  matt 
     39  1.1  matt 
     40  1.1  matt #include "../include/asm.h"
     41  1.1  matt 
     42  1.1  matt /*
     43  1.1  matt  * read750 (int block, int *regs)
     44  1.1  matt  */
     45  1.1  matt ENTRY(read750, 0xFFE)
     46  1.1  matt 	movl	8(%ap), %r8
     47  1.1  matt 	movl	4(%r8), %r1
     48  1.1  matt 	movl	8(%r8), %r2
     49  1.1  matt 	movl	12(%r8), %r3
     50  1.1  matt 	movl	24(%r8), %r6
     51  1.1  matt 	clrl	%r5
     52  1.1  matt 	movl	4(%ap), %r8
     53  1.1  matt 	pushl	$0
     54  1.1  matt 	movl	$0, 4(%sp)
     55  1.1  matt 	movl    %fp, 0xf0000	# ragge ???
     56  1.1  matt 	jsb	(%r6)
     57  1.1  matt 	movl    0xf0000, %fp
     58  1.1  matt 	ret
     59  1.1  matt 
     60  1.1  matt /*
     61  1.1  matt  * romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
     62  1.1  matt  */
     63  1.1  matt ENTRY(romread_uvax, 0xFFE)
     64  1.1  matt 	movl	16(%ap),%r11	# restore boot-contents of %r11 (rpb)
     65  1.1  matt 	movl    52(%r11), %r7     # load iovec/bqo into %r7
     66  1.1  matt 	addl3   (%r7), %r7, %r6	# load qio into %r6
     67  1.1  matt 	pushl	%r11		# base of rpb
     68  1.1  matt 	pushl	$0		# virtual-flag
     69  1.1  matt 	pushl	$33		# read-logical-block
     70  1.1  matt 	pushl	4(%ap)		# lbn to start reading
     71  1.1  matt 	pushl	8(%ap)		# number of bytes to read
     72  1.1  matt 	pushl	12(%ap)		# buffer-address
     73  1.1  matt 	calls	$6, (%r6)	# call the qio-routine
     74  1.1  matt 	ret			# %r0 holds the result
     75  1.1  matt 
     76  1.1  matt /*
     77  1.1  matt  * romwrite_uvax (int lbn, int size, void *buf, struct rpb *rpb)
     78  1.1  matt  */
     79  1.1  matt ENTRY(romwrite_uvax, 0xFFE)
     80  1.1  matt 	movl    16(%ap), %r11	# restore boot-contents of %r11 (rpb)
     81  1.1  matt 	movl    52(%r11), %r7     # load iovec/bqo into %r7
     82  1.1  matt 	addl3   (%r7), %r7, %r6    # load qio into %r6
     83  1.1  matt 	pushl   %r11             # base of rpb
     84  1.1  matt 	pushl   $0              # virtual-flag
     85  1.1  matt 	pushl   $32             # write-logical-block
     86  1.1  matt 	pushl   4(%ap)           # lbn to start reading
     87  1.1  matt 	pushl   8(%ap)           # number of bytes to read
     88  1.1  matt 	pushl   12(%ap)          # buffer-address
     89  1.1  matt 	calls   $6, (%r6)        # call the qio-routine
     90  1.1  matt 	ret                     # %r0 holds the result
     91  1.1  matt 
     92