Skip to content

Commit

Permalink
powerpc: Remove hard coded FP offsets in alignment handler
Browse files Browse the repository at this point in the history
The alignment handler assumes big endian ordering when selecting
the low word of a 64bit floating point value. Use the existing
union which works in both little and big endian.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Anton Blanchard authored and Benjamin Herrenschmidt committed Oct 11, 2013
1 parent f626190 commit c324496
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/align.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ int fix_alignment(struct pt_regs *regs)
#ifdef CONFIG_PPC_FPU
preempt_disable();
enable_kernel_fp();
cvt_df(&data.dd, (float *)&data.v[4]);
cvt_df(&data.dd, (float *)&data.x32.low32);
preempt_enable();
#else
return 0;
Expand Down Expand Up @@ -935,7 +935,7 @@ int fix_alignment(struct pt_regs *regs)
#ifdef CONFIG_PPC_FPU
preempt_disable();
enable_kernel_fp();
cvt_fd((float *)&data.v[4], &data.dd);
cvt_fd((float *)&data.x32.low32, &data.dd);
preempt_enable();
#else
return 0;
Expand Down

0 comments on commit c324496

Please sign in to comment.