patch-2.3.27 linux/arch/ppc/kernel/head.S

Next file: linux/arch/ppc/kernel/pmac_setup.c
Previous file: linux/arch/ppc/kernel/entry.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.26/linux/arch/ppc/kernel/head.S linux/arch/ppc/kernel/head.S
@@ -817,6 +817,15 @@
 	srwi	r4,r4,16
 	cmpi	0,r4,12
 	bnelr
+	
+	/* enable altivec so we can save */
+	mfmsr	r4
+	oris	r4,r4,MSR_VEC@h
+	mtmsr	r4
+
+	/* make sure our tsk pointer is valid */
+	cmpi	0,r3,0
+	beqlr
 
 	/* save altivec regs */
 	addi	r4,r3,THREAD+THREAD_VRSAVE
@@ -830,6 +839,11 @@
 	lis	r6,MSR_VEC@h
 	andi.	r5,r5,r6
 	stw	r5,_MSR(r4)
+
+	/* we've given up the altivec - clear the pointer */
+	li	r3,0
+	lis	r4,last_task_used_altivec@h
+	stw	r3,last_task_used_altivec@l(r4)
 #endif /* CONFIG_ALTIVEC */
 	blr
 	

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