Mon Jan 10 16:43:30 2011 UTC ()
Add hazard nops required by MIPS1 in noreorder case.
(Umm, is it easier to remove noreorder and all BDslot insns?)


(tsutsui)
diff -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootinit.S
diff -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootread.S
diff -r1.7 -r1.8 src/sys/arch/pmax/stand/common/clear_cache.S
diff -r1.7 -r1.8 src/sys/arch/pmax/stand/common/printf.S
diff -r1.3 -r1.4 src/sys/arch/pmax/stand/common/getchar.S

cvs diff -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootinit.S (switch to unified diff)

--- src/sys/arch/pmax/stand/common/bootinit.S 2011/01/10 15:25:15 1.6
+++ src/sys/arch/pmax/stand/common/bootinit.S 2011/01/10 16:43:29 1.7
@@ -1,43 +1,44 @@ @@ -1,43 +1,44 @@
1/* $NetBSD: bootinit.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ 1/* $NetBSD: bootinit.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jonathan Stone, Michael Hitch and Simon Burge. 8 * by Jonathan Stone, Michael Hitch and Simon Burge.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <mips/asm.h> 32#include <mips/asm.h>
33#include <mips/cpuregs.h> 33#include <mips/cpuregs.h>
34#include <machine/dec_prom.h> 34#include <machine/dec_prom.h>
35 35
36 .set noreorder 36 .set noreorder
37LEAF(bootinit) 37LEAF(bootinit)
38 lw v0, _C_LABEL(callv) # get pointer to call back vectors 38 lw v0, _C_LABEL(callv) # get pointer to call back vectors
 39 nop
39 lw v0, 0x54(v0) # offset for callv->_bootinit 40 lw v0, 0x54(v0) # offset for callv->_bootinit
40 nop 41 nop
41 j v0 # call PROM bootinit 42 j v0 # call PROM bootinit
42 nop 43 nop
43END(bootinit) 44END(bootinit)

cvs diff -r1.6 -r1.7 src/sys/arch/pmax/stand/common/bootread.S (switch to unified diff)

--- src/sys/arch/pmax/stand/common/bootread.S 2011/01/10 15:25:15 1.6
+++ src/sys/arch/pmax/stand/common/bootread.S 2011/01/10 16:43:29 1.7
@@ -1,43 +1,44 @@ @@ -1,43 +1,44 @@
1/* $NetBSD: bootread.S,v 1.6 2011/01/10 15:25:15 tsutsui Exp $ */ 1/* $NetBSD: bootread.S,v 1.7 2011/01/10 16:43:29 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jonathan Stone, Michael Hitch and Simon Burge. 8 * by Jonathan Stone, Michael Hitch and Simon Burge.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <mips/asm.h> 32#include <mips/asm.h>
33#include <mips/cpuregs.h> 33#include <mips/cpuregs.h>
34#include <machine/dec_prom.h> 34#include <machine/dec_prom.h>
35 35
36 .set noreorder 36 .set noreorder
37LEAF(bootread) 37LEAF(bootread)
38 lw v0, _C_LABEL(callv) # get pointer to call back vectors 38 lw v0, _C_LABEL(callv) # get pointer to call back vectors
 39 nop
39 lw v0, 0x58(v0) # offset for callv->_bootread 40 lw v0, 0x58(v0) # offset for callv->_bootread
40 nop 41 nop
41 j v0 # call PROM bootread 42 j v0 # call PROM bootread
42 nop 43 nop
43END(bootread) 44END(bootread)

cvs diff -r1.7 -r1.8 src/sys/arch/pmax/stand/common/clear_cache.S (switch to unified diff)

--- src/sys/arch/pmax/stand/common/clear_cache.S 2011/01/10 15:25:15 1.7
+++ src/sys/arch/pmax/stand/common/clear_cache.S 2011/01/10 16:43:29 1.8
@@ -1,43 +1,44 @@ @@ -1,43 +1,44 @@
1/* $NetBSD: clear_cache.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ 1/* $NetBSD: clear_cache.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jonathan Stone, Michael Hitch and Simon Burge. 8 * by Jonathan Stone, Michael Hitch and Simon Burge.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <mips/asm.h> 32#include <mips/asm.h>
33#include <mips/cpuregs.h> 33#include <mips/cpuregs.h>
34#include <machine/dec_prom.h> 34#include <machine/dec_prom.h>
35 35
36 .set noreorder 36 .set noreorder
37LEAF(clear_cache) 37LEAF(clear_cache)
38 lw v0, _C_LABEL(callv) # get pointer to call back vectors 38 lw v0, _C_LABEL(callv) # get pointer to call back vectors
 39 nop
39 lw v0, 0x7c(v0) # offset for callv->_clear_cache 40 lw v0, 0x7c(v0) # offset for callv->_clear_cache
40 nop 41 nop
41 j v0 # call PROM clear_cache 42 j v0 # call PROM clear_cache
42 nop 43 nop
43END(clear_cache) 44END(clear_cache)

cvs diff -r1.7 -r1.8 src/sys/arch/pmax/stand/common/printf.S (switch to unified diff)

--- src/sys/arch/pmax/stand/common/printf.S 2011/01/10 15:25:15 1.7
+++ src/sys/arch/pmax/stand/common/printf.S 2011/01/10 16:43:29 1.8
@@ -1,62 +1,63 @@ @@ -1,62 +1,63 @@
1/* $NetBSD: printf.S,v 1.7 2011/01/10 15:25:15 tsutsui Exp $ */ 1/* $NetBSD: printf.S,v 1.8 2011/01/10 16:43:29 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jonathan Stone, Michael Hitch and Simon Burge. 8 * by Jonathan Stone, Michael Hitch and Simon Burge.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <mips/asm.h> 32#include <mips/asm.h>
33#include <mips/cpuregs.h> 33#include <mips/cpuregs.h>
34#include <machine/dec_prom.h> 34#include <machine/dec_prom.h>
35 35
36 .set noreorder 36 .set noreorder
37LEAF(printf) 37LEAF(printf)
38 lw v0, _C_LABEL(callv) # get pointer to call back vectors 38 lw v0, _C_LABEL(callv) # get pointer to call back vectors
 39 nop
39 lw t9, 0x30(v0) # offset for callv->_printf 40 lw t9, 0x30(v0) # offset for callv->_printf
40 nop 41 nop
41#ifdef __mips_n32 42#ifdef __mips_n32
42 /* 43 /*
43 * If someone calls printf with more than 4 args on n32, 44 * If someone calls printf with more than 4 args on n32,
44 * we need to synthesize a o32 call. For now we assume no more than 45 * we need to synthesize a o32 call. For now we assume no more than
45 * 8 arguments and no 64bit values. 46 * 8 arguments and no 64bit values.
46 */ 47 */
47 subu sp, sp, 48 48 subu sp, sp, 48
48 sw a4, 16(sp) 49 sw a4, 16(sp)
49 sw a5, 20(sp) 50 sw a5, 20(sp)
50 sw a6, 24(sp) 51 sw a6, 24(sp)
51 sw a7, 28(sp) 52 sw a7, 28(sp)
52 sw ra, 44(sp) 53 sw ra, 44(sp)
53 jalr t9 # call PROM printf 54 jalr t9 # call PROM printf
54 nop 55 nop
55 lw ra, 44(sp) 56 lw ra, 44(sp)
56 j ra 57 j ra
57 addu sp, sp, 48 58 addu sp, sp, 48
58#else 59#else
59 j t9 # call PROM printf 60 j t9 # call PROM printf
60 nop 61 nop
61#endif 62#endif
62END(printf) 63END(printf)

