xref: /netbsd/sys/arch/vax/boot/common/romread.S (revision 6550d01e)
1/*	$NetBSD: romread.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */
2/*
3 * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Ludd by
7 * Bertram Barth.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
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
23 *
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.
34 */
35
36 /* All bugs are subject to removal without further notice */
37
38
39
40#include "../include/asm.h"
41
42/*
43 * read750 (int block, int *regs)
44 */
45ENTRY(read750, 0xFFE)
46	movl	8(%ap), %r8
47	movl	4(%r8), %r1
48	movl	8(%r8), %r2
49	movl	12(%r8), %r3
50	movl	24(%r8), %r6
51	clrl	%r5
52	movl	4(%ap), %r8
53	pushl	$0
54	movl	$0, 4(%sp)
55	movl    %fp, 0xf0000	# ragge ???
56	jsb	(%r6)
57	movl    0xf0000, %fp
58	ret
59
60/*
61 * romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
62 */
63ENTRY(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
75
76/*
77 * romwrite_uvax (int lbn, int size, void *buf, struct rpb *rpb)
78 */
79ENTRY(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
91
92