Pārlūkot izejas kodu

* Try to adapt sigcontext record to MIPS linux system

git-svn-id: trunk@21714 -
pierre 13 gadi atpakaļ
vecāks
revīzija
5597af2279
2 mainītis faili ar 35 papildinājumiem un 21 dzēšanām
  1. 2 6
      rtl/linux/mips/sighnd.inc
  2. 33 15
      rtl/linux/mips/sighndh.inc

+ 2 - 6
rtl/linux/mips/sighnd.inc

@@ -59,20 +59,16 @@ begin
   { give runtime error at the position where the signal was raised }
   { give runtime error at the position where the signal was raised }
   if res<>0 then
   if res<>0 then
     begin
     begin
-{$ifdef FPC_FRAMETYPE_RECORD}
       if assigned(SigContext) then
       if assigned(SigContext) then
         begin
         begin
-          frame:=pointer(SigContext^.sigc_sp);   { stack pointer }
-          addr:=pointer(SigContext^.sigc_pc);  { program counter }
+          frame:=pointer(ptruint(SigContext^.sigc_regs[29]));   { stack pointer }
+          addr:=pointer(ptruint(SigContext^.sigc_pc));  { program counter }
         end
         end
       else
       else
         begin
         begin
           frame:=nil;
           frame:=nil;
           addr:=nil;
           addr:=nil;
         end;
         end;
-{$else not FPC_FRAMETYPE_RECORD}
-      frame:=nil;
-{$endif FPC_FRAMETYPE_RECORD}
       HandleErrorAddrFrame(res,addr,frame);
       HandleErrorAddrFrame(res,addr,frame);
     end;
     end;
 end;
 end;

+ 33 - 15
rtl/linux/mips/sighndh.inc

@@ -25,22 +25,40 @@ type
     ins    : array[0..7] of longint;
     ins    : array[0..7] of longint;
   end;
   end;
 
 
+(* MIPS OABI32 structure 
+struct sigcontext {
+  unsigned int sc_regmask;
+  unsigned int sc_status;
+  unsigned long long sc_pc;
+  unsigned long long sc_regs[32];
+  unsigned long long sc_fpregs[32];
+  unsigned int sc_ownedfp;
+  unsigned int sc_fpc_csr;
+  unsigned int sc_fpc_eir;
+  unsigned int sc_used_math;
+  unsigned int sc_dsp;
+  unsigned long long sc_mdhi;
+  unsigned long long sc_mdlo;
+  unsigned long sc_hi1;
+  unsigned long sc_lo1;
+  unsigned long sc_hi2;
+  unsigned long sc_lo2;
+  unsigned long sc_hi3;
+  unsigned long sc_lo3;
+}; *)
   PSigContext = ^TSigContext;
   PSigContext = ^TSigContext;
   TSigContext = record
   TSigContext = record
-    sigc_onstack,      { state to restore }
-    sigc_mask,         { sigmask to restore }
-    sigc_sp,           { stack pointer }
-    sigc_pc,           { program counter }
-    sigc_npc,          { next program counter }
-    sigc_psr,          { for condition codes etc }
-    sigc_g1,           { User uses these two registers }
-    sigc_o0, { within the trampoline code. }
-    { Now comes information regarding the users window set
-      * at the time of the signal. }
-    sigc_oswins : longint;       { outstanding windows }
-    { stack ptrs for each regwin buf }
-    sigc_spbuf  : array[0..__SUNOS_MAXWIN-1] of pchar;
-    { Windows to restore after signal }
-    sigc_wbuf   : array[0..__SUNOS_MAXWIN] of twbuf;
+    sigc_regmask,                   
+    sigc_status: cuint; 
+    sigc_pc : culonglong;    
+    sigc_regs : array[0..31] of culonglong;
+    sigc_fpregs : array[0..31] of culonglong; 
+    sigc_fpc_csr, sigc_fpc_eir : cuint;
+    sigc_used_math : cuint;
+    sigc_dsp : cuint;
+    sigc_mdhi, sigc_mdlo : culonglong;
+    sigc_hi1,sigc_lo1,
+    sigc_hi2,sigc_lo2,
+    sigc_hi3,sigc_lo3 : culong;
   end;
   end;