Commit 137a3200 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Merged in RO_3_71

parent aae6f73a
File added
File added
File added
File added
File added
......@@ -158,6 +158,7 @@ redrawlast SETL {FALSE}
GBLL debugmjs1
GBLL debugmjs2
GBLL debugmjs3
GBLL debugmjs4
GBLL sixteenmeg
......@@ -293,18 +294,10 @@ debugtemp SETL false
debugmjs1 SETL false ; for debugging new memory management stuff
debugmjs2 SETL false ; for debugging new memory management stuff
debugmjs3 SETL false ; for debugging new memory management stuff
debugmjs4 SETL false ; Mike's debugs 4 (TransferBlock)
[ false ; for ChildWindows testing - remove this when integrating with original sources
Stork SETL false
BlendedFonts SETL false ; Blend fonts directly with window backgrounds
KeyboardMenus SETL false ; Allow keyboard control of menus
DeleteRight SETL false ; Delete key deletes right
DisableShiftF12 SETL false ; Disable Shift-F12 iconbar toggling
NCMenus SETL false ; Use NC menu style
Twitter SETL false ; Anti-twitter on redraws
NoCommandPrompt SETL false ; Don't show "Press SPACE..." when closing command window
ShrinkableAreas SETL false ; Support shrinkable dynamic areas
]
END
DeleteRight SETL false
This diff is collapsed.
......@@ -671,6 +671,7 @@ wimp_area_handler
; Errors: "Invalid task handle"
; "Wimp transfer out of range"
;
; note that we use tempworkspace here
SWIWimp_TransferBlock ROUT
MyEntry "TransferBlock"
......@@ -682,6 +683,8 @@ SWIWimp_TransferBlock ROUT
LDR R14,taskhandle
LDR R14,[wsptr,R14]
CMP R14,#0
CMPNE R14,[wsptr,R14]
CMPNE R14,#0
STRGT R1,[R14,#task_environment+12*MemoryLimit]
[ Medusa
MedusaOS
......@@ -691,12 +694,14 @@ SWIWimp_TransferBlock ROUT
Pull "R0-R4"
]
;
Debug mjs4,"&&& validtask_alive",R2
BL validtask_alive
MOVVC R7,R6 ; R7 --> dest task block
MOVVC R2,R0
[ Medusa
Push "R5"
]
Debug mjs4,"&&& validtask_alive",R2
BLVC validtask_alive ; R6 --> source task block
BVC %FT05
medusa_exit_trb
......@@ -712,7 +717,7 @@ medusa_exit_trb2
B ExitWimp
;
05
SUBS R10,R4,#0 ; length must be >= 0
SUBS R10,R4,#0 ; length must != 0
BNE %FT07 ; ignore zero length now!
[ Medusa
ADD SP,SP,#4
......@@ -723,9 +728,9 @@ medusa_exit_trb2
B ExitWimp
07
SUBGES R8,R1,#ApplicationStart ; buffer start >= &8000
SUBGES R9,R3,#ApplicationStart ; R8,R9 = offsets into domain
BLT err_badtransfer
SUB R8,R1,#ApplicationStart ; assuming app space...
SUB R9,R3,#ApplicationStart ; ... R8,R9 = offsets into domain
Debug mjs4,"&&& offsets R8,R9",R8,R9
;
[ Medusa :LAND: sixteenmeg
MedusaOS
......@@ -736,20 +741,20 @@ medusa_exit_trb2
]
;
CMP R1,R11 ; not in application space?
ADDGE R8,R8,#ApplicationStart ; make absolute again
BGE %FT11
ADDHS R8,R8,#ApplicationStart ; make absolute again
BHS %FT11
LDR R14,[R6,#task_environment+12*MemoryLimit]
ADD R0,R1,R4
CMP R0,R14
BGT err_badtransfer
BHI err_badtransfer
11
CMP R3,R11 ; not in application space?
ADDGE R9,R9,#ApplicationStart ; make absolute again
BGE %FT01
ADDHS R9,R9,#ApplicationStart ; make absolute again
BHS %FT01
LDR R14,[R7,#task_environment+12*MemoryLimit]
ADD R2,R3,R4
CMP R2,R14
BGT err_badtransfer
BHI err_badtransfer
01
;
; map all slots into memory space, copy the data, then unmap them
......@@ -764,36 +769,39 @@ medusa_exit_trb2
MedusaOS
; orignal calling values are still on the stack
BNE %FT03
CMP R6,R7 ; are the tasks the same?
TEQ R6,R7 ; are the tasks the same?
BEQ %FT02
CMP R10,#7*1024*1024
BLT %FT02
; ok we're doing a BIG transfer, so split it up
MOV R10,#7*1024*1024 ; 7 meg, leave a bit of breathing space
ADD R0,SP,#4
LDMIA R0,{R0-R4}
Push "R1" ; save end-of-current-slot
ADD R0,SP,#8
LDMIA R0,{R0-R4} ; original parameters for Wimp_TransferBlock
ADD R1,R1,#7*1024*1024 ; we'll carry on but only do 7 megs worth
ADD R3,R3,#7*1024*1024 ; then recall the routine, but starting 7 meg
SUB R4,R4,#7*1024*1024 ; further on.
SWI XWimp_TransferBlock
Pull "R1"
; this will cycle through as many times as required
02
; now if the ammount to copy+ R1 > app space, or 2* copy if neither task is the current task
; then part or all of current task must be paged out.
Debug mjs4,"&&& alleged end of current slot (R1)",R1
MOV R0,R1
LDR R1,taskhandle
LDR R2,pagesize
LDR R4,[SP] ; task handle
CMP R1,R4
TEQ R1,R4
BEQ onetask_currentr4 ; one of the tasks is the current task
CMP R1,R5
TEQ R1,R5
BEQ onetask_currentr5
CMP R8,R11
ADDLT R0,R0,R10
ADDLT R0,R0,R2 ; just in case copy is over a page
ADDLO R0,R0,R10
ADDLO R0,R0,R2 ; just in case copy is over a page
CMP R9,R11
ADDLT R0,R0,R10
ADDLT R0,R0,R10
ADDLO R0,R0,R10
ADDLO R0,R0,R10
[ sixteenmeg
CMP R0,#16*1024*1024
|
......@@ -802,7 +810,7 @@ medusa_exit_trb2
LDREQ R14,orig_applicationspacesize
CMP R0,R14
]
BLT %FT03
BLO %FT03
; since the copy must take place in application space (on ARM 3 its the only place! and on
; ARM 600 a level 2 page table would be required- 24K) we have to make some room by paging
......@@ -818,8 +826,8 @@ makespacefromct
BL mapslotout ; map out CT
MOV R0,#0
STR R0,taskhandle
ADD R0,SP,#4
LDMIA R0,{R0-R4}
ADD R0,SP,#8 ; skipping just-pushed R1 and pushed R5 for Medusa...
LDMIA R0,{R0-R4} ; ...restore R0-R4 from stack for recursive call
SWI XWimp_TransferBlock ; do it again, only this time there is no current task
Pull "R1"
STR R1,taskhandle ; return to how it all was
......@@ -835,7 +843,7 @@ onetask_currentr5
BEQ %FT03
CMP R8,R11 ; we only need to woryy about space if the copy
; is actually in the tasks app space
BLT onetaskcurrent
BLO onetaskcurrent
B %FT03
onetask_currentr4
......@@ -844,8 +852,9 @@ onetask_currentr4
CMP R9,R11
onetaskcurrent
ADDLT R0,R0,R10
ADDLT R0,R0,R2 ; just in case copy is over a page
ADDLO R0,R0,R10
ADDLO R0,R0,R2 ; just in case copy is over a page
Debug mjs4,"&&& onetask_current R0,R2,R10",R0,R2,R10
[ sixteenmeg
CMP R0,#16*1024*1024
|
......@@ -855,7 +864,7 @@ onetaskcurrent
CMP R0,R14
]
BLT %FT03
BLO %FT03
B makespacefromct
......@@ -867,27 +876,34 @@ onetaskcurrent
Pull "R4"
MedusaOS
ADDEQ SP,SP,#20 ; will always be original values on stack
MOV R2,#0
STR R2,tempworkspace+4 ; indicate mapenoughslot
STR R2,tempworkspace+12 ; not used yet
MOV R2,R1
LDR R3,taskhandle
CMP R8,R11 ; do we need it paged in ?
BGE %FT04
CMP R3,R5
BHS %FT04
TEQ R3,R5
ADDEQ R8,R8,#ApplicationStart
BEQ %FT04
LDR R0,[R6,#task_slotptr]
MOV R1,R8
MOV R8,R2
STR R1,tempworkspace ;save domain offset for later mapping-out use of mapenoughslot
STR R10,tempworkspace+4 ;save length for later mapping-out use of mapenoughslot
BL mapenoughslot
ADD R8,R8,R0
04
CMP R9,R11
BGE %FT06
CMP R3,R4
BHS %FT06
TEQ R3,R4
ADDEQ R9,R9,#ApplicationStart
BEQ %FT06
LDR R0,[R7,#task_slotptr]
MOV R1,R9
MOV R9,R2
STR R1,tempworkspace+8 ;save domain offset for later mapping out use of mapenoughslot
STR R10,tempworkspace+12 ;save length for later mapping out use of mapenoughslot
BL mapenoughslot ; page in only whats required for the copy
ADD R9,R9,R0
06
......@@ -913,7 +929,7 @@ onetaskcurrent
BEQ wordcopy ; word aligned, yipee!!!
CMP R8,R9
BGE %FT02
BHS %FT02
ADD R8,R8,R10
ADD R9,R9,R10
01
......@@ -930,17 +946,28 @@ onetaskcurrent
03
[ Medusa
LDR R2,taskhandle ; page out the bits we paged in, unless CT
CMP R2,R5
TEQ R2,R5
BEQ %FT05
LDR R0,[R6,#task_slotptr]
CMP R0,#-1
BLNE mapout
LDRNE R10,tempworkspace+4 ; saved length (0 if no mapping done)
CMPNE R10,#0
LDRNE R1,tempworkspace ; saved domain offset
MOVNE R2,#-1 ; map out
Debug mjs4,"putative page out R0,R1,R2,R10",R0,R1,R2,R10
BLNE mapenoughslot
05
CMP R2,R4
LDR R2,taskhandle ; page out the bits we paged in, unless CT
TEQ R2,R4
BEQ %FT10
LDR R0,[R7,#task_slotptr]
CMP R0,#-1
BLNE mapout
LDRNE R10,tempworkspace+12 ; saved length (0 if no mapping done)
CMPNE R10,#0
LDRNE R1,tempworkspace+8 ; saved domain offset
MOVNE R2,#-1 ; map out
Debug mjs4,"putative page out R0,R1,R2,R10",R0,R1,R2,R10
BLNE mapenoughslot
10
|
BL unrackslots
......@@ -949,7 +976,7 @@ onetaskcurrent
wordcopy
CMP R8,R9
BGE %FT02
BHS %FT02
ADD R8,R8,R10
ADD R9,R9,R10
01
......
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