Browse Source

* i386 signal handler receives a ucontext instead of sigcontext

git-svn-id: trunk@1478 -
peter 20 years ago
parent
commit
75c00e21c9
2 changed files with 17 additions and 3 deletions
  1. 3 3
      rtl/linux/i386/sighnd.inc
  2. 14 0
      rtl/linux/i386/sighndh.inc

+ 3 - 3
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;
 

+ 14 - 0
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;