Home | History | Annotate | Line # | Download | only in common
romread.S revision 1.1.190.1
      1  1.1.190.1  skrll /*	$NetBSD: romread.S,v 1.1.190.1 2017/08/28 17:51:54 skrll 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  *
     18        1.1   matt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19        1.1   matt  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20        1.1   matt  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21        1.1   matt  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22        1.1   matt  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23        1.1   matt  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24        1.1   matt  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25        1.1   matt  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26        1.1   matt  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27        1.1   matt  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28        1.1   matt  */
     29        1.1   matt 
     30        1.1   matt  /* All bugs are subject to removal without further notice */
     31        1.1   matt 
     32        1.1   matt 
     33        1.1   matt 
     34        1.1   matt #include "../include/asm.h"
     35        1.1   matt 
     36        1.1   matt /*
     37        1.1   matt  * read750 (int block, int *regs)
     38        1.1   matt  */
     39        1.1   matt ENTRY(read750, 0xFFE)
     40        1.1   matt 	movl	8(%ap), %r8
     41        1.1   matt 	movl	4(%r8), %r1
     42        1.1   matt 	movl	8(%r8), %r2
     43        1.1   matt 	movl	12(%r8), %r3
     44        1.1   matt 	movl	24(%r8), %r6
     45        1.1   matt 	clrl	%r5
     46        1.1   matt 	movl	4(%ap), %r8
     47        1.1   matt 	pushl	$0
     48        1.1   matt 	movl	$0, 4(%sp)
     49        1.1   matt 	movl    %fp, 0xf0000	# ragge ???
     50        1.1   matt 	jsb	(%r6)
     51        1.1   matt 	movl    0xf0000, %fp
     52        1.1   matt 	ret
     53        1.1   matt 
     54        1.1   matt /*
     55        1.1   matt  * romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
     56        1.1   matt  */
     57        1.1   matt ENTRY(romread_uvax, 0xFFE)
     58        1.1   matt 	movl	16(%ap),%r11	# restore boot-contents of %r11 (rpb)
     59        1.1   matt 	movl    52(%r11), %r7     # load iovec/bqo into %r7
     60        1.1   matt 	addl3   (%r7), %r7, %r6	# load qio into %r6
     61        1.1   matt 	pushl	%r11		# base of rpb
     62        1.1   matt 	pushl	$0		# virtual-flag
     63        1.1   matt 	pushl	$33		# read-logical-block
     64        1.1   matt 	pushl	4(%ap)		# lbn to start reading
     65        1.1   matt 	pushl	8(%ap)		# number of bytes to read
     66        1.1   matt 	pushl	12(%ap)		# buffer-address
     67        1.1   matt 	calls	$6, (%r6)	# call the qio-routine
     68        1.1   matt 	ret			# %r0 holds the result
     69        1.1   matt 
     70        1.1   matt /*
     71        1.1   matt  * romwrite_uvax (int lbn, int size, void *buf, struct rpb *rpb)
     72        1.1   matt  */
     73        1.1   matt ENTRY(romwrite_uvax, 0xFFE)
     74        1.1   matt 	movl    16(%ap), %r11	# restore boot-contents of %r11 (rpb)
     75        1.1   matt 	movl    52(%r11), %r7     # load iovec/bqo into %r7
     76        1.1   matt 	addl3   (%r7), %r7, %r6    # load qio into %r6
     77        1.1   matt 	pushl   %r11             # base of rpb
     78        1.1   matt 	pushl   $0              # virtual-flag
     79        1.1   matt 	pushl   $32             # write-logical-block
     80        1.1   matt 	pushl   4(%ap)           # lbn to start reading
     81        1.1   matt 	pushl   8(%ap)           # number of bytes to read
     82        1.1   matt 	pushl   12(%ap)          # buffer-address
     83        1.1   matt 	calls   $6, (%r6)        # call the qio-routine
     84        1.1   matt 	ret                     # %r0 holds the result
     85        1.1   matt 
     86