Browse Source

+ xtensa-linux: OS specific system unit header files

git-svn-id: trunk@44612 -
florian 5 years ago
parent
commit
460369405e
4 changed files with 129 additions and 0 deletions
  1. 3 0
      .gitattributes
  2. 46 0
      rtl/linux/xtensa/sighndh.inc
  3. 46 0
      rtl/linux/xtensa/stat.inc
  4. 34 0
      rtl/linux/xtensa/syscallh.inc

+ 3 - 0
.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/syscall.inc svneol=native#text/plain
 rtl/linux/x86_64/syscallh.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/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/cpuh.inc svneol=native#text/plain
 rtl/m68k/int64p.inc svneol=native#text/plain
 rtl/m68k/int64p.inc svneol=native#text/plain
 rtl/m68k/lowmath.inc svneol=native#text/plain
 rtl/m68k/lowmath.inc svneol=native#text/plain

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

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

+ 34 - 0
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';