RTL for FP 2.2.0

git-svn-id: svn://kolibrios.org@643 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
bw
2007-09-28 12:26:28 +00:00
parent 3e571197e0
commit ec5962d52e
8 changed files with 79 additions and 26 deletions
+3 -1
View File
@@ -5,5 +5,7 @@
{$undef os2}
{$undef linux}
{$define EMULATOR}
{$undef DISABLE_NO_THREAD_MANAGER}
{$undef debug_mt}
{$define EMULATOR}
+1 -1
View File
@@ -594,7 +594,7 @@ end;
{ Sound }
function kos_speak(notes: Pointer): Boolean; assembler; register;
function kos_speaker(notes: Pointer): Boolean; assembler; register;
asm
pushl %esi
pushl %ebx
+1
View File
@@ -151,6 +151,7 @@ begin
FThreadID := BeginThread(TThreadFunc(@KonsoleThreadMain), @Self);
if FThreadID <> 0 then
{XXX: ¬®¦¥â § ¢¨á­ãâì}
{‚®, â ª ¨ ¥áâì ¢ 2.2.0.}
while not FOpened do ThreadSwitch;
end;
+1 -1
View File
@@ -142,7 +142,7 @@ function kos_fileinfo(kosfile: PKosFile): DWord;
{ Sound }
function kos_speak(notes: Pointer): Boolean;
function kos_speaker(notes: Pointer): Boolean;
{ Work with hardware }
function kos_readport(index: DWord): DWord;
+49 -1
View File
@@ -185,7 +185,7 @@ begin
if not IsMultiThread then
begin
TLSKey := TLSAlloc();
InitThreadVars(@SysRelocateThreadVar); {XXX: must be @SysRelocateThreadvar}
InitThreadVars(@SysRelocateThreadVar);
IsMultiThread := True;
end;
@@ -287,6 +287,51 @@ begin
end;
{*****************************************************************************
Heap Mutex Protection
*****************************************************************************}
{$ifndef HAS_MT_MEMORYMANAGER}
var
HeapMutex: TRTLCriticalSection;
procedure KosHeapMutexInit;
begin
InitCriticalSection(HeapMutex);
end;
procedure KosHeapMutexDone;
begin
DoneCriticalSection(HeapMutex);
end;
procedure KosHeapMutexLock;
begin
EnterCriticalSection(HeapMutex);
end;
procedure KosHeapMutexUnlock;
begin
LeaveCriticalSection(HeapMutex);
end;
const
KosMemoryMutexManager: TMemoryMutexManager = (
MutexInit : @KosHeapMutexInit;
MutexDone : @KosHeapMutexDone;
MutexLock : @KosHeapMutexLock;
MutexUnlock: @KosHeapMutexUnlock);
procedure InitHeapMutexes;
begin
SetMemoryMutexManager(KosMemoryMutexManager);
end;
{$endif HAS_MT_MEMORYMANAGER}
var
KosThreadManager: TThreadManager;
@@ -336,5 +381,8 @@ begin
SemaphorePost := @NoSemaphorePost;
end;
SetThreadManager(KosThreadManager);
{$ifndef HAS_MT_MEMORYMANAGER}
InitHeapMutexes;
{$endif HAS_MT_MEMORYMANAGER}
ThreadID := GetCurrentThreadID;
end;
+1 -1
View File
@@ -161,7 +161,7 @@ begin
ReleaseFileRecord(Handle);
end;
function FileTruncate(Handle: THandle; Size: Int64): Boolean;
function FileTruncate(Handle: THandle; Size: Longint): Boolean;
begin
Result := False;
end;