aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2023-01-14 10:20:47 +0000
committerIain Sandoe <iain@sandoe.co.uk>2023-01-23 17:25:49 +0000
commitbcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc (patch)
tree3df4fabb051d4ac0c2cc7d3fb62472f7e8ef1683 /gcc
parentb457cab64038cd9b7a8481594ff673f1822681f6 (diff)
downloadgcc-bcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc.zip
gcc-bcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc.tar.gz
gcc-bcc023e2b4dd0dc1fd1fca3ea12664d5bdade4dc.tar.bz2
modula-2: Fix stack size request in initPreemptive [PR108405]
As noted in the PR, the problem is that we make a request for additional stack that violates the constraints on some systems. This patch chooses a value that is divisible by common OS page sizes. TODO: the user value should be checked and then an exception thrown if it is not suitable. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR modula2/108405 gcc/m2/ChangeLog: * gm2-libs-iso/Preemptive.mod (initPreemptive): Use a value for extra space that is divisible by common OS pagesizes.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/m2/gm2-libs-iso/Preemptive.mod5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/m2/gm2-libs-iso/Preemptive.mod b/gcc/m2/gm2-libs-iso/Preemptive.mod
index 53952e1..44aa62b 100644
--- a/gcc/m2/gm2-libs-iso/Preemptive.mod
+++ b/gcc/m2/gm2-libs-iso/Preemptive.mod
@@ -33,6 +33,9 @@ FROM libc IMPORT printf ;
CONST
debugging = FALSE ;
+ (* The space we request becomes part of a stack request, which generally
+ has constraints on size and alignment. *)
+ extraWorkSpace = 10 * 1024 * 1024 ;
(*
timer - the timer process which runs at maximum scheduling priority with
@@ -107,7 +110,7 @@ BEGIN
IF NOT init
THEN
init := TRUE ;
- Create (timer, 10000000, MAX (Urgency), NIL, timerId) ;
+ Create (timer, extraWorkSpace, MAX (Urgency), NIL, timerId) ;
Activate (timerId)
END
END initPreemptive ;