Commit be560349 authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL
Browse files

Fix Message_TaskInitialise reporting wrong slot size

Message_TaskInitialise was reporting that MemoryLimit was the slot size
of the application, which was resulting in the task manager showing the
wrong slot size if for some reason MemoryLimit had been artificially
reduced below ApplicationSpaceSize (e.g. due to the task being a child
of a C system() call). And because MemoryLimit is lower than
ApplicationSpaceSize, any attempt the task makes to grow/shrink its wimp
slot is denied, so task manager will be stuck showing the wrong value
for the entire lifetime of the task.

Fix Message_TaskInitialise to use ApplicationSpaceSize instead, so that
the total size of the slot is reported instead of just the usable area.

This fixes task manager incorrectly showing that Fat32Fs has a slot size
of 0 on some of my Raspberry Pis, when really it has a size of 256K.
This discrepancy was also causing the "System memory allocation" numbers
to not total up correctly (the sum was 256K lower than the displayed
parent 5958a073
......@@ -876,7 +876,7 @@ returntaskhandle
BL fulltaskhandle ; R14 = handle including version bits
STR R14,[sp,#0*4] ; overwrite value of R1 on stack
MOV R0,#MemoryLimit ; do this now cos R0 needed
MOV R0,#ApplicationSpaceSize; do this now cos R0 needed
MOV R1,#0
SWI XOS_ChangeEnvironment
SUB R5,R1,#ApplicationStart ; data + 4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment