PERFORCE change 27690 for review

Marcel Moolenaar marcel at FreeBSD.org
Sun Mar 30 20:41:35 PST 2003


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

Change 27690 by marcel at marcel_nfs on 2003/03/30 20:41:27

	o  Save ar.csd and ar.ssd in _get_caller_saved().
	o  Restore ar.csd and ar.ssd in _set_caller_saved().
	o  Add _setcontext() and _getcontext() for use by
	   the getcontext() and setcontext() syscall and for
	   use by cpu_switch(), savectx() and restorectx().
	o  Add explicit bundling to _set_caller_saved().

Affected files ...

.. //depot/projects/ia64_epc/sys/ia64/ia64/context.s#5 edit

Differences ...

==== //depot/projects/ia64_epc/sys/ia64/ia64/context.s#5 (text+ko) ====

@@ -32,6 +32,86 @@
 	.section	.text.context, "ax"
 
 /*
+ * _getcontext(ucontext_t *ucp)
+ */
+ENTRY(_getcontext, 1)
+{	.mii
+1:	nop		0
+	mov		r17=ip
+	add		r16=UC_MCONTEXT+MC_SPECIAL,r32
+	;;
+}
+{	.mfb
+	add		r17=2f-1b,r17
+	nop		0
+	br.sptk		_get_special_sync
+	;;
+}
+{	.mmi
+2:	alloc		loc0=ar.pfs,1,2,1,0
+	;;
+	add		in0=UC_MCONTEXT,in0
+	mov		loc1=rp
+	;;
+}
+{	.mmb
+	st8		[in0]=r0
+	add		out0=MC_PRESERVED,in0
+	br.call.sptk	rp=_get_callee_saved
+	;;
+}
+{	.mib
+	add		out0=MC_PRESERVED_FP,in0
+	add		in0=8,in0
+	br.call.sptk	rp=_get_callee_saved_fp
+	;;
+}
+{	.mii
+	st8		[in0]=r0
+	mov		ar.pfs=loc0
+	mov		rp=loc1
+	;;
+}
+{	.mfb
+	nop		0
+	nop		0
+	br.ret.sptk	rp
+	;;
+}
+END(_getcontext)
+
+/*
+ * _setcontext(ucontext_t *ucp)
+ */
+ENTRY(_setcontext, 1)
+{	.mmi
+	alloc		loc0=ar.pfs,1,2,1,0
+	;;
+	nop		0
+	mov		loc1=rp
+	;;
+}
+{	.mib
+	nop		0
+	add		out0=UC_MCONTEXT+MC_PRESERVED_FP,in0
+	br.call.sptk	rp=_set_callee_saved_fp
+	;;
+}
+{	.mib
+	nop		0
+	add		out0=UC_MCONTEXT+MC_PRESERVED,in0
+	br.call.sptk	rp=_set_callee_saved
+	;;
+}
+{	.mib
+	nop		0
+	add		r16=UC_MCONTEXT+MC_SPECIAL,in0
+	br.sptk		_set_special_sync
+	;;
+}
+END(_setcontext)
+
+/*
  * _{get|set}_special_sync
  * Does not follow runtime convention!
  *
@@ -416,7 +496,19 @@
 	;;
 }
 {	.mmb
-	st8		[r3]=r10		// ccv
+	st8		[r3]=r10,16		// ccv
+	mov		r9=ar.csd
+	nop		8
+	;;
+}
+{	.mmi
+	st8		[r2]=r9,16		// csd
+	mov		r10=ar.ssd
+	nop		9
+	;;
+}
+{	.mmb
+	st8		[r3]=r10		// ssd
 	st8		[r2]=r0			// __spare
 	br.sptk		b6
 	;;
@@ -434,79 +526,126 @@
  * postcondition:       Will return with register bank 0 selected.
  */
 ENTRY(_set_caller_saved, 0)
+{	.mii
 	ld8		r8=[r16]		// nat (after)
 	add		r2=40,r16
 	add		r3=48,r16
 	;;
+}
+{	.mmi
 	mov		ar.unat=r8
 	mov		r8=r16
 	mov		r9=r17
 	;;
+}
+{	.mmi
 	ld8.fill	r10=[r2],16		// r10
 	ld8.fill	r11=[r3],16		// r11
 	nop		0
 	;;
+}
+{	.mmb
 	ld8.fill	r14=[r2],16		// r14
 	ld8.fill	r15=[r3],16		// r15
 	nop		1
 	;;
+}
+{	.mmi
 	ld8.fill	r16=[r2],16		// r16
 	ld8.fill	r17=[r3],16		// r17
 	nop		2
 	;;
+}
+{	.mmb
 	ld8.fill	r18=[r2],16		// r18
 	ld8.fill	r19=[r3],16		// r19
 	nop		3
 	;;
+}
+{	.mmi
 	ld8.fill	r20=[r2],16		// r20
 	ld8.fill	r21=[r3],16		// r21
 	nop		4
 	;;
+}
+{	.mmb
 	ld8.fill	r22=[r2],16		// r22
 	ld8.fill	r23=[r3],16		// r23
 	nop		5
 	;;
+}
+{	.mmi
 	ld8.fill	r24=[r2],16		// r24
 	ld8.fill	r25=[r3],16		// r25
 	nop		6
 	;;
+}
+{	.mmb
 	ld8.fill	r26=[r2],16		// r26
 	ld8.fill	r27=[r3],16		// r27
 	nop		7
 	;;
+}
+{	.mmi
 	ld8.fill	r28=[r2],16		// r28
 	ld8.fill	r29=[r3],16		// r29
 	nop		8
 	;;
+}
+{	.mmb
 	ld8.fill	r30=[r2],16		// r30
 	ld8.fill	r31=[r3],16		// r31
 	bsw.0
 	;;
+}
 	/* We're using register bank 0 now. */
-
+{	.mii
 	ld8		r18=[r2]		// unat (before)
 	add		r16=8,r8
 	add		r17=16,r8
+}
+{	.mii
 	ld8		r19=[r3]		// b6
 	add		r20=16,r2
 	add		r21=16,r3
 	;;
+}
+{	.mmi
 	ld8.fill	r2=[r16],16		// r2
 	ld8.fill	r3=[r17],16		// r3
 	mov		rp=r9
 	;;
-	ld8		r16=[r20]		// b7
-	ld8		r17=[r21]		// ccv
+}
+{	.mmi
+	ld8		r22=[r20],16		// b7
+	ld8		r23=[r21],16		// ccv
 	mov		b6=r19
 	;;
+}
+{	.mmi
 	ld8.fill	r8=[r16]		// r8
 	ld8.fill	r9=[r17]		// r9
 	mov		b7=r16
 	;;
+}
+{	.mmb
+	ld8		r19=[r20]		// csd
 	mov		ar.unat=r18
+	nop		9
+	;;
+}
+{	.mmi
+	ld8		r18=[r21]		// ssd
 	mov		ar.ccv=r17
+	nop		10
+	;;
+}
+{	.mmb
+	mov		ar.csd=r19
+	mov		ar.ssd=r18
 	br.ret.sptk	rp
 	;;
+}
 END(_get_called_saved)
 
 /*


More information about the p4-projects mailing list