Ver código fonte

netbsd: bits of the m68k support I started to hack together. non functional yet.

git-svn-id: trunk@35501 -
Károly Balogh 8 anos atrás
pai
commit
14ba99ea09
4 arquivos alterados com 72 adições e 0 exclusões
  1. 2 0
      .gitattributes
  2. 14 0
      rtl/netbsd/m68k/bsyscall.inc
  3. 49 0
      rtl/netbsd/m68k/sighnd.inc
  4. 7 0
      rtl/netbsd/signal.inc

+ 2 - 0
.gitattributes

@@ -9446,6 +9446,8 @@ rtl/netbsd/i386/dllprt0.as svneol=native#text/plain
 rtl/netbsd/i386/prt0.as svneol=native#text/plain
 rtl/netbsd/i386/prt0_10.as svneol=native#text/plain
 rtl/netbsd/i386/sighnd.inc svneol=native#text/plain
+rtl/netbsd/m68k/bsyscall.inc svneol=native#text/plain
+rtl/netbsd/m68k/sighnd.inc svneol=native#text/plain
 rtl/netbsd/pmutext.inc svneol=native#text/plain
 rtl/netbsd/powerpc/bsyscall.inc svneol=native#text/plain
 rtl/netbsd/powerpc/cprt0.as svneol=native#text/plain

+ 14 - 0
rtl/netbsd/m68k/bsyscall.inc

@@ -0,0 +1,14 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2005 by Michael Van Canneyt,
+    member of the Free Pascal development team.
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ **********************************************************************}
+

+ 49 - 0
rtl/netbsd/m68k/sighnd.inc

@@ -0,0 +1,49 @@
+{
+   This file is part of the Free Pascal run time library
+   (c) 2016 the Free Pascal development team
+
+   See the file COPYING.FPC, included in this distribution,
+   for details about the copyright.
+
+   Signalhandler for NetBSD/m68k
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY;without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+CONST FPU_ALL=$7F;
+
+function getfpustate(const Sigcontext:sigcontextRec):longint; {inline;}
+begin
+  getfpustate:=0;
+end;
+
+procedure SignalToRunerror(Signo: longint;info : PSigInfo;SigContext: PSigContextRec); public name '_FPC_DEFAULTSIGHANDLER'; cdecl;
+var
+  res : word;
+begin
+    res:=0;
+    if signo = SIGFPE then
+     begin
+        res := 200;
+     end
+    else
+    if (signo = SIGILL) or (signo = SIGBUS) or (signo = SIGSEGV) then
+      begin
+        res := 216;
+      end
+    else if (signo = SIGINT) then
+      begin
+        res:=217;
+      end
+    else if (signo = SIGKILL) then
+      begin
+        res:=233
+      end;
+  { give runtime error at the position where the signal was raised }
+  if res<>0 then
+   begin
+     HandleError(res);
+   end;
+end;

+ 7 - 0
rtl/netbsd/signal.inc

@@ -287,6 +287,13 @@ enum { _FRAME_GREG(GREG_OFFSETS) _NGREG = 26 };
 	end;
 {$endif def x86_64}
 
+{$ifdef CPUM68K}
+        SigContextRec = record
+            sc_args : array[0..6] of clong;
+            {$WARNING FIXME! SigContextRec}
+        end;
+{$endif m68k}
+
   SignalHandler   = Procedure(Sig : Longint);cdecl;
   PSignalHandler  = ^SignalHandler;
   SignalRestorer  = Procedure;cdecl;