romcalls.S revision 1.3 1 /* $NetBSD: romcalls.S,v 1.3 2001/03/03 13:59:10 tsutsui Exp $ */
2
3 /*-
4 * Copyright (C) 1999 Izumi Tsutsui. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29 #include <m68k/asm.h>
30 #include <machine/romcall.h>
31
32 .text
33 .align 4
34
35 ENTRY_NOPROFILE(rom_halt)
36 moveq #8, %d7 | RB_HALT
37 trap #15
38
39 ENTRY_NOPROFILE(rom_open)
40 linkw %a6, #0
41 moveml %d2-%d7/%a2-%a5,%sp@- | save %d2-%d7, %a2-%a5
42 moveq #SYS_open, %d0
43 trap #0
44 moveml %a6@(-40),%d2-%d7/%a2-%a5
45 unlk %a6
46 rts
47
48 ENTRY_NOPROFILE(rom_close)
49 linkw %a6, #0
50 moveml %d2-%d7/%a2-%a5,%sp@- | save %d2-%d7, %a2-%a5
51 moveq #SYS_close, %d0
52 trap #0
53 moveml %a6@(-40),%d2-%d7/%a2-%a5
54 unlk %a6
55 rts
56
57 ENTRY_NOPROFILE(rom_read)
58 linkw %a6, #0
59 moveml %d2-%d7/%a2-%a5,%sp@- | save %d2-%d7, %a2-%a5
60 moveq #SYS_read, %d0
61 trap #0
62 moveml %a6@(-40),%d2-%d7/%a2-%a5
63 unlk %a6
64 rts
65
66 ENTRY_NOPROFILE(rom_write)
67 linkw %a6, #0
68 moveml %d2-%d7/%a2-%a5,%sp@- | save %d2-%d7, %a2-%a5
69 moveq #SYS_write, %d0
70 trap #0
71 moveml %a6@(-40),%d2-%d7/%a2-%a5
72 unlk %a6
73 rts
74
75 ENTRY_NOPROFILE(rom_lseek)
76 linkw %a6, #0
77 moveml %d2-%d7/%a2-%a5,%sp@- | save %d2-%d7, %a2-%a5
78 moveq #SYS_lseek, %d0
79 trap #0
80 moveml %a6@(-40),%d2-%d7/%a2-%a5
81 unlk %a6
82 rts
83