cvs diff -r1.3 -r1.4 src/sys/arch/pmax/stand/common/getchar.S (switch to unified diff)

--- src/sys/arch/pmax/stand/common/getchar.S 2011/01/10 15:25:15 1.3
+++ src/sys/arch/pmax/stand/common/getchar.S 2011/01/10 16:43:29 1.4
@@ -1,43 +1,44 @@ @@ -1,43 +1,44 @@
1/* $NetBSD: getchar.S,v 1.3 2011/01/10 15:25:15 tsutsui Exp $ */ 1/* $NetBSD: getchar.S,v 1.4 2011/01/10 16:43:29 tsutsui Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jonathan Stone, Michael Hitch and Simon Burge. 8 * by Jonathan Stone, Michael Hitch and Simon Burge.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <mips/asm.h> 32#include <mips/asm.h>
33#include <mips/cpuregs.h> 33#include <mips/cpuregs.h>
34#include <machine/dec_prom.h> 34#include <machine/dec_prom.h>
35 35
36 .set noreorder 36 .set noreorder
37LEAF(getchar) 37LEAF(getchar)
38 lw v0, _C_LABEL(callv) # get pointer to call back vectors 38 lw v0, _C_LABEL(callv) # get pointer to call back vectors
 39 nop
39 lw v0, 0x24(v0) # offset for callv->_getchar 40 lw v0, 0x24(v0) # offset for callv->_getchar
40 nop 41 nop
41 j v0 # call PROM getchar 42 j v0 # call PROM getchar
42 nop 43 nop
43END(getchar) 44END(getchar)