PERFORCE change 30939 for review

Marcel Moolenaar marcel at FreeBSD.org
Sat May 10 23:49:43 PDT 2003


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

Change 30939 by marcel at marcel_nfs on 2003/05/10 23:48:58

	Add support for swithing to ia32. We need to restore the
	scratch registers as they hold the ia32 state and jump
	to userland not with a regular branch, but with br.ia.
	That's about it here...

Affected files ...

.. //depot/projects/ia64_epc/sys/ia64/ia64/syscall.s#18 edit

Differences ...

==== //depot/projects/ia64_epc/sys/ia64/ia64/syscall.s#18 (text+ko) ====

@@ -92,6 +92,13 @@
 	br.sptk		b6
 	;;
 }
+gw_ret_ia32:
+	mov		ar.rnat=r0
+	mov		ar.rsc=0xc
+	mov		ar.pfs=r0
+	;;
+	br.ia.sptk	b6
+	;;
 
 ENTRY(break_sigtramp, 0)
 {	.mib
@@ -432,10 +439,10 @@
 	mov		ar.pfs=r20
 	;;
 }
-{	.mmb
+{	.mmi
 	ld8		gp=[r15],16		// gp
 	ld8		r27=[r14],16		// ndirty
-	nop		0
+	tbit.z		p14,p15=r26,34		// p14=ia64, p15=ia32
 	;;
 }
 {	.mmi
@@ -450,10 +457,10 @@
 	nop		0
 	;;
 }
-{	.mmi
-	ld8		r9=[r14]		// r9
-	ld8		r10=[r15]		// r10
-	dep		r26=-1,r26,19,1		// Set psr.dfh
+{	.mmb
+	ld8		r9=[r14],40		// r9
+	ld8		r10=[r15],40		// r10
+(p15)	br.spnt		epc_syscall_setup_ia32
 	;;
 }
 {	.mmi
@@ -487,4 +494,64 @@
 	br.ret.sptk	b7
 	;;
 }
+epc_syscall_setup_ia32:
+{	.mmi
+	loadrs
+	mov		ar.k7=r31
+	mov		sp=r16
+	;;
+}
+{	.mmi
+	mov		r30=ar.bspstore
+	;;
+	mov		ar.bspstore=r21
+	dep		r30=0,r30,0,9
+	;;
+}
+{	.mmi
+	mov		ar.k6=r30
+	mov		ar.unat=r17
+	mov		r11=r26
+	;;
+}
+
+	ld8		r16=[r14],16
+	ld8		r17=[r15],16
+	;;
+	ld8		r18=[r14],16
+	ld8		r19=[r15],16
+	;;
+	ld8		r20=[r14],16
+	ld8		r21=[r15],16
+	;;
+	ld8		r22=[r14],16
+	ld8		r23=[r15],16
+	;;
+	ld8		r24=[r14],16
+	ld8		r25=[r15],16
+	;;
+	ld8		r26=[r14],16
+	ld8		r27=[r15],16
+	;;
+	ld8		r28=[r14],16
+	ld8		r29=[r15],16
+	;;
+	ld8		r30=[r14],40
+	ld8		r31=[r15],40
+	;;
+	ld8		r2=[r14],16
+	ld8		r3=[r15],8
+	;;
+	mov		ar.csd=r2
+	mov		ar.ssd=r3
+	;;
+	mov		r2=ar.k5
+	mov		psr.l=r11
+	;;
+	srlz.d
+	add		r2=gw_ret_ia32-ia64_gateway_page,r2
+	;;
+	mov		b7=r2
+	br.ret.sptk	b7
+	;;
 END(epc_syscall)


More information about the p4-projects mailing list