Commit 58ab0016 authored by Venkatesh Pallipadi's avatar Venkatesh Pallipadi Committed by David Mosberger

[PATCH] ia64: Clearing of exception status before calling IA32 user signal handler

One more bug fix for IA32 exception handler. IA32 exception handler is
not clearing the exception status, before calling the user signal handler
routine.
parent c52f1179
...@@ -219,6 +219,7 @@ save_ia32_fpstate_live (struct _fpstate_ia32 *save) ...@@ -219,6 +219,7 @@ save_ia32_fpstate_live (struct _fpstate_ia32 *save)
struct _fpreg_ia32 *fpregp; struct _fpreg_ia32 *fpregp;
char buf[32]; char buf[32];
unsigned long fsr, fcr, fir, fdr; unsigned long fsr, fcr, fir, fdr;
unsigned long new_fsr;
unsigned long num128[2]; unsigned long num128[2];
unsigned long mxcsr=0; unsigned long mxcsr=0;
int fp_tos, fr8_st_map; int fp_tos, fr8_st_map;
...@@ -231,6 +232,13 @@ save_ia32_fpstate_live (struct _fpstate_ia32 *save) ...@@ -231,6 +232,13 @@ save_ia32_fpstate_live (struct _fpstate_ia32 *save)
asm volatile ( "mov %0=ar.fcr;" : "=r"(fcr)); asm volatile ( "mov %0=ar.fcr;" : "=r"(fcr));
asm volatile ( "mov %0=ar.fir;" : "=r"(fir)); asm volatile ( "mov %0=ar.fir;" : "=r"(fir));
asm volatile ( "mov %0=ar.fdr;" : "=r"(fdr)); asm volatile ( "mov %0=ar.fdr;" : "=r"(fdr));
/*
* We need to clear the exception state before calling the signal
* handler. Clear the bits 15, bits 0-7 in fp status word. Similar
* to the functionality of fnclex instruction.
*/
new_fsr = fsr & (~0x80ff) ;
asm volatile ( "mov ar.fsr=%0;" :: "r"(new_fsr));
__put_user(fcr & 0xffff, &save->cw); __put_user(fcr & 0xffff, &save->cw);
__put_user(fsr & 0xffff, &save->sw); __put_user(fsr & 0xffff, &save->sw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment