From 6e3936c534a611af81ae0e91082badc7c034ab6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Sat, 8 Jul 2017 23:48:29 +0000 Subject: [PATCH] amicommon: implement StackTop for other Amiga-like systems git-svn-id: trunk@36697 - --- rtl/amicommon/sysos.inc | 7 +++++++ rtl/amiga/system.pp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rtl/amicommon/sysos.inc b/rtl/amicommon/sysos.inc index 894d3ab370..e5ab92f71b 100644 --- a/rtl/amicommon/sysos.inc +++ b/rtl/amicommon/sysos.inc @@ -44,6 +44,13 @@ System Dependent Structures/Consts *****************************************************************************} +{$ifndef FPC_SYSTEM_HAS_STACKTOP} +{$define FPC_SYSTEM_HAS_STACKTOP} +function StackTop: pointer; +begin + StackTop:=FindTask(nil)^.tc_SPUpper; +end; +{$endif FPC_SYSTEM_HAS_STACKTOP} const CTRL_C = 20; { Error code on CTRL-C press } diff --git a/rtl/amiga/system.pp b/rtl/amiga/system.pp index f6047df795..85c6a054a9 100644 --- a/rtl/amiga/system.pp +++ b/rtl/amiga/system.pp @@ -302,7 +302,7 @@ end; begin IsConsole := TRUE; StackLength := CheckInitialStkLen(InitialStkLen); - StackBottom := Sptr - StackLength; + StackBottom := StackTop - StackLength; { OS specific startup } AOS_wbMsg:=nil; ASYS_origDir:=0;