Jelajahi Sumber

* Add PAGESIZE local constant.
+ Set LAST_PAGE_GENERATES_SIGNAL macro for linux powerpc/powerpc64.
+ Use page_size for StackBottom computation.
+ Use LAST_PAGE_GENERATES_SIGNAL in StackBottom computation.

git-svn-id: trunk@39736 -

pierre 7 tahun lalu
induk
melakukan
32001975bf
1 mengubah file dengan 13 tambahan dan 1 penghapusan
  1. 13 1
      rtl/linux/system.pp

+ 13 - 1
rtl/linux/system.pp

@@ -411,6 +411,15 @@ function FpUGetRLimit(resource : cInt; rlim : PRLimit) : cInt; cdecl; external c
 {$endif}
 {$endif}
 
+{$if defined(CPUPOWERPC) or defined(CPUPOWERPC64)}
+const
+  page_size = $10000;
+  {$define LAST_PAGE_GENERATES_SIGNAL}
+{$else}
+const
+  page_size = $1000;
+{$endif}
+
 function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
 var
   limits : TRLimit;
@@ -445,7 +454,10 @@ begin
 {$endif}
   IsConsole := TRUE;
   StackLength := CheckInitialStkLen(initialStkLen);
-  StackBottom := initialstkptr - StackLength;
+  StackBottom := pointer((ptruint(initialstkptr) or (page_size - 1)) + 1 - StackLength);
+{$ifdef LAST_PAGE_GENERATES_SIGNAL}
+  StackBottom:=StackBottom + page_size;
+{$endif}
   { Set up signals handlers (may be needed by init code to test cpu features) }
   InstallSignals;
 {$if defined(cpui386) or defined(cpuarm)}