Annotation of sys/arch/vax/boot/boot/consio2.S, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: consio2.S,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
2: /* $NetBSD: consio2.S,v 1.1 2002/02/24 01:04:24 matt Exp $ */
3: /*
4: * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
5: * All rights reserved.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
15: * 3. All advertising materials mentioning features or use of this software
16: * must display the following acknowledgement:
17: * This product includes software developed at Ludd, University of Lule}.
18: * 4. The name of the author may not be used to endorse or promote products
19: * derived from this software without specific prior written permission
20: *
21: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31: */
32:
33: #include <machine/asm.h>
34:
35: /*
36: * int rom_putchar (int c) ==> putchar() using ROM-routines
37: */
38: ENTRY(rom_putchar, 0x0004) # save-mask: R2
39: movl 4(ap), r2 # move argument to R2
40: jsb *_C_LABEL(rom_putc) # write it
41: ret # that is all
42:
43:
44: /*
45: * int rom_getchar (void) ==> getchar() using ROM-routines
46: */
47: ENTRY(rom_getchar, 0x0002) # save-mask: R1
48: loop: # do {
49: jsb *_C_LABEL(rom_getc) # call the getc-routine
50: tstl r0 # check if char ready
51: beql loop # } while (R0 == 0)
52: movl r1, r0 # R1 holds char
53: ret # we are done
54:
55: ENTRY(rom_testchar, 0)
56: mnegl $1,r0
57: jsb *_C_LABEL(rom_getc)
58: tstl r0
59: beql 1f
60: movl r1,r0
61: 1: ret
62:
63: ENTRY(_rtt, 0)
64: halt
65:
66:
67: /*
68: * int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630
69: */
70: ENTRY(ka630_rom_getchar, 0x0802) # save-mask: R1, R11
71: movl _C_LABEL(ka630_conspage),r11 # load location of console page
72: 1: # do {
73: jsb *0x1C(r11) # call the getc-routine (KA630_GETC)
74: blbc r0,1b # } while (R0 == 0)
75: movl r1,r0 # R1 holds char
76: ret # we are done
77:
78: ENTRY(ka630_rom_testchar, 0)
79: movl _C_LABEL(ka630_conspage),r3
80: jsb *0x1C(r3)
81: blbc r0,1f
82: movl r1,r0
83: 1: ret
84:
85: /*
86: * int ka630_rom_putchar (int c) ==> putchar() using ROM-routines on KA630
87: */
88: ENTRY(ka630_rom_putchar, 0x802) # save-mask: R1, R11
89: movl _C_LABEL(ka630_conspage),r11
90: # load location of console page
91: 1: # do {
92: jsb *0x20(r11) # is rom ready? (KA630_PUTC_POLL)
93: blbc r0,1b # } while (R0 == 0)
94: movl 4(ap),r1 # R1 holds char
95: jsb *0x24(r11) # output character (KA630_PUTC)
96: ret # we are done
97:
98: /*
99: * int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53
100: */
101: ENTRY(ka53_rom_getchar, 0x0802) # save-mask: R1, R11
102: movl _C_LABEL(ka53_conspage),r11
103: # load location of console page
104: 1: # do {
105: jsb *0x64(r11) # test for char
106: blbc r0,1b # } while (R0 == 0)
107: jsb *0x6c(r11) # get the char
108: ret # we are done
109:
110: ENTRY(ka53_rom_testchar, 0)
111: movl _C_LABEL(ka53_conspage),r3
112: jsb *0x64(r3)
113: blbc r0,1f
114: jsb *0x6c(r3) # get the char
115: 1: ret
116:
117: /*
118: * int ka53_rom_putchar (int c) ==> putchar() using ROM-routines on KA53
119: */
120: ENTRY(ka53_rom_putchar, 0x0802) # save-mask: R1, R11
121: movl _C_LABEL(ka53_conspage),r11
122: # load location of console page
123: 1: # do {
124: jsb *0x20(r11) # is rom ready?
125: blbc r0,1b # } whi le (R0 == 0)
126: movl 4(ap),r1 # R1 holds char
127: jsb *0x24(r11) # output character
128: ret # we are done
CVSweb