Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Use cpu_number() to find curpcb, rather tha...



details:   https://anonhg.NetBSD.org/src/rev/a9667353cc0e
branches:  trunk
changeset: 538162:a9667353cc0e
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sun Oct 13 11:20:37 2002 +0000

description:
Use cpu_number() to find curpcb, rather than assuming CPU 0.

diffstat:

 sys/arch/arm/arm/bcopyinout.S |  39 ++++++++++++++++++++++++++++++++++-----
 sys/arch/arm/arm/copystr.S    |  29 ++++++++++++++++++++++++-----
 2 files changed, 58 insertions(+), 10 deletions(-)

diffs (152 lines):

diff -r 97352e4bdad1 -r a9667353cc0e sys/arch/arm/arm/bcopyinout.S
--- a/sys/arch/arm/arm/bcopyinout.S     Sun Oct 13 10:11:31 2002 +0000
+++ b/sys/arch/arm/arm/bcopyinout.S     Sun Oct 13 11:20:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcopyinout.S,v 1.7 2002/10/12 12:20:09 bjh21 Exp $     */
+/*     $NetBSD: bcopyinout.S,v 1.8 2002/10/13 11:20:37 bjh21 Exp $     */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -41,15 +41,14 @@
 
 #include <machine/asm.h>
 
-RCSID("$NetBSD: bcopyinout.S,v 1.7 2002/10/12 12:20:09 bjh21 Exp $")   
+RCSID("$NetBSD: bcopyinout.S,v 1.8 2002/10/13 11:20:37 bjh21 Exp $")   
 
        .text
        .align  0
 
 #ifdef MULTIPROCESSOR
-       /* FIXME: This is bogus in the general case. */
-.Lcurpcb:
-       .word   _C_LABEL(cpu_info_store) + CI_CURPCB
+.Lcpu_info:
+       .word   _C_LABEL(cpu_info)
 #else
 .Lcurpcb:
        .word _C_LABEL(curpcb)
@@ -88,8 +87,18 @@
        moveq   pc, lr
 
        SAVE_REGS
+#ifdef MULTIPROCESSOR
+       /* XXX Probably not appropriate for non-Hydra SMPs */
+       stmfd   sp!, {r0-r2, r14}
+       bl      _C_LABEL(cpu_number)
+       ldr     r4, .Lcpu_info
+       ldr     r4, [r4, r0, lsl #2]
+       ldr     r4, [r4, #CI_CURPCB]
+       ldmfd   sp!, {r0-r2, r14}
+#else
        ldr     r4, .Lcurpcb
        ldr     r4, [r4]
+#endif
 
        ldr     r5, [r4, #PCB_ONFAULT]
        add     r3, pc, #.Lcopyfault - . - 8
@@ -301,8 +310,18 @@
        moveq   pc, lr
 
        SAVE_REGS
+#ifdef MULTIPROCESSOR
+       /* XXX Probably not appropriate for non-Hydra SMPs */
+       stmfd   sp!, {r0-r2, r14}
+       bl      _C_LABEL(cpu_number)
+       ldr     r4, .Lcpu_info
+       ldr     r4, [r4, r0, lsl #2]
+       ldr     r4, [r4, #CI_CURPCB]
+       ldmfd   sp!, {r0-r2, r14}
+#else
        ldr     r4, .Lcurpcb
        ldr     r4, [r4]
+#endif
 
        ldr     r5, [r4, #PCB_ONFAULT]
        add     r3, pc, #.Lcopyfault - . - 8
@@ -504,8 +523,18 @@
        moveq   pc, lr
 
        SAVE_REGS
+#ifdef MULTIPROCESSOR
+       /* XXX Probably not appropriate for non-Hydra SMPs */
+       stmfd   sp!, {r0-r2, r14}
+       bl      _C_LABEL(cpu_number)
+       ldr     r4, .Lcpu_info
+       ldr     r4, [r4, r0, lsl #2]
+       ldr     r4, [r4, #CI_CURPCB]
+       ldmfd   sp!, {r0-r2, r14}
+#else
        ldr     r4, .Lcurpcb
        ldr     r4, [r4]
+#endif
 
        ldr     r5, [r4, #PCB_ONFAULT]
        add     r3, pc, #.Lcopyfault - . - 8
diff -r 97352e4bdad1 -r a9667353cc0e sys/arch/arm/arm/copystr.S
--- a/sys/arch/arm/arm/copystr.S        Sun Oct 13 10:11:31 2002 +0000
+++ b/sys/arch/arm/arm/copystr.S        Sun Oct 13 11:20:37 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copystr.S,v 1.6 2002/10/12 12:20:09 bjh21 Exp $        */
+/*     $NetBSD: copystr.S,v 1.7 2002/10/13 11:20:38 bjh21 Exp $        */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -43,16 +43,15 @@
 #include "assym.h"
 #include <machine/asm.h>
 
-RCSID("$NetBSD: copystr.S,v 1.6 2002/10/12 12:20:09 bjh21 Exp $")
+RCSID("$NetBSD: copystr.S,v 1.7 2002/10/13 11:20:38 bjh21 Exp $")
 
 #include <sys/errno.h>
 
        .text
        .align  0
 #ifdef MULTIPROCESSOR
-       /* FIXME: This is bogus in the general case. */
-.Lcurpcb:
-       .word   _C_LABEL(cpu_info_store) + CI_CURPCB
+.Lcpu_info:
+       .word   _C_LABEL(cpu_info)
 #else
 .Lcurpcb:
        .word   _C_LABEL(curpcb)
@@ -115,8 +114,18 @@
        moveq   r0, #ENAMETOOLONG
        beq     2f
 
+#ifdef MULTIPROCESSOR
+       /* XXX Probably not appropriate for non-Hydra SMPs */
+       stmfd   sp!, {r0-r3, r14}
+       bl      _C_LABEL(cpu_number)
+       ldr     r4, .Lcpu_info
+       ldr     r4, [r4, r0, lsl #2]
+       ldr     r4, [r4, #CI_CURPCB]
+       ldmfd   sp!, {r0-r3, r14}
+#else
        ldr     r4, .Lcurpcb
        ldr     r4, [r4]
+#endif
 
 #ifdef DIAGNOSTIC
        teq     r4, #0x00000000
@@ -162,8 +171,18 @@
        moveq   r0, #ENAMETOOLONG
        beq     2f
 
+#ifdef MULTIPROCESSOR
+       /* XXX Probably not appropriate for non-Hydra SMPs */
+       stmfd   sp!, {r0-r3, r14}
+       bl      _C_LABEL(cpu_number)
+       ldr     r4, .Lcpu_info
+       ldr     r4, [r4, r0, lsl #2]
+       ldr     r4, [r4, #CI_CURPCB]
+       ldmfd   sp!, {r0-r3, r14}
+#else
        ldr     r4, .Lcurpcb
        ldr     r4, [r4]
+#endif
 
 #ifdef DIAGNOSTIC
        teq     r4, #0x00000000



Home | Main Index | Thread Index | Old Index