| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bcopy.S,v 1.11 2010/03/20 23:31:30 chs Exp $ */ | | 1 | /* $NetBSD: bcopy.S,v 1.12 2011/01/22 10:58:44 skrll Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2002 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2002 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 Matthew Fredette. | | 8 | * by Matthew Fredette. |
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. |
| @@ -23,35 +23,38 @@ | | | @@ -23,35 +23,38 @@ |
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 | /* | | 32 | /* |
33 | * Copy routines for NetBSD/hppa. | | 33 | * Copy routines for NetBSD/hppa. |
34 | */ | | 34 | */ |
35 | | | 35 | |
| | | 36 | #include "opt_multiprocessor.h" |
| | | 37 | |
36 | #undef _LOCORE | | 38 | #undef _LOCORE |
37 | #define _LOCORE /* XXX fredette - unfortunate */ | | 39 | #define _LOCORE /* XXX fredette - unfortunate */ |
38 | | | 40 | |
| | | 41 | #include <machine/cpu.h> |
39 | #include <machine/asm.h> | | 42 | #include <machine/asm.h> |
40 | #include <machine/frame.h> | | 43 | #include <machine/frame.h> |
41 | #include <machine/reg.h> | | 44 | #include <machine/reg.h> |
42 | | | 45 | |
43 | #if defined(LIBC_SCCS) && !defined(lint) | | 46 | #if defined(LIBC_SCCS) && !defined(lint) |
44 | RCSID("$NetBSD: bcopy.S,v 1.11 2010/03/20 23:31:30 chs Exp $") | | 47 | RCSID("$NetBSD: bcopy.S,v 1.12 2011/01/22 10:58:44 skrll Exp $") |
45 | #endif /* LIBC_SCCS and not lint */ | | 48 | #endif /* LIBC_SCCS and not lint */ |
46 | | | 49 | |
47 | /* | | 50 | /* |
48 | * The stbys instruction is a little asymmetric. When (%r2 & 3) | | 51 | * The stbys instruction is a little asymmetric. When (%r2 & 3) |
49 | * is zero, stbys,b,m %r1, 4(%r2) works like stws,ma. You | | 52 | * is zero, stbys,b,m %r1, 4(%r2) works like stws,ma. You |
50 | * might then wish that when (%r2 & 3) == 0, stbys,e,m %r1, -4(%r2) | | 53 | * might then wish that when (%r2 & 3) == 0, stbys,e,m %r1, -4(%r2) |
51 | * worked like stws,mb. But it doesn't. | | 54 | * worked like stws,mb. But it doesn't. |
52 | * | | 55 | * |
53 | * This macro works around this problem. It requires that %t2 | | 56 | * This macro works around this problem. It requires that %t2 |
54 | * hold the number of bytes that will be written by this store | | 57 | * hold the number of bytes that will be written by this store |
55 | * (meaning that it ranges from one to four). | | 58 | * (meaning that it ranges from one to four). |
56 | * | | 59 | * |
57 | * Watch the delay-slot trickery here. The comib is used to set | | 60 | * Watch the delay-slot trickery here. The comib is used to set |
| @@ -488,27 +491,27 @@ RCSID("$NetBSD: bcopy.S,v 1.11 2010/03/2 | | | @@ -488,27 +491,27 @@ RCSID("$NetBSD: bcopy.S,v 1.11 2010/03/2 |
488 | #include "assym.h" | | 491 | #include "assym.h" |
489 | | | 492 | |
490 | /* | | 493 | /* |
491 | * int spcopy(pa_space_t ssp, const void *src, pa_space_t dsp, void *dst, | | 494 | * int spcopy(pa_space_t ssp, const void *src, pa_space_t dsp, void *dst, |
492 | * size_t len) | | 495 | * size_t len) |
493 | * | | 496 | * |
494 | * We assume that the regions do not overlap. | | 497 | * We assume that the regions do not overlap. |
495 | */ | | 498 | */ |
496 | LEAF_ENTRY(spcopy) | | 499 | LEAF_ENTRY(spcopy) |
497 | | | 500 | |
498 | /* | | 501 | /* |
499 | * Setup the fault handler, which will fill in %ret0 if triggered. | | 502 | * Setup the fault handler, which will fill in %ret0 if triggered. |
500 | */ | | 503 | */ |
501 | mfctl CR_CURLWP, %r31 | | 504 | GET_CURLWP(%r31) |
502 | #ifdef DIAGNOSTIC | | 505 | #ifdef DIAGNOSTIC |
503 | comb,<>,n %r0, %r31, Lspcopy_curlwp_ok | | 506 | comb,<>,n %r0, %r31, Lspcopy_curlwp_ok |
504 | ldil L%panic, %r1 | | 507 | ldil L%panic, %r1 |
505 | ldil L%Lspcopy_curlwp_bad, %arg0 | | 508 | ldil L%Lspcopy_curlwp_bad, %arg0 |
506 | ldo R%panic(%r1), %r1 | | 509 | ldo R%panic(%r1), %r1 |
507 | ldo R%Lspcopy_curlwp_bad(%arg0), %arg0 | | 510 | ldo R%Lspcopy_curlwp_bad(%arg0), %arg0 |
508 | .call | | 511 | .call |
509 | bv,n %r0(%r1) | | 512 | bv,n %r0(%r1) |
510 | nop | | 513 | nop |
511 | Lspcopy_curlwp_bad: | | 514 | Lspcopy_curlwp_bad: |
512 | .asciz "spcopy: curlwp == NULL\n" | | 515 | .asciz "spcopy: curlwp == NULL\n" |
513 | .align 8 | | 516 | .align 8 |
514 | Lspcopy_curlwp_ok: | | 517 | Lspcopy_curlwp_ok: |