patch-2.4.23 linux-2.4.23/arch/sparc64/kernel/entry.S

Next file: linux-2.4.23/arch/sparc64/kernel/head.S
Previous file: linux-2.4.23/arch/sparc64/kernel/cpu.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/sparc64/kernel/entry.S linux-2.4.23/arch/sparc64/kernel/entry.S
@@ -911,10 +911,15 @@
 	sllx		%g1, 63, %g2;					\
 	or		%g4, %g2, %g4;					\
 	/* Get log entry pointer for this cpu at this trap level. */	\
+	BRANCH_IF_JALAPENO(g2,g3,50f)					\
 	ldxa		[%g0] ASI_SAFARI_CONFIG, %g2;			\
 	srlx		%g2, 17, %g2;					\
-	and		%g2, 0x3ff, %g2;				\
-	sllx		%g2, 9, %g2;					\
+	ba,pt		%xcc, 60f; 					\
+	 and		%g2, 0x3ff, %g2;				\
+50:	ldxa		[%g0] ASI_JBUS_CONFIG, %g2;			\
+	srlx		%g2, 17, %g2;					\
+	and		%g2, 0x1f, %g2;					\
+60:	sllx		%g2, 9, %g2;					\
 	sethi		%hi(cheetah_error_log), %g3;			\
 	ldx		[%g3 + %lo(cheetah_error_log)], %g3;		\
 	brz,pn		%g3, 80f;					\
@@ -1749,8 +1754,8 @@
 	cmp		%o0, -ENOIOCTLCMD
 	sllx		%g2, 32, %g2
 	bgeu,pn		%xcc, 1f
-
 	 andcc		%l0, 0x02, %l6	
+80:
 	andn		%g3, %g2, %g3		/* System call success, clear Carry condition code. */
 	stx		%g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]	
 	bne,pn		%icc, linux_syscall_trace2
@@ -1760,9 +1765,21 @@
 	 stx		%l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
 
 1:
+	/* Really a failure?  Check if force_successful_syscall_return()
+	 * was invoked.
+	 */
+	ldx		[%curptr + AOFF_task_thread + AOFF_thread_flags], %l0
+	andcc		%l0, SPARC_FLAG_SYS_SUCCESS, %g0
+	be,pt		%icc, 1f
+	 andcc		%l6, 0x02, %g0
+	andn		%l0, SPARC_FLAG_SYS_SUCCESS, %l0
+	ba,pt		%xcc, 80b
+	 stx		%l0, [%curptr + AOFF_task_thread + AOFF_thread_flags]
+
 	/* System call failure, set Carry condition code.
 	 * Also, get abs(errno) to return to the process.
 	 */
+1:
 	sub		%g0, %o0, %o0
 	or		%g3, %g2, %g3
 	stx		%o0, [%sp + PTREGS_OFF + PT_V9_I0]

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)