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