Переглянути джерело

amicommon: implement StackTop for other Amiga-like systems

git-svn-id: trunk@36697 -
Károly Balogh 8 роки тому
батько
коміт
6e3936c534
2 змінених файлів з 8 додано та 1 видалено
  1. 7 0
      rtl/amicommon/sysos.inc
  2. 1 1
      rtl/amiga/system.pp

+ 7 - 0
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 }

+ 1 - 1
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;