PERFORCE change 29107 for review

Marcel Moolenaar marcel at FreeBSD.org
Thu Apr 17 00:21:00 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=29107

Change 29107 by marcel at marcel_nfs on 2003/04/17 00:20:18

	Fix breakage I introduced by the previous commit to mp_machdep.c
	and move some code from locore.s to mp_machdep.c. The previous
	commit to mp_machdep.c was lacking the declaration of M_PMAP.
	We now initialize the pcpup pointer (and ar.k4) from C code.
	This makes it more visible than having it in locore.s.
	While here, remove the volatile modifiers from ap_stack and
	ap_pcpu. It's causing compile warnings without actually being
	required.
	While in locore.s, add explicit bundling and reschedule the
	instructions to get better packing.
	
	Also: don't define ar.k4 when we enter user space. It's an
	CPU invariant.

Affected files ...

.. //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#10 edit
.. //depot/projects/ia64_epc/sys/ia64/ia64/mp_machdep.c#6 edit

Differences ...

==== //depot/projects/ia64_epc/sys/ia64/ia64/locore.s#10 (text+ko) ====

@@ -217,15 +217,9 @@
 	nop		0
 	;;
 }
-{	.mmi
+{	.mmb
 	srlz.d
 	mov		ar.k6=r30
-	nop		0
-	;;
-}
-{	.mmb
-	mov		ar.k4=r13
-	nop		0
 	br.ret.sptk	rp
 	;;
 }
@@ -299,35 +293,50 @@
 	rfi
 
 	.align	32
-2:	movl	r16 = ia64_vector_table			// set up IVT early
+2:
+{	.mlx
+	mov	ar.rsc = 0
+	movl	r16 = ia64_vector_table			// set up IVT early
 	;;
+}
+{	.mlx
 	mov	cr.iva = r16
+	movl	r16 = ap_stack
 	;;
+}
+{	.mmi
 	srlz.i
 	;;
-	movl	r16 = ap_stack
-	movl	r17 = ap_pcpu
-	mov	ar.rsc = 0
-	;;
 	ld8	r16 = [r16]
-	ld8	r17 = [r17]
 	mov	r18 = KSTACK_PAGES*PAGE_SIZE-SIZEOF_PCB-SIZEOF_TRAPFRAME-16
 	;;
-	add	sp = r18, r16
+}
+{	.mlx
 	mov	ar.bspstore = r16
+	movl	gp = __gp
 	;;
+}
+{	.mmi
 	loadrs
-	movl	gp = __gp
+	;;
+	alloc	r17 = ar.pfs, 0, 0, 0, 0
+	add	sp = r18, r16
 	;;
-	mov	ar.k4 = r17
+}
+{	.mfb
 	mov	ar.rsc = 3
-	mov	r13 = r17	/* gas doesn't know tp as an alias for r13 */
+	nop	0
+	br.call.sptk.few rp = ia64_ap_startup
 	;;
-	alloc	r16 = ar.pfs, 0, 0, 0, 0
+}
+	/* NOT REACHED */
+9:
+{	.mfb
+	nop	0
+	nop	0
+	br.sptk	9b
 	;;
-	br.call.sptk.few rp = ia64_ap_startup
-	/* NOT REACHED */
-9:	br	9b
+}
 END(os_boot_rendez)
 
 #endif /* !SMP */

==== //depot/projects/ia64_epc/sys/ia64/ia64/mp_machdep.c#6 (text+ko) ====

@@ -56,6 +56,8 @@
 #include <machine/fpu.h>
 #include <i386/include/specialreg.h>
 
+MALLOC_DECLARE(M_PMAP);
+
 void ia64_ap_startup(void);
 
 extern vm_offset_t vhpt_base, vhpt_size;
@@ -69,8 +71,8 @@
 int	mp_ipi_test = 0;
 
 /* Variables used by os_boot_rendez */
-volatile vm_offset_t ap_stack;
-volatile struct pcpu *ap_pcpu;
+void *ap_stack;
+struct pcpu *ap_pcpu;
 volatile int ap_delay;
 volatile int ap_awake;
 volatile int ap_spin;
@@ -86,6 +88,9 @@
 	__asm __volatile("mov cr.pta=%0;; srlz.i;;" ::
 	    "r" (vhpt_base + (1<<8) + (vhpt_size<<2) + 1));
 
+	pcpup = ap_pcpu;
+	ia64_set_k4((intptr_t)pcpup);
+
 	map_pal_code();
 	map_port_space();
 	map_gateway_page();


More information about the p4-projects mailing list