Author: marius
Date: Mon Jul 25 17:54:05 2011
New Revision: 224353
URL: http://svn.freebsd.org/changeset/base/224353

Log:
  MFC: r222828 (partial)
  
  - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C
    version does.
  - Initialize global registers early in the MP startup code so PCPU can be
    used.

Modified:
  stable/7/sys/sparc64/include/ktr.h
  stable/7/sys/sparc64/sparc64/mp_locore.S
  stable/7/sys/sparc64/sparc64/mp_machdep.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/sparc64/include/ktr.h
==============================================================================
--- stable/7/sys/sparc64/include/ktr.h  Mon Jul 25 17:54:04 2011        
(r224352)
+++ stable/7/sys/sparc64/include/ktr.h  Mon Jul 25 17:54:05 2011        
(r224353)
@@ -82,7 +82,7 @@ l2:   add     r2, 1, r3 ; \
 #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \
        set     mask, r1 ; \
        TEST(ktr_mask, r1, r2, r2, l3) ; \
-       lduw    [PCPU(MID)], r1 ; \
+       lduw    [PCPU(CPUID)], r1 ; \
        mov     1, r2 ; \
        sllx    r2, r1, r1 ; \
        TEST(ktr_cpumask, r1, r2, r3, l3) ; \

Modified: stable/7/sys/sparc64/sparc64/mp_locore.S
==============================================================================
--- stable/7/sys/sparc64/sparc64/mp_locore.S    Mon Jul 25 17:54:04 2011        
(r224352)
+++ stable/7/sys/sparc64/sparc64/mp_locore.S    Mon Jul 25 17:54:05 2011        
(r224353)
@@ -269,13 +269,17 @@ ENTRY(mp_startup)
        add     %l1, %l2, %l1
        sub     %l1, SPOFF + CCFSZ, %sp
 
+       /* Initialize global registers. */
+       call    cpu_setregs
+        mov    %l1, %o0
+
 #if KTR_COMPILE & KTR_SMP
        CATR(KTR_SMP,
            "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx"
            , %g1, %g2, %g3, 7, 8, 9)
-       lduw    [%l1 + PC_CPUID], %g2
+       lduw    [PCPU(CPUID)], %g2
        stx     %g2, [%g1 + KTR_PARM1]
-       lduw    [%l1 + PC_MID], %g2
+       lduw    [PCPU(MID)], %g2
        stx     %g2, [%g1 + KTR_PARM2]
        stx     %l1, [%g1 + KTR_PARM3]
        stx     %sp, [%g1 + KTR_PARM5]

Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/mp_machdep.c   Mon Jul 25 17:54:04 2011        
(r224352)
+++ stable/7/sys/sparc64/sparc64/mp_machdep.c   Mon Jul 25 17:54:05 2011        
(r224353)
@@ -438,9 +438,6 @@ cpu_mp_bootstrap(struct pcpu *pc)
         */
        tlb_flush_nonlocked();
 
-       /* Initialize global registers. */
-       cpu_setregs(pc);
-
        /*
         * Enable interrupts.
         * Note that the PIL we be lowered indirectly via sched_throw(NULL)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to