Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Mar 2003 18:40:56 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 27272 for review
Message-ID:  <200303240240.h2O2euqu010659@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=27272

Change 27272 by marcel@marcel_nfs on 2003/03/23 18:40:56

	Implement _set_caller_saved
	
	This function restores the non-FP, non-stacked scratch registers.
	It's used in the same context as _get_caller_saved, however things
	are slughly different. Since the details are not fixed, I assume
	for now that this function cannot follow the runtime specification
	but still use RP to branch back (we have no other branch registers
	free). We have to revisit this when we know how we save and restore
	the trapframe...

Affected files ...

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

Differences ...

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

@@ -426,10 +426,85 @@
 /*
  * _set_caller_saved
  *
- * PRECONDITION:	Must be called with register bank 1 selected
- * POSTCONDITION:	Will return with register bank 0 selected
+ * Does not follow runtime specification:
+ * inputs:              r16 = pointer to struct _caller_saved
+ *                      r17 = return address (no call/ret semantics)
+ * precondition:        Must be called with register bank 1 selected,
+ *
+ * postcondition:       Will return with register bank 0 selected.
  */
-ENTRY(_set_caller_saved, 1)
+ENTRY(_set_caller_saved, 0)
+	ld8		r8=[r16]		// nat (after)
+	add		r2=40,r16
+	add		r3=48,r16
+	;;
+	mov		ar.unat=r8
+	mov		r8=r16
+	mov		r9=r17
+	;;
+	ld8.fill	r10=[r2],16		// r10
+	ld8.fill	r11=[r3],16		// r11
+	nop		0
+	;;
+	ld8.fill	r14=[r2],16		// r14
+	ld8.fill	r15=[r3],16		// r15
+	nop		1
+	;;
+	ld8.fill	r16=[r2],16		// r16
+	ld8.fill	r17=[r3],16		// r17
+	nop		2
+	;;
+	ld8.fill	r18=[r2],16		// r18
+	ld8.fill	r19=[r3],16		// r19
+	nop		3
+	;;
+	ld8.fill	r20=[r2],16		// r20
+	ld8.fill	r21=[r3],16		// r21
+	nop		4
+	;;
+	ld8.fill	r22=[r2],16		// r22
+	ld8.fill	r23=[r3],16		// r23
+	nop		5
+	;;
+	ld8.fill	r24=[r2],16		// r24
+	ld8.fill	r25=[r3],16		// r25
+	nop		6
+	;;
+	ld8.fill	r26=[r2],16		// r26
+	ld8.fill	r27=[r3],16		// r27
+	nop		7
+	;;
+	ld8.fill	r28=[r2],16		// r28
+	ld8.fill	r29=[r3],16		// r29
+	nop		8
+	;;
+	ld8.fill	r30=[r2],16		// r30
+	ld8.fill	r31=[r3],16		// r31
+	bsw.0
+	;;
+	/* We're using register bank 0 now. */
+
+	ld8		r18=[r2]		// unat (before)
+	add		r16=8,r8
+	add		r17=16,r8
+	ld8		r19=[r3]		// b6
+	add		r20=16,r2
+	add		r21=16,r3
+	;;
+	ld8.fill	r2=[r16],16		// r2
+	ld8.fill	r3=[r17],16		// r3
+	mov		rp=r9
+	;;
+	ld8		r16=[r20]		// b7
+	ld8		r17=[r21]		// ccv
+	mov		b6=r19
+	;;
+	ld8.fill	r8=[r16]		// r8
+	ld8.fill	r9=[r17]		// r9
+	mov		b7=r16
+	;;
+	mov		ar.unat=r18
+	mov		ar.ccv=r17
 	br.ret.sptk	rp
 	;;
 END(_get_called_saved)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303240240.h2O2euqu010659>