diff --git a/rom/exec/newcreatetaska.c b/rom/exec/newcreatetaska.c index 97b1cc4e36..6802d994f9 100644 --- a/rom/exec/newcreatetaska.c +++ b/rom/exec/newcreatetaska.c @@ -127,7 +127,7 @@ static const struct newMemList MemTemplate = break; case TASKTAG_STACKSIZE: - nml.nml_ME[1].me_Length = AROS_ALIGN(tag->ti_Data); + nml.nml_ME[1].me_Length = AROS_ALIGN((ULONG)tag->ti_Data); break; case TASKTAG_NAME: @@ -161,6 +161,14 @@ static const struct newMemList MemTemplate = } } + /* We need a minimum stack to handle interrupt contexts. Additionally confirned on MorphOS that + it sets a minimum fixed size of stack */ + if (nml.nml_ME[1].me_Length < AROS_STACKSIZE) + { + nml.nml_ME[1].me_Length = AROS_STACKSIZE; + } + + DADDTASK("NewCreateTaskA: name %s", taskname ? taskname : ""); ml = NewAllocEntry((struct MemList *)&nml, NULL);