From 460369405ecbc3200eeaf38350bf8b2e082fd34f Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 5 Apr 2020 21:12:13 +0000 Subject: [PATCH] + xtensa-linux: OS specific system unit header files git-svn-id: trunk@44612 - --- .gitattributes | 3 +++ rtl/linux/xtensa/sighndh.inc | 46 +++++++++++++++++++++++++++++++++++ rtl/linux/xtensa/stat.inc | 46 +++++++++++++++++++++++++++++++++++ rtl/linux/xtensa/syscallh.inc | 34 ++++++++++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 rtl/linux/xtensa/sighndh.inc create mode 100644 rtl/linux/xtensa/stat.inc create mode 100644 rtl/linux/xtensa/syscallh.inc diff --git a/.gitattributes b/.gitattributes index 19f7ce48f0..ae2ad05aaf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11180,6 +11180,9 @@ rtl/linux/x86_64/stat.inc svneol=native#text/plain rtl/linux/x86_64/syscall.inc svneol=native#text/plain rtl/linux/x86_64/syscallh.inc svneol=native#text/plain rtl/linux/x86_64/sysnr.inc svneol=native#text/plain +rtl/linux/xtensa/sighndh.inc svneol=native#text/plain +rtl/linux/xtensa/stat.inc svneol=native#text/plain +rtl/linux/xtensa/syscallh.inc svneol=native#text/plain rtl/m68k/cpuh.inc svneol=native#text/plain rtl/m68k/int64p.inc svneol=native#text/plain rtl/m68k/lowmath.inc svneol=native#text/plain diff --git a/rtl/linux/xtensa/sighndh.inc b/rtl/linux/xtensa/sighndh.inc new file mode 100644 index 0000000000..a75569a722 --- /dev/null +++ b/rtl/linux/xtensa/sighndh.inc @@ -0,0 +1,46 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 1999-2000 by Jonas Maebe, + member of the Free Pascal development team. + + TSigContext + + 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. + + **********************************************************************} + +{$packrecords C} + +type + PSigContext = ^TSigContext; + TSigContext = record + sc_pc, + sc_ps, + sc_lbeg, + sc_lend, + sc_lcount, + sc_sar, + sc_acclo, + sc_acchi : culong; + sc_a : array[0..15] of culong; + end; + + stack_t = record + ss_sp : pointer; + ss_flags : cint; + ss_size : size_t; + end; + + pucontext = ^tucontext; + tucontext = record + uc_flags : culong; + uc_link : pucontext; + uc_stack : stack_t; + uc_mcontext : TSigContext; + uc_sigmask : tsigset; + end; diff --git a/rtl/linux/xtensa/stat.inc b/rtl/linux/xtensa/stat.inc new file mode 100644 index 0000000000..10e4e06460 --- /dev/null +++ b/rtl/linux/xtensa/stat.inc @@ -0,0 +1,46 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 1999-2000 by Jonas Maebe, (c) 2005 Thomas Schatzl, + members of the Free Pascal development team. + + Contains the definition of the stat type for the Xtensa platform. + + 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. + + **********************************************************************} + +{ This structure was adapted from + + include/uapi/asm-generic/stat.h + + in Linux 4.0. Note that the stat record is the same for direct + syscalls as for when linking to libc. +} + +{$PACKRECORDS C} + stat = record + st_dev : culonglong; + st_ino : culonglong; + st_mode : cuint; + st_nlink : cuint; + st_uid : cuint; + st_gid : cuint; + st_rdev : culonglong; + st_size : clonglong; + st_blksize : culong; + __unused2 : culong; + st_blocks : culonglong; + st_atime : cULong; + st_atime_nsec : cULong; + st_mtime : cULong; + st_mtime_nsec : cULong; + st_ctime : cULong; + st_ctime_nsec : cULong; + __unused4a : cULong; + __unused5a : cULong; + end; diff --git a/rtl/linux/xtensa/syscallh.inc b/rtl/linux/xtensa/syscallh.inc new file mode 100644 index 0000000000..8f1359ba94 --- /dev/null +++ b/rtl/linux/xtensa/syscallh.inc @@ -0,0 +1,34 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2002 Marco van de Voort + member of the Free Pascal development team. + + Xtensa syscall headers for Linux + + 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. + + **********************************************************************} + +Type + TSysResult = longint; // all platforms, cint=32-bit. + // On platforms with off_t =64-bit, people should + // use int64, and typecast all calls that don't + // return off_t to cint. + +// I don't think this is going to work on several platforms +// 64-bit machines don't have only 64-bit params. + + TSysParam = Longint; + +function Do_SysCall(sysnr:TSysParam):TSysResult; external name 'FPC_SYSCALL0'; +function Do_SysCall(sysnr,param1:TSysParam):TSysResult; external name 'FPC_SYSCALL1'; +function Do_SysCall(sysnr,param1,param2:TSysParam):TSysResult; external name 'FPC_SYSCALL2'; +function Do_SysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; external name 'FPC_SYSCALL3'; +function Do_SysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; external name 'FPC_SYSCALL4'; +function Do_SysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; external name 'FPC_SYSCALL5'; +function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; external name 'FPC_SYSCALL6';