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