Home | History | Annotate | Line # | Download | only in common
      1  1.5  tsutsui /*	$NetBSD: romcalls.S,v 1.5 2003/04/18 18:52:27 tsutsui Exp $	*/
      2  1.1   tsubai 
      3  1.1   tsubai /*-
      4  1.1   tsubai  * Copyright (C) 1999 Tsubai Masanari.  All rights reserved.
      5  1.1   tsubai  *
      6  1.1   tsubai  * Redistribution and use in source and binary forms, with or without
      7  1.1   tsubai  * modification, are permitted provided that the following conditions
      8  1.1   tsubai  * are met:
      9  1.1   tsubai  * 1. Redistributions of source code must retain the above copyright
     10  1.1   tsubai  *    notice, this list of conditions and the following disclaimer.
     11  1.1   tsubai  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1   tsubai  *    notice, this list of conditions and the following disclaimer in the
     13  1.1   tsubai  *    documentation and/or other materials provided with the distribution.
     14  1.1   tsubai  * 3. The name of the author may not be used to endorse or promote products
     15  1.1   tsubai  *    derived from this software without specific prior written permission.
     16  1.1   tsubai  *
     17  1.1   tsubai  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18  1.1   tsubai  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19  1.1   tsubai  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20  1.1   tsubai  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21  1.1   tsubai  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22  1.1   tsubai  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23  1.1   tsubai  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24  1.1   tsubai  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25  1.1   tsubai  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     26  1.1   tsubai  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27  1.1   tsubai  */
     28  1.1   tsubai 
     29  1.1   tsubai #include <mips/asm.h>
     30  1.1   tsubai #include <mips/cpuregs.h>
     31  1.1   tsubai #include <machine/romcall.h>
     32  1.1   tsubai 
     33  1.1   tsubai 	.text
     34  1.1   tsubai 	.align	2
     35  1.1   tsubai 	.set	noreorder
     36  1.1   tsubai 
     37  1.5  tsutsui LEAF_NOPROFILE(rom_halt)
     38  1.1   tsubai 	addu	sp, sp, -16
     39  1.1   tsubai 	li	a0, 8		# RB_HALT
     40  1.1   tsubai 	sw	a0, 0(sp)
     41  1.1   tsubai 	li	a0, SYS_reboot
     42  1.1   tsubai 	move	a1, sp
     43  1.1   tsubai 	syscall
     44  1.1   tsubai 	nop
     45  1.5  tsutsui END(rom_halt)
     46  1.1   tsubai 
     47  1.5  tsutsui LEAF_NOPROFILE(rom_open)
     48  1.1   tsubai 	addu	sp, sp, -32
     49  1.1   tsubai 	sw	ra, 28(sp)
     50  1.1   tsubai 
     51  1.1   tsubai 	sw	a0, 16(sp)
     52  1.1   tsubai 	sw	a1, 20(sp)
     53  1.1   tsubai 
     54  1.1   tsubai 	li	a0, SYS_open
     55  1.1   tsubai 	addu	a1, sp, 16
     56  1.1   tsubai 	syscall
     57  1.1   tsubai 	nop
     58  1.1   tsubai 
     59  1.1   tsubai 	lw	ra, 28(sp)
     60  1.1   tsubai 	addu	sp, sp, 32
     61  1.1   tsubai 	j	ra
     62  1.1   tsubai 	nop
     63  1.5  tsutsui END(rom_open)
     64  1.1   tsubai 
     65  1.5  tsutsui LEAF_NOPROFILE(rom_close)
     66  1.1   tsubai 	addu	sp, sp, -32
     67  1.1   tsubai 	sw	ra, 28(sp)
     68  1.1   tsubai 
     69  1.1   tsubai 	sw	a0, 16(sp)
     70  1.1   tsubai 
     71  1.1   tsubai 	li	a0, SYS_close
     72  1.1   tsubai 	addu	a1, sp, 16
     73  1.1   tsubai 	syscall
     74  1.1   tsubai 	nop
     75  1.1   tsubai 
     76  1.1   tsubai 	lw	ra, 28(sp)
     77  1.1   tsubai 	addu	sp, sp, 32
     78  1.1   tsubai 	j	ra
     79  1.1   tsubai 	nop
     80  1.5  tsutsui END(rom_close)
     81  1.1   tsubai 
     82  1.5  tsutsui LEAF_NOPROFILE(rom_read)
     83  1.1   tsubai 	addu	sp, sp, -32
     84  1.1   tsubai 	sw	ra, 28(sp)
     85  1.1   tsubai 
     86  1.1   tsubai 	sw	a0, 16(sp)
     87  1.1   tsubai 	sw	a1, 20(sp)
     88  1.1   tsubai 	sw	a2, 24(sp)
     89  1.1   tsubai 
     90  1.1   tsubai 	li	a0, SYS_read
     91  1.1   tsubai 	addu	a1, sp, 16
     92  1.1   tsubai 	syscall
     93  1.1   tsubai 	nop
     94  1.1   tsubai 
     95  1.1   tsubai 	lw	ra, 28(sp)
     96  1.1   tsubai 	addu	sp, sp, 32
     97  1.1   tsubai 	j	ra
     98  1.1   tsubai 	nop
     99  1.5  tsutsui END(rom_read)
    100  1.1   tsubai 
    101  1.5  tsutsui LEAF_NOPROFILE(rom_write)
    102  1.1   tsubai 	addu	sp, sp, -32
    103  1.1   tsubai 	sw	ra, 28(sp)
    104  1.1   tsubai 
    105  1.1   tsubai 	sw	a0, 16(sp)
    106  1.1   tsubai 	sw	a1, 20(sp)
    107  1.1   tsubai 	sw	a2, 24(sp)
    108  1.1   tsubai 
    109  1.1   tsubai 	li	a0, SYS_write
    110  1.1   tsubai 	addu	a1, sp, 16
    111  1.1   tsubai 	syscall
    112  1.1   tsubai 	nop
    113  1.1   tsubai 
    114  1.1   tsubai 	lw	ra, 28(sp)
    115  1.1   tsubai 	addu	sp, sp, 32
    116  1.1   tsubai 	j	ra
    117  1.1   tsubai 	nop
    118  1.5  tsutsui END(rom_write)
    119  1.1   tsubai 
    120  1.5  tsutsui LEAF_NOPROFILE(rom_lseek)
    121  1.1   tsubai 	addu	sp, sp, -32
    122  1.1   tsubai 	sw	ra, 28(sp)
    123  1.1   tsubai 
    124  1.1   tsubai 	sw	a0, 16(sp)
    125  1.1   tsubai 	sw	a1, 20(sp)
    126  1.1   tsubai 	sw	a2, 24(sp)
    127  1.1   tsubai 
    128  1.1   tsubai 	li	a0, SYS_lseek
    129  1.4  tsutsui 	addu	a1, sp, 16
    130  1.4  tsutsui 	syscall
    131  1.4  tsutsui 	nop
    132  1.4  tsutsui 
    133  1.4  tsutsui 	lw	ra, 28(sp)
    134  1.4  tsutsui 	addu	sp, sp, 32
    135  1.4  tsutsui 	j	ra
    136  1.4  tsutsui 	nop
    137  1.5  tsutsui END(rom_lseek)
    138  1.4  tsutsui 
    139  1.5  tsutsui LEAF_NOPROFILE(rom_ioctl)
    140  1.4  tsutsui 	addu	sp, sp, -32
    141  1.4  tsutsui 	sw	ra, 28(sp)
    142  1.4  tsutsui 
    143  1.4  tsutsui 	sw	a0, 16(sp)
    144  1.4  tsutsui 	sw	a1, 20(sp)
    145  1.4  tsutsui 	sw	a2, 24(sp)
    146  1.4  tsutsui 
    147  1.4  tsutsui 	li	a0, SYS_ioctl
    148  1.1   tsubai 	addu	a1, sp, 16
    149  1.1   tsubai 	syscall
    150  1.1   tsubai 	nop
    151  1.1   tsubai 
    152  1.1   tsubai 	lw	ra, 28(sp)
    153  1.1   tsubai 	addu	sp, sp, 32
    154  1.1   tsubai 	j	ra
    155  1.1   tsubai 	nop
    156  1.5  tsutsui END(rom_ioctl)
    157