Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101834
b: refs/heads/master
c: 7c29217
h: refs/heads/master
v: v3
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed Jul 15, 2008
1 parent 0e7010f commit 6693611
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01f4b8b8b8db09b88be7df7e51192e4e678b69d3
refs/heads/master: 7c29217096d83f657e6ee70479af09b46f4275f6
8 changes: 4 additions & 4 deletions trunk/arch/powerpc/kernel/misc_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,12 @@ _GLOBAL(giveup_altivec)

#ifdef CONFIG_VSX
/*
* giveup_vsx(tsk)
* Disable VSX for the task given as the argument,
* and save the vector registers in its thread_struct.
* __giveup_vsx(tsk)
* Disable VSX for the task given as the argument.
* Does NOT save vsx registers.
* Enables the VSX for use in the kernel on return.
*/
_GLOBAL(giveup_vsx)
_GLOBAL(__giveup_vsx)
mfmsr r5
oris r5,r5,MSR_VSX@h
mtmsrd r5 /* enable use of VSX now */
Expand Down
10 changes: 9 additions & 1 deletion trunk/arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ void enable_kernel_vsx(void)
EXPORT_SYMBOL(enable_kernel_vsx);
#endif

void giveup_vsx(struct task_struct *tsk)
{
giveup_fpu(tsk);
giveup_altivec(tsk);
__giveup_vsx(tsk);
}

void flush_vsx_to_thread(struct task_struct *tsk)
{
if (tsk->thread.regs) {
Expand Down Expand Up @@ -290,7 +297,8 @@ struct task_struct *__switch_to(struct task_struct *prev,
#endif /* CONFIG_ALTIVEC */
#ifdef CONFIG_VSX
if (prev->thread.regs && (prev->thread.regs->msr & MSR_VSX))
giveup_vsx(prev);
/* VMX and FPU registers are already save here */
__giveup_vsx(prev);
#endif /* CONFIG_VSX */
#ifdef CONFIG_SPE
/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ static int save_user_regs(struct pt_regs *regs, struct mcontext __user *frame,
* contains valid data
*/
if (current->thread.used_vsr) {
flush_vsx_to_thread(current);
__giveup_vsx(current);
if (copy_vsx_to_user(&frame->mc_vsregs, current))
return 1;
msr |= MSR_VSX;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static long setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
* VMX data.
*/
if (current->thread.used_vsr) {
flush_vsx_to_thread(current);
__giveup_vsx(current);
v_regs += ELF_NVRREG;
err |= copy_vsx_to_user(v_regs, current);
/* set MSR_VSX in the MSR value in the frame to
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ extern void enable_kernel_altivec(void);
extern void giveup_altivec(struct task_struct *);
extern void load_up_altivec(struct task_struct *);
extern int emulate_altivec(struct pt_regs *);
extern void __giveup_vsx(struct task_struct *);
extern void giveup_vsx(struct task_struct *);
extern void enable_kernel_spe(void);
extern void giveup_spe(struct task_struct *);
Expand Down

0 comments on commit 6693611

Please sign in to comment.