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

Fix PMP appspace size check

Fix AreaGrow to read appspace size correctly when appspace is a PMP
(i.e. an AMBControl node). Reading DANode_Size will only report the
amount of memory currently paged in (e.g. by lazy task swapping),
causing AreaGrow to underestimate how much it can potentially take from
the area.
parent 1a3c927f
......@@ -5382,16 +5382,19 @@ AreaGrow ROUT
GetAppSpaceDANode r4
EORS r6, r4, r12 ; only take from app space if dest isn't app space!
LDRNE r6, [r4, #DANode_Size] ; get current size of apl space
LDRNE r4, [r4, #DANode_Flags]
EORNE r4, r4, #DynAreaFlags_PMP
TSTNE r4, #DynAreaFlags_PMP
SUBNE r6, r6, #&8000 ; can't take away 0-&7FFF
ADD r3, r2, r6, LSR #12 ; add on to amount we could remove from free pool (pages)
BEQ %FT645
LDR r6, [r4, #DANode_Flags]
TST r6, #DynAreaFlags_PMP
LDRNE r6, [r4, #DANode_PMPSize]
LDREQ r6, [r4, #DANode_Size] ; get current size of apl space
SUBEQ r6, r6, #&8000 ; can't take away 0-&7FFF
MOVEQ r6, r6, LSR #12
ADD r3, r2, r6 ; add on to amount we could remove from free pool (pages)
645
[ DebugCDA2
DREG r6, "Can get from app space an additional ", cc
DREG r3, " bytes making a total of ", cc
DREG r3, " pages making a total of ", cc
DLINE " pages"
]
......
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