From 75c00e21c995b72d3855d65d4ef39128528a4e6e Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 18 Oct 2005 13:41:48 +0000 Subject: [PATCH] * i386 signal handler receives a ucontext instead of sigcontext git-svn-id: trunk@1478 - --- rtl/linux/i386/sighnd.inc | 6 +++--- rtl/linux/i386/sighndh.inc | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rtl/linux/i386/sighnd.inc b/rtl/linux/i386/sighnd.inc index 5ebe739b8b..d636017ca1 100644 --- a/rtl/linux/i386/sighnd.inc +++ b/rtl/linux/i386/sighnd.inc @@ -32,7 +32,7 @@ begin end; -procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; SigContext: PSigContext);cdecl; +procedure SignalToRunerror(sig : longint; SigInfo: PSigInfo; UContext: Pucontext);cdecl; var res,fpustate : word; begin @@ -43,7 +43,7 @@ begin { this is not allways necessary but I don't know yet how to tell if it is or not PM } res:=200; - fpustate:=GetFPUState(SigContext^); + fpustate:=GetFPUState(UContext^.uc_mcontext); if (FpuState and FPU_All) <> 0 then begin { first check the more precise options } @@ -71,6 +71,6 @@ begin reenable_signal(sig); { give runtime error at the position where the signal was raised } if res<>0 then - HandleErrorAddrFrame(res,pointer(SigContext^.eip),pointer(SigContext^.ebp)); + HandleErrorAddrFrame(res,pointer(UContext^.uc_mcontext.eip),pointer(UContext^.uc_mcontext.ebp)); end; diff --git a/rtl/linux/i386/sighndh.inc b/rtl/linux/i386/sighndh.inc index d412b9ade4..ecb5a92b30 100644 --- a/rtl/linux/i386/sighndh.inc +++ b/rtl/linux/i386/sighndh.inc @@ -55,4 +55,18 @@ type cr2: cardinal; end; + tsigaltstack=record + ss_sp : pointer; + ss_flags : longint; + ss_size : longint; + end; + + Pucontext=^Tucontext; + TUcontext=record + uc_flags : cardinal; + uc_link : Pucontext; + uc_stack : tsigaltstack; + uc_mcontext : tsigcontext; + uc_sigmask : tsigset; + end;