All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fast path for rdhwr emulation for TLS
@ 2006-07-07 15:00 Atsushi Nemoto
  2006-07-07 15:22 ` Maciej W. Rozycki
  0 siblings, 1 reply; 26+ messages in thread
From: Atsushi Nemoto @ 2006-07-07 15:00 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

Adding special short path for emulationg RDHWR which is used to
support TLS.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index b563811..545bcb1 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -357,7 +357,7 @@ #endif
 	BUILD_HANDLER ibe be cli silent			/* #6  */
 	BUILD_HANDLER dbe be cli silent			/* #7  */
 	BUILD_HANDLER bp bp sti silent			/* #9  */
-	BUILD_HANDLER ri ri sti silent			/* #10 */
+	BUILD_HANDLER ri_slow ri sti silent		/* #10 */
 	BUILD_HANDLER cpu cpu sti silent		/* #11 */
 	BUILD_HANDLER ov ov sti silent			/* #12 */
 	BUILD_HANDLER tr tr sti silent			/* #13 */
@@ -369,6 +369,39 @@ #endif
 	BUILD_HANDLER dsp dsp sti silent		/* #26 */
 	BUILD_HANDLER reserved reserved sti verbose	/* others */
 
+	.align	5
+	LEAF(handle_ri)
+	.set	push
+	.set	noat
+	mfc0	k0, CP0_CAUSE
+	MFC0	k1, CP0_EPC
+	bltz	k0, handle_ri_slow	/* if delay slot */
+	lw	k0, (k1)
+	li	k1, 0x7c03e83b	/* rdhwr v1,$29 */
+	bne	k0, k1, handle_ri_slow	/* if not ours */
+	get_saved_sp	/* k1 := current_thread_info */
+	MFC0	k0, CP0_EPC
+	LONG_ADDIU	k0, 4
+	.set	noreorder
+#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	jr	k0
+	 rfe
+#else
+	/* I hope three instructions between MTC0 and ERET are enough... */
+	MTC0	k0, CP0_EPC
+	ori	k1, _THREAD_MASK
+	xori	k1, _THREAD_MASK
+	LONG_L	v1, TI_TP_VALUE(k1)
+	.set	mips3
+	eret
+	.set	mips0
+#endif
+	.set	pop
+	END(handle_ri)
+
 #ifdef CONFIG_64BIT
 /* A temporary overflow handler used by check_daddi(). */
 

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2006-09-15  3:09 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-07 15:00 [PATCH] fast path for rdhwr emulation for TLS Atsushi Nemoto
2006-07-07 15:22 ` Maciej W. Rozycki
2006-07-07 16:12   ` Atsushi Nemoto
2006-07-07 16:43     ` Atsushi Nemoto
2006-07-07 17:04       ` Maciej W. Rozycki
2006-07-07 18:22       ` Ralf Baechle
2006-07-07 16:58     ` Maciej W. Rozycki
2006-07-08 16:12       ` Atsushi Nemoto
2006-07-10 14:40         ` Atsushi Nemoto
2006-09-14 17:28           ` Ralf Baechle
2006-09-15  3:09             ` Atsushi Nemoto
2006-07-10 14:55       ` Atsushi Nemoto
2006-07-11  2:53         ` Daniel Jacobowitz
2006-07-11  3:20           ` Atsushi Nemoto
2006-09-08 17:39             ` Nigel Stephens
2006-09-09 13:56               ` Atsushi Nemoto
2006-09-10 22:30                 ` Nigel Stephens
2006-09-11  5:04                   ` Atsushi Nemoto
2006-09-11  8:50                     ` Atsushi Nemoto
2006-09-11  9:49                       ` Thiemo Seufer
2006-09-11 14:13                         ` Atsushi Nemoto
2006-09-11 15:17                           ` Thiemo Seufer
2006-09-11 13:09                 ` Maciej W. Rozycki
2006-09-11 14:30                   ` Atsushi Nemoto
2006-09-11 17:53                     ` Maciej W. Rozycki
2006-09-12  1:55                       ` Atsushi Nemoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.