Commit Graph

358 Commits

Author SHA1 Message Date
Jonas Maebe
d8021a1102 + FreeBSD/AArch64 support (patch by Mikaël Urankar, mantis #38441)
git-svn-id: trunk@49157 -
2021-04-10 07:57:28 +00:00
Jonas Maebe
4166e8c464 * Darwin/BSD: fixed StackBottom calculation
git-svn-id: trunk@49139 -
2021-04-08 19:50:30 +00:00
ondrej
1a0ba60de6 * revert r47598: implement TRandomGenerator
git-svn-id: trunk@47605 -
2020-11-27 04:53:06 +00:00
ondrej
c4dd3b661a * rtl: implement TRandomGenerator for thread-safe random
git-svn-id: trunk@47598 -
2020-11-26 05:59:00 +00:00
pierre
51d6622148 Switch OpenBSD libc version of geterrnolocation from libcerrno lib C variable to _libc___errno function use
git-svn-id: trunk@47157 -
2020-10-23 10:25:44 +00:00
Tomas Hajny
288c7e3c9e * Do_IsDevice treats pipes and sockets the same way as character devices
git-svn-id: trunk@46863 -
2020-09-13 22:08:18 +00:00
florian
3cd4168ab3 + introduce TOSTimestamp
git-svn-id: trunk@44033 -
2020-01-25 14:14:41 +00:00
marco
edb07af423 * more GPL -> GPL with modification.
git-svn-id: trunk@43964 -
2020-01-17 15:01:23 +00:00
marco
3053f8c2e8 * many syscallh header files had GPL license instead of modified. I owned the copyright, or in one case, Thomas did, but it was a full copy of mine. -> changed to modified
* removed the remark about calling convention from several implementations. Oldfpccall no longer used.

git-svn-id: trunk@43962 -
2020-01-17 12:07:50 +00:00
Jonas Maebe
693e72ade3 * Darwin now uses Mach VM calls for memory allocation instead of mmap/munmap
+ added sysrealloc support for Darwin (Darwin does not have mremap)

git-svn-id: trunk@42729 -
2019-08-18 15:55:07 +00:00
svenbarth
90278f4859 + add fpmprotect function to complete fpmmap/fpmunmap
git-svn-id: trunk@42181 -
2019-06-06 20:46:01 +00:00
pierre
5fb61dc386 FreeBSD fixes for stat and dirent records
git-svn-id: trunk@41967 -
2019-05-01 15:59:52 +00:00
nickysn
d25e7b1074 * separated the OpenBSD version of the stat structure to a separate ifdef block.
* Fixed some incompatibilities in the OpenBSD stat structure - removed st_lspare
  and changed the type of st_blksize to cint32 instead of cuint32.

git-svn-id: trunk@41827 -
2019-04-04 15:55:16 +00:00
nickysn
122888741c + added some comments to the else/endif directives to make it easier to figure
out their corresponding ifdef

git-svn-id: trunk@41826 -
2019-04-04 14:52:28 +00:00
nickysn
46b98a6da4 * Improvements to the implementation of FpOpenDir for *BSD:
* use FpFStat instead of FpStat to avoid a race condition, where the directory
    path could change between the calls of FpOpen and FpStat
  * improved cleanup (i.e. call FpClose, free allocated memory to avoid
    memleaks) in case of errors

git-svn-id: trunk@41820 -
2019-04-02 17:44:23 +00:00
nickysn
aa3d13dd4a - removed the FPC_USE_GETDIRENTRIES_SYSCALL define and use_getdirentries_syscall
global variable, they are compatibility flags of a no longer supported OpenBSD version

git-svn-id: trunk@41790 -
2019-03-24 16:30:50 +00:00
nickysn
ede50a2c4f - get rid of the FPC_USE_GETDIRENTRIES_I49_SYSCALL define and the
use_openbsd_getdirentries_49 global variable - both are compatibility features
  for a no longer supported OpenBSD version

git-svn-id: trunk@41789 -
2019-03-24 16:12:30 +00:00
nickysn
9a18543324 * cleaned up most of the obsolete OpenBSD syscall numbers
git-svn-id: trunk@41783 -
2019-03-23 20:35:03 +00:00
nickysn
01669ebf70 * use the actual _haltproc procedure, defined in the startup code on OpenBSD
* fixed the x86_64 syscall invocation in the OpenBSD _haltproc

git-svn-id: trunk@41762 -
2019-03-21 18:16:23 +00:00
nickysn
7b00c732b8 * Adjust for OpenBSD struct changes in the 'dir' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41643 -
2019-03-08 16:26:40 +00:00
nickysn
2564588bf7 * Adjust for OpenBSD struct changes in the 'dirent' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41642 -
2019-03-08 16:22:53 +00:00
nickysn
c183b49125 * refactored the ifdefs around the dirent structure
git-svn-id: trunk@41641 -
2019-03-08 16:18:17 +00:00
nickysn
d9509a22ad * Adjust for OpenBSD struct changes in the 'stat' structure. Based on OpenBSD
ports patch patch-fpcsrc_rtl_bsd_ostypes_inc

git-svn-id: trunk@41640 -
2019-03-08 16:14:40 +00:00
marco
14b14f3bda * fixes sysctl also with 3.0.4 as starting compiler.
M    rtl/bsd/sysctl.pp
M    compiler/systems.pas

git-svn-id: trunk@38250 -
2018-02-16 17:58:20 +00:00
Károly Balogh
33abf859b4 netbsd/m68k: a fuggly fix for FpLseek, so the compiler works natively at least
git-svn-id: trunk@36803 -
2017-07-27 19:02:40 +00:00
Károly Balogh
12697deda7 netbsd: try to support syscalls which return 64bit values properly on 68k
git-svn-id: trunk@36802 -
2017-07-27 19:01:38 +00:00
Károly Balogh
90ed130750 bsd: add support for syscalls on m68k, based on NetBSD/elf
git-svn-id: trunk@36780 -
2017-07-23 23:02:44 +00:00
michael
52cd572cec * Use specific type for TFPSet elements
git-svn-id: trunk@36710 -
2017-07-09 14:47:27 +00:00
marco
324ec4af58 * another sysctl fix. Original fixes were done in the assumption that the
sysctl param type change was merged. It wasn't. So from specific 3.0 versions
   now all versions.

git-svn-id: trunk@36170 -
2017-05-10 09:09:59 +00:00
marco
818a64952c * fix bootstrapping issue on freebsd x86_64
git-svn-id: trunk@36162 -
2017-05-09 17:07:44 +00:00
michael
5bbf299c22 * Fix bug #31555, disbablefile locking
git-svn-id: trunk@35611 -
2017-03-17 07:58:59 +00:00
pierre
7853c23a0e Fix compilation after commit 35566: change sysctl name parameter type to pcint
git-svn-id: trunk@35573 -
2017-03-12 21:00:41 +00:00
marco
ec3aa1f56a * change sysctl name parameter type to pcint as per manpage. Param names already conform to manual page names, so not changed
mantis #31515

git-svn-id: trunk@35566 -
2017-03-11 16:23:02 +00:00
marco
46cd3181e4 * fix typo sysctlNAMEtomib, mantis #31515 by Heiko
git-svn-id: trunk@35548 -
2017-03-09 15:18:57 +00:00
Károly Balogh
5cde490e57 bsd: fixed the system unit to also include the softpu interface part on m68k, not only the implementation
git-svn-id: trunk@35312 -
2017-01-16 21:04:40 +00:00
marco
7ef8f00100 * more occured -> occurred spelling fixes.
git-svn-id: trunk@35130 -
2016-12-14 20:05:21 +00:00
Jonas Maebe
11c90a73b1 - removed "Set8087CW(Default8087CW)" call from SysEntry:
o it is already performed in fpc_cpucodeinit
   o in libraries, fpc_cpucodeinit first sets Default8087CW to the current x87
     control word to avoid them enabling fpu exceptions if the host platform
     had first disabled them

git-svn-id: trunk@33993 -
2016-06-15 18:32:07 +00:00
svenbarth
3f45860cf9 Use constref instead of const when passing TEntryInformation along
git-svn-id: trunk@33951 -
2016-06-11 20:45:47 +00:00
svenbarth
535621faaa Rename FPC_HAS_INDIRECT_MAIN_INFORMATION to FPC_HAS_INDIRECT_ENTRY_INFORMATION which is more logical considering the record's name
git-svn-id: trunk@33950 -
2016-06-11 20:38:22 +00:00
svenbarth
f406867100 Merged revision(s) 31929-31931,32547 from branches/svenbarth/packages:
Switch Mac OS X to indirect entry information.

compiler/systems/t_bsd.pas, TLinkerBSD:
  + implement InitSysInitUnitName
compiler/system.pas:
  * systems_internal_sysinit: add Darwin systems
compiler/hlcgobj.pas, thlcgobj:
  * gen_proc_symbol_end: for Darwin systems don't directly call PascalMain for libraries, but FPC_LIBMAIN instead
rtl/darwin:
  + add sysinit.pas unit which contains the executable and library entry points for Darwin
rtl/darwin/Makefile.fpc:
  * add sysinit unit
rtl/bsd/sysosh.inc:
  + add a Darwin specific TPlatformEntryInformation (could probably be used for all Unix systems...)
rtl/bsd/system.pp:
  * define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin systems once we're no longer bootstrapping with 2.6.x
  + add EntryInformation variable (this could maybe moved to system.inc...)
  + add new procedure SysEntry that is called from the entrypoint and which sets up necessary information required by other parts of the RTL
  * the old FPC_SYSTEMMAIN is still in place for bootstrapping
rtl/inc/systemh.inc, TEntryInformation:
  * PascalMain is cdecl on non-Windows systems (ToDo: really?)
rtl/inc/system.inc:
  * initialstklen is provided by the indirect entry information, so no external here
........
Fix bootstrapping.

rtl/darwin/sysinit.pas:
  * enable the code only when no longer bootstrapping with 2.6.x
........
Fix bootstrapping.

rtl/objpas/objpas.pp:
  * define FPC_HAS_INDIRECT_MAIN_INFORMATION for Darwin only while not bootstrapping with 2.6.x
........
rtl/darwin/sysinit.pas:
  * reference PASCALMAIN correctly (I wonder how this even worked previously :/ )

git-svn-id: trunk@33949 -
2016-06-11 20:29:51 +00:00
marco
9c03d0d6ba * fix for mantis #25931 return error 5 on EBUSY and ENOTDIR
git-svn-id: trunk@33262 -
2016-03-17 21:14:07 +00:00
svenbarth
191a293e4a Fix compilation of Mac OS X. Without the cdecl modifier we need the _
rtl/bsd/system.pp:
  * use _PASCALMAIN instead of PASCALMAIN

git-svn-id: trunk@33034 -
2016-01-30 19:38:40 +00:00
svenbarth
b525cecad8 - get rid of the calling convention modifier for PascalMain as it's generated using the default calling convention anyway (without any parameters this luckily doesn't matter that much ;) )
(Note: adjusted merge info as in my packages branch there is a less complete commit for this)

git-svn-id: trunk@33023 -
2016-01-29 14:51:15 +00:00
Jonas Maebe
f8f03ac4ad * fixed dirent handling for DragonFly BSD (patch by John Marino,
mantis #29228)

git-svn-id: trunk@32706 -
2015-12-24 10:54:47 +00:00
pierre
f08fa883e2 Pipe syscall for DragonFly also uses EAX:EDX for result, like FreeBSD
git-svn-id: trunk@31209 -
2015-07-14 21:58:27 +00:00
Jonas Maebe
5a8959381c + Darwin/AArch64 support
git-svn-id: trunk@29934 -
2015-02-23 22:53:50 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
pierre
7ffca97a68 OpenBSD support for OS version specific syscall numbers
git-svn-id: trunk@29136 -
2014-11-23 21:59:25 +00:00
sergei
3a5e6485b5 - RTL: removed InitVariantManager, it was an empty procedure since day 1.
git-svn-id: trunk@29114 -
2014-11-22 20:35:46 +00:00