1 /* op50n-io.S -- low-level I/O routines for the Oki OP50N eval board.
3 * Copyright (c) 1995 Cygnus Support
5 * The authors hereby grant permission to use, copy, modify, distribute,
6 * and license this software and its documentation for any purpose, provided
7 * that existing copyright notices are retained in all copies and that this
8 * notice is included verbatim in any distributions. No written agreement,
9 * license, or royalty fee is required for any of the authorized uses.
10 * Modifications to this software may be copyrighted by their authors
11 * and need not follow the licensing terms described here, provided that
12 * the new terms are clearly indicated on the first page of each file where
16 mon_start .EQU 0xd0000000
17 where_dp .EQU mon_start+4*4
18 where_ci .EQU mon_start+14*4
19 where_co .EQU mon_start+15*4
20 where_read .EQU mon_start+22*4
21 where_write .EQU mon_start+23*4
24 *int c = inbyte(wait);
28 .EXPORT inbyte,CODE,ARGW0=GR,RTNVAL=GR
31 .CALLINFO CALLER,FRAME=64,SAVE_RP
35 stw %r27,-56(0,%r30) ; save my dp
36 ldil l%where_dp,%r27 ; load monitors dp
37 ldw r%where_dp(0,%r27),%r27
39 ldw r%where_ci(0,%r1),%r1
42 ldw -56(0,%r30),%r27 ; load my dp
50 /* int c = outbyte(c);
52 .EXPORT outbyte,CODE,ARGW0=GR,RTNVAL=GR
55 .CALLINFO CALLER,FRAME=64,SAVE_RP
59 stw %r27,-56(0,%r30) ; save my dp
60 ldil l%where_dp,%r27 ; load monitors dp
61 ldw r%where_dp(0,%r27),%r27
63 ldw r%where_co(0,%r1),%r1
66 ldw -56(0,%r30),%r27 ; load my dp
75 /* cnt = read(fd, bufp, cnt);
77 .EXPORT read,CODE,ARGW0=NO,ARGW1=NO,ARGW2=NO,ARGW3=NO,RTNVAL=NO
80 .CALLINFO FRAME=64,CALLS,SAVE_RP
84 stw %dp,-56(0,%r30) ; save my dp
85 ldil l%where_dp,%dp ; load monitors dp
86 ldw r%where_dp(0,%dp), %dp
88 ldw r%where_read(0,%r1), %r1
91 ldw -56(0,%r30),%dp ; load my dp
98 /* cnt = write(fd, bufp, cnt);
100 .EXPORT write,CODE,ARGW0=NO,ARGW1=NO,ARGW2=NO,ARGW3=NO,RTNVAL=NO
103 .CALLINFO FRAME=64,CALLS,SAVE_RP
107 stw %dp,-56(0,%r30) ; save my dp
108 ldil l%where_dp,%dp ; load monitors dp
109 ldw r%where_dp(0,%dp), %dp
110 ldil l%where_write,%r1
111 ldw r%where_write(0,%r1), %r1
114 ldw -56(0,%r30),%dp ; load my dp