From 314fe142476a72c58459d624cdb2067646cfbc43 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 3 Mar 2005 20:58:38 +0000 Subject: [PATCH] + routines in baseunix can be overriden by processor specifics in bsyscall.inc --- rtl/freebsd/i386/bsyscall.inc | 20 ++++++++++++ rtl/freebsd/x86_64/bsyscall.inc | 20 ++++++++++++ rtl/linux/arm/bsyscall.inc | 20 ++++++++++++ rtl/linux/bunxsysc.inc | 9 ++++-- rtl/linux/i386/bsyscall.inc | 20 ++++++++++++ rtl/linux/m68k/bsyscall.inc | 20 ++++++++++++ rtl/linux/powerpc/bsyscall.inc | 20 ++++++++++++ rtl/linux/sparc/bsyscall.inc | 56 +++++++++++++++++++++++++++++++++ rtl/linux/sparc/syscall.inc | 42 +++---------------------- rtl/linux/x86_64/bsyscall.inc | 20 ++++++++++++ rtl/unix/baseunix.pp | 6 +++- 11 files changed, 211 insertions(+), 42 deletions(-) create mode 100644 rtl/freebsd/i386/bsyscall.inc create mode 100644 rtl/freebsd/x86_64/bsyscall.inc create mode 100644 rtl/linux/arm/bsyscall.inc create mode 100644 rtl/linux/i386/bsyscall.inc create mode 100644 rtl/linux/m68k/bsyscall.inc create mode 100644 rtl/linux/powerpc/bsyscall.inc create mode 100644 rtl/linux/sparc/bsyscall.inc create mode 100644 rtl/linux/x86_64/bsyscall.inc diff --git a/rtl/freebsd/i386/bsyscall.inc b/rtl/freebsd/i386/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/freebsd/i386/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/freebsd/x86_64/bsyscall.inc b/rtl/freebsd/x86_64/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/freebsd/x86_64/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/arm/bsyscall.inc b/rtl/linux/arm/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/linux/arm/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/bunxsysc.inc b/rtl/linux/bunxsysc.inc index 937343a2a1..c655d2e4ab 100644 --- a/rtl/linux/bunxsysc.inc +++ b/rtl/linux/bunxsysc.inc @@ -338,13 +338,13 @@ begin end; -{$ifndef FPC_SYSTEM_HAS_FPPIPE} +{$ifndef FPC_BASEUNIX_HAS_FPPIPE} Function fppipe(var fildes : tfildes):cint; begin fppipe:=do_syscall(syscall_nr_pipe,TSysParam(@fildes)); end; -{$endif FPC_SYSTEM_HAS_FPPIPE} +{$endif FPC_BASEUNIX_HAS_FPPIPE} function fpfcntl(fildes:cint;Cmd:cint;Arg:cint):cint; @@ -534,7 +534,10 @@ end; { $Log$ - Revision 1.3 2005-03-03 20:13:44 florian + Revision 1.4 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc + + Revision 1.3 2005/03/03 20:13:44 florian + sparc specific pipe implementation Revision 1.2 2005/02/14 17:13:30 peter diff --git a/rtl/linux/i386/bsyscall.inc b/rtl/linux/i386/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/linux/i386/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/m68k/bsyscall.inc b/rtl/linux/m68k/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/linux/m68k/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/powerpc/bsyscall.inc b/rtl/linux/powerpc/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/linux/powerpc/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/sparc/bsyscall.inc b/rtl/linux/sparc/bsyscall.inc new file mode 100644 index 0000000000..21db1fad5c --- /dev/null +++ b/rtl/linux/sparc/bsyscall.inc @@ -0,0 +1,56 @@ +{ + $Id$ + 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. + + **********************************************************************} + + +{$define FPC_BASEUNIX_HAS_FPPIPE} +Function fppipe(var fildes : tfildes):cint;assembler; +{ + This function puts the registers in place, does the call, and then + copies back the registers as they are after the SysCall. +} +asm + mov 42,%g1 + mov %i0,%o0 + ta 0x10 + bcc .LSyscOK + nop + mov %o0,%l0 + sethi %hi(fpc_threadvar_relocate_proc),%o2 + or %o2,%lo(fpc_threadvar_relocate_proc),%o2 + ld [%o2],%o3 + subcc %o3,%g0,%g0 + bne .LThread + nop + sethi %hi(Errno+4),%o0 + ba .LNoThread + or %o0,%lo(Errno+4),%o0 +.LThread: + sethi %hi(Errno),%o0 + or %o0,%lo(Errno),%o0 + call %o3 + ld [%o0],%o0 +.LNoThread: + st %l0,[%o0] + mov -1,%o0 +.LSyscOK: + st [%i0],%o0 + st [%i0+4],%o1 +end; + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/linux/sparc/syscall.inc b/rtl/linux/sparc/syscall.inc index 72df687c1c..acd1be7633 100644 --- a/rtl/linux/sparc/syscall.inc +++ b/rtl/linux/sparc/syscall.inc @@ -58,43 +58,6 @@ asm end; -{$define FPC_SYSTEM_HAS_FPPIPE} -Function fppipe(var fildes : tfildes):cint;assembler; -{ - This function puts the registers in place, does the call, and then - copies back the registers as they are after the SysCall. -} -asm - mov 42,%g1 - mov %i0,%o0 - ta 0x10 - bcc .LSyscOK - nop - mov %o0,%l0 - sethi %hi(fpc_threadvar_relocate_proc),%o2 - or %o2,%lo(fpc_threadvar_relocate_proc),%o2 - ld [%o2],%o3 - subcc %o3,%g0,%g0 - bne .LThread - nop - sethi %hi(Errno+4),%o0 - ba .LNoThread - or %o0,%lo(Errno+4),%o0 -.LThread: - sethi %hi(Errno),%o0 - or %o0,%lo(Errno),%o0 - call %o3 - ld [%o0],%o0 -.LNoThread: - st %l0,[%o0] - mov -1,%o0 -.LSyscOK: - st [%i0],%o0 - st [%i0+4],%o1 -end; - - - {***************************************************************************** --- Main:The System Call Self --- *****************************************************************************} @@ -354,7 +317,10 @@ end; { $Log$ - Revision 1.18 2005-03-03 20:13:44 florian + Revision 1.19 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc + + Revision 1.18 2005/03/03 20:13:44 florian + sparc specific pipe implementation Revision 1.17 2005/02/14 17:13:30 peter diff --git a/rtl/linux/x86_64/bsyscall.inc b/rtl/linux/x86_64/bsyscall.inc new file mode 100644 index 0000000000..6868b62a1d --- /dev/null +++ b/rtl/linux/x86_64/bsyscall.inc @@ -0,0 +1,20 @@ +{ + $Id$ + 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. + + **********************************************************************} + +{ + $Log$ + Revision 1.1 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc +} \ No newline at end of file diff --git a/rtl/unix/baseunix.pp b/rtl/unix/baseunix.pp index 7f4b5ee9fd..d337b49aac 100644 --- a/rtl/unix/baseunix.pp +++ b/rtl/unix/baseunix.pp @@ -82,6 +82,7 @@ end; {$ifndef FPC_USE_LIBC} {$i syscallh.inc} // do_syscall declarations themselves {$i sysnr.inc} // syscall numbers. + {$i bsyscall.inc} // cpu specific syscalls {$i bunxsysc.inc} // syscalls in system unit. {$i settimeo.inc} {$endif} @@ -92,7 +93,10 @@ end; end. { $Log$ - Revision 1.3 2005-02-14 17:13:31 peter + Revision 1.4 2005-03-03 20:58:38 florian + + routines in baseunix can be overriden by processor specifics in bsyscall.inc + + Revision 1.3 2005/02/14 17:13:31 peter * truncate log Revision 1.2 2005/02/13 21:47:56 peter