* don't care about __stklen anymore

git-svn-id: trunk@9028 -
This commit is contained in:
florian 2007-11-01 10:18:05 +00:00
parent 6a3ecebe6c
commit 78ca6925ba
3 changed files with 18 additions and 10 deletions

View File

@ -44,7 +44,11 @@ const
var var
{ widechar, because also used by widestring -> pwidechar conversions } { widechar, because also used by widestring -> pwidechar conversions }
emptychar : widechar;public name 'FPC_EMPTYCHAR'; emptychar : widechar;public name 'FPC_EMPTYCHAR';
{$ifndef FPC_NO_GENERIC_STACK_CHECK}
{ if the OS does the stack checking, we don't need any stklen from the
main program }
initialstklen : SizeUint;external name '__stklen'; initialstklen : SizeUint;external name '__stklen';
{$endif FPC_NO_GENERIC_STACK_CHECK}
{ checks whether the given suggested size for the stack of the current { checks whether the given suggested size for the stack of the current
thread is acceptable. If this is the case, returns it unaltered. thread is acceptable. If this is the case, returns it unaltered.

View File

@ -1083,7 +1083,7 @@ begin
end; end;
end; end;
(* ProcessID cached to avoid repeated calls to GetCurrentProcess. *) { ProcessID cached to avoid repeated calls to GetCurrentProcess. }
var var
ProcessID: SizeUInt; ProcessID: SizeUInt;
@ -1093,9 +1093,10 @@ begin
GetProcessID := ProcessID; GetProcessID := ProcessID;
end; end;
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt; function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;assembler;
begin asm
result := stklen; movl %fs:(4),%eax
subl %fs:(8),%eax
end; end;
{ {
@ -1105,7 +1106,8 @@ const
} }
begin begin
StackLength := CheckInitialStkLen(InitialStkLen); { pass dummy value }
StackLength := CheckInitialStkLen($1000000);
StackBottom := StackTop - StackLength; StackBottom := StackTop - StackLength;
{ get some helpful informations } { get some helpful informations }
GetStartupInfo(@startupinfo); GetStartupInfo(@startupinfo);

View File

@ -1136,9 +1136,10 @@ begin
end; end;
function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt; function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;assembler;
begin asm
result := stklen; movq %gs:(8),%rax
subq %gs:(16),%rax
end; end;
@ -1146,7 +1147,8 @@ begin
SysResetFPU; SysResetFPU;
if not(IsLibrary) then if not(IsLibrary) then
SysInitFPU; SysInitFPU;
StackLength := CheckInitialStkLen(InitialStkLen); { pass dummy value }
StackLength := CheckInitialStkLen($1000000);
StackBottom := StackTop - StackLength; StackBottom := StackTop - StackLength;
{ get some helpful informations } { get some helpful informations }
GetStartupInfo(@startupinfo); GetStartupInfo(@startupinfo);