Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
RiscOS
Sources
Kernel
Commits
cee53f6d
Commit
cee53f6d
authored
27 years ago
by
Kevin Bracey
Browse files
Options
Download
Email Patches
Plain Diff
Taught AMBControl about shrinkable dynamic areas
parent
cc3f5fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
1 deletion
+51
-1
s/AMBControl/growp
s/AMBControl/growp
+51
-1
No files found.
s/AMBControl/growp
View file @
cee53f6d
...
...
@@ -24,7 +24,7 @@
;
; exit: -
growpages
growpages
ROUT
Push
"R0-R7,LR"
MOV
R6
,
R1
;save entry R1
...
...
@@ -42,6 +42,9 @@ growpages
LDR
R4
,[
R1
,#
DANode_Size
]
MOV
R4
,
R4
,
LSR
#
Log2PageSize
;no. of pages in FreePool
CMP
R3
,
R4
[
ShrinkableDAs
BLGT
growp_TryToShrinkShrinkables
]
MOVGT
R3
,
R4
;R3 := no. of pages we will move
CMP
R3
,#
0
BEQ
%FT02
;done if can't move any pages
...
...
@@ -81,4 +84,51 @@ growpages
STRVS
R0
,[
SP
]
Pull
"R0-R7,PC"
[
ShrinkableDAs
;
; growp_TryToShrinkShrinkables - try to shrink shrinkable DAs, to grow free pool
;
; entry:
; R1 -> FreePool DANode
; R3 = no. of pages required in FreePool
; R4 = no. of pages in FreePool (must be less than R3)
;
; exit:
; R4 = new no. of pages in FreePool
; condition code GT is true if still less than required (ie. R3 > R4 on exit)
;
growp_TryToShrinkShrinkables
ROUT
Push
"R0-R2,R11,R12,LR"
MOV
R11
,
R1
; -> FreePool DANode
MOV
R1
,
R3
,
LSL
#
Log2PageSize
;amount we need in FreePool
MOV
R2
,
R4
,
LSL
#
Log2PageSize
;amount we have in FreePool
MOV
R10
,#
DAList
ASSERT
DANode_Link
=
0
;because DAList has only link
10
LDR
R10
,[
R10
,#
DANode_Link
]
;and load next
CMP
R10
,#
1
;any more nodes?
BCC
%FT99
LDR
LR
,[
R10
,#
DANode_Flags
]
;check area is shrinkable
TST
LR
,#
DynAreaFlags_Shrinkable
BEQ
%BT10
;if not, try next area
SUBS
R1
,
R1
,
R2
;amount we still need
LDR
LR
,[
R10
,#
DANode_Size
]
;available size of this area
CMP
LR
,
R1
MOVCC
R1
,
LR
;min(amount we need, size of this area)
RSB
R1
,
R1
,#
0
;make negative - it's a shrink
LDR
R0
,[
R10
,#
DANode_Number
]
SWI
XOS_ChangeDynamicArea
;should not be currently threaded during AMBControl
MOV
R1
,
R3
,
LSL
#
Log2PageSize
;original amount we need again
LDR
R2
,[
R11
,#
DANode_Size
]
;get new size of FreePool
CMP
R2
,
R1
BCC
%BT10
;if still too small, loop
99
MOV
R4
,
R2
,
LSR
#
Log2PageSize
;no. of pages now in FreePool
CMP
R3
,
R4
Pull
"R0-R2,R11,R12,PC"
]
;ShrinkableDAs
END
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment