diff --git a/rtl/amicommon/sysosh.inc b/rtl/amicommon/sysosh.inc index b6c62506b7..a7b5d136ce 100644 --- a/rtl/amicommon/sysosh.inc +++ b/rtl/amicommon/sysosh.inc @@ -31,6 +31,11 @@ type TRTLCriticalSection = record { This must actually be bigger or equal to sizeof(TSignalSemaphore) which seems to be 46 bytes on MorphOS and Amiga/m68k. } - semaphore: array[0..63] of byte; + semaphore: array[0..63] of byte; end; {$ENDIF} + +{ BeginThread flags we support in AThreads } +const + CREATE_SUSPENDED = 1; + STACK_SIZE_PARAM_IS_A_RESERVATION = 2; diff --git a/rtl/amicommon/sysutils.pp b/rtl/amicommon/sysutils.pp index 1c3bc8a989..d06e32e22c 100644 --- a/rtl/amicommon/sysutils.pp +++ b/rtl/amicommon/sysutils.pp @@ -63,7 +63,7 @@ uses {$i sysutils.inc} -{ * Include sytem specific includes * } +{ * Include system specific includes * } {$include execd.inc} {$include execf.inc} {$include timerd.inc} @@ -900,7 +900,7 @@ end; procedure Sleep(Milliseconds: cardinal); begin // Amiga dos.library Delay() has precision of 1/50 seconds - Delay(Milliseconds div 20); + DOSDelay(Milliseconds div 20); end; diff --git a/rtl/amiga/m68k/doslibf.inc b/rtl/amiga/m68k/doslibf.inc index 9603b539b8..26afb5c212 100644 --- a/rtl/amiga/m68k/doslibf.inc +++ b/rtl/amiga/m68k/doslibf.inc @@ -111,7 +111,7 @@ SysCall AOS_DOSBase 186; function DateStamp(date: PDateStamp location 'd1'): PDateStamp; SysCall AOS_DOSBase 192; -procedure Delay(timeout: LongInt location 'd1'); +procedure DOSDelay(timeout: LongInt location 'd1'); SysCall AOS_DOSBase 198; function WaitForChar(file1 : LongInt location 'd1'; diff --git a/rtl/aros/arosthreads.inc b/rtl/aros/arosthreads.inc index fd0d9d0798..b9f06d9424 100644 --- a/rtl/aros/arosthreads.inc +++ b/rtl/aros/arosthreads.inc @@ -322,7 +322,7 @@ end; procedure EmptyFunc; begin - Delay(1); + DOSDelay(1); ReleaseSemaphore(@AROSThreadStruct^.EmptySemaphore); end; @@ -379,7 +379,7 @@ begin NP_Entry, PtrUInt(@EmptyFunc), TAG_DONE, TAG_END]); ObtainSemaphore(@AROSThreadStruct^.EmptySemaphore); - Delay(1); + DOSDelay(1); end; // NewThread^.Task := CreateNewProcTags([ diff --git a/rtl/aros/i386/doslibf.inc b/rtl/aros/i386/doslibf.inc index 058608e653..77f106333a 100644 --- a/rtl/aros/i386/doslibf.inc +++ b/rtl/aros/i386/doslibf.inc @@ -34,7 +34,7 @@ function IoErr: longint; syscall AOS_DOSBase 22; procedure dosExit(ErrCode: longint); syscall AOS_DOSBase 24; function SetProtection(const name: PChar; protect: longword): LongInt; syscall AOS_DOSBase 31; function DateStamp(date: PDateStamp): PDateStamp; syscall AOS_DOSBase 32; -procedure Delay(ticks: LongWord); syscall AOS_DOSBase 33; +procedure dosDelay(ticks: LongWord); syscall AOS_DOSBase 33; function AllocDosObject(Type_: LongWord; const Tags: PTagItem): Pointer; syscall AOS_DOSBase 38; procedure FreeDosObject(Type_: LongWord; Ptr: Pointer); syscall AOS_DOSBase 39; function SetFileDate(name: PChar; date: PDateStamp): LongBool; syscall AOS_DOSBase 66; diff --git a/rtl/aros/i386/execf.inc b/rtl/aros/i386/execf.inc index 0a15874015..f2d184b080 100644 --- a/rtl/aros/i386/execf.inc +++ b/rtl/aros/i386/execf.inc @@ -2,7 +2,7 @@ This file is part of the Free Pascal run time library. Copyright (c) 2006 Karoly Balogh - exec functions (V40) for Amiga/PowerPC + exec functions for AROS/i386 See the file COPYING.FPC, included in this distribution, for details about the copyright. @@ -28,6 +28,7 @@ function AllocSignal(signalNum: LongInt): ShortInt; syscall LocalExecBase 55; procedure FreeSignal(signalNum: LongInt); syscall LocalExecBase 56; procedure AddPort(port: PMsgPort); syscall LocalExecBase 59; procedure RemPort(port: PMsgPort); syscall LocalExecBase 60; +procedure PutMsg(Port: PMsgPort; Message: PMessage); syscall AOS_ExecBase 61; function GetMsg(port: PMsgPort): PMessage; syscall LocalExecBase 62; procedure ReplyMsg(message : pMessage); syscall LocalExecBase 63; function WaitPort(port: PMsgPort): PMessage; syscall LocalExecBase 64; @@ -40,6 +41,9 @@ procedure InitSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 93; procedure ObtainSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 94; procedure ReleaseSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 95; function AttemptSemaphore(SigSem: PSignalSemaphore): LongWord; syscall AOS_ExecBase 96; +function CreateMsgPort: PMsgPort; syscall AOS_ExecBase 111; +procedure DeleteMsgPort(Port: PMsgPort); syscall AOS_ExecBase 112; +procedure ObtainSemaphoreShared(SigSem: PSignalSemaphore); syscall AOS_ExecBase 113; function CreatePool(requirements: Cardinal; puddleSize: Cardinal; threshSize: Cardinal): Pointer; syscall LocalExecBase 116; procedure DeletePool(poolHeader: Pointer); syscall LocalExecBase 117; function AllocPooled(poolHeader: Pointer; memSize: Cardinal): Pointer; syscall LocalExecBase 118; diff --git a/rtl/aros/systhrd.inc b/rtl/aros/systhrd.inc index 904d1eb617..47939c99b6 100644 --- a/rtl/aros/systhrd.inc +++ b/rtl/aros/systhrd.inc @@ -153,7 +153,7 @@ end; procedure SysThreadSwitch; begin - Delay(0); + DOSDelay(0); end; function SysSuspendThread(ThreadHandle: THandle): dword; diff --git a/rtl/morphos/doslibf.inc b/rtl/morphos/doslibf.inc index e4f9816ba9..10fd9dff1e 100644 --- a/rtl/morphos/doslibf.inc +++ b/rtl/morphos/doslibf.inc @@ -114,7 +114,7 @@ SysCall MOS_DOSBase 186; function DateStamp(date: PDateStamp location 'd1'): PDateStamp; SysCall MOS_DOSBase 192; -procedure Delay(timeout: LongInt location 'd1'); +procedure DOSDelay(timeout: LongInt location 'd1'); SysCall MOS_DOSBase 198; function WaitForChar(file1 : LongInt location 'd1